summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srvsvc/srv_srvsvc_nt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 2d58466850..011d41fa52 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -1226,16 +1226,6 @@ WERROR _srvsvc_NetSessDel(struct pipes_struct *p,
bool not_root = False;
WERROR werr;
- username = r->in.user;
- machine = r->in.client;
-
- /* strip leading backslashes if any */
- if (machine && machine[0] == '\\' && machine[1] == '\\') {
- machine += 2;
- }
-
- num_sessions = list_sessions(p->mem_ctx, &session_list);
-
DEBUG(5,("_srvsvc_NetSessDel: %d\n", __LINE__));
werr = WERR_ACCESS_DENIED;
@@ -1249,6 +1239,16 @@ WERROR _srvsvc_NetSessDel(struct pipes_struct *p,
goto done;
}
+ username = r->in.user;
+ machine = r->in.client;
+
+ /* strip leading backslashes if any */
+ if (machine && machine[0] == '\\' && machine[1] == '\\') {
+ machine += 2;
+ }
+
+ num_sessions = list_sessions(p->mem_ctx, &session_list);
+
for (snum = 0; snum < num_sessions; snum++) {
if ((strequal(session_list[snum].username, username) || username[0] == '\0' ) &&