Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Add permission bits to open() with O_CREAT.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gburgessiv committed Feb 9, 2017
1 parent 23f4e6b commit d6f2e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libappfuse/tests/FuseBufferTest.cc
Expand Up @@ -31,7 +31,7 @@ namespace fuse {
constexpr char kTempFile[] = "/data/local/tmp/appfuse_test_dump";

void OpenTempFile(android::base::unique_fd* fd) {
fd->reset(open(kTempFile, O_CREAT | O_RDWR));
fd->reset(open(kTempFile, O_CREAT | O_RDWR, 0600));
ASSERT_NE(-1, *fd) << strerror(errno);
unlink(kTempFile);
ASSERT_NE(-1, *fd) << strerror(errno);
Expand Down

0 comments on commit d6f2e69

Please sign in to comment.