From: Stefan Metzmacher Date: Tue, 26 May 2009 13:20:36 +0000 (+0200) Subject: s3:smbd: move already_got_session to struct smbd_server_connection X-Git-Tag: tdb-1.1.5~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f554af187161a006c3f51edd129e53500acc9046;p=thirdparty%2Fsamba.git s3:smbd: move already_got_session to struct smbd_server_connection metze --- diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 6c34f9d44b3..bcf01069bc4 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 e8f26a98d02..2b4dce7489e 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 4c33257b9d4..3bf0566097a 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 16fc61955d8..f71fde1818e 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