2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Add support for command-specific Defaults entries. E.g.

Defaults!/usr/bin/vi noexec
This commit is contained in:
Todd C. Miller
2004-11-19 21:35:12 +00:00
parent 0cddfc3684
commit fe869025c4
11 changed files with 1063 additions and 947 deletions

8
sudo.c
View File

@@ -257,7 +257,7 @@ main(argc, argv, envp)
/* Parse sudoers and set any defaults listed in it. */
if (parse_sudoers(_PATH_SUDOERS) || parse_error)
log_error(0, "parse error in %s near line %d", errorfile, errorlineno);
if (!update_defaults())
if (!update_defaults(SKIP_CMND))
log_error(NO_STDERR|NO_EXIT, "problem with defaults entries");
}
@@ -612,7 +612,8 @@ init_vars(sudo_mode)
}
/*
* Fill in user_cmnd, user_args, user_base and user_stat variables.
* Fill in user_cmnd, user_args, user_base and user_stat variables
* and apply any command-specific defaults entries.
*/
static int
set_cmnd(sudo_mode)
@@ -667,6 +668,9 @@ set_cmnd(sudo_mode)
else
user_base = user_cmnd;
if (!update_defaults(ONLY_CMND))
log_error(NO_STDERR|NO_EXIT, "problem with defaults entries");
return(rval);
}