summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-11-24 17:31:38 +0000
committerGerald Carter <jerry@samba.org>2003-11-24 17:31:38 +0000
commitc39f5fea4ad7b57ee8ad4d2b115163f76753f853 (patch)
treee65a6577d044de2fdbfd354bbd1a72c47aec3199 /source3/groupdb
parent62685054962f4be7d8791b87dff85e89347269e8 (diff)
downloadsamba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.tar.gz
samba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.tar.bz2
samba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.zip
more access fixes for group enumeration in LDAP; bug 281
(This used to be commit 68283407e0f366d8315f4be6caed67eb6fe84b85)
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 7a07b5c344..8f534d779e 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -629,6 +629,7 @@ Returns a GROUP_MAP struct based on the gid.
BOOL get_group_from_gid(gid_t gid, GROUP_MAP *map)
{
struct group *grp;
+ BOOL ret;
if(!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping"));
@@ -641,7 +642,12 @@ BOOL get_group_from_gid(gid_t gid, GROUP_MAP *map)
/*
* make a group map from scratch if doesn't exist.
*/
- if (!pdb_getgrgid(map, gid)) {
+
+ become_root();
+ ret = pdb_getgrgid(map, gid);
+ unbecome_root();
+
+ if ( !ret ) {
map->gid=gid;
map->sid_name_use=SID_NAME_ALIAS;