add RUNAS_DEFAULT
This commit is contained in:
4
OPTIONS
4
OPTIONS
@@ -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.
|
||||||
|
@@ -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 */
|
||||||
|
@@ -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
2
sudo.c
@@ -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";
|
||||||
|
@@ -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];
|
||||||
|
2
visudo.c
2
visudo.c
@@ -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
|
||||||
|
Reference in New Issue
Block a user