version 1.18, 2016/06/07 16:49:23 |
version 1.19, 2016/06/27 15:41:17 |
|
|
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); |
|
|
%} |
%} |
|
|
%token TPERMIT TDENY TAS TCMD TARGS |
%token TPERMIT TDENY TAS TCMD TARGS |
%token TNOPASS TKEEPENV |
%token TNOPASS TKEEPENV TSETENV |
%token TSTRING |
%token TSTRING |
|
|
%% |
%% |
|
|
$$.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; |
|
|
} ; |
} ; |
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 */ { |
|
|
{ "args", TARGS }, |
{ "args", TARGS }, |
{ "nopass", TNOPASS }, |
{ "nopass", TNOPASS }, |
{ "keepenv", TKEEPENV }, |
{ "keepenv", TKEEPENV }, |
|
{ "setenv", TSETENV }, |
}; |
}; |
|
|
int |
int |