]> granicus.if.org Git - sudo/commitdiff
NOPASSWD may now have blanks before the ':'
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Jul 1996 04:45:22 +0000 (04:45 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Jul 1996 04:45:22 +0000 (04:45 +0000)
'(' only starts a 'runas' if in the initial state to avoid
collision with command args

parse.lex

index 320be5702ff384099a0013cfe4669940c7430c62..aeec090909af5054b25bdce90c05e3a670b56190 100644 (file)
--- a/parse.lex
+++ b/parse.lex
@@ -123,7 +123,7 @@ WORD                        [[:alnum:]_-]+
                        }                       /* return comments */
 
 <GOTCMND>\"[^\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? */
+<INITIAL>\(            {
                                BEGIN GOTRUNAS;
                                LEXTRACE("RUNAS ");
                                return (RUNAS);
@@ -215,7 +213,7 @@ NOPASSWD:           {
                            return(NAME);
                        }
 
-<GOTRUNAS>\)           BEGIN INITIAL; /* XXX - will newlines be treated correctly? */
+<GOTRUNAS>\)           BEGIN INITIAL;
 
 
 \/[^\,:=\\ \t\n#]+     {