else
while (top) {
if (host_matches == TRUE) {
- if (cmnd_matches == TRUE) {
- if (runas_matches == TRUE) {
+ if (runas_matches == TRUE) {
+ if (cmnd_matches == TRUE) {
/*
* User was granted access to cmnd on host.
* If no passwd required return as such.
return(VALIDATE_OK_NOPASS);
else
return(VALIDATE_OK);
+ } else if (cmnd_matches == FALSE) {
+ /* User was explicitly denied acces to cmnd on host. */
+ return(VALIDATE_NOT_OK);
}
- } else if (cmnd_matches == FALSE) {
- /* User was explicitly denied acces to cmnd on host. */
- return(VALIDATE_NOT_OK);
}
}
top--;
no_passwd = -1;
}
} runasspec nopasswd opcmnd {
- if ($2 > 0 && $4 == TRUE) {
+ if ($2 > 0)
runas_matches = TRUE;
- if ($3 == TRUE)
- no_passwd = TRUE;
- } else if (printmatches == TRUE) {
+ if ($3 == TRUE)
+ no_passwd = TRUE;
+ if (($2 == -1 || $4 == -1) && printmatches == TRUE) {
cm_list[cm_list_len].runas_len = 0;
cm_list[cm_list_len].cmnd_len = 0;
cm_list[cm_list_len].nopasswd = FALSE;
case 23:
#line 280 "parse.yacc"
{
- if (yyvsp[-2].BOOLEAN > 0 && yyvsp[0].BOOLEAN == TRUE) {
+ if (yyvsp[-2].BOOLEAN > 0)
runas_matches = TRUE;
- if (yyvsp[-1].BOOLEAN == TRUE)
- no_passwd = TRUE;
- } else if (printmatches == TRUE) {
+ if (yyvsp[-1].BOOLEAN == TRUE)
+ no_passwd = TRUE;
+ if ((yyvsp[-2].BOOLEAN == -1 || yyvsp[0].BOOLEAN == -1) && printmatches == TRUE) {
cm_list[cm_list_len].runas_len = 0;
cm_list[cm_list_len].cmnd_len = 0;
cm_list[cm_list_len].nopasswd = FALSE;