s3:smbd: move already_got_session to struct smbd_server_connection
authorStefan Metzmacher <metze@samba.org>
Tue, 26 May 2009 13:20:36 +0000 (15:20 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 3 Jun 2009 15:54:37 +0000 (17:54 +0200)
metze

source3/smbd/globals.c
source3/smbd/globals.h
source3/smbd/process.c
source3/smbd/reply.c

index 6c34f9d44b3750edfe444258bd51ecbf1a5912b6..bcf01069bc46b207b2e2cdb0a7e65d952befc240 100644 (file)
@@ -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.
index e8f26a98d02c8e75ed4b5d11e6e5b76d7dfd5379..2b4dce7489e7c9ca58444aa380e6125b73f914cd 100644 (file)
@@ -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;
index 4c33257b9d425bf27f8d67781052a70a5674ff00..3bf0566097af54156514c00ff1670e19ea046dc6 100644 (file)
@@ -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(),
index 16fc61955d8a49cb4411f7ccd6cbdd62c0a80c1a..f71fde1818e26e0c36350fc7f41e71bf6d7e3e1c 100644 (file)
@@ -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