Clean up a bit :-)
authorVolker Lendecke <vlendec@samba.org>
Sun, 14 Mar 2004 10:36:07 +0000 (10:36 +0000)
committerVolker Lendecke <vlendec@samba.org>
Sun, 14 Mar 2004 10:36:07 +0000 (10:36 +0000)
Volker
(This used to be commit 66c4a6dee88274c2e1493224b0ba694418b32796)

source3/groupdb/mapping.c
source3/passdb/util_sam_sid.c

index cbf022f377257ed0ccb1b2d0bf39d64d8872c61d..319d39c99fdb8303a9eacd7871671db9c71c5fc9 100644 (file)
@@ -531,6 +531,19 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
        return (result == 0 ? NT_STATUS_OK : NT_STATUS_ACCESS_DENIED);
 }
 
+static void add_sid_to_array(const DOM_SID *sid, DOM_SID **sids, int *num)
+{
+       *sids = Realloc(*sids, ((*num)+1) * sizeof(DOM_SID));
+
+       if (*sids == NULL)
+               return;
+
+       sid_copy(&((*sids)[*num]), sid);
+       *num += 1;
+
+       return;
+}
+
 static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, int *num)
 {
        GROUP_MAP map;
index 1d1e74cd6f84aac22f8a192d218f79ed13dcab2f..f6cc2491a8b1169a590f9f2d583e0950295040b9 100644 (file)
@@ -305,60 +305,3 @@ BOOL map_name_to_wellknown_sid(DOM_SID *sid, enum SID_NAME_USE *use, const char
 
        return False;
 }
-
-void add_sid_to_array(const DOM_SID *sid, DOM_SID **sids, int *num)
-{
-       *sids = Realloc(*sids, ((*num)+1) * sizeof(DOM_SID));
-
-       if (*sids == NULL)
-               return;
-
-       sid_copy(&((*sids)[*num]), sid);
-       *num += 1;
-
-       return;
-}
-
-void add_gid_to_array_unique(gid_t gid, gid_t **gids, int *num)
-{
-       int i;
-
-       if ((*num) >= groups_max())
-               return;
-
-       for (i=0; i<*num; i++) {
-               if ((*gids)[i] == gid)
-                       return;
-       }
-       
-       *gids = Realloc(*gids, (*num+1) * sizeof(gid_t));
-
-       if (*gids == NULL)
-               return;
-
-       (*gids)[*num] = gid;
-       *num += 1;
-}
-
-/**************************************************************************
- Augment a gid list with gids from alias memberships
-***************************************************************************/
-
-void add_foreign_gids_from_sid(const DOM_SID *sid, gid_t **gids, int *num)
-{
-       DOM_SID *aliases;
-       int j, num_aliases;
-
-       if (!pdb_enum_alias_memberships(sid, &aliases, &num_aliases))
-               return;
-
-       for (j=0; j<num_aliases; j++) {
-               gid_t gid;
-
-               if (!NT_STATUS_IS_OK(sid_to_gid(&aliases[j], &gid)))
-                       continue;
-
-               add_gid_to_array_unique(gid, gids, num);
-       }
-       SAFE_FREE(aliases);
-}