=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/parse.yacc,v retrieving revision 1.4.6.1 retrieving revision 1.5 diff -u -r1.4.6.1 -r1.5 --- src/usr.bin/sudo/Attic/parse.yacc 2002/01/18 17:20:23 1.4.6.1 +++ src/usr.bin/sudo/Attic/parse.yacc 2001/09/19 10:58:07 1.5 @@ -1,6 +1,6 @@ %{ /* - * Copyright (c) 1996, 1998-2001 Todd C. Miller + * Copyright (c) 1996, 1998-2000 Todd C. Miller * All rights reserved. * * This code is derived from software contributed by Chris Jepeway @@ -45,37 +45,30 @@ */ #include "config.h" - -#include -#include #include #ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif +#include #endif /* STDC_HEADERS */ -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif /* HAVE_STRING_H */ #ifdef HAVE_UNISTD_H -# include +#include #endif /* HAVE_UNISTD_H */ #include +#include +#include +#ifdef HAVE_STRING_H +#include +#endif /* HAVE_STRING_H */ +#ifdef HAVE_STRINGS_H +#include +#endif /* HAVE_STRINGS_H */ #if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) -# include +#include #endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #if defined(YYBISON) && defined(HAVE_ALLOCA_H) && !defined(__GNUC__) -# include +#include #endif /* YYBISON && HAVE_ALLOCA_H && !__GNUC__ */ #ifdef HAVE_LSEARCH -# include +#include #endif /* HAVE_LSEARCH */ #include "sudo.h" @@ -86,7 +79,7 @@ #endif /* HAVE_LSEARCH */ #ifndef lint -static const char rcsid[] = "$Sudo: parse.yacc,v 1.179 2001/12/30 18:41:12 millert Exp $"; +static const char rcsid[] = "$Sudo: parse.yacc,v 1.173 2000/03/24 23:58:58 millert Exp $"; #endif /* lint */ /* @@ -98,7 +91,6 @@ int printmatches = FALSE; int pedantic = FALSE; int keepall = FALSE; -int quiet = FALSE; /* * Alias types @@ -200,7 +192,7 @@ /* Save the line the first error occurred on. */ if (errorlineno == -1) errorlineno = sudolineno ? sudolineno - 1 : 0; - if (s && !quiet) { + if (s) { #ifndef TRACELEXER (void) fprintf(stderr, ">>> sudoers file: %s, line %d <<<\n", s, sudolineno ? sudolineno - 1 : 0); @@ -222,7 +214,6 @@ %start file /* special start symbol */ %token COMMAND /* absolute pathname w/ optional args */ %token ALIAS /* an UPPERCASE alias name */ -%token DEFVAR /* a Defaults variable name */ %token NTWKADDR /* w.x.y.z */ %token NETGROUP /* a netgroup (+NAME) */ %token USERGROUP /* a usergroup (%NAME) */ @@ -239,7 +230,7 @@ %token CMNDALIAS /* Cmnd_Alias keyword */ %token USERALIAS /* User_Alias keyword */ %token RUNASALIAS /* Runas_Alias keyword */ -%token ':' '=' ',' '!' '+' '-' /* union member tokens */ +%token ':' '=' ',' '!' /* union member tokens */ %token ERROR /* @@ -299,49 +290,32 @@ defaults_list : defaults_entry | defaults_entry ',' defaults_list -defaults_entry : DEFVAR { +defaults_entry : WORD { if (defaults_matches == TRUE && - !set_default($1, NULL, TRUE)) { + !set_default($1, NULL, 1)) { yyerror(NULL); YYERROR; } free($1); } - | '!' DEFVAR { + | '!' WORD { if (defaults_matches == TRUE && - !set_default($2, NULL, FALSE)) { + !set_default($2, NULL, 0)) { yyerror(NULL); YYERROR; } free($2); } - | DEFVAR '=' WORD { + | WORD '=' WORD { + /* XXX - need to support quoted values */ if (defaults_matches == TRUE && - !set_default($1, $3, TRUE)) { + !set_default($1, $3, 1)) { yyerror(NULL); YYERROR; } free($1); free($3); } - | DEFVAR '+' WORD { - if (defaults_matches == TRUE && - !set_default($1, $3, '+')) { - yyerror(NULL); - YYERROR; - } - free($1); - free($3); - } - | DEFVAR '-' WORD { - if (defaults_matches == TRUE && - !set_default($1, $3, '-')) { - yyerror(NULL); - YYERROR; - } - free($1); - free($3); - } privileges : privilege | privileges ':' privilege @@ -489,7 +463,7 @@ */ if (runas_matches == -1) runas_matches = (strcmp(*user_runas, - def_str(I_RUNAS_DEFAULT)) == 0); + def_str(I_RUNAS_DEF)) == 0); } | RUNAS runaslist { runas_matches = ($2 == TRUE ? TRUE : FALSE); @@ -1028,7 +1002,7 @@ } while ((p = strtok(NULL, ", "))); (void) fputs(") ", stdout); } else { - (void) printf("(%s) ", def_str(I_RUNAS_DEFAULT)); + (void) printf("(%s) ", def_str(I_RUNAS_DEF)); } /* Is a password required? */