diff options
author | 2019-01-20 01:14:31 +0100 | |
---|---|---|
committer | 2019-01-20 01:14:31 +0100 | |
commit | e20b469efeff2d618ab8b0f1cd5bb4551c4a6d7c (patch) | |
tree | 95ea800f95c210fe02a7f7dbb035644d6a80c5e1 | |
parent | rearrange shutdown option (diff) | |
download | firejail-e20b469efeff2d618ab8b0f1cd5bb4551c4a6d7c.tar.gz firejail-e20b469efeff2d618ab8b0f1cd5bb4551c4a6d7c.tar.zst firejail-e20b469efeff2d618ab8b0f1cd5bb4551c4a6d7c.zip |
disallow zero seconds timeout
-rw-r--r-- | src/firejail/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index 6b30ab5fe..f1c4f7059 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -1093,8 +1093,13 @@ unsigned extract_timeout(const char *str) { | |||
1093 | fprintf(stderr, "Error: invalid timeout, please use a hh:mm:ss format\n"); | 1093 | fprintf(stderr, "Error: invalid timeout, please use a hh:mm:ss format\n"); |
1094 | exit(1); | 1094 | exit(1); |
1095 | } | 1095 | } |
1096 | unsigned timeout = h * 3600 + m * 60 + s; | ||
1097 | if (timeout == 0) { | ||
1098 | fprintf(stderr, "Error: invalid timeout\n"); | ||
1099 | exit(1); | ||
1100 | } | ||
1096 | 1101 | ||
1097 | return h * 3600 + m * 60 + s; | 1102 | return timeout; |
1098 | } | 1103 | } |
1099 | 1104 | ||
1100 | void disable_file_or_dir(const char *fname) { | 1105 | void disable_file_or_dir(const char *fname) { |