add RUNAS_DEFAULT

This commit is contained in:
Todd C. Miller
1998-09-08 00:42:02 +00:00
parent fd94f14a19
commit e68f156aca
6 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
The following options may be used to configure sudo 1.4 The following options may be used to configure sudo 1.4
RUNAS_DEFAULT
The default user to run commands as if the -u flag is not specified
on the command line. This defaults to "root".
FQDN FQDN
Define this if you want to put fully qualified hostnames in the sudoers Define this if you want to put fully qualified hostnames in the sudoers
file. Ie: instead of myhost you would use myhost.mydomain.edu. file. Ie: instead of myhost you would use myhost.mydomain.edu.

View File

@@ -31,6 +31,7 @@
/* User-configurable Sudo runtime options */ /* User-configurable Sudo runtime options */
#define RUNAS_DEFAULT "root" /* default user to run cmd as if no -u flag */
/*#define FQDN /* expect fully qualified hosts in sudoers */ /*#define FQDN /* expect fully qualified hosts in sudoers */
#define LOGGING SLOG_SYSLOG /* log via SLOG_SYSLOG, SLOG_FILE, SLOG_BOTH */ #define LOGGING SLOG_SYSLOG /* log via SLOG_SYSLOG, SLOG_FILE, SLOG_BOTH */
#define LOGFAC LOG_LOCAL2 /* syslog facility for sudo to use */ #define LOGFAC LOG_LOCAL2 /* syslog facility for sudo to use */

View File

@@ -308,7 +308,7 @@ opcmnd : cmnd { ; }
; ;
runasspec : /* empty */ { runasspec : /* empty */ {
$$ = (strcmp("root", runas_user) == 0); $$ = (strcmp(RUNAS_DEFAULT, runas_user) == 0);
} }
| RUNAS runaslist { | RUNAS runaslist {
$$ = $2; $$ = $2;

2
sudo.c
View File

@@ -141,7 +141,7 @@ char **Argv;
int NewArgc = 0; int NewArgc = 0;
char **NewArgv = NULL; char **NewArgv = NULL;
struct passwd *user_pw_ent; struct passwd *user_pw_ent;
char *runas_user = "root"; char *runas_user = RUNAS_DEFAULT;
char *cmnd = NULL; char *cmnd = NULL;
char *cmnd_args = NULL; char *cmnd_args = NULL;
char *tty = "unknown"; char *tty = "unknown";

View File

@@ -78,7 +78,7 @@ extern int num_interfaces;
char *cmnd = NULL; char *cmnd = NULL;
char *cmnd_args = NULL; char *cmnd_args = NULL;
char *runas_user = "root"; char *runas_user = RUNAS_DEFAULT;
char host[MAXHOSTNAMELEN]; char host[MAXHOSTNAMELEN];
char *shost; char *shost;
char cwd[MAXPATHLEN]; char cwd[MAXPATHLEN];

View File

@@ -105,7 +105,7 @@ int NewArgc = 0;
char *sudoers = _PATH_SUDO_SUDOERS; char *sudoers = _PATH_SUDO_SUDOERS;
char *stmp = _PATH_SUDO_STMP; char *stmp = _PATH_SUDO_STMP;
int parse_error = FALSE; int parse_error = FALSE;
char *runas_user = "root"; char *runas_user = RUNAS_DEFAULT;
/* /*
* For the parsing routines * For the parsing routines