diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-06-05 22:03:17 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-06-05 22:03:17 +0200 |
commit | d51904c48970265e84c303ae97502152b85da587 (patch) | |
tree | dfb75ae9712bac4ab6e25bd3bb3d79b6465685f0 /source4/torture/smb2/getinfo.c | |
parent | d05ca8cbba364b65780d35a32495d6388bc3caa8 (diff) | |
parent | c6cc3cb88ec271da6c372ec881ea66ab8f6e2b68 (diff) | |
download | samba-d51904c48970265e84c303ae97502152b85da587.tar.gz samba-d51904c48970265e84c303ae97502152b85da587.tar.bz2 samba-d51904c48970265e84c303ae97502152b85da587.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit dcdfee611ccc0ae798e3eea2cfdf3c7642dc5677)
Diffstat (limited to 'source4/torture/smb2/getinfo.c')
-rw-r--r-- | source4/torture/smb2/getinfo.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/torture/smb2/getinfo.c b/source4/torture/smb2/getinfo.c index 906d6e4f8d..5b35d7e693 100644 --- a/source4/torture/smb2/getinfo.c +++ b/source4/torture/smb2/getinfo.c @@ -167,6 +167,40 @@ static bool torture_smb2_fsinfo(struct smb2_tree *tree) } +/* + test for buffer size handling +*/ +static bool torture_smb2_buffercheck(struct smb2_tree *tree) +{ + NTSTATUS status; + struct smb2_handle handle; + struct smb2_getinfo b; + + printf("Testing buffer size handling\n"); + status = smb2_util_roothandle(tree, &handle); + if (!NT_STATUS_IS_OK(status)) { + printf(__location__ " Unable to create root handle - %s\n", nt_errstr(status)); + return false; + } + + ZERO_STRUCT(b); + b.in.info_type = SMB2_GETINFO_FS; + b.in.info_class = 1; + b.in.output_buffer_length = 0x1; + b.in.input_buffer_length = 0; + b.in.file.handle = handle; + + status = smb2_getinfo(tree, tree, &b); + if (!NT_STATUS_EQUAL(status, NT_STATUS_INFO_LENGTH_MISMATCH)) { + printf(__location__ " Wrong error code for small buffer %s\n", + nt_errstr(status)); + return false; + } + + return true; +} + + /* basic testing of all SMB2 getinfo levels */ bool torture_smb2_getinfo(struct torture_context *torture) @@ -196,6 +230,7 @@ bool torture_smb2_getinfo(struct torture_context *torture) ret &= torture_smb2_fileinfo(torture, tree); ret &= torture_smb2_fsinfo(tree); + ret &= torture_smb2_buffercheck(tree); talloc_free(mem_ctx); |