summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-03-24 08:36:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:16 -0500
commit91e6894031406d23093b3da05263a0e85219b5f3 (patch)
tree2f2358ad24034d110614d3d963820fadb45d4149 /source3
parent2e3ce1d534b544b2eedd9183f9f97c17a8e403fc (diff)
downloadsamba-91e6894031406d23093b3da05263a0e85219b5f3.tar.gz
samba-91e6894031406d23093b3da05263a0e85219b5f3.tar.bz2
samba-91e6894031406d23093b3da05263a0e85219b5f3.zip
r6034: Check only once
(This used to be commit 5a4274371cdbbd278d8aaa922f3e5f51a3cb5aec)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 5dd2e6e47f..ed08f185f7 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1359,6 +1359,7 @@ WERROR _srv_net_sess_del(pipes_struct *p, SRV_Q_NET_SESS_DEL *q_u, SRV_R_NET_SES
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 @@ WERROR _srv_net_sess_del(pipes_struct *p, SRV_Q_NET_SESS_DEL *q_u, SRV_R_NET_SES
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 @@ WERROR _srv_net_sess_del(pipes_struct *p, SRV_Q_NET_SESS_DEL *q_u, SRV_R_NET_SES
} else {
r_u->status = WERR_ACCESS_DENIED;
}
- if (user.uid != sec_initial_uid()) {
+ if (not_root) {
unbecome_root();
}
}