aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-08-20 00:00:41 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-08-20 00:00:41 +0200
commit6ba6972787e0a6200ac08554defa9c2349deb4eb (patch)
treef6cb879fd2520593d831d0a3f3d3798ad2c93bb0 /src
parentMerge branch 'master' of https://github.com/netblue30/firejail (diff)
downloadfirejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.tar.gz
firejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.tar.zst
firejail-6ba6972787e0a6200ac08554defa9c2349deb4eb.zip
fix check for find_child return value (bandwidth.c, netfilter.c)
Diffstat (limited to 'src')
-rw-r--r--src/firejail/bandwidth.c2
-rw-r--r--src/firejail/netfilter.c2
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 }