mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
NOPASSWD may now have blanks before the ':'
'(' only starts a 'runas' if in the initial state to avoid collision with command args
This commit is contained in:
10
parse.lex
10
parse.lex
@@ -123,7 +123,7 @@ WORD [[:alnum:]_-]+
|
|||||||
} /* return comments */
|
} /* return comments */
|
||||||
|
|
||||||
<GOTCMND>\"[^\n]*\" {
|
<GOTCMND>\"[^\n]*\" {
|
||||||
/* XXX - should be able to span lines? */
|
/* XXX - this should go away */
|
||||||
LEXTRACE("ARG ");
|
LEXTRACE("ARG ");
|
||||||
fill_args(yytext+1, yyleng-2, sawspace);
|
fill_args(yytext+1, yyleng-2, sawspace);
|
||||||
sawspace = FALSE;
|
sawspace = FALSE;
|
||||||
@@ -158,8 +158,7 @@ WORD [[:alnum:]_-]+
|
|||||||
return('.');
|
return('.');
|
||||||
}
|
}
|
||||||
|
|
||||||
NOPASSWD: {
|
NOPASSWD[[:blank:]]*: {
|
||||||
/* XXX - is this the best way? */
|
|
||||||
/* cmnd does not require passwd for this user */
|
/* cmnd does not require passwd for this user */
|
||||||
LEXTRACE("NOPASSWD ");
|
LEXTRACE("NOPASSWD ");
|
||||||
return(NOPASSWD);
|
return(NOPASSWD);
|
||||||
@@ -189,8 +188,7 @@ NOPASSWD: {
|
|||||||
return(FQHOST);
|
return(FQHOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
\( {
|
<INITIAL>\( {
|
||||||
/* XXX - what about '(' in command args? */
|
|
||||||
BEGIN GOTRUNAS;
|
BEGIN GOTRUNAS;
|
||||||
LEXTRACE("RUNAS ");
|
LEXTRACE("RUNAS ");
|
||||||
return (RUNAS);
|
return (RUNAS);
|
||||||
@@ -215,7 +213,7 @@ NOPASSWD: {
|
|||||||
return(NAME);
|
return(NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
<GOTRUNAS>\) BEGIN INITIAL; /* XXX - will newlines be treated correctly? */
|
<GOTRUNAS>\) BEGIN INITIAL;
|
||||||
|
|
||||||
|
|
||||||
\/[^\,:=\\ \t\n#]+ {
|
\/[^\,:=\\ \t\n#]+ {
|
||||||
|
Reference in New Issue
Block a user