summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-01 14:11:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:41 -0500
commitb20c00f718c09cc2c9077235488683e0ca98f5bc (patch)
treed71e3f997dbe0a8d41998f1a531c73836b82845f /source4/smb_server
parent2f60a2bc7ac5610aacd50bd131975989423181a0 (diff)
downloadsamba-b20c00f718c09cc2c9077235488683e0ca98f5bc.tar.gz
samba-b20c00f718c09cc2c9077235488683e0ca98f5bc.tar.bz2
samba-b20c00f718c09cc2c9077235488683e0ca98f5bc.zip
r16732: use the given macros
metze (This used to be commit 6d5c74c38ca4d4a605b619cd7cbbd7e1dccd6b0c)
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/smb2/tcon.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/source4/smb_server/smb2/tcon.c b/source4/smb_server/smb2/tcon.c
index b2270640c8..28c505a1fd 100644
--- a/source4/smb_server/smb2/tcon.c
+++ b/source4/smb_server/smb2/tcon.c
@@ -262,19 +262,12 @@ failed:
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 @@ static void smb2srv_tcon_send(struct smb2srv_request *req, union smb_tcon *io)
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;
- }
-
- io = talloc(req, union smb_tcon);
- if (!io) {
- smbsrv_terminate_connection(req->smb_conn, nt_errstr(NT_STATUS_NO_MEMORY));
- talloc_free(req);
- return;
- }
+ SMB2SRV_CHECK_BODY_SIZE(req, 0x08, True);
+ SMB2SRV_TALLOC_IO_PTR(io, union smb_tcon);
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 @@ void smb2srv_tdis_recv(struct smb2srv_request *req)
{
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);