From 10e0e119aec8a55fe1244b88e61f9967d7ddc70e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 20 Jul 1996 04:45:22 +0000 Subject: [PATCH] NOPASSWD may now have blanks before the ':' '(' only starts a 'runas' if in the initial state to avoid collision with command args --- parse.lex | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/parse.lex b/parse.lex index 320be5702..aeec09090 100644 --- a/parse.lex +++ b/parse.lex @@ -123,7 +123,7 @@ WORD [[:alnum:]_-]+ } /* return comments */ \"[^\n]*\" { - /* XXX - should be able to span lines? */ + /* XXX - this should go away */ LEXTRACE("ARG "); fill_args(yytext+1, yyleng-2, sawspace); sawspace = FALSE; @@ -158,8 +158,7 @@ WORD [[:alnum:]_-]+ return('.'); } -NOPASSWD: { - /* XXX - is this the best way? */ +NOPASSWD[[:blank:]]*: { /* cmnd does not require passwd for this user */ LEXTRACE("NOPASSWD "); return(NOPASSWD); @@ -189,8 +188,7 @@ NOPASSWD: { return(FQHOST); } -\( { - /* XXX - what about '(' in command args? */ +\( { BEGIN GOTRUNAS; LEXTRACE("RUNAS "); return (RUNAS); @@ -215,7 +213,7 @@ NOPASSWD: { return(NAME); } -\) BEGIN INITIAL; /* XXX - will newlines be treated correctly? */ +\) BEGIN INITIAL; \/[^\,:=\\ \t\n#]+ {