1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

fix bug #281 by surrounding pdb_getgrgid() with become/unbecome_root()

(This used to be commit f6a01f5115)
This commit is contained in:
Gerald Carter 2003-08-11 07:05:23 +00:00
parent 63a72d20bd
commit 0c67574d24

View File

@ -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 */