diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-03-18 10:10:25 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-03-20 09:32:26 -0700 |
commit | d24b8afb79f75b1db9301b79862be484a4932979 (patch) | |
tree | 91a6445a0a30e4f2a8711896be1cae9eaaf389c3 /source3/smbd | |
parent | 40c3db9b6a584a6c243fd02b12269d54e7425fea (diff) | |
download | samba-d24b8afb79f75b1db9301b79862be484a4932979.tar.gz samba-d24b8afb79f75b1db9301b79862be484a4932979.tar.bz2 samba-d24b8afb79f75b1db9301b79862be484a4932979.zip |
s3:smbd: keep global_client_caps and max_send from the first successful session setup
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/sesssetup.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 890189cb34..4728759c6c 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -132,11 +132,12 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) uint16_t action = 0; NTTIME now = timeval_to_nttime(&req->request_time); struct smbXsrv_session *session = NULL; + uint16_t smb_bufsize = SVAL(req->vwv+2, 0); uint32_t client_caps = IVAL(req->vwv+10, 0); DEBUG(3,("Doing spnego session setup\n")); - if (global_client_caps == 0) { + if (!sconn->smb1.sessions.done_sesssetup) { global_client_caps = client_caps; if (!(global_client_caps & CAP_STATUS32)) { @@ -377,6 +378,12 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) return; } + if (!sconn->smb1.sessions.done_sesssetup) { + sconn->smb1.sessions.max_send = + MIN(sconn->smb1.sessions.max_send,smb_bufsize); + } + sconn->smb1.sessions.done_sesssetup = true; + /* current_user_info is changed on new vuid */ reload_services(sconn, conn_snum_used, true); } else if (NT_STATUS_IS_OK(status)) { @@ -560,7 +567,7 @@ static void setup_new_vc_session(struct smbd_server_connection *sconn) void reply_sesssetup_and_X(struct smb_request *req) { uint64_t sess_vuid; - int smb_bufsize; + uint16_t smb_bufsize; DATA_BLOB lm_resp; DATA_BLOB nt_resp; DATA_BLOB plaintext_password; @@ -671,8 +678,7 @@ void reply_sesssetup_and_X(struct smb_request *req) const uint8_t *save_p = req->buf; uint16 byte_count; - - if(global_client_caps == 0) { + if (!sconn->smb1.sessions.done_sesssetup) { global_client_caps = IVAL(req->vwv+11, 0); if (!(global_client_caps & CAP_STATUS32)) { |