diff options
author | 2017-08-01 00:22:34 +0300 | |
---|---|---|
committer | 2017-08-01 00:22:34 +0300 | |
commit | b682a3edeec25b6a70fb1c7a75995bcdd638cc9a (patch) | |
tree | 26805b082e1e064c42c97f495096ba6193d56323 /src/firejail | |
parent | Merge pull request #1421 from SpotComms/fix1420 (diff) | |
download | firejail-b682a3edeec25b6a70fb1c7a75995bcdd638cc9a.tar.gz firejail-b682a3edeec25b6a70fb1c7a75995bcdd638cc9a.tar.zst firejail-b682a3edeec25b6a70fb1c7a75995bcdd638cc9a.zip |
Fix tracing with private-lib
Diffstat (limited to 'src/firejail')
-rw-r--r-- | src/firejail/fs_lib.c | 6 | ||||
-rw-r--r-- | src/firejail/fs_trace.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/firejail/fs_lib.c b/src/firejail/fs_lib.c index cc60a330f..19e900a4b 100644 --- a/src/firejail/fs_lib.c +++ b/src/firejail/fs_lib.c | |||
@@ -185,6 +185,12 @@ void fs_private_lib(void) { | |||
185 | fs_logger_print(); | 185 | fs_logger_print(); |
186 | } | 186 | } |
187 | 187 | ||
188 | // for our trace and tracelog libs | ||
189 | if (arg_trace) | ||
190 | duplicate(LIBDIR "/firejail/libtrace.so", RUN_LIB_DIR); | ||
191 | else if (arg_tracelog) | ||
192 | duplicate(LIBDIR "/firejail/libtracelog.so", RUN_LIB_DIR); | ||
193 | |||
188 | if (arg_debug) | 194 | if (arg_debug) |
189 | printf("Mount-bind %s on top of /lib /lib64 /usr/lib\n", RUN_LIB_DIR); | 195 | printf("Mount-bind %s on top of /lib /lib64 /usr/lib\n", RUN_LIB_DIR); |
190 | if (mount(RUN_LIB_DIR, "/lib", NULL, MS_BIND|MS_REC, NULL) < 0 || | 196 | if (mount(RUN_LIB_DIR, "/lib", NULL, MS_BIND|MS_REC, NULL) < 0 || |
diff --git a/src/firejail/fs_trace.c b/src/firejail/fs_trace.c index f964c05d0..df76f4fe1 100644 --- a/src/firejail/fs_trace.c +++ b/src/firejail/fs_trace.c | |||
@@ -51,11 +51,15 @@ void fs_trace(void) { | |||
51 | FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); | 51 | FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); |
52 | if (!fp) | 52 | if (!fp) |
53 | errExit("fopen"); | 53 | errExit("fopen"); |
54 | const char *prefix = LIBDIR "/firejail"; | ||
55 | if (arg_private_lib) | ||
56 | prefix = RUN_LIB_DIR; | ||
57 | |||
54 | if (arg_trace) { | 58 | if (arg_trace) { |
55 | fprintf(fp, "%s/firejail/libtrace.so\n", LIBDIR); | 59 | fprintf(fp, "%s/libtrace.so\n", prefix); |
56 | } | 60 | } |
57 | else if (arg_tracelog) { | 61 | else if (arg_tracelog) { |
58 | fprintf(fp, "%s/firejail/libtracelog.so\n", LIBDIR); | 62 | fprintf(fp, "%s/libtracelog.so\n", prefix); |
59 | if (!arg_quiet) | 63 | if (!arg_quiet) |
60 | printf("Blacklist violations are logged to syslog\n"); | 64 | printf("Blacklist violations are logged to syslog\n"); |
61 | } | 65 | } |