diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 1999-04-06 05:40:51 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 1999-04-06 05:40:51 +0000 |
commit | 228288b333b2417d07425e7fa6d55fb3aa65ce5c (patch) | |
tree | e3da38330f2e2a8ea4e9f7ee0bd4336d3536cd01 /parse.yacc | |
parent | 7f126c17207bbf6d6c365e243506345e8226ac68 (diff) | |
download | sudo-228288b333b2417d07425e7fa6d55fb3aa65ce5c.tar.gz |
It is now possible to use the '!' operator in a runas list as
well as in a Cmnd_Alias, Host_Alias and User_Alias.
Diffstat (limited to 'parse.yacc')
-rw-r--r-- | parse.yacc | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/parse.yacc b/parse.yacc index ea47e3510..68401cb09 100644 --- a/parse.yacc +++ b/parse.yacc @@ -241,6 +241,17 @@ privilege : hostspec '=' cmndspeclist { } ; +ophostspec : hostspec + | '!' { + push; + } ophostspec { + pop; + if (host_matched == TRUE) + host_matches = FALSE; + else if (host_matched == FALSE) + host_matches = TRUE; + } + hostspec : ALL { host_matches = TRUE; } @@ -529,8 +540,8 @@ hostalias : ALIAS { push; } '=' hostlist { } ; -hostlist : hostspec - | hostlist ',' hostspec +hostlist : ophostspec + | hostlist ',' ophostspec ; cmndaliases : cmndalias @@ -557,9 +568,8 @@ cmndalias : ALIAS { } ; -cmndlist : cmnd - { ; } - | cmndlist ',' cmnd +cmndlist : opcmnd { ; } + | cmndlist ',' opcmnd ; runasaliases : runasalias @@ -599,11 +609,21 @@ useralias : ALIAS { push; } '=' userlist { } ; -userlist : user - { ; } - | userlist ',' user +userlist : opuser { ; } + | userlist ',' opuser ; +opuser : user + | '!' { + push; + } opuser { + pop; + if (user_matched == TRUE) + user_matches = FALSE; + else if (user_matched == FALSE) + user_matches = TRUE; + } + user : NAME { if (strcmp($1, user_name) == 0) user_matches = TRUE; |