From 04f9b2a809cb83c3d36c75791bfa28690800c883 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 16 Jul 2014 20:03:46 -0700 Subject: debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones Change-Id: I71bdfba30346a9fad3129b404f39eda8190698e3 --- debuggerd/tombstone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 debuggerd/tombstone.cpp (limited to 'debuggerd/tombstone.cpp') diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp old mode 100755 new mode 100644 index f41166b..e447190 --- 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; -- cgit v1.1