Author: jerry
Date: 2006-07-24 12:05:20 +0000 (Mon, 24 Jul 2006)
New Revision: 17217

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

Log:
Fix a couple of "smbldap_open(): Cannot open when not root" bugs
when viewing or modifying local group membership.


Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0_23/source/rpc_server/srv_samr_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2006-07-24 05:02:38 UTC 
(rev 17216)
+++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2006-07-24 12:05:20 UTC 
(rev 17217)
@@ -3771,7 +3771,9 @@
 
        DEBUG(10, ("sid is %s\n", sid_string_static(&alias_sid)));
 
+       become_root();
        status = pdb_enum_aliasmem(&alias_sid, &sids, &num_sids);
+       unbecome_root();
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -4602,7 +4604,11 @@
 
        /* get the current group information */
 
-       if ( !pdb_get_aliasinfo( &group_sid, &info ) ) {
+       become_root();
+       ret = pdb_get_aliasinfo( &group_sid, &info );
+       unbecome_root();
+
+       if ( !ret ) {
                return NT_STATUS_NO_SUCH_ALIAS;
        }
 

Modified: branches/SAMBA_3_0_23/source/rpc_server/srv_samr_nt.c
===================================================================
--- branches/SAMBA_3_0_23/source/rpc_server/srv_samr_nt.c       2006-07-24 
05:02:38 UTC (rev 17216)
+++ branches/SAMBA_3_0_23/source/rpc_server/srv_samr_nt.c       2006-07-24 
12:05:20 UTC (rev 17217)
@@ -3758,7 +3758,9 @@
 
        DEBUG(10, ("sid is %s\n", sid_string_static(&alias_sid)));
 
+       become_root();
        status = pdb_enum_aliasmem(&alias_sid, &sids, &num_sids);
+       unbecome_root();
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -4589,7 +4591,11 @@
 
        /* get the current group information */
 
-       if ( !pdb_get_aliasinfo( &group_sid, &info ) ) {
+       become_root();
+       ret = pdb_get_aliasinfo( &group_sid, &info );
+       unbecome_root();
+
+       if ( !ret ) {
                return NT_STATUS_NO_SUCH_ALIAS;
        }
 

Reply via email to