From 1fd1e2ba581c8ac67ba63fbb889fbedcc65bfbb9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 20 Jun 2006 07:05:51 +0000 Subject: r16407: add parsing code the SMB2 GetInfo in the server metze (This used to be commit c4755c83c61c0cc822c69cd274056ec20ba66fdb) --- source4/smb_server/smb2/fileinfo.c | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 source4/smb_server/smb2/fileinfo.c (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c new file mode 100644 index 0000000000..366de56a66 --- /dev/null +++ b/source4/smb_server/smb2/fileinfo.c @@ -0,0 +1,77 @@ +/* + Unix SMB2 implementation. + + Copyright (C) Stefan Metzmacher 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "libcli/smb2/smb2.h" +#include "libcli/smb2/smb2_calls.h" +#include "smb_server/smb_server.h" +#include "smb_server/service_smb_proto.h" +#include "smb_server/smb2/smb2_server.h" +#include "ntvfs/ntvfs.h" + +static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) +{ + struct smb2srv_request *req; + struct smb2_getinfo *info; + + SMB2SRV_CHECK_ASYNC_STATUS(info, struct smb2_getinfo); + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, True, 0)); + + /* TODO: this is maybe a o16s32_blob */ + SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, info->out.blob)); + SSVAL(req->out.body, 0x06, 0); + + smb2srv_send_reply(req); +} + +static NTSTATUS smb2srv_getinfo_backend(struct ntvfs_request *ntvfs, struct smb2_getinfo *info) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +void smb2srv_getinfo_recv(struct smb2srv_request *req) +{ + struct smb2_getinfo *info; + + SMB2SRV_CHECK_BODY_SIZE(req, 0x30, True); + SMB2SRV_TALLOC_IO_PTR(info, struct smb2_getinfo); + SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_getinfo_send, NTVFS_ASYNC_STATE_MAY_ASYNC); + + info->in.level = SVAL(req->in.body, 0x02); + info->in.max_response_size = IVAL(req->in.body, 0x04); + info->in.unknown1 = IVAL(req->in.body, 0x08); + info->in.unknown2 = IVAL(req->in.body, 0x0C); + info->in.flags = IVAL(req->in.body, 0x10); + info->in.flags2 = IVAL(req->in.body, 0x14); + info->in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x18); + + SMB2SRV_CHECK_FILE_HANDLE(info->in.file.ntvfs); + SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_getinfo_backend(req->ntvfs, info)); +} + +void smb2srv_setinfo_recv(struct smb2srv_request *req) +{ + smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED); +} + +void smb2srv_break_recv(struct smb2srv_request *req) +{ + smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED); +} -- cgit From 98024a8125a841def4110974a5c94987acab5360 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jun 2006 17:35:04 +0000 Subject: r16467: implement SMB2 GetInfo server code metze (This used to be commit 49b5b3cd58c41b67adfbb77b4244989fba6bcd2e) --- source4/smb_server/smb2/fileinfo.c | 173 +++++++++++++++++++++++++++++++++++-- 1 file changed, 166 insertions(+), 7 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 366de56a66..d00871e1fe 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -25,33 +25,192 @@ #include "smb_server/service_smb_proto.h" #include "smb_server/smb2/smb2_server.h" #include "ntvfs/ntvfs.h" +#include "librpc/gen_ndr/ndr_security.h" + +struct smb2srv_getinfo_op { + struct smb2srv_request *req; + struct smb2_getinfo *info; + void *io_ptr; + NTSTATUS (*send_fn)(struct smb2srv_getinfo_op *op); +}; static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) { + struct smb2srv_getinfo_op *op; struct smb2srv_request *req; - struct smb2_getinfo *info; - SMB2SRV_CHECK_ASYNC_STATUS(info, struct smb2_getinfo); + /* + * SMB2 uses NT_STATUS_INVALID_INFO_CLASS + * so we need to translated it here + */ + if (NT_STATUS_EQUAL(NT_STATUS_INVALID_LEVEL, ntvfs->async_states->status)) { + ntvfs->async_states->status = NT_STATUS_INVALID_INFO_CLASS; + } + + SMB2SRV_CHECK_ASYNC_STATUS(op, struct smb2srv_getinfo_op); + + ZERO_STRUCT(op->info->out); + if (op->send_fn) { + SMB2SRV_CHECK(op->send_fn(op)); + } + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, True, 0)); /* TODO: this is maybe a o16s32_blob */ - SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, info->out.blob)); + SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, op->info->out.blob)); SSVAL(req->out.body, 0x06, 0); smb2srv_send_reply(req); } -static NTSTATUS smb2srv_getinfo_backend(struct ntvfs_request *ntvfs, struct smb2_getinfo *info) +static NTSTATUS smb2srv_getinfo_file_send(struct smb2srv_getinfo_op *op) +{ + union smb_fileinfo *io = talloc_get_type(op->io_ptr, union smb_fileinfo); + NTSTATUS status; + + status = smbsrv_push_passthru_fileinfo(op->req, + &op->info->out.blob, + io->generic.level, io, + STR_UNICODE); + NT_STATUS_NOT_OK_RETURN(status); + + return NT_STATUS_OK; +} + +static NTSTATUS smb2srv_getinfo_file(struct smb2srv_getinfo_op *op, uint8_t smb2_level) +{ + union smb_fileinfo *io; + + io = talloc(op, union smb_fileinfo); + NT_STATUS_HAVE_NO_MEMORY(io); + + switch (op->info->in.level) { + case RAW_FILEINFO_SMB2_ALL_EAS: + io->all_eas.level = op->info->in.level; + io->all_eas.in.file.ntvfs = op->info->in.file.ntvfs; + io->all_eas.in.continue_flags = op->info->in.flags2; + break; + + case RAW_FILEINFO_SMB2_ALL_INFORMATION: + io->all_info2.level = op->info->in.level; + io->all_info2.in.file.ntvfs = op->info->in.file.ntvfs; + break; + + default: + /* the rest directly maps to the passthru levels */ + io->generic.level = smb2_level + 1000; + io->generic.in.file.ntvfs = op->info->in.file.ntvfs; + break; + } + + op->io_ptr = io; + op->send_fn = smb2srv_getinfo_file_send; + + return ntvfs_qfileinfo(op->req->ntvfs, io); +} + +static NTSTATUS smb2srv_getinfo_fs_send(struct smb2srv_getinfo_op *op) +{ + union smb_fsinfo *io = talloc_get_type(op->io_ptr, union smb_fsinfo); + NTSTATUS status; + + status = smbsrv_push_passthru_fsinfo(op->req, + &op->info->out.blob, + io->generic.level, io, + STR_UNICODE); + NT_STATUS_NOT_OK_RETURN(status); + + return NT_STATUS_OK; +} + +static NTSTATUS smb2srv_getinfo_fs(struct smb2srv_getinfo_op *op, uint8_t smb2_level) { - return NT_STATUS_NOT_IMPLEMENTED; + union smb_fsinfo *io; + + io = talloc(op, union smb_fsinfo); + NT_STATUS_HAVE_NO_MEMORY(io); + + /* the rest directly maps to the passthru levels */ + io->generic.level = smb2_level + 1000; + + /* TODO: allow qfsinfo only the share root directory handle */ + + op->io_ptr = io; + op->send_fn = smb2srv_getinfo_fs_send; + + return ntvfs_fsinfo(op->req->ntvfs, io); +} + +static NTSTATUS smb2srv_getinfo_security_send(struct smb2srv_getinfo_op *op) +{ + union smb_fileinfo *io = talloc_get_type(op->io_ptr, union smb_fileinfo); + NTSTATUS status; + + status = ndr_push_struct_blob(&op->info->out.blob, op->req, + io->query_secdesc.out.sd, + (ndr_push_flags_fn_t)ndr_push_security_descriptor); + NT_STATUS_NOT_OK_RETURN(status); + + return NT_STATUS_OK; +} + +static NTSTATUS smb2srv_getinfo_security(struct smb2srv_getinfo_op *op, uint8_t smb2_level) +{ + union smb_fileinfo *io; + + switch (smb2_level) { + case 0x00: + io = talloc(op, union smb_fileinfo); + NT_STATUS_HAVE_NO_MEMORY(io); + + io->query_secdesc.level = RAW_FILEINFO_SEC_DESC; + io->query_secdesc.in.file.ntvfs = op->info->in.file.ntvfs; + io->query_secdesc.in.secinfo_flags = op->info->in.flags; + + op->io_ptr = io; + op->send_fn = smb2srv_getinfo_security_send; + + return ntvfs_qfileinfo(op->req->ntvfs, io); + } + + return NT_STATUS_INVALID_INFO_CLASS; +} + +static NTSTATUS smb2srv_getinfo_backend(struct smb2srv_getinfo_op *op) +{ + uint8_t smb2_class; + uint8_t smb2_level; + + smb2_class = 0xFF & op->info->in.level; + smb2_level = 0xFF & (op->info->in.level>>8); + + switch (smb2_class) { + case SMB2_GETINFO_FILE: + return smb2srv_getinfo_file(op, smb2_level); + + case SMB2_GETINFO_FS: + return smb2srv_getinfo_fs(op, smb2_level); + + case SMB2_GETINFO_SECURITY: + return smb2srv_getinfo_security(op, smb2_level); + } + + return NT_STATUS_FOOBAR; } void smb2srv_getinfo_recv(struct smb2srv_request *req) { struct smb2_getinfo *info; + struct smb2srv_getinfo_op *op; - SMB2SRV_CHECK_BODY_SIZE(req, 0x30, True); + SMB2SRV_CHECK_BODY_SIZE(req, 0x28, True); SMB2SRV_TALLOC_IO_PTR(info, struct smb2_getinfo); + /* this overwrites req->io_ptr !*/ + SMB2SRV_TALLOC_IO_PTR(op, struct smb2srv_getinfo_op); + op->req = req; + op->info = info; + op->io_ptr = NULL; + op->send_fn = NULL; SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_getinfo_send, NTVFS_ASYNC_STATE_MAY_ASYNC); info->in.level = SVAL(req->in.body, 0x02); @@ -63,7 +222,7 @@ void smb2srv_getinfo_recv(struct smb2srv_request *req) info->in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x18); SMB2SRV_CHECK_FILE_HANDLE(info->in.file.ntvfs); - SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_getinfo_backend(req->ntvfs, info)); + SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_getinfo_backend(op)); } void smb2srv_setinfo_recv(struct smb2srv_request *req) -- cgit From 74fe06832a9cc7c62d295549ad38e2c4936f8044 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 26 Jun 2006 15:24:10 +0000 Subject: r16520: move smb2srv_break_recv back to fileio.c metze (This used to be commit cdee9b2168da47a38da769eb2b4f403bc4699dfe) --- source4/smb_server/smb2/fileinfo.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index d00871e1fe..2bb0f838ea 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -229,8 +229,3 @@ void smb2srv_setinfo_recv(struct smb2srv_request *req) { smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED); } - -void smb2srv_break_recv(struct smb2srv_request *req) -{ - smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED); -} -- cgit From ca044dcd3a8eb7bfa8da05a88bf4346ccd135221 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 27 Jun 2006 17:46:57 +0000 Subject: r16568: add parsing code for SMB2 SetInfo metze (This used to be commit 70cc9928437d6edab3de5a858078870f510398d0) --- source4/smb_server/smb2/fileinfo.c | 66 +++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 2bb0f838ea..500a824d94 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -225,7 +225,71 @@ void smb2srv_getinfo_recv(struct smb2srv_request *req) SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_getinfo_backend(op)); } +struct smb2srv_setinfo_op { + struct smb2srv_request *req; + struct smb2_setinfo *info; +}; + +static void smb2srv_setinfo_send(struct ntvfs_request *ntvfs) +{ + struct smb2srv_setinfo_op *op; + struct smb2srv_request *req; + + /* + * SMB2 uses NT_STATUS_INVALID_INFO_CLASS + * so we need to translated it here + */ + if (NT_STATUS_EQUAL(NT_STATUS_INVALID_LEVEL, ntvfs->async_states->status)) { + ntvfs->async_states->status = NT_STATUS_INVALID_INFO_CLASS; + } + + SMB2SRV_CHECK_ASYNC_STATUS(op, struct smb2srv_setinfo_op); + + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x02, False, 0)); + + smb2srv_send_reply(req); +} + +static NTSTATUS smb2srv_setinfo_backend(struct smb2srv_setinfo_op *op) +{ + uint8_t smb2_class; + /*uint8_t smb2_level;*/ + + smb2_class = 0xFF & op->info->in.level; + /*smb2_level = 0xFF & (op->info->in.level>>8);*/ + + switch (smb2_class) { + case SMB2_GETINFO_FILE: + return NT_STATUS_NOT_IMPLEMENTED; + + case SMB2_GETINFO_FS: + return NT_STATUS_NOT_IMPLEMENTED; + + case SMB2_GETINFO_SECURITY: + return NT_STATUS_NOT_IMPLEMENTED; + } + + return NT_STATUS_FOOBAR; +} + void smb2srv_setinfo_recv(struct smb2srv_request *req) { - smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED); + struct smb2_setinfo *info; + struct smb2srv_setinfo_op *op; + + SMB2SRV_CHECK_BODY_SIZE(req, 0x20, True); + SMB2SRV_TALLOC_IO_PTR(info, struct smb2_setinfo); + /* this overwrites req->io_ptr !*/ + SMB2SRV_TALLOC_IO_PTR(op, struct smb2srv_setinfo_op); + op->req = req; + op->info = info; + SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_setinfo_send, NTVFS_ASYNC_STATE_MAY_ASYNC); + + info->in.level = SVAL(req->in.body, 0x02); + SMB2SRV_CHECK(smb2_pull_s32o32_blob(&req->in, info, req->in.body+0x04, &info->in.blob)); + info->in.flags = IVAL(req->in.body, 0x0C); + info->in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x10); + + SMB2SRV_CHECK_FILE_HANDLE(info->in.file.ntvfs); + SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_setinfo_backend(op)); } -- cgit From bcc9e8af30e430e5bc49f23457a56ffe21624679 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Jun 2006 06:53:44 +0000 Subject: r16666: implement setting of security_descriptors via SMB2 SetInfo metze (This used to be commit 6908582f68478d5f702159f6b01934ffff3a95f0) --- source4/smb_server/smb2/fileinfo.c | 48 ++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 500a824d94..74b316f6a4 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -250,23 +250,61 @@ static void smb2srv_setinfo_send(struct ntvfs_request *ntvfs) smb2srv_send_reply(req); } +static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2_level) +{ + return NT_STATUS_FOOBAR; +} + +static NTSTATUS smb2srv_setinfo_fs(struct smb2srv_setinfo_op *op, uint8_t smb2_level) +{ + return NT_STATUS_FOOBAR; +} + +static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t smb2_level) +{ + union smb_setfileinfo *io; + NTSTATUS status; + + switch (smb2_level) { + case 0x00: + io = talloc(op, union smb_setfileinfo); + NT_STATUS_HAVE_NO_MEMORY(io); + + io->set_secdesc.level = RAW_SFILEINFO_SEC_DESC; + io->set_secdesc.in.file.ntvfs = op->info->in.file.ntvfs; + io->set_secdesc.in.secinfo_flags = op->info->in.flags; + + io->set_secdesc.in.sd = talloc(io, struct security_descriptor); + NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd); + + status = ndr_pull_struct_blob(&op->info->in.blob, io, + io->set_secdesc.in.sd, + (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); + NT_STATUS_NOT_OK_RETURN(status); + + return ntvfs_setfileinfo(op->req->ntvfs, io); + } + + return NT_STATUS_INVALID_INFO_CLASS; +} + static NTSTATUS smb2srv_setinfo_backend(struct smb2srv_setinfo_op *op) { uint8_t smb2_class; - /*uint8_t smb2_level;*/ + uint8_t smb2_level; smb2_class = 0xFF & op->info->in.level; - /*smb2_level = 0xFF & (op->info->in.level>>8);*/ + smb2_level = 0xFF & (op->info->in.level>>8); switch (smb2_class) { case SMB2_GETINFO_FILE: - return NT_STATUS_NOT_IMPLEMENTED; + return smb2srv_setinfo_file(op, smb2_level); case SMB2_GETINFO_FS: - return NT_STATUS_NOT_IMPLEMENTED; + return smb2srv_setinfo_fs(op, smb2_level); case SMB2_GETINFO_SECURITY: - return NT_STATUS_NOT_IMPLEMENTED; + return smb2srv_setinfo_security(op, smb2_level); } return NT_STATUS_FOOBAR; -- cgit From 826597bfa8313bcaf017cfb43e6f7535eb75e20f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Jun 2006 11:17:37 +0000 Subject: r16670: try to match the vista error codes a bit more metze (This used to be commit 1a4978118d27e978c04997869a307b793582917b) --- source4/smb_server/smb2/fileinfo.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 74b316f6a4..32b7d1094e 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -173,7 +173,7 @@ static NTSTATUS smb2srv_getinfo_security(struct smb2srv_getinfo_op *op, uint8_t return ntvfs_qfileinfo(op->req->ntvfs, io); } - return NT_STATUS_INVALID_INFO_CLASS; + return NT_STATUS_INVALID_PARAMETER; } static NTSTATUS smb2srv_getinfo_backend(struct smb2srv_getinfo_op *op) @@ -193,9 +193,12 @@ static NTSTATUS smb2srv_getinfo_backend(struct smb2srv_getinfo_op *op) case SMB2_GETINFO_SECURITY: return smb2srv_getinfo_security(op, smb2_level); + + case 0x04: + return NT_STATUS_NOT_SUPPORTED; } - return NT_STATUS_FOOBAR; + return NT_STATUS_INVALID_PARAMETER; } void smb2srv_getinfo_recv(struct smb2srv_request *req) @@ -257,7 +260,21 @@ static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2 static NTSTATUS smb2srv_setinfo_fs(struct smb2srv_setinfo_op *op, uint8_t smb2_level) { - return NT_STATUS_FOOBAR; + switch (smb2_level) { + case 0x02: + return NT_STATUS_NOT_IMPLEMENTED; + + case 0x06: + return NT_STATUS_ACCESS_DENIED; + + case 0x08: + return NT_STATUS_ACCESS_DENIED; + + case 0x0A: + return NT_STATUS_ACCESS_DENIED; + } + + return NT_STATUS_INVALID_INFO_CLASS; } static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t smb2_level) @@ -305,9 +322,12 @@ static NTSTATUS smb2srv_setinfo_backend(struct smb2srv_setinfo_op *op) case SMB2_GETINFO_SECURITY: return smb2srv_setinfo_security(op, smb2_level); + + case 0x04: + return NT_STATUS_NOT_SUPPORTED; } - return NT_STATUS_FOOBAR; + return NT_STATUS_INVALID_PARAMETER; } void smb2srv_setinfo_recv(struct smb2srv_request *req) -- cgit From a18fc61d4f6140ed6081d779dbad223cdd6df0cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 1 Jul 2006 14:12:13 +0000 Subject: r16733: implement SMB2 SetInfo metze (This used to be commit 9b6f74778f8db2fa18bb56dcbc6bd8168a882ac9) --- source4/smb_server/smb2/fileinfo.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 32b7d1094e..d6290da33e 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -255,7 +255,22 @@ static void smb2srv_setinfo_send(struct ntvfs_request *ntvfs) static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2_level) { - return NT_STATUS_FOOBAR; + union smb_setfileinfo *io; + NTSTATUS status; + + io = talloc(op, union smb_setfileinfo); + NT_STATUS_HAVE_NO_MEMORY(io); + + /* the levels directly map to the passthru levels */ + io->generic.level = smb2_level + 1000; + io->generic.in.file.ntvfs = op->info->in.file.ntvfs; + + status = smbsrv_pull_passthru_sfileinfo(io, io->generic.level, io, + &op->info->in.blob, + STR_UNICODE, NULL); + NT_STATUS_NOT_OK_RETURN(status); + + return ntvfs_setfileinfo(op->req->ntvfs, io); } static NTSTATUS smb2srv_setinfo_fs(struct smb2srv_setinfo_op *op, uint8_t smb2_level) -- cgit From e8b61d7cc830b4f9f23618757fca1d8b8f095873 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 8 Jul 2006 08:20:10 +0000 Subject: r16872: when we know the data length we can preallocate the buffer and avoid a realloc metze (This used to be commit 51d59d23a1179689bda7cd1ab8cc43de31ad4f24) --- source4/smb_server/smb2/fileinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index d6290da33e..f5cc6d73ee 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -54,7 +54,7 @@ static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) SMB2SRV_CHECK(op->send_fn(op)); } - SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, True, 0)); + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, True, op->info->out.blob.length)); /* TODO: this is maybe a o16s32_blob */ SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, op->info->out.blob)); -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/smb_server/smb2/fileinfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index f5cc6d73ee..4f4b790702 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 0c56f8dac31c51a42dedf2a1da9fd76896855b19 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:10:49 +0000 Subject: r25551: Convert to standard bool type. (This used to be commit c9651e2c5c078edee7b91085e936a93625c8d708) --- source4/smb_server/smb2/fileinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 4f4b790702..41b31f586f 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -53,7 +53,7 @@ static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) SMB2SRV_CHECK(op->send_fn(op)); } - SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, True, op->info->out.blob.length)); + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, true, op->info->out.blob.length)); /* TODO: this is maybe a o16s32_blob */ SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, op->info->out.blob)); @@ -205,7 +205,7 @@ void smb2srv_getinfo_recv(struct smb2srv_request *req) struct smb2_getinfo *info; struct smb2srv_getinfo_op *op; - SMB2SRV_CHECK_BODY_SIZE(req, 0x28, True); + SMB2SRV_CHECK_BODY_SIZE(req, 0x28, true); SMB2SRV_TALLOC_IO_PTR(info, struct smb2_getinfo); /* this overwrites req->io_ptr !*/ SMB2SRV_TALLOC_IO_PTR(op, struct smb2srv_getinfo_op); @@ -247,7 +247,7 @@ static void smb2srv_setinfo_send(struct ntvfs_request *ntvfs) SMB2SRV_CHECK_ASYNC_STATUS(op, struct smb2srv_setinfo_op); - SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x02, False, 0)); + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x02, false, 0)); smb2srv_send_reply(req); } @@ -349,7 +349,7 @@ void smb2srv_setinfo_recv(struct smb2srv_request *req) struct smb2_setinfo *info; struct smb2srv_setinfo_op *op; - SMB2SRV_CHECK_BODY_SIZE(req, 0x20, True); + SMB2SRV_CHECK_BODY_SIZE(req, 0x20, true); SMB2SRV_TALLOC_IO_PTR(info, struct smb2_setinfo); /* this overwrites req->io_ptr !*/ SMB2SRV_TALLOC_IO_PTR(op, struct smb2srv_setinfo_op); -- cgit From 529763a9aa192a6785ba878aceeb1683c2510913 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2007 19:24:51 +0100 Subject: r25920: ndr: change NTSTAUS into enum ndr_err_code (samba4 callers) lib/messaging/ lib/registry/ lib/ldb-samba/ librpc/rpc/ auth/auth_winbind.c auth/gensec/ auth/kerberos/ dsdb/repl/ dsdb/samdb/ dsdb/schema/ torture/ cluster/ctdb/ kdc/ ntvfs/ipc/ torture/rap/ ntvfs/ utils/getntacl.c ntptr/ smb_server/ libcli/wrepl/ wrepl_server/ libcli/cldap/ libcli/dgram/ libcli/ldap/ libcli/raw/ libcli/nbt/ libnet/ winbind/ rpc_server/ metze (This used to be commit 6223c7fddc972687eb577e04fc1c8e0604c35435) --- source4/smb_server/smb2/fileinfo.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 41b31f586f..8715279dad 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -143,12 +143,14 @@ static NTSTATUS smb2srv_getinfo_fs(struct smb2srv_getinfo_op *op, uint8_t smb2_l static NTSTATUS smb2srv_getinfo_security_send(struct smb2srv_getinfo_op *op) { union smb_fileinfo *io = talloc_get_type(op->io_ptr, union smb_fileinfo); - NTSTATUS status; + enum ndr_err_code ndr_err; - status = ndr_push_struct_blob(&op->info->out.blob, op->req, - io->query_secdesc.out.sd, - (ndr_push_flags_fn_t)ndr_push_security_descriptor); - NT_STATUS_NOT_OK_RETURN(status); + ndr_err = ndr_push_struct_blob(&op->info->out.blob, op->req, + io->query_secdesc.out.sd, + (ndr_push_flags_fn_t)ndr_push_security_descriptor); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + return ndr_map_error2ntstatus(ndr_err); + } return NT_STATUS_OK; } @@ -294,7 +296,7 @@ static NTSTATUS smb2srv_setinfo_fs(struct smb2srv_setinfo_op *op, uint8_t smb2_l static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t smb2_level) { union smb_setfileinfo *io; - NTSTATUS status; + enum ndr_err_code ndr_err; switch (smb2_level) { case 0x00: @@ -308,10 +310,12 @@ static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t io->set_secdesc.in.sd = talloc(io, struct security_descriptor); NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd); - status = ndr_pull_struct_blob(&op->info->in.blob, io, - io->set_secdesc.in.sd, - (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); - NT_STATUS_NOT_OK_RETURN(status); + ndr_err = ndr_pull_struct_blob(&op->info->in.blob, io, + io->set_secdesc.in.sd, + (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + return ndr_map_error2ntstatus(ndr_err); + } return ntvfs_setfileinfo(op->req->ntvfs, io); } -- cgit From 86dc05e99f124db47f2743d1fc23117a7f5145ab Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 1 Jan 2008 22:05:05 -0600 Subject: r26638: libndr: Require explicitly specifying iconv_convenience for ndr_struct_push_blob(). (This used to be commit 61ad78ac98937ef7a9aa32075a91a1c95b7606b3) --- source4/smb_server/smb2/fileinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 8715279dad..bbd784bf8f 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -145,7 +145,7 @@ static NTSTATUS smb2srv_getinfo_security_send(struct smb2srv_getinfo_op *op) union smb_fileinfo *io = talloc_get_type(op->io_ptr, union smb_fileinfo); enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&op->info->out.blob, op->req, + ndr_err = ndr_push_struct_blob(&op->info->out.blob, op->req, NULL, io->query_secdesc.out.sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { -- cgit From 7d5f0e0893d42b56145a3ffa34e3b4b9906cbd91 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 1 Jan 2008 22:05:13 -0600 Subject: r26639: librpc: Pass iconv convenience on from RPC connection to NDR library, so it can be overridden by OpenChange. (This used to be commit 2f29f80e07adef1f020173f2cd6d947d0ef505ce) --- source4/smb_server/smb2/fileinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index bbd784bf8f..00c455e351 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -310,7 +310,7 @@ static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t io->set_secdesc.in.sd = talloc(io, struct security_descriptor); NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd); - ndr_err = ndr_pull_struct_blob(&op->info->in.blob, io, + ndr_err = ndr_pull_struct_blob(&op->info->in.blob, io, NULL, io->set_secdesc.in.sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { -- cgit From e870cfec9f3512b0f1bd3110d7b975652525e28a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Feb 2008 10:12:33 +1100 Subject: Convert SMB and SMB2 code to use a common buffer handling structure This converts our SMB and SMB2 code to use a common structure "struct request_bufinfo" for information on the buffer bounds of a packet, alignment information and string handling. This allows us to use a common backend for SMB and SMB2 code, while still using all the same string and blob handling functions. Up to now we had been passing a NULL req handle into these common routines from the SMB2 side of the server, which meant that we failed any operation which did a bounds checked string extraction (such as a RenameInformation setinfo call, which is what Vista uses for renaming files) There is still some more work to be done on this - for example we can now remove many of the SMB2 specific buffer handling functions that we had, and use the SMB ones. (This used to be commit ca6d9be6cb6a403a81b18fa6e9a6a0518d7f0f68) --- source4/smb_server/smb2/fileinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 00c455e351..e375b7308f 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -268,7 +268,7 @@ static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2 status = smbsrv_pull_passthru_sfileinfo(io, io->generic.level, io, &op->info->in.blob, - STR_UNICODE, NULL); + STR_UNICODE, &op->req->in.bufinfo); NT_STATUS_NOT_OK_RETURN(status); return ntvfs_setfileinfo(op->req->ntvfs, io); -- cgit From 4a04a5e620a4666fc123d04cb96ef391de72c469 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Feb 2008 14:54:21 +1100 Subject: A better way to handle the different format of RenameInformation in SMB2 We now define a separate info level RAW_SFILEINFO_RENAME_INFORMATION_SMB2 and set that level when handling SMB2 packets. This makes the parsers clearer. (This used to be commit f6cdf3f1177f63d80be757f007eb15380839b4f5) --- source4/smb_server/smb2/fileinfo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index e375b7308f..e6521991ef 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -266,6 +266,11 @@ static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2 io->generic.level = smb2_level + 1000; io->generic.in.file.ntvfs = op->info->in.file.ntvfs; + /* handle cases that don't map directly */ + if (io->generic.level == RAW_SFILEINFO_RENAME_INFORMATION) { + io->generic.level = RAW_SFILEINFO_RENAME_INFORMATION_SMB2; + } + status = smbsrv_pull_passthru_sfileinfo(io, io->generic.level, io, &op->info->in.blob, STR_UNICODE, &op->req->in.bufinfo); -- cgit From b640f475be9b0f83e7812a5c7756344c5891cba3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Feb 2008 17:11:36 +1100 Subject: updated SMB2 code for getinfo according to WSPP docs - Updated getinfo structures and field names - also updated the protocol revision number handling to reflect new docs (This used to be commit 3aaa2e86d94675c6c68d66d75292c3e34bfbc81b) --- source4/smb_server/smb2/fileinfo.c | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index e6521991ef..d6db61eaba 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -79,19 +79,21 @@ static NTSTATUS smb2srv_getinfo_file_send(struct smb2srv_getinfo_op *op) static NTSTATUS smb2srv_getinfo_file(struct smb2srv_getinfo_op *op, uint8_t smb2_level) { union smb_fileinfo *io; + uint16_t level; io = talloc(op, union smb_fileinfo); NT_STATUS_HAVE_NO_MEMORY(io); - switch (op->info->in.level) { + level = op->info->in.info_type | (op->info->in.info_class << 8); + switch (level) { case RAW_FILEINFO_SMB2_ALL_EAS: - io->all_eas.level = op->info->in.level; + io->all_eas.level = level; io->all_eas.in.file.ntvfs = op->info->in.file.ntvfs; - io->all_eas.in.continue_flags = op->info->in.flags2; + io->all_eas.in.continue_flags = op->info->in.getinfo_flags; break; case RAW_FILEINFO_SMB2_ALL_INFORMATION: - io->all_info2.level = op->info->in.level; + io->all_info2.level = level; io->all_info2.in.file.ntvfs = op->info->in.file.ntvfs; break; @@ -166,7 +168,7 @@ static NTSTATUS smb2srv_getinfo_security(struct smb2srv_getinfo_op *op, uint8_t io->query_secdesc.level = RAW_FILEINFO_SEC_DESC; io->query_secdesc.in.file.ntvfs = op->info->in.file.ntvfs; - io->query_secdesc.in.secinfo_flags = op->info->in.flags; + io->query_secdesc.in.secinfo_flags = op->info->in.additional_information; op->io_ptr = io; op->send_fn = smb2srv_getinfo_security_send; @@ -179,23 +181,17 @@ static NTSTATUS smb2srv_getinfo_security(struct smb2srv_getinfo_op *op, uint8_t static NTSTATUS smb2srv_getinfo_backend(struct smb2srv_getinfo_op *op) { - uint8_t smb2_class; - uint8_t smb2_level; - - smb2_class = 0xFF & op->info->in.level; - smb2_level = 0xFF & (op->info->in.level>>8); - - switch (smb2_class) { + switch (op->info->in.info_type) { case SMB2_GETINFO_FILE: - return smb2srv_getinfo_file(op, smb2_level); + return smb2srv_getinfo_file(op, op->info->in.info_class); case SMB2_GETINFO_FS: - return smb2srv_getinfo_fs(op, smb2_level); + return smb2srv_getinfo_fs(op, op->info->in.info_class); case SMB2_GETINFO_SECURITY: - return smb2srv_getinfo_security(op, smb2_level); + return smb2srv_getinfo_security(op, op->info->in.info_class); - case 0x04: + case SMB2_GETINFO_QUOTA: return NT_STATUS_NOT_SUPPORTED; } @@ -217,13 +213,15 @@ void smb2srv_getinfo_recv(struct smb2srv_request *req) op->send_fn = NULL; SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_getinfo_send, NTVFS_ASYNC_STATE_MAY_ASYNC); - info->in.level = SVAL(req->in.body, 0x02); - info->in.max_response_size = IVAL(req->in.body, 0x04); - info->in.unknown1 = IVAL(req->in.body, 0x08); - info->in.unknown2 = IVAL(req->in.body, 0x0C); - info->in.flags = IVAL(req->in.body, 0x10); - info->in.flags2 = IVAL(req->in.body, 0x14); + info->in.info_type = CVAL(req->in.body, 0x02); + info->in.info_class = CVAL(req->in.body, 0x03); + info->in.output_buffer_length = IVAL(req->in.body, 0x04); + info->in.reserved = IVAL(req->in.body, 0x0C); + info->in.additional_information = IVAL(req->in.body, 0x10); + info->in.getinfo_flags = IVAL(req->in.body, 0x14); info->in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x18); + SMB2SRV_CHECK(smb2_pull_o16As32_blob(&req->in, op, + req->in.body+0x08, &info->in.blob)); SMB2SRV_CHECK_FILE_HANDLE(info->in.file.ntvfs); SMB2SRV_CALL_NTVFS_BACKEND(smb2srv_getinfo_backend(op)); -- cgit From 6ef9674caa67c1f086285f1bee17c6f390778588 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 30 May 2008 07:28:53 +1000 Subject: the docs shows that this is a o16s32 blob (This used to be commit a6d28e2b330a20e95b745966bb5eb153bdc58ed1) --- source4/smb_server/smb2/fileinfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index d6db61eaba..942000133c 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -55,8 +55,7 @@ static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, true, op->info->out.blob.length)); - /* TODO: this is maybe a o16s32_blob */ - SMB2SRV_CHECK(smb2_push_o16s16_blob(&req->out, 0x02, op->info->out.blob)); + SMB2SRV_CHECK(smb2_push_o16s32_blob(&req->out, 0x02, op->info->out.blob)); SSVAL(req->out.body, 0x06, 0); smb2srv_send_reply(req); -- cgit From eb8634b2f02bb0134435a964bb9687f0de32b349 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 31 May 2008 13:39:51 +1000 Subject: check for requested buffer size in getinfo call (This used to be commit ed8f16379d01d3dffd2645e2b275aa27507dfec9) --- source4/smb_server/smb2/fileinfo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/smb_server/smb2/fileinfo.c') diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 942000133c..6c4b8f33d5 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -53,6 +53,11 @@ static void smb2srv_getinfo_send(struct ntvfs_request *ntvfs) SMB2SRV_CHECK(op->send_fn(op)); } + if (op->info->in.output_buffer_length < op->info->out.blob.length) { + smb2srv_send_error(req, NT_STATUS_INFO_LENGTH_MISMATCH); + return; + } + SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x08, true, op->info->out.blob.length)); SMB2SRV_CHECK(smb2_push_o16s32_blob(&req->out, 0x02, op->info->out.blob)); -- cgit