aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2020-01-17 23:14:09 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2020-01-17 23:14:09 +0100
commit894b94fd2d2fe6f94c3b629eb813f0bf75001ae5 (patch)
tree60dcac8a193c8f17322747c83ff619b48fef023e
parentFix gfeeds (diff)
downloadfirejail-894b94fd2d2fe6f94c3b629eb813f0bf75001ae5.tar.gz
firejail-894b94fd2d2fe6f94c3b629eb813f0bf75001ae5.tar.zst
firejail-894b94fd2d2fe6f94c3b629eb813f0bf75001ae5.zip
fix join timeout if sleep interval is not a multiple
-rw-r--r--etc/firejail.config6
-rw-r--r--src/firejail/join.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/etc/firejail.config b/etc/firejail.config
index 3bff2f7ed..6fb7d829a 100644
--- a/etc/firejail.config
+++ b/etc/firejail.config
@@ -62,9 +62,9 @@
62# root user can always join sandboxes. 62# root user can always join sandboxes.
63# join yes 63# join yes
64 64
65# Timeout when joining a sandbox, default five seconds. Wait up to 65# Timeout when joining a sandbox, default five seconds. It is not
66# the specified period of time to allow sandbox setup to finish. 66# possible to join a sandbox while it is still starting up. Wait up
67# It is not possible to join a sandbox while it is still starting up. 67# to the specified period of time to allow sandbox setup to finish.
68# join-timeout 5 68# join-timeout 5
69 69
70# Enable or disable sandbox name change, default enabled. 70# Enable or disable sandbox name change, default enabled.
diff --git a/src/firejail/join.c b/src/firejail/join.c
index 1494c782f..f61e50d31 100644
--- a/src/firejail/join.c
+++ b/src/firejail/join.c
@@ -322,8 +322,8 @@ bool is_ready_for_join(const pid_t pid) {
322void check_join_permission(pid_t pid) { 322void check_join_permission(pid_t pid) {
323 // check if pid belongs to a fully set up firejail sandbox 323 // check if pid belongs to a fully set up firejail sandbox
324 unsigned long i; 324 unsigned long i;
325 for (i = 0; is_ready_for_join(pid) == false; i += SNOOZE) { // give sandbox some time to start up 325 for (i = SNOOZE; is_ready_for_join(pid) == false; i += SNOOZE) { // give sandbox some time to start up
326 if (i >= join_timeout) { 326 if (i > join_timeout) {
327 fprintf(stderr, "Error: no valid sandbox\n"); 327 fprintf(stderr, "Error: no valid sandbox\n");
328 exit(1); 328 exit(1);
329 } 329 }