From e101224d831904f35303682c095e0c6aef8de5df Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 Dec 2001 00:00:43 +0000 Subject: init group db before use this fixes the smbpasswd segvs (This used to be commit d2bcdfd995b9562872d865e723b23ed84247a73f) --- source3/groupdb/mapping.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/groupdb/mapping.c') diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 32a5286408..a0f6148e90 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -180,6 +180,8 @@ BOOL add_mapping_entry(GROUP_MAP *map, int flag) int len; int i; PRIVILEGE_SET *set; + + init_group_mapping(); sid_to_string(string_sid, &map->sid); @@ -489,6 +491,8 @@ BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map) int i; PRIVILEGE_SET *set; + init_group_mapping(); + /* the key is the SID, retrieving is direct */ sid_to_string(string_sid, &sid); @@ -543,6 +547,8 @@ BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map) int i; PRIVILEGE_SET *set; + init_group_mapping(); + /* we need to enumerate the TDB to find the GID */ for (kbuf = tdb_firstkey(tdb); @@ -600,6 +606,8 @@ BOOL get_group_map_from_ntname(char *name, GROUP_MAP *map) int i; PRIVILEGE_SET *set; + init_group_mapping(); + /* we need to enumerate the TDB to find the name */ for (kbuf = tdb_firstkey(tdb); @@ -655,6 +663,8 @@ BOOL group_map_remove(DOM_SID sid) pstring key; fstring string_sid; + init_group_mapping(); + /* the key is the SID, retrieving is direct */ sid_to_string(string_sid, &sid); @@ -691,6 +701,8 @@ BOOL enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap, int i; PRIVILEGE_SET *set; + init_group_mapping(); + *num_entries=0; *rmap=NULL; -- cgit