svn commit: samba r16732 - in branches/SAMBA_4_0/source/smb_server/smb2: .

metze at samba.org metze at samba.org
Sat Jul 1 14:11:01 GMT 2006


Author: metze
Date: 2006-07-01 14:11:00 +0000 (Sat, 01 Jul 2006)
New Revision: 16732

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

Log:
use the given macros

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb2/tcon.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb2/tcon.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-07-01 14:10:07 UTC (rev 16731)
+++ branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-07-01 14:11:00 UTC (rev 16732)
@@ -262,19 +262,12 @@
 
 static void smb2srv_tcon_send(struct smb2srv_request *req, union smb_tcon *io)
 {
-	NTSTATUS status;
-
 	if (NT_STATUS_IS_ERR(req->status)) {
 		smb2srv_send_error(req, req->status);
 		return;
 	}
 
-	status = smb2srv_setup_reply(req, 0x10, False, 0);
-	if (!NT_STATUS_IS_OK(status)) {
-		smbsrv_terminate_connection(req->smb_conn, nt_errstr(status));
-		talloc_free(req);
-		return;
-	}
+	SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x10, False, 0));
 
 	SBVAL(req->out.hdr,	SMB2_HDR_TID,	io->smb2.out.tid);
 
@@ -289,28 +282,13 @@
 void smb2srv_tcon_recv(struct smb2srv_request *req)
 {
 	union smb_tcon *io;
-	NTSTATUS status;
 
-	if (req->in.body_size < 0x08) {
-		smb2srv_send_error(req,  NT_STATUS_FOOBAR);
-		return;
-	}
+	SMB2SRV_CHECK_BODY_SIZE(req, 0x08, True);
+	SMB2SRV_TALLOC_IO_PTR(io, union smb_tcon);
 
-	io = talloc(req, union smb_tcon);
-	if (!io) {
-		smbsrv_terminate_connection(req->smb_conn, nt_errstr(NT_STATUS_NO_MEMORY));
-		talloc_free(req);
-		return;
-	}
-
 	io->smb2.level		= RAW_TCON_SMB2;
 	io->smb2.in.unknown1	= SVAL(req->in.body, 0x02);
-	status = smb2_pull_o16s16_string(&req->in, io, req->in.body+0x04, &io->smb2.in.path);
-	if (!NT_STATUS_IS_OK(status)) {
-		smbsrv_terminate_connection(req->smb_conn, nt_errstr(status));
-		talloc_free(req);
-		return;
-	}
+	SMB2SRV_CHECK(smb2_pull_o16s16_string(&req->in, io, req->in.body+0x04, &io->smb2.in.path));
 
 	req->status = smb2srv_tcon_backend(req, io);
 
@@ -354,10 +332,7 @@
 {
 	uint16_t _pad;
 
-	if (req->in.body_size < 0x04) {
-		smb2srv_send_error(req,  NT_STATUS_FOOBAR);
-		return;
-	}
+	SMB2SRV_CHECK_BODY_SIZE(req, 0x04, False);
 
 	_pad	= SVAL(req->in.body, 0x02);
 



More information about the samba-cvs mailing list