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 | 0c67574d2432f79967b4c1d435d5023dc1f42189 (patch) | |
tree | f21ffc0c480bdd228c19076638c73faf17384b23 | |
parent | 63a72d20bd0effd544c46b8ddb593d21ebff5d3b (diff) | |
download | samba-0c67574d2432f79967b4c1d435d5023dc1f42189.tar.gz samba-0c67574d2432f79967b4c1d435d5023dc1f42189.tar.xz samba-0c67574d2432f79967b4c1d435d5023dc1f42189.zip |
fix bug #281 by surrounding pdb_getgrgid() with become/unbecome_root()
(This used to be commit f6a01f51159ccd822c6e764b7243fff375f22747)
-rw-r--r-- | source3/passdb/passdb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index e005913eb2..05c452f33d 100644 --- a/source3/passdb/passdb.c +++ b/source3/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 */ |