diff options
author | Gerald Carter <jerry@samba.org> | 2003-08-11 07:05:23 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-08-11 07:05:23 +0000 |
commit | f6a01f51159ccd822c6e764b7243fff375f22747 (patch) | |
tree | 18b43c4f83f65008cd79bd9cdb5269819cc02a82 /source/passdb | |
parent | f833d1f15691a418b99f82dbda75b673fb3428f6 (diff) | |
download | samba-f6a01f51159ccd822c6e764b7243fff375f22747.tar.gz samba-f6a01f51159ccd822c6e764b7243fff375f22747.tar.xz samba-f6a01f51159ccd822c6e764b7243fff375f22747.zip |
fix bug #281 by surrounding pdb_getgrgid() with become/unbecome_root()
Diffstat (limited to 'source/passdb')
-rw-r--r-- | source/passdb/passdb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/passdb/passdb.c b/source/passdb/passdb.c index e005913eb27..05c452f33d4 100644 --- a/source/passdb/passdb.c +++ b/source/passdb/passdb.c @@ -1167,11 +1167,18 @@ BOOL local_sid_to_uid(uid_t *puid, const DOM_SID *psid, enum SID_NAME_USE *name_ DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid) { GROUP_MAP group; + BOOL ret; /* we don't need to disable winbindd since the gid is stored in the GROUP_MAP object */ + + /* done as root since ldap backend requires root to open a connection */ - if ( !pdb_getgrgid( &group, gid ) ) { + become_root(); + ret = pdb_getgrgid( &group, gid ); + unbecome_root(); + + if ( !ret ) { /* fallback to rid mapping if enabled */ |