diff options
author | Nick Kralevich <nnk@google.com> | 2014-07-16 20:03:46 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2014-07-16 20:08:41 -0700 |
commit | 04f9b2a809cb83c3d36c75791bfa28690800c883 (patch) | |
tree | 1446c02be0a8ff725beb9fce49ac75686df8003e /debuggerd/tombstone.cpp | |
parent | cadd5bb70eae200d744f115fd63c3ebe17069db8 (diff) | |
download | system_core-04f9b2a809cb83c3d36c75791bfa28690800c883.zip system_core-04f9b2a809cb83c3d36c75791bfa28690800c883.tar.gz system_core-04f9b2a809cb83c3d36c75791bfa28690800c883.tar.bz2 |
debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones
Change-Id: I71bdfba30346a9fad3129b404f39eda8190698e3
Diffstat (limited to 'debuggerd/tombstone.cpp')
-rw-r--r--[-rwxr-xr-x] | debuggerd/tombstone.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp index f41166b..e447190 100755..100644 --- a/debuggerd/tombstone.cpp +++ b/debuggerd/tombstone.cpp @@ -674,7 +674,7 @@ static char* find_and_open_tombstone(int* fd) { if (errno != ENOENT) continue; - *fd = open(path, O_CREAT | O_EXCL | O_WRONLY, 0600); + *fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_NOFOLLOW | O_CLOEXEC, 0600); if (*fd < 0) continue; // raced ? @@ -689,7 +689,7 @@ static char* find_and_open_tombstone(int* fd) { // we didn't find an available file, so we clobber the oldest one snprintf(path, sizeof(path), TOMBSTONE_TEMPLATE, oldest); - *fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600); + *fd = open(path, O_CREAT | O_TRUNC | O_WRONLY | O_NOFOLLOW | O_CLOEXEC, 0600); if (*fd < 0) { ALOGE("failed to open tombstone file '%s': %s\n", path, strerror(errno)); return NULL; |