svn commit: samba r6034 - in branches/SAMBA_3_0/source/rpc_server: .

idra at samba.org idra at samba.org
Thu Mar 24 08:36:00 GMT 2005


Author: idra
Date: 2005-03-24 08:36:00 +0000 (Thu, 24 Mar 2005)
New Revision: 6034

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

Log:

Check only once


Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c	2005-03-24 08:00:15 UTC (rev 6033)
+++ branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c	2005-03-24 08:36:00 UTC (rev 6034)
@@ -1359,6 +1359,7 @@
 	int num_sessions, snum, ret;
 	fstring username;
 	fstring machine;
+	BOOL not_root = False;
 	/* SE_PRIV se_diskop = SE_DISK_OPERATOR; / * Is disk op appropriate here ? JRA. * /
 	BOOL is_disk_op = False;                 / * No. SSS. :) */
 
@@ -1393,6 +1394,7 @@
 		    strequal(session_list[snum].remote_machine, machine)) {
 		
 			if (user.uid != sec_initial_uid()) {
+				not_root = True;
 				become_root();
 			}
 			if ((ret = message_send_pid(session_list[snum].pid, MSG_SHUTDOWN, NULL, 0, False))) {
@@ -1400,7 +1402,7 @@
 			} else {
 				r_u->status = WERR_ACCESS_DENIED;
 			}
-			if (user.uid != sec_initial_uid()) {
+			if (not_root) {
 				unbecome_root();
 			}
 		}



More information about the samba-cvs mailing list