1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

init group db before use

this fixes the smbpasswd segvs
(This used to be commit d2bcdfd995)
This commit is contained in:
Andrew Tridgell 2001-12-03 00:00:43 +00:00
parent 633ee99afa
commit e101224d83

View File

@ -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;