diff options
author | netblue30 <netblue30@yahoo.com> | 2019-09-15 06:59:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-15 06:59:31 -0500 |
commit | 99da7745bfd2a7c3a8c982e15b7d9b38e4df9b4b (patch) | |
tree | aab0f8277a0ae1de922b8a9268b01428e8febd73 /src/libtrace/libtrace.c | |
parent | Make sure that we are unprivileged before creating the trace log file. (diff) | |
parent | Fix #2899 (diff) | |
download | firejail-99da7745bfd2a7c3a8c982e15b7d9b38e4df9b4b.tar.gz firejail-99da7745bfd2a7c3a8c982e15b7d9b38e4df9b4b.tar.zst firejail-99da7745bfd2a7c3a8c982e15b7d9b38e4df9b4b.zip |
Merge branch 'master' into fix-profile-builder
Diffstat (limited to 'src/libtrace/libtrace.c')
-rw-r--r-- | src/libtrace/libtrace.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index b3f040e8f..0c21b9b70 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c | |||
@@ -52,10 +52,7 @@ static orig_access_t orig_access = NULL; | |||
52 | // | 52 | // |
53 | // library constructor/destructor | 53 | // library constructor/destructor |
54 | // | 54 | // |
55 | // Replacing printf with fprintf to /dev/tty in order to fix #561 | 55 | // Using fprintf to /dev/tty instead of printf in order to fix #561 |
56 | // If you really want to turn it off, comment the following line, but its a | ||
57 | // really bad idea. | ||
58 | #define PRINTF_DEVTTY | ||
59 | static FILE *ftty = NULL; | 56 | static FILE *ftty = NULL; |
60 | static pid_t mypid = 0; | 57 | static pid_t mypid = 0; |
61 | #define MAXNAME 16 | 58 | #define MAXNAME 16 |
@@ -75,12 +72,8 @@ void init(void) { | |||
75 | // if exists, log to trace file | 72 | // if exists, log to trace file |
76 | logfile = RUN_TRACE_FILE; | 73 | logfile = RUN_TRACE_FILE; |
77 | if (orig_access(logfile, F_OK)) | 74 | if (orig_access(logfile, F_OK)) |
78 | #ifdef PRINTF_DEVTTY | ||
79 | // else log to associated tty | 75 | // else log to associated tty |
80 | logfile = "/dev/tty"; | 76 | logfile = "/dev/tty"; |
81 | #else | ||
82 | logfile = "/proc/self/fd/2"; | ||
83 | #endif | ||
84 | } | 77 | } |
85 | 78 | ||
86 | // logfile | 79 | // logfile |