r25598: Add missing become_root/unbecome_root around calls of add_aliases. samba-misc-tags/initial-v3-2-unstable
authorMichael Adam <obnox@samba.org>
Wed, 10 Oct 2007 08:27:56 +0000 (08:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:31:17 +0000 (12:31 -0500)
This triggered a "cannot access LDAP when not root"-bug with
"passdb backend = ldap" and "winbind nested groups = yes".

This *might* be a step towards fixing bug #4308, since the
failure was observerd when triggered by acl code.

Michael

source/auth/token_util.c

index 2c11fa5b178ac8683aa61a2e7a4339a3e64d1713..7514d867adc47e82c097d436e841d8ee8d1e6d41 100644 (file)
@@ -388,6 +388,8 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
        
        if (lp_winbind_nested_groups()) {
 
+               become_root();
+
                /* Now add the aliases. First the one from our local SAM */
 
                status = add_aliases(get_global_sam_sid(), result);
@@ -405,6 +407,8 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                        TALLOC_FREE(result);
                        return NULL;
                }
+
+               unbecome_root();
        }