summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-27 10:53:43 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-27 10:53:43 +0000
commitde03bb6160df8e4091ac43d282d5011f514899cb (patch)
treebd04a001e529253075710ecebf9895c8bf1c40fc
parentbc06e06d34c4a5da1272e1f2eab3e00fe3d7a0d4 (diff)
downloadsamba-de03bb6160df8e4091ac43d282d5011f514899cb.tar.gz
samba-de03bb6160df8e4091ac43d282d5011f514899cb.tar.bz2
samba-de03bb6160df8e4091ac43d282d5011f514899cb.zip
Patch from Kevin Stefanik <kstef@mtppi.org> to do some more error checking for
group mapping init failures. (This used to be commit cd6a2dad4e3092a19f784b6548fce49ecd8bb549)
-rw-r--r--source3/groupdb/mapping.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index f71a184bb8..a25566a6a8 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -199,7 +199,10 @@ BOOL add_mapping_entry(GROUP_MAP *map, int flag)
int i;
PRIVILEGE_SET *set;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
sid_to_string(string_sid, &map->sid);
@@ -509,7 +512,10 @@ BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map, BOOL with_priv)
int i;
PRIVILEGE_SET *set;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
/* the key is the SID, retrieving is direct */
@@ -568,7 +574,10 @@ BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map, BOOL with_priv)
int i;
PRIVILEGE_SET *set;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
/* we need to enumerate the TDB to find the GID */
@@ -628,7 +637,10 @@ BOOL get_group_map_from_ntname(char *name, GROUP_MAP *map, BOOL with_priv)
int i;
PRIVILEGE_SET *set;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
/* we need to enumerate the TDB to find the name */
@@ -688,7 +700,10 @@ BOOL group_map_remove(DOM_SID sid)
pstring key;
fstring string_sid;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
/* the key is the SID, retrieving is direct */
@@ -726,7 +741,10 @@ BOOL enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap,
int i;
PRIVILEGE_SET *set;
- init_group_mapping();
+ if(!init_group_mapping()) {
+ DEBUG(0,("failed to initialize group mapping"));
+ return(False);
+ }
*num_entries=0;
*rmap=NULL;