summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Burgess IV2017-02-09 01:40:34 -0600
committerGeorge Burgess IV2017-02-09 01:44:29 -0600
commitd6f2e696245993da4211f8a67e8c2463fd6c7a78 (patch)
tree3523bf352342b81d793e62d61f18bccd0554a9ce /libappfuse
parent23f4e6b0a5ce3eee548a4cd9e857f522ddaf492b (diff)
downloadplatform-system-core-d6f2e696245993da4211f8a67e8c2463fd6c7a78.tar.gz
platform-system-core-d6f2e696245993da4211f8a67e8c2463fd6c7a78.tar.xz
platform-system-core-d6f2e696245993da4211f8a67e8c2463fd6c7a78.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: I6b2a3694f85565afdeb782585c6af36e8c4d1557
Diffstat (limited to 'libappfuse')
-rw-r--r--libappfuse/tests/FuseBufferTest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libappfuse/tests/FuseBufferTest.cc b/libappfuse/tests/FuseBufferTest.cc
index db35d330d..1a1abd57e 100644
--- a/libappfuse/tests/FuseBufferTest.cc
+++ b/libappfuse/tests/FuseBufferTest.cc
@@ -31,7 +31,7 @@ namespace fuse {
31constexpr char kTempFile[] = "/data/local/tmp/appfuse_test_dump"; 31constexpr char kTempFile[] = "/data/local/tmp/appfuse_test_dump";
32 32
33void OpenTempFile(android::base::unique_fd* fd) { 33void OpenTempFile(android::base::unique_fd* fd) {
34 fd->reset(open(kTempFile, O_CREAT | O_RDWR)); 34 fd->reset(open(kTempFile, O_CREAT | O_RDWR, 0600));
35 ASSERT_NE(-1, *fd) << strerror(errno); 35 ASSERT_NE(-1, *fd) << strerror(errno);
36 unlink(kTempFile); 36 unlink(kTempFile);
37 ASSERT_NE(-1, *fd) << strerror(errno); 37 ASSERT_NE(-1, *fd) << strerror(errno);