diff options
author | Jeremy Allison <jra@samba.org> | 2006-04-18 03:45:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:24 -0500 |
commit | 6ca1ba38147403bc5a8a3f1ec560c0671b1f9463 (patch) | |
tree | 34e052108d633896323194e7b8e9f55639394534 /source3 | |
parent | 5445694eb9c7a5e64e7e58feb78c87bc627402b5 (diff) | |
download | samba-6ca1ba38147403bc5a8a3f1ec560c0671b1f9463.tar.gz samba-6ca1ba38147403bc5a8a3f1ec560c0671b1f9463.tar.bz2 samba-6ca1ba38147403bc5a8a3f1ec560c0671b1f9463.zip |
r15115: Fix error return on sessionsetup. Ensure no
data blob is added if the logon call failed.
Jeremy.
(This used to be commit 71d0191c313e2106ae2bdef3119b3ff6e591ee1b)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/sesssetup.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 3280e2d5fc..7c90263a5b 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -95,21 +95,25 @@ static BOOL reply_sesssetup_blob(connection_struct *conn, char *outbuf, { char *p; - set_message(outbuf,4,0,True); + if (!NT_STATUS_IS_OK(nt_status) && !NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { + ERROR_NT(nt_status); + } else { + set_message(outbuf,4,0,True); - nt_status = nt_status_squash(nt_status); - SIVAL(outbuf, smb_rcls, NT_STATUS_V(nt_status)); - SSVAL(outbuf, smb_vwv0, 0xFF); /* no chaining possible */ - SSVAL(outbuf, smb_vwv3, blob.length); - p = smb_buf(outbuf); + nt_status = nt_status_squash(nt_status); + SIVAL(outbuf, smb_rcls, NT_STATUS_V(nt_status)); + SSVAL(outbuf, smb_vwv0, 0xFF); /* no chaining possible */ + SSVAL(outbuf, smb_vwv3, blob.length); + p = smb_buf(outbuf); - /* should we cap this? */ - memcpy(p, blob.data, blob.length); - p += blob.length; + /* should we cap this? */ + memcpy(p, blob.data, blob.length); + p += blob.length; - p += add_signature( outbuf, p ); + p += add_signature( outbuf, p ); - set_message_end(outbuf,p); + set_message_end(outbuf,p); + } show_msg(outbuf); return send_smb(smbd_server_fd(),outbuf); |