diff options
author | smitsohu <smitsohu@gmail.com> | 2018-08-20 00:00:41 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2018-08-20 00:00:41 +0200 |
commit | 6ba6972787e0a6200ac08554defa9c2349deb4eb (patch) | |
tree | f6cb879fd2520593d831d0a3f3d3798ad2c93bb0 | |
parent | Merge branch 'master' of https://github.com/netblue30/firejail (diff) | |
download | firejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.tar.gz firejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.tar.zst firejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.zip |
fix check for find_child return value (bandwidth.c, netfilter.c)
-rw-r--r-- | src/firejail/bandwidth.c | 2 | ||||
-rw-r--r-- | 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 | |||
328 | // join the network namespace | 328 | // join the network namespace |
329 | //************************ | 329 | //************************ |
330 | pid_t child; | 330 | pid_t child; |
331 | if (find_child(pid, &child) == -1) { | 331 | if (find_child(pid, &child) == 1) { |
332 | fprintf(stderr, "Error: cannot join the network namespace\n"); | 332 | fprintf(stderr, "Error: cannot join the network namespace\n"); |
333 | exit(1); | 333 | exit(1); |
334 | } | 334 | } |
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) { | |||
170 | 170 | ||
171 | // join the network namespace | 171 | // join the network namespace |
172 | pid_t child; | 172 | pid_t child; |
173 | if (find_child(pid, &child) == -1) { | 173 | if (find_child(pid, &child) == 1) { |
174 | fprintf(stderr, "Error: cannot join the network namespace\n"); | 174 | fprintf(stderr, "Error: cannot join the network namespace\n"); |
175 | exit(1); | 175 | exit(1); |
176 | } | 176 | } |