Author: obnox
Date: 2007-10-10 08:27:56 +0000 (Wed, 10 Oct 2007)
New Revision: 25598

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25598

Log:
Add missing become_root/unbecome_root around calls of add_aliases.
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


Modified:
   branches/SAMBA_3_0_MAINT/source/auth/auth_util.c
   branches/SAMBA_3_2/source/auth/token_util.c
   branches/SAMBA_3_2_0/source/auth/token_util.c


Changeset:
Modified: branches/SAMBA_3_0_MAINT/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0_MAINT/source/auth/auth_util.c    2007-10-10 07:18:24 UTC 
(rev 25597)
+++ branches/SAMBA_3_0_MAINT/source/auth/auth_util.c    2007-10-10 08:27:56 UTC 
(rev 25598)
@@ -949,6 +949,8 @@
        
        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);
@@ -966,6 +968,8 @@
                        TALLOC_FREE(result);
                        return NULL;
                }
+
+               unbecome_root();
        } 
 
 

Modified: branches/SAMBA_3_2/source/auth/token_util.c
===================================================================
--- branches/SAMBA_3_2/source/auth/token_util.c 2007-10-10 07:18:24 UTC (rev 
25597)
+++ branches/SAMBA_3_2/source/auth/token_util.c 2007-10-10 08:27:56 UTC (rev 
25598)
@@ -388,6 +388,8 @@
        
        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 @@
                        TALLOC_FREE(result);
                        return NULL;
                }
+
+               unbecome_root();
        } 
 
 

Modified: branches/SAMBA_3_2_0/source/auth/token_util.c
===================================================================
--- branches/SAMBA_3_2_0/source/auth/token_util.c       2007-10-10 07:18:24 UTC 
(rev 25597)
+++ branches/SAMBA_3_2_0/source/auth/token_util.c       2007-10-10 08:27:56 UTC 
(rev 25598)
@@ -388,6 +388,8 @@
        
        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 @@
                        TALLOC_FREE(result);
                        return NULL;
                }
+
+               unbecome_root();
        } 
 
 

Reply via email to