From 5106bfc13933ec44ca7c576d49d41f364023ea27 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 11 Dec 2017 09:20:41 -0700 Subject: [PATCH] Allow the plugin to determine whether or not an empty timeout is allowed. For sudoers, an error will be returned for an empty timeout. --- plugins/sudoers/policy.c | 1 - src/parse_args.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c index 00169be6b..2c26efb80 100644 --- a/plugins/sudoers/policy.c +++ b/plugins/sudoers/policy.c @@ -307,7 +307,6 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group) continue; } if (MATCHES(*cur, "timeout=")) { - CHECK(*cur, "timeout="); p = *cur + sizeof("timeout=") - 1; user_timeout = parse_timeout(p); if (user_timeout == -1) { diff --git a/src/parse_args.c b/src/parse_args.c index ab5690aea..f3e1a1289 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -428,8 +428,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, break; #endif case 'T': - if (*optarg == '\0') - usage(1); + /* Plugin determines whether empty timeout is allowed. */ sudo_settings[ARG_TIMEOUT].value = optarg; break; case 'S': -- 2.40.0