From 6ba6972787e0a6200ac08554defa9c2349deb4eb Mon Sep 17 00:00:00 2001 From: smitsohu Date: Mon, 20 Aug 2018 00:00:41 +0200 Subject: fix check for find_child return value (bandwidth.c, netfilter.c) --- src/firejail/bandwidth.c | 2 +- src/firejail/netfilter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/firejail/bandwidth.c b/src/firejail/bandwidth.c index 0045b444f..49a94186c 100644 --- a/src/firejail/bandwidth.c +++ b/src/firejail/bandwidth.c @@ -328,7 +328,7 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in // join the network namespace //************************ pid_t child; - if (find_child(pid, &child) == -1) { + if (find_child(pid, &child) == 1) { fprintf(stderr, "Error: cannot join the network namespace\n"); exit(1); } diff --git a/src/firejail/netfilter.c b/src/firejail/netfilter.c index de446d032..11c7e9669 100644 --- a/src/firejail/netfilter.c +++ b/src/firejail/netfilter.c @@ -170,7 +170,7 @@ void netfilter_print(pid_t pid, int ipv6) { // join the network namespace pid_t child; - if (find_child(pid, &child) == -1) { + if (find_child(pid, &child) == 1) { fprintf(stderr, "Error: cannot join the network namespace\n"); exit(1); } -- cgit v1.2.3-70-g09d2