]> granicus.if.org Git - sudo/commitdiff
Allow the plugin to determine whether or not an empty timeout is
authorTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 11 Dec 2017 16:20:41 +0000 (09:20 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 11 Dec 2017 16:20:41 +0000 (09:20 -0700)
allowed.  For sudoers, an error will be returned for an empty timeout.

plugins/sudoers/policy.c
src/parse_args.c

index 00169be6bea9b5b7e8bc47620a17f4a4fc482b9b..2c26efb80f9fed57e6f11929da022362b74faeef 100644 (file)
@@ -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) {
index ab5690aeaf9bcfc0a4a6e4b68fce46ce49ec9cc4..f3e1a1289d951df7b37a7d30947adceded6cd597 100644 (file)
@@ -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':