diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-07-03 08:29:32 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-07-03 14:29:32 +0200 |
commit | 0004f698df1410ef8b6ab3fb5f4b41a60c91182c (patch) | |
tree | 602a66a4117fe4563c9a489aed4488c6b20000c8 /src/cryptsetup | |
parent | 131d5e148e9ed883b3c5a3de7aca9a4f97b2774e (diff) | |
download | systemd-0004f698df1410ef8b6ab3fb5f4b41a60c91182c.tar.gz |
Parse "timeout=0" as infinity in various generators (#6264)
This extends 2d79a0bbb9f651656384a0a86ed814e6306fb5dd to the kernel
command line parsing.
The parsing is changed a bit to only understand "0" as infinity. If units are
specified, parse normally, e.g. "0s" is just 0. This makes it possible to
provide a zero timeout if necessary.
Simple test is added.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1462378.
Diffstat (limited to 'src/cryptsetup')
-rw-r--r-- | src/cryptsetup/cryptsetup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 91c653312a..3b4c086162 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -190,7 +190,7 @@ static int parse_one_option(const char *option) { arg_type = CRYPT_PLAIN; else if ((val = startswith(option, "timeout="))) { - r = parse_sec(val, &arg_timeout); + r = parse_sec_fix_0(val, &arg_timeout); if (r < 0) { log_error_errno(r, "Failed to parse %s, ignoring: %m", option); return 0; |