switch (m->type) {
case ALIAS:
rval = alias_matches(m->name, USERALIAS, pw, NULL);
- if (rval != UNSPEC || (rval = !strcmp(m->name, pw->pw_name)))
- matched = rval;
+ if (rval == UNSPEC)
+ rval = !strcmp(m->name, pw->pw_name);
+ matched = m->negated ? !rval : rval;
break;
case ALL:
matched = !m->negated;
switch (m->type) {
case ALIAS:
rval = alias_matches(m->name, RUNASALIAS, pw, NULL);
- if (rval != UNSPEC || (rval = !strcmp(m->name, pw->pw_name)))
- matched = rval;
+ if (rval == UNSPEC)
+ rval = !strcmp(m->name, pw->pw_name);
+ matched = m->negated ? !rval : rval;
break;
case ALL:
matched = !m->negated;
switch (m->type) {
case ALIAS:
rval = alias_matches(m->name, HOSTALIAS, shost, lhost);
- if (rval != UNSPEC || (rval = hostname_matches(shost, lhost, m->name)))
- matched = rval;
+ if (rval == UNSPEC)
+ rval = hostname_matches(shost, lhost, m->name);
+ matched = m->negated ? !rval : rval;
break;
case ALL:
matched = !m->negated;
case ALIAS:
rval = alias_matches(m->name, CMNDALIAS, cmnd, args);
if (rval != UNSPEC)
- matched = rval;
+ matched = m->negated ? !rval : rval;
break;
case ALL:
matched = !m->negated;