Move new_member_all to ldap_util.c, it is only used by ldap/sssd.

This commit is contained in:
Todd C. Miller
2021-01-31 05:44:40 -07:00
parent a74e8502c0
commit 568931035d
7 changed files with 16 additions and 24 deletions

View File

@@ -409,7 +409,7 @@ sudo_ldap_role_to_priv(const char *cn, void *hosts, void *runasusers,
if (hosts == NULL) {
/* The host has already matched, use ALL as wildcard. */
if ((m = new_member_all(NULL)) == NULL)
if ((m = sudo_ldap_new_member_all()) == NULL)
goto oom;
TAILQ_INSERT_TAIL(&priv->hostlist, m, entries);
} else {
@@ -653,3 +653,15 @@ oom:
}
debug_return_ptr(NULL);
}
/* So ldap.c and sssd.c don't need to include gram.h */
struct member *
sudo_ldap_new_member_all(void)
{
struct member *m;
debug_decl(sudo_ldap_new_member_all, SUDOERS_DEBUG_LDAP);
if ((m = calloc(1, sizeof(*m))) != NULL)
m->type = ALL;
debug_return_ptr(m);
}