From f554af187161a006c3f51edd129e53500acc9046 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 May 2009 15:20:36 +0200 Subject: [PATCH] s3:smbd: move already_got_session to struct smbd_server_connection metze --- source3/smbd/globals.c | 2 -- source3/smbd/globals.h | 5 +++-- source3/smbd/process.c | 2 ++ source3/smbd/reply.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 6c34f9d44b37..bcf01069bc46 100644 --- a/source3/smbd/globals.c +++ b/source3/smbd/globals.c @@ -107,8 +107,6 @@ int num_validated_vuids = 0; char *my_yp_domain = NULL; #endif -bool already_got_session = false; - /* * Size of data we can send to client. Set * by the client for all protocols above CORE. diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index e8f26a98d02c..2b4dce7489e7 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -105,8 +105,6 @@ extern int num_validated_vuids; extern char *my_yp_domain; #endif -extern bool already_got_session; - /* * Size of data we can send to client. Set * by the client for all protocols above CORE. @@ -316,6 +314,9 @@ struct smbd_smb2_tcon { struct pending_auth_data; struct smbd_server_connection { + struct { + bool got_session; + } nbt; bool allow_smb2; struct { struct fd_event *fde; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 4c33257b9d42..3bf0566097af 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2157,6 +2157,8 @@ void smbd_process(void) #endif + smbd_server_conn->nbt.got_session = false; + smbd_server_conn->smb1.negprot.max_recv = MIN(lp_maxxmit(),BUFFER_SIZE); smbd_server_conn->smb1.fde = event_add_fd(smbd_event_context(), diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 16fc61955d8a..f71fde1818e2 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -523,7 +523,7 @@ void reply_special(char *inbuf) switch (msg_type) { case 0x81: /* session request */ - if (already_got_session) { + if (sconn->nbt.got_session) { exit_server_cleanly("multiple session request not permitted"); } @@ -567,7 +567,7 @@ void reply_special(char *inbuf) reload_services(True); reopen_logs(); - already_got_session = True; + sconn->nbt.got_session = true; break; case 0x89: /* session keepalive request -- 2.34.1