Prune alias contents when pruning and expanding aliases.

This abuses the userlist_matches_filter() and hostlist_matches_filter()
functions.  A better approach would be to call the correct function
from user_matches() and host_matches().
This commit is contained in:
Todd C. Miller
2018-04-15 08:14:46 -06:00
parent f8f0c16c73
commit 1bfe03000d
2 changed files with 46 additions and 1 deletions

View File

@@ -116,6 +116,7 @@ user_matches(const struct passwd *pw, const struct member *m)
break;
case ALIAS:
if ((a = alias_get(m->name, USERALIAS)) != NULL) {
/* XXX */
int rc = userlist_matches(pw, &a->members);
if (rc != UNSPEC)
matched = m->negated ? !rc : rc;
@@ -325,6 +326,7 @@ host_matches(const struct passwd *pw, const char *lhost, const char *shost,
break;
case ALIAS:
if ((a = alias_get(m->name, HOSTALIAS)) != NULL) {
/* XXX */
int rc = hostlist_matches_int(pw, lhost, shost, &a->members);
if (rc != UNSPEC)
matched = m->negated ? !rc : rc;