summaryrefslogtreecommitdiffstats
path: root/source4/torture/raw
Commit message (Collapse)AuthorAgeFilesLines
* torture: Fix raw.open.chained-ntcreatexVolker Lendecke2014-12-091-2/+2
| | | | | | | | | | | | sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good. Same as 574750777a Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Dec 9 19:43:31 CET 2014 on sn-devel-104
* torture: Fix raw.open.chained-openxVolker Lendecke2014-11-281-2/+2
| | | | | | | | | | sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Nov 28 13:30:18 CET 2014 on sn-devel-104
* s4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9aJeremy Allison2014-11-071-0/+121
| | | | | | | | | | Shows attribute(stat) access open can create a file, and subsequent attribute(stat) opens don't break oplocks. Can be extended to explore more varients. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Provide enough space for test EA name in raw.eas testAndrew Bartlett2014-09-111-1/+1
| | | | | | | | | | | | | | | | The issue is that previously bad_ea_name[5] was the last element on the array, and so when we later did a strlen() on it, we read past the end of the stack array. We need bad_ea_name[5] to be the second-last element, followed by the \0 placed there by the strlcpy(). Found by AddressSanitizer Change-Id: I871c08200aa2591c612dfa44da92b83132f83d88 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Sep 11 08:50:16 CEST 2014 on sn-devel-104
* torture: allow us to correctly use sizeof(buf) in raw.open testsAndrew Bartlett2014-09-081-3/+3
| | | | | | | | | | | | This changes the sizeof(buf) from sizeof(void *), 8 on 64-bit machines, to sizeof("test") (eg 5). Found by AddressSanitizer Andrew Bartlett Change-Id: I01f18b35c041f3b16be9f6da8ae5d1917d7e24d9 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
* torture: Use torture_assert macro for value check in raw.readChristof Schmitt2014-08-301-6/+3
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture: Use torture_assert macro for status check in raw.readChristof Schmitt2014-08-301-6/+3
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture: Use torture_fail macro in check_buffer for read requestsChristof Schmitt2014-08-301-5/+7
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture: Add test for 16 bit alignment of readx dataChristof Schmitt2014-08-301-0/+23
| | | | | | | | | | | | | | MS-CIFS requires a one byte pad to guarantee 16 bit alignment of the data: Pad (1 byte): This field is optional. When using the NT LAN Manager dialect, this field can be used to align the Data field to a 16-bit boundary relative to the start of the SMB Header. If Unicode strings are being used, this field MUST be present. When used, this field MUST be one padding byte long. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock ↵Jeremy Allison2014-07-081-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementation is (currently) correct. Needed as there was a proposal to re-architect our multi-lock to dispense with lock order precedence, which isn't how Windows does it (unfortunately, as the new code would have been cleaner :-). Tested against the Win2k12 SMB1 implementation. This test is designed to show that lock precedence on the server is based on the order received, not on the ability to grant. For example: A blocked lock request containing 2 locks will be satified before a subsequent blocked lock request over one of the same regions, even if that region is then unlocked. E.g. (a) lock 100->109, 120->129 (granted) (b) lock 100->109, 120-129 (blocks) (c) lock 100->109 (blocks) (d) unlock 100->109 lock (c) will not be granted as lock (b) will take precedence. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jul 8 10:16:59 CEST 2014 on sn-devel-104
* torture4: Make raw.lock.multilock fail after 20 secondsVolker Lendecke2014-07-041-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 4 00:04:10 CEST 2014 on sn-devel-104
* torture4: Adapt comment to codeVolker Lendecke2014-07-031-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: smbtorture: Add multi-lock test. Regression test for bug #10684.Jeremy Allison2014-07-031-0/+97
| | | | | | | | | Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout. https://bugzilla.samba.org/show_bug.cgi?id=10684 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* torture4: Add a little test that truncate actually works :-)Volker Lendecke2014-06-251-0/+13
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Jun 25 13:37:24 CEST 2014 on sn-devel-104
* s4: torture: Add regression test case for #10671 - Samba file corruption as ↵Jeremy Allison2014-06-251-0/+73
| | | | | | | | | | | | | | | | | | a result of failed lock check. Adds a new test to raw.open. Opens a file with SHARE_NONE, writes 1 byte at offset 1023, attempts a second open with r/w access+truncate disposition, then checks that open fails with SHARING_VIOLATION, and the file is not truncated (is still size 1024). Correctly detects the bug and fixed smbd for me. https://bugzilla.samba.org/show_bug.cgi?id=10671 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* torture: convert raw.mux to use torture_comment() macros instead of printf()Andrew Bartlett2014-06-231-28/+28
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: convert raw.mux to use torture_assert() macrosAndrew Bartlett2014-06-231-27/+17
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: convert CHECK_STATUS into torture_assert_ntstatus_equal in raw.mux ↵Andrew Bartlett2014-06-231-33/+26
| | | | | | | | tests Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture/raw: fix debug message in torture_raw_qfileinfo_pipe()Stefan Metzmacher2014-03-251-1/+1
| | | | | | | We no longer use dcerpc_pipe_open_smb() there. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-torture: Use talloc for asprintf.Andreas Schneider2013-12-061-12/+10
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s4-torture: Relax time checking in CHECK_NTTIME.Andreas Schneider2013-11-121-1/+1
| | | | | | | | | NTTIME has a nanosecond resolution. We should be tolerate if the system is busy writing and reading the value. To reproduce this problem just run the test under valgrind. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* Add regression test for bug #10229 - No access check verification on stream ↵Jeremy Allison2013-11-041-0/+181
| | | | | | | | | | | | | | files. Checks against a file with attribute READONLY, and a security descriptor denying WRITE_DATA access. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Nov 4 23:10:10 CET 2013 on sn-devel-104
* torture: Extend the raw.oplock.level_ii_1 testVolker Lendecke2013-10-231-0/+14
| | | | | | | | | | | | | | smbd broke to none twice. Make sure this won't happen again :-) This used to happen before the MSG_SMB_BREAK_RESPONSE merge. In process_oplock_break_message we did not call remove_oplock, which would have prevented this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 23 14:06:13 CEST 2013 on sn-devel-104
* torture: Add a test showing we have to break L2 at open timeVolker Lendecke2013-10-231-0/+105
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Add oplock break to l2/none testsVolker Lendecke2013-10-231-0/+96
| | | | | | | | | The level we have to break to depends on the create disposition of the second opener. If it's overwriting, break to none. If it's not, break to level2. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Check break level in raw.oplock.exclusive5Volker Lendecke2013-10-231-0/+1
| | | | | | | | | | This is what Windows does in this case, we don't survive that. We break to LEVEL2 here. Fixes and more precise test to follow. We don't survive this anymore. Re-enable later. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Add reproducer for bug 10216Volker Lendecke2013-10-231-0/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:tortore:raw/qfileinfo: don't use dcerpc_pipe_open_smb() to open a named pipeStefan Metzmacher2013-10-171-12/+29
| | | | | | | | | | | We can directly use smb_raw_open() to open a handle to a named pipe. This avoids the need for the layer violation functions dcerpc_smb_tree() and dcerpc_smb_fnum(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture: Extend raw.oplock.batch10Volker Lendecke2013-10-151-0/+12
| | | | | | | | | | With FAKE_LEVEL_II_OPLOCKS around we did not grant LEVEL2 after a NO_OPLOCK file got written to. Windows does grant LEVEL2 in this case. With the have_level2_oplocks in brlocks.tdb we can now grant LEVEL2 in this case as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Extend the raw.oplock.doc1 testVolker Lendecke2013-10-111-7/+21
| | | | | | | If delete_on_close is set, there is no oplock break. Check that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Fix a typoVolker Lendecke2013-10-061-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Remove FORCE_OPLOCK_BREAK_TO_NONEVolker Lendecke2013-09-061-0/+3
| | | | | | | | | | | | | | | This flag existed to break an exclusive or batch oplock in just one instead of two steps down to "no oplock" when we did an allocation or file size change. Running raw.oplock against W2k12 differs in this respect from W2k3: W2k12 takes two steps (via level2) to break to none. This removes the special flag that we only had for compatibility with systems older than W2k12... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Sep 6 00:47:07 CEST 2013 on sn-devel-104
* torture: Adapt raw.oplock to w2k12Volker Lendecke2013-09-051-6/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Add torture tests to raw.eas to check sending Windows invalid names in the ↵Jeremy Allison2013-07-191-0/+114
| | | | | | | | | | | | | | | | middle of an EA list. Add torture tests to probe the set of invalid Windows EA names. Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jul 19 11:50:25 CEST 2013 on sn-devel-104
* torture: Don't segfault in raw.session on error.Andreas Schneider2013-07-021-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Fix comparsion of uninitalized bytes.Andreas Schneider2013-07-021-0/+2
| | | | | | | | | As we compare string make sure we have the null terminator. Found by valgrind. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s4-smbtorture: Set result message when failing the inheritance test.Alexander Werth2013-05-091-0/+7
| | | | | Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture: let raw.read accept larger reads than 0x10000Stefan Metzmacher2013-03-201-4/+2
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 20 21:53:20 CET 2013 on sn-devel-104
* s4:torture: raw.read fix large reads against windowsStefan Metzmacher2013-03-201-9/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Fix memcmp of short buffer.Andreas Schneider2013-02-221-2/+2
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Add samba3.samba3badnameblob test to check regressions in bug #9215.Jeremy Allison2012-10-012-0/+139
| | | | | | | Bad name in SMB1 openX can cause a crash in iconv inside glibc. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Oct 1 23:29:25 CEST 2012 on sn-devel-104
* s4:torture: fix error reporting in the raw.oplock-brl3 testMichael Adam2012-09-141-2/+1
| | | | | | | Error was assigned to a variable that was not returned. Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Sep 14 14:05:20 CEST 2012 on sn-devel-104
* smbtorture: Test that delete requests are not specialVolker Lendecke2012-09-101-0/+78
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* Now ACL inheritance flags are working, add test_inheritance_flags() back ↵Jeremy Allison2012-08-301-5/+10
| | | | into raw.acls to ensure we don't regress.
* s4-torture: Show that we cannot list extended attributes on streamsAndrew Bartlett2012-08-201-0/+11
|
* s4-torture: Show that we cannot have extended attributes on streamsAndrew Bartlett2012-08-201-2/+17
|
* s4-torture: Improve raw.streams test to cover EAs and to use torture_assert()Andrew Bartlett2012-08-201-34/+25
| | | | | | | | | | The extension of this test is to create an extended attribute, so we can confirm that the easize field on a stream actually refers to the parent file. This has been run against Windows 7. Andrew Bartlett
* torture: Reproducer for 64c0367Volker Lendecke2012-08-101-0/+20
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s4:torture: send the TCONX_FLAG_EXTENDED_RESPONSE flagStefan Metzmacher2012-08-023-5/+5
| | | | | | | metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Aug 2 10:54:18 CEST 2012 on sn-devel-104
* s4:torture/raw: add raw.session.expire1Stefan Metzmacher2012-06-221-0/+200
| | | | | | | This demonstrates the interaction of CAP_DYNAMIC_REAUTH and NT_STATUS_NETWORK_SESSION_EXPIRED. metze