version 1.1, 1999/11/18 16:29:01 |
version 1.2, 1999/12/10 06:45:11 |
|
|
#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 */ |
|
|
/* |
/* |
|
|
%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 |
|
|
%% |
%% |
|
|
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) |
|
|
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 { |
|
|
; |
; |
|
|
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. */ |
|
|
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) |