summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-07-16 20:03:46 -0700
committerNick Kralevich <nnk@google.com>2014-07-16 20:08:41 -0700
commit04f9b2a809cb83c3d36c75791bfa28690800c883 (patch)
tree1446c02be0a8ff725beb9fce49ac75686df8003e /debuggerd
parentcadd5bb70eae200d744f115fd63c3ebe17069db8 (diff)
downloadsystem_core-04f9b2a809cb83c3d36c75791bfa28690800c883.tar.gz
system_core-04f9b2a809cb83c3d36c75791bfa28690800c883.tar.bz2
system_core-04f9b2a809cb83c3d36c75791bfa28690800c883.zip
debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones
Change-Id: I71bdfba30346a9fad3129b404f39eda8190698e3
Diffstat (limited to 'debuggerd')
-rw-r--r--[-rwxr-xr-x]debuggerd/tombstone.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp
index f41166b5e..e44719087 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;