summaryrefslogtreecommitdiff
path: root/nslcd/util.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-01-17 15:35:45 +0000
committerArthur de Jong <arthur@arthurdejong.org>2007-01-17 15:35:45 +0000
commitc026629eedf04f9d3579180980bb6bfa6759d15b (patch)
tree5318f4af5959644343a502696cf6f9bc161a5ebd /nslcd/util.c
parent971cc42b25ab2b0f014482562c734976915e3033 (diff)
move name_list stuff to group.c as that is the only place it's used at the moment
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@222 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/util.c')
-rw-r--r--nslcd/util.c106
1 files changed, 0 insertions, 106 deletions
diff --git a/nslcd/util.c b/nslcd/util.c
index bccc49e..182c822 100644
--- a/nslcd/util.c
+++ b/nslcd/util.c
@@ -1610,112 +1610,6 @@ _nss_ldap_db_put (void *db,
return NSS_STATUS_SUCCESS;
}
-/*
- * Add a nested netgroup or group to the namelist
- */
-enum nss_status
-_nss_ldap_namelist_push (struct name_list **head, const char *name)
-{
- struct name_list *nl;
-
- log_log(LOG_DEBUG,"==> _nss_ldap_namelist_push (%s)", name);
-
- nl = (struct name_list *) malloc (sizeof (*nl));
- if (nl == NULL)
- {
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_push");
- return NSS_STATUS_TRYAGAIN;
- }
-
- nl->name = strdup (name);
- if (nl->name == NULL)
- {
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_push");
- free (nl);
- return NSS_STATUS_TRYAGAIN;
- }
-
- nl->next = *head;
-
- *head = nl;
-
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_push");
-
- return NSS_STATUS_SUCCESS;
-}
-
-/*
- * Remove last nested netgroup or group from the namelist
- */
-void
-_nss_ldap_namelist_pop (struct name_list **head)
-{
- struct name_list *nl;
-
- log_log(LOG_DEBUG,"==> _nss_ldap_namelist_pop");
-
- assert (*head != NULL);
- nl = *head;
-
- *head = nl->next;
-
- assert (nl->name != NULL);
- free (nl->name);
- free (nl);
-
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_pop");
-}
-
-/*
- * Cleanup nested netgroup or group namelist.
- */
-void
-_nss_ldap_namelist_destroy (struct name_list **head)
-{
- struct name_list *p, *next;
-
- log_log(LOG_DEBUG,"==> _nss_ldap_namelist_destroy");
-
- for (p = *head; p != NULL; p = next)
- {
- next = p->next;
-
- if (p->name != NULL)
- free (p->name);
- free (p);
- }
-
- *head = NULL;
-
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_destroy");
-}
-
-/*
- * Check whether we have already seen a netgroup or group,
- * to avoid loops in nested netgroup traversal
- */
-int
-_nss_ldap_namelist_find (struct name_list *head, const char *netgroup)
-{
- struct name_list *p;
- int found = 0;
-
- log_log(LOG_DEBUG,"==> _nss_ldap_namelist_find");
-
- for (p = head; p != NULL; p = p->next)
- {
- if (strcasecmp (p->name, netgroup) == 0)
- {
- found++;
- break;
- }
- }
-
- log_log(LOG_DEBUG,"<== _nss_ldap_namelist_find");
-
- return found;
-}
-
enum nss_status _nss_ldap_validateconfig (struct ldap_config *config)
{
struct stat statbuf;