From b28ac86ab8d24110032e101ba7c7fbd2f7403d7d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 17 Aug 1999 12:47:53 +0000 Subject: [PATCH] In pedantic mode we need to save *all* the aliases, not just those that match, or we get spurious warnings. --- parse.yacc | 10 +++++----- sudo.tab.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/parse.yacc b/parse.yacc index 9590152e8..759a9770d 100644 --- a/parse.yacc +++ b/parse.yacc @@ -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; diff --git a/sudo.tab.c b/sudo.tab.c index 462c00486..b02f7efec 100644 --- a/sudo.tab.c +++ b/sudo.tab.c @@ -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; -- 2.40.0