[BACK]Return to parse.yacc CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/parse.yacc between version 1.1 and 1.2

version 1.1, 1999/11/18 16:29:01 version 1.2, 1999/12/10 06:45:11
Line 79 
Line 79 
 #endif /* HAVE_LSEARCH */  #endif /* HAVE_LSEARCH */
   
 #ifndef lint  #ifndef lint
 static const char rcsid[] = "$Sudo: parse.yacc,v 1.166 1999/10/07 21:20:57 millert Exp $";  static const char rcsid[] = "$Sudo: parse.yacc,v 1.167 1999/12/05 19:06:09 millert Exp $";
 #endif /* lint */  #endif /* lint */
   
 /*  /*
Line 242 
Line 242 
 %type <BOOLEAN>  cmnd  %type <BOOLEAN>  cmnd
 %type <BOOLEAN>  host  %type <BOOLEAN>  host
 %type <BOOLEAN>  runasuser  %type <BOOLEAN>  runasuser
   %type <BOOLEAN>  oprunasuser
   %type <BOOLEAN>  runaslist
 %type <BOOLEAN>  user  %type <BOOLEAN>  user
   
 %%  %%
Line 462 
Line 464 
                                 runas_matches = (strcmp(*user_runas,                                  runas_matches = (strcmp(*user_runas,
                                     def_str(I_RUNAS_DEF)) == 0);                                      def_str(I_RUNAS_DEF)) == 0);
                         }                          }
                 |       RUNAS runaslist { ; }                  |       RUNAS runaslist {
                               runas_matches = ($2 == TRUE ? TRUE : FALSE);
                           }
                 ;                  ;
   
 runaslist       :       oprunasuser  runaslist       :       oprunasuser { ; }
                 |       runaslist ',' oprunasuser                  |       runaslist ',' oprunasuser {
                               /* Later entries override earlier ones. */
                               if ($3 != -1)
                                   $$ = $3;
                               else
                                   $$ = $1;
                           }
                 ;                  ;
   
 oprunasuser     :       runasuser {  oprunasuser     :       runasuser { ; }
                             if ($1 != -1)  
                                 runas_matches = $1;  
                         }  
                 |       '!' {                  |       '!' {
                             if (printmatches == TRUE) {                              if (printmatches == TRUE) {
                                 if (in_alias == TRUE)                                  if (in_alias == TRUE)
Line 482 
Line 489 
                                     append_runas("!", ", ");                                      append_runas("!", ", ");
                             }                              }
                         } runasuser {                          } runasuser {
                             if ($3 != -1)                              /* Set $$ to the negation of runasuser */
                                 runas_matches = ! $3;                              $$ = ($3 == -1 ? -1 : ! $3);
                         }                          }
   
 runasuser       :       WORD {  runasuser       :       WORD {
Line 717 
Line 724 
                 ;                  ;
   
 runasalias      :       ALIAS {  runasalias      :       ALIAS {
                             push;  
                             if (printmatches == TRUE) {                              if (printmatches == TRUE) {
                                 in_alias = TRUE;                                  in_alias = TRUE;
                                 /* Allocate space for ga_list if necessary. */                                  /* Allocate space for ga_list if necessary. */
Line 726 
Line 732 
                                 ga_list[ga_list_len-1].alias = estrdup($1);                                  ga_list[ga_list_len-1].alias = estrdup($1);
                             }                              }
                         } '=' runaslist {                          } '=' runaslist {
                             if ((runas_matches != -1 || pedantic) &&                              if (($4 != -1 || pedantic) &&
                                 !add_alias($1, RUNAS_ALIAS, runas_matches))                                  !add_alias($1, RUNAS_ALIAS, $4))
                                 YYERROR;                                  YYERROR;
                             pop;  
                             free($1);                              free($1);
   
                             if (printmatches == TRUE)                              if (printmatches == TRUE)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2