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:
parent
63a72d20bd
commit
0c67574d24
@ -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 */
|
||||
|
||||
if ( !pdb_getgrgid( &group, gid ) ) {
|
||||
/* done as root since ldap backend requires root to open a connection */
|
||||
|
||||
become_root();
|
||||
ret = pdb_getgrgid( &group, gid );
|
||||
unbecome_root();
|
||||
|
||||
if ( !ret ) {
|
||||
|
||||
/* fallback to rid mapping if enabled */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user