]> granicus.if.org Git - sudo/commitdiff
In pedantic mode we need to save *all* the aliases, not just those
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 17 Aug 1999 12:47:53 +0000 (12:47 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 17 Aug 1999 12:47:53 +0000 (12:47 +0000)
that match, or we get spurious warnings.

parse.yacc
sudo.tab.c

index 9590152e8e17d01658d2ab34578280dc8dc8b91e..759a9770d90af6713302aba0eec9162c9345c9bf 100644 (file)
@@ -562,7 +562,7 @@ cmnd                :       ALL {
                            else {
                                if (pedantic)
                                    (void) fprintf(stderr,
-                                       "Warning: undeclared Cmnd_Alias `%s' referenced near line %d", $1, sudolineno);
+                                       "Warning: undeclared Cmnd_Alias `%s' referenced near line %d\n", $1, sudolineno);
                                $$ = -1;
                            }
                            free($1);
@@ -600,7 +600,7 @@ hostaliases :       hostalias
                ;
 
 hostalias      :       ALIAS { push; } '=' hostlist {
-                           if (host_matches != -1 &&
+                           if ((host_matches != -1 || pedantic) &&
                                !add_alias($1, HOST_ALIAS, host_matches))
                                YYERROR;
                            pop;
@@ -624,7 +624,7 @@ cmndalias   :       ALIAS {
                                ga_list[ga_list_len-1].alias = estrdup($1);
                             }
                        } '=' cmndlist {
-                           if (cmnd_matches != -1 &&
+                           if ((cmnd_matches != -1 || pedantic) &&
                                !add_alias($1, CMND_ALIAS, cmnd_matches))
                                YYERROR;
                            pop;
@@ -652,7 +652,7 @@ runasalias  :       ALIAS {
                                ga_list[ga_list_len-1].alias = estrdup($1);
                            }
                        } '=' runaslist {
-                           if (runas_matches != -1 &&
+                           if ((runas_matches != -1 || pedantic) &&
                                !add_alias($1, RUNAS_ALIAS, runas_matches))
                                YYERROR;
                            pop;
@@ -668,7 +668,7 @@ useraliases :       useralias
                ;
 
 useralias      :       ALIAS { push; } '=' userlist {
-                           if (user_matches != -1 &&
+                           if ((user_matches != -1 || pedantic) &&
                                !add_alias($1, USER_ALIAS, user_matches))
                                YYERROR;
                            pop;
index 462c00486b136676c6a87839117a09373166b108..b02f7efec7a0ac68e962bcce5564d7d5b24fccc0 100644 (file)
@@ -1440,7 +1440,7 @@ case 44:
                            else {
                                if (pedantic)
                                    (void) fprintf(stderr,
-                                       "Warning: undeclared Cmnd_Alias `%s' referenced near line %d", yyvsp[0].string, sudolineno);
+                                       "Warning: undeclared Cmnd_Alias `%s' referenced near line %d\n", yyvsp[0].string, sudolineno);
                                yyval.BOOLEAN = -1;
                            }
                            free(yyvsp[0].string);
@@ -1482,7 +1482,7 @@ break;
 case 49:
 #line 602 "parse.yacc"
 {
-                           if (host_matches != -1 &&
+                           if ((host_matches != -1 || pedantic) &&
                                !add_alias(yyvsp[-3].string, HOST_ALIAS, host_matches))
                                YYERROR;
                            pop;
@@ -1503,7 +1503,7 @@ break;
 case 55:
 #line 626 "parse.yacc"
 {
-                           if (cmnd_matches != -1 &&
+                           if ((cmnd_matches != -1 || pedantic) &&
                                !add_alias(yyvsp[-3].string, CMND_ALIAS, cmnd_matches))
                                YYERROR;
                            pop;
@@ -1532,7 +1532,7 @@ break;
 case 61:
 #line 654 "parse.yacc"
 {
-                           if (runas_matches != -1 &&
+                           if ((runas_matches != -1 || pedantic) &&
                                !add_alias(yyvsp[-3].string, RUNAS_ALIAS, runas_matches))
                                YYERROR;
                            pop;
@@ -1549,7 +1549,7 @@ break;
 case 65:
 #line 670 "parse.yacc"
 {
-                           if (user_matches != -1 &&
+                           if ((user_matches != -1 || pedantic) &&
                                !add_alias(yyvsp[-3].string, USER_ALIAS, user_matches))
                                YYERROR;
                            pop;