diff options
author | smitsohu <smitsohu@gmail.com> | 2018-08-19 16:20:19 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2018-08-19 16:20:19 +0200 |
commit | e46ccf93b218cf0de5438c74d28b0949d637094f (patch) | |
tree | 3270453e1a35063b4e619940fe628386627df048 /src | |
parent | man: fix example for --build command (diff) | |
download | firejail-e46ccf93b218cf0de5438c74d28b0949d637094f.tar.gz firejail-e46ccf93b218cf0de5438c74d28b0949d637094f.tar.zst firejail-e46ccf93b218cf0de5438c74d28b0949d637094f.zip |
fix failing travis build (make no assumptions about C standard)
plus function rename
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/join.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/firejail/join.c b/src/firejail/join.c index 17191d9a9..1e25999e2 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -223,7 +223,7 @@ static void extract_umask(pid_t pid) { | |||
223 | fclose(fp); | 223 | fclose(fp); |
224 | } | 224 | } |
225 | 225 | ||
226 | static void ready_for_join(pid_t pid) { | 226 | static void check_ready_for_join(pid_t pid) { |
227 | char *fname; | 227 | char *fname; |
228 | if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_READY_FOR_JOIN) == -1) | 228 | if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_READY_FOR_JOIN) == -1) |
229 | errExit("asprintf"); | 229 | errExit("asprintf"); |
@@ -295,12 +295,13 @@ void join(pid_t pid, int argc, char **argv, int index) { | |||
295 | free(comm); | 295 | free(comm); |
296 | 296 | ||
297 | // pid must belong to a valid firejail sandbox | 297 | // pid must belong to a valid firejail sandbox |
298 | ready_for_join(pid); | 298 | check_ready_for_join(pid); |
299 | 299 | ||
300 | // walk down the process tree a few nodes, there should be no firejail leaf | 300 | // walk down the process tree a few nodes, there should be no firejail leaf |
301 | #define MAXNODES 4 | 301 | #define MAXNODES 4 |
302 | pid_t current = pid, next; | 302 | pid_t current = pid, next; |
303 | for (int i = 0; i < MAXNODES; i++) { | 303 | int i; |
304 | for (i = 0; i < MAXNODES; i++) { | ||
304 | if (find_child(current, &next) == 1) { | 305 | if (find_child(current, &next) == 1) { |
305 | EUID_ROOT(); | 306 | EUID_ROOT(); |
306 | comm = pid_proc_comm(current); | 307 | comm = pid_proc_comm(current); |