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

Diff for /src/usr.bin/doas/parse.y between version 1.18 and 1.19

version 1.18, 2016/06/07 16:49:23 version 1.19, 2016/06/27 15:41:17
Line 48 
Line 48 
 struct rule **rules;  struct rule **rules;
 int nrules, maxrules;  int nrules, maxrules;
 int parse_errors = 0;  int parse_errors = 0;
   int obsolete_warned = 0;
   
 void yyerror(const char *, ...);  void yyerror(const char *, ...);
 int yylex(void);  int yylex(void);
Line 56 
Line 57 
 %}  %}
   
 %token TPERMIT TDENY TAS TCMD TARGS  %token TPERMIT TDENY TAS TCMD TARGS
 %token TNOPASS TKEEPENV  %token TNOPASS TKEEPENV TSETENV
 %token TSTRING  %token TSTRING
   
 %%  %%
Line 97 
Line 98 
                         $$.envlist = $2.envlist;                          $$.envlist = $2.envlist;
                 } | TDENY {                  } | TDENY {
                         $$.action = DENY;                          $$.action = DENY;
                           $$.options = 0;
                           $$.envlist = NULL;
                 } ;                  } ;
   
 options:        /* none */  options:        /* none */ {
                 | options option {                          $$.options = 0;
                           $$.envlist = NULL;
                   } | options option {
                         $$.options = $1.options | $2.options;                          $$.options = $1.options | $2.options;
                         $$.envlist = $1.envlist;                          $$.envlist = $1.envlist;
                         if ($2.envlist) {                          if ($2.envlist) {
                                 if ($$.envlist) {                                  if ($$.envlist) {
                                         yyerror("can't have two keepenv sections");                                          yyerror("can't have two setenv sections");
                                         YYERROR;                                          YYERROR;
                                 } else                                  } else
                                         $$.envlist = $2.envlist;                                          $$.envlist = $2.envlist;
Line 113 
Line 118 
                 } ;                  } ;
 option:         TNOPASS {  option:         TNOPASS {
                         $$.options = NOPASS;                          $$.options = NOPASS;
                           $$.envlist = NULL;
                 } | TKEEPENV {                  } | TKEEPENV {
                         $$.options = KEEPENV;                          $$.options = KEEPENV;
                           $$.envlist = NULL;
                 } | TKEEPENV '{' envlist '}' {                  } | TKEEPENV '{' envlist '}' {
                         $$.options = KEEPENV;                          $$.options = 0;
                           if (!obsolete_warned) {
                                   warnx("keepenv with list is obsolete");
                                   obsolete_warned = 1;
                           }
                         $$.envlist = $3.envlist;                          $$.envlist = $3.envlist;
                   } | TSETENV '{' envlist '}' {
                           $$.options = 0;
                           $$.envlist = $3.envlist;
                 } ;                  } ;
   
 envlist:        /* empty */ {  envlist:        /* empty */ {
Line 195 
Line 209 
         { "args", TARGS },          { "args", TARGS },
         { "nopass", TNOPASS },          { "nopass", TNOPASS },
         { "keepenv", TKEEPENV },          { "keepenv", TKEEPENV },
           { "setenv", TSETENV },
 };  };
   
 int  int

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19