Merge "Deprecate <cutils/log.h> and <utils/Log.h>"
diff --git a/keystore/Android.bp b/keystore/Android.bp
index ed60596..210b8b5 100644
--- a/keystore/Android.bp
+++ b/keystore/Android.bp
@@ -269,6 +269,7 @@
         "binder/android/security/IConfirmationPromptCallback.aidl",
         "binder/android/security/IKeystoreService.aidl",
     ],
+    path: "binder",
 }
 
 cc_library_shared {
@@ -297,5 +298,3 @@
         "libkeystore_parcelables",
     ],
 }
-
-subdirs = ["tests"]
diff --git a/keystore/blob.cpp b/keystore/blob.cpp
index e931c30..b901553 100644
--- a/keystore/blob.cpp
+++ b/keystore/blob.cpp
@@ -231,11 +231,10 @@
 
     size_t fileLength = offsetof(blobv3, value) + dataLength + mBlob.info;
 
-    const char* tmpFileName = ".tmp";
-    int out =
-        TEMP_FAILURE_RETRY(open(tmpFileName, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR));
+    char tmpFileName[] = ".tmpXXXXXX";
+    int out = TEMP_FAILURE_RETRY(mkstemp(tmpFileName));
     if (out < 0) {
-        ALOGW("could not open file: %s: %s", tmpFileName, strerror(errno));
+        ALOGW("could not open temporary file: %s: %s", tmpFileName, strerror(errno));
         return ResponseCode::SYSTEM_ERROR;
     }