Allow the plugin to determine whether or not an empty timeout is
allowed. For sudoers, an error will be returned for an empty timeout.
This commit is contained in:
@@ -307,7 +307,6 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (MATCHES(*cur, "timeout=")) {
|
if (MATCHES(*cur, "timeout=")) {
|
||||||
CHECK(*cur, "timeout=");
|
|
||||||
p = *cur + sizeof("timeout=") - 1;
|
p = *cur + sizeof("timeout=") - 1;
|
||||||
user_timeout = parse_timeout(p);
|
user_timeout = parse_timeout(p);
|
||||||
if (user_timeout == -1) {
|
if (user_timeout == -1) {
|
||||||
|
@@ -428,8 +428,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 'T':
|
case 'T':
|
||||||
if (*optarg == '\0')
|
/* Plugin determines whether empty timeout is allowed. */
|
||||||
usage(1);
|
|
||||||
sudo_settings[ARG_TIMEOUT].value = optarg;
|
sudo_settings[ARG_TIMEOUT].value = optarg;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
|
Reference in New Issue
Block a user