Add limited support for "sudo -l -h other_host". Since group lookups

are done on the local host, rules that use group membership may be
incorrect if the group database is not synchronized between hosts.
This commit is contained in:
Todd C. Miller
2013-08-14 13:49:14 -06:00
parent 79104ce751
commit d0e3867587
8 changed files with 39 additions and 15 deletions

View File

@@ -275,7 +275,7 @@ hostlist_matches(struct member_list *list)
matched = !m->negated;
break;
case NETGROUP:
if (netgr_matches(m->name, user_host, user_shost, NULL))
if (netgr_matches(m->name, user_runhost, user_srunhost, NULL))
matched = !m->negated;
break;
case NTWKADDR:
@@ -292,7 +292,7 @@ hostlist_matches(struct member_list *list)
}
/* FALLTHROUGH */
case WORD:
if (hostname_matches(user_shost, user_host, m->name))
if (hostname_matches(user_srunhost, user_runhost, m->name))
matched = !m->negated;
break;
}