mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Replace RUNAS token with '(' and ')' tokens to make the runas
portion of the grammar more natural.
This commit is contained in:
4
gram.y
4
gram.y
@@ -122,7 +122,6 @@ yyerror(s)
|
||||
%token <tok> DEFAULTS_USER /* User-specific defaults entry */
|
||||
%token <tok> DEFAULTS_RUNAS /* Runas-specific defaults entry */
|
||||
%token <tok> DEFAULTS_CMND /* Command-specific defaults entry */
|
||||
%token <tok> RUNAS /* ( runas_list ) */
|
||||
%token <tok> NOPASSWD /* no passwd req for command */
|
||||
%token <tok> PASSWD /* passwd req for command (default) */
|
||||
%token <tok> NOEXEC /* preload dummy execve() for cmnd */
|
||||
@@ -136,6 +135,7 @@ yyerror(s)
|
||||
%token <tok> USERALIAS /* User_Alias keyword */
|
||||
%token <tok> RUNASALIAS /* Runas_Alias keyword */
|
||||
%token <tok> ':' '=' ',' '!' '+' '-' /* union member tokens */
|
||||
%token <tok> '(' ')' /* runas tokens */
|
||||
%token <tok> ERROR
|
||||
|
||||
%type <cmndspec> cmndspec
|
||||
@@ -319,7 +319,7 @@ opcmnd : cmnd {
|
||||
runasspec : /* empty */ {
|
||||
$$ = NULL;
|
||||
}
|
||||
| RUNAS runaslist {
|
||||
| '(' runaslist ')' {
|
||||
$$ = $2;
|
||||
}
|
||||
;
|
||||
|
6
toke.l
6
toke.l
@@ -94,6 +94,7 @@ IPV6ADDR \:\:|({HEXDIGIT}\:){7}{HEXDIGIT}|({HEXDIGIT}\:){5}{HEXDIGIT}\:{DOTTEDQ
|
||||
|
||||
HOSTNAME [[:alnum:]_-]+
|
||||
WORD ([^#>!=:,\(\) \t\n\\]|\\[^\n])+
|
||||
ID #-?[0-9]+
|
||||
PATH \/(\\[\,:= \t#]|[^\,:=\\ \t\n#])+
|
||||
ENVAR ([^#!=, \t\n\\\"]|\\[^\n])([^#=, \t\n\\\"]|\\[^\n])*
|
||||
DEFVAR [a-z_]+
|
||||
@@ -359,7 +360,7 @@ NOSETENV[[:blank:]]*: {
|
||||
|
||||
<INITIAL>\( {
|
||||
BEGIN GOTRUNAS;
|
||||
LEXTRACE("RUNAS ");
|
||||
LEXTRACE("( ");
|
||||
return (RUNAS);
|
||||
}
|
||||
|
||||
@@ -375,7 +376,7 @@ NOSETENV[[:blank:]]*: {
|
||||
}
|
||||
}
|
||||
|
||||
<GOTRUNAS>(#[0-9-]+|{WORD}) {
|
||||
<GOTRUNAS>({ID}|{WORD}) {
|
||||
/* username/uid that user can run command as */
|
||||
if (!fill(yytext, yyleng))
|
||||
yyterminate();
|
||||
@@ -392,6 +393,7 @@ NOSETENV[[:blank:]]*: {
|
||||
|
||||
<GOTRUNAS>\) {
|
||||
BEGIN INITIAL;
|
||||
LEXTRACE(") ");
|
||||
}
|
||||
|
||||
<GOTDEFS>({PATH}|sudoedit) {
|
||||
|
Reference in New Issue
Block a user