Add support for "Defaults" line in sudoers to make configuration variables

changable at runtime (and on a global, per-host and per-user basis).
Both the names and the internal representation are still subject to change.
It was necessary to make sudo_user.runas but a char ** instead of a
char * since this value can be changed by a Defaults line.  There is a
similar (but more complicated) issue with sudo_user.prompt but it
is handled differently at the moment.

Add a "-L" flag to list the name of options with their descriptions.  This
may only be temporary.

Move some prototypes to parse.h

Be much less restrictive on what is allowed for a username.
This commit is contained in:
Todd C. Miller
1999-09-08 08:06:28 +00:00
parent 093fbe1e47
commit 13bf42675d
31 changed files with 3114 additions and 1928 deletions

View File

@@ -72,7 +72,7 @@ static const char rcsid[] = "$Sudo$";
* stores it in a statically allocated array, filling in a pointer
* to the array. Returns FOUND if the command was found, NOT_FOUND
* if it was not found, or NOT_FOUND_DOT if it would have been found
* but it is in '.' and IGNORE_DOT_PATH is in effect.
* but it is in '.' and FL_IGNORE_DOT is set.
*/
int
find_path(infile, outfile)
@@ -105,9 +105,12 @@ find_path(infile, outfile)
}
/*
* Grab PATH out of environment and make a local copy
* Grab PATH out of the environment (or from the string table
* if SECURE_PATH is in effect) and make a local copy.
*/
if ((path = getenv("PATH")) == NULL)
if (sudo_strtable[I_SECURE_PATH])
path = sudo_strtable[I_SECURE_PATH];
else if ((path = getenv("PATH")) == NULL)
return(NOT_FOUND);
path = estrdup(path);
origpath = path;
@@ -147,10 +150,8 @@ find_path(infile, outfile)
*/
if (!result && checkdot) {
result = sudo_goodpath(infile);
#ifdef IGNORE_DOT_PATH
if (result)
if (result && sudo_flag_set(FL_IGNORE_DOT))
return(NOT_FOUND_DOT);
#endif /* IGNORE_DOT_PATH */
}
if (result) {