summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Burgess IV2017-02-03 16:45:47 -0600
committerGeorge Burgess IV2017-02-03 16:45:47 -0600
commit151ea52cf68e4f9716c985b6ee0b2bf2f160f6ef (patch)
tree6b1c4e5c514007d1b6cf22ed4cdbfa0bae3b761a /storaged
parent9f5d1c12585ac1dcad227eb6e9c96c71a4cf07fd (diff)
downloadplatform-system-core-151ea52cf68e4f9716c985b6ee0b2bf2f160f6ef.tar.gz
platform-system-core-151ea52cf68e4f9716c985b6ee0b2bf2f160f6ef.tar.xz
platform-system-core-151ea52cf68e4f9716c985b6ee0b2bf2f160f6ef.zip
Add permission bits to open with O_CREAT.
It's an error to pass open O_CREAT without giving it mode bits: https://linux.die.net/man/3/open Bug: 32073964 Test: Compiles with clang FORTIFY. Change-Id: Iaa78c3003ed960e1ffe7e56623dba33db4e17443
Diffstat (limited to 'storaged')
-rw-r--r--storaged/tests/storaged_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/storaged/tests/storaged_test.cpp b/storaged/tests/storaged_test.cpp
index 5395b9a41..9e03c5018 100644
--- a/storaged/tests/storaged_test.cpp
+++ b/storaged/tests/storaged_test.cpp
@@ -33,7 +33,7 @@
33 33
34static void pause(uint32_t sec) { 34static void pause(uint32_t sec) {
35 const char* path = "/cache/test"; 35 const char* path = "/cache/test";
36 int fd = open(path, O_WRONLY | O_CREAT); 36 int fd = open(path, O_WRONLY | O_CREAT, 0600);
37 ASSERT_LT(-1, fd); 37 ASSERT_LT(-1, fd);
38 char buffer[2048]; 38 char buffer[2048];
39 memset(buffer, 1, sizeof(buffer)); 39 memset(buffer, 1, sizeof(buffer));