From: Nikita Kalyazin Date: Mon, 28 Oct 2013 12:18:58 +0000 (+0400) Subject: [FIX] add O_CLOEXEC while opening logfile X-Git-Tag: Tizen_SDK_2.3~141 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72911f5b3cf0424e1d27e01abfc79150cc29a97e;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] add O_CLOEXEC while opening logfile This prevents our logfile from being written by the traced application (it is bad because it has no permissions to write to our logfile). Change-Id: Ifa5f097d050cb0d80eaee8097bf10abd5734a4c9 Signed-off-by: Nikita Kalyazin --- diff --git a/daemon/da_debug.c b/daemon/da_debug.c index 33089c9..b4af13d 100644 --- a/daemon/da_debug.c +++ b/daemon/da_debug.c @@ -42,7 +42,8 @@ #if DEBUG void initialize_log() { - int fd = open(DEBUG_LOGFILE, O_WRONLY | O_CREAT | O_TRUNC, 0777); + int fd = open(DEBUG_LOGFILE, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, + 0777); if (fd > 0) { dup2(fd, 1); dup2(fd, 2);