From 2ec608c1c8edaab9f7e9fc24282dbbb8539e6258 Mon Sep 17 00:00:00 2001 From: Glenn Washburn Date: Sat, 13 Oct 2018 15:00:02 -0500 Subject: The path in ld.so.preload should point to RUN_FIREJAIL_LIB_DIR, as LIBDIR may not exist. --- src/firejail/fs_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firejail/fs_trace.c b/src/firejail/fs_trace.c index 38ab7e2f8..235e09291 100644 --- a/src/firejail/fs_trace.c +++ b/src/firejail/fs_trace.c @@ -51,7 +51,7 @@ void fs_trace(void) { FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); if (!fp) errExit("fopen"); - const char *prefix = LIBDIR "/firejail"; + const char *prefix = RUN_FIREJAIL_LIB_DIR; if (arg_trace) { fprintf(fp, "%s/libtrace.so\n", prefix); -- cgit v1.2.3-54-g00ecf From 1650db5c78153cc3c92969f178f826e1991771d4 Mon Sep 17 00:00:00 2001 From: Paweł Date: Sun, 14 Oct 2018 13:44:26 +0200 Subject: Make --join return exit code of the invoked program --- src/firejail/join.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/firejail/join.c b/src/firejail/join.c index c2b207c52..c849b200c 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c @@ -436,8 +436,18 @@ void join(pid_t pid, int argc, char **argv, int index) { // it will never get here!!! } + int status = 0; // wait for the child to finish - waitpid(child, NULL, 0); + waitpid(child, &status, 0); flush_stdin(); - exit(0); + + if (WIFEXITED(status)) { + status = WEXITSTATUS(status); + } else if (WIFSIGNALED(status)) { + status = WTERMSIG(status); + } else { + status = 0; + } + + exit(status); } -- cgit v1.2.3-54-g00ecf