svn commit: samba r15114 - in trunk/source/smbd: .

jra at samba.org jra at samba.org
Tue Apr 18 03:44:55 GMT 2006


Author: jra
Date: 2006-04-18 03:44:55 +0000 (Tue, 18 Apr 2006)
New Revision: 15114

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15114

Log:
Fix error return on sessionsetup. Ensure no
data blob is added if the logon call failed.
Jeremy.

Modified:
   trunk/source/smbd/sesssetup.c


Changeset:
Modified: trunk/source/smbd/sesssetup.c
===================================================================
--- trunk/source/smbd/sesssetup.c	2006-04-17 23:25:25 UTC (rev 15113)
+++ trunk/source/smbd/sesssetup.c	2006-04-18 03:44:55 UTC (rev 15114)
@@ -95,21 +95,25 @@
 {
 	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);



More information about the samba-cvs mailing list