summaryrefslogtreecommitdiff
path: root/source4/torture
Commit message (Collapse)AuthorAgeFilesLines
* CVE-2022-37967 Add new PAC checksumJoseph Sutton2022-12-131-2/+12
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15231 Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* CVE-2022-38023 s4:rpc_server/netlogon: require aes if weak crypto is disabledStefan Metzmacher2022-12-131-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2022-38023 s4:torture: use NETLOGON_NEG_SUPPORTS_AES by defaultStefan Metzmacher2022-12-134-18/+27
| | | | | | | | | | | | For generic tests we should use the best available features. And AES will be required by default soon. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4/torture/smb2: avoid possibly closing undefined handleDouglas Bagnall2022-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From OSS-Fuzz compilation: Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1456:2: error: variable 'dir_handle' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] Step #3 - "compile-honggfuzz-address-x86_64": torture_assert_ntstatus_ok_goto(tctx, status, ret, done, Step #3 - "compile-honggfuzz-address-x86_64": ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:748:3: note: expanded from macro 'torture_assert_ntstatus_ok_goto' Step #3 - "compile-honggfuzz-address-x86_64": torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt) Step #3 - "compile-honggfuzz-address-x86_64": ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:316:6: note: expanded from macro 'torture_assert_ntstatus_equal_goto' Step #3 - "compile-honggfuzz-address-x86_64": if (!NT_STATUS_EQUAL(__got, __expected)) { \ Step #3 - "compile-honggfuzz-address-x86_64": ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1582:24: note: uninitialized use occurs here Step #3 - "compile-honggfuzz-address-x86_64": smb2_util_close(tree, dir_handle); Step #3 - "compile-honggfuzz-address-x86_64": ^~~~~~~~~~ Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1456:2: note: remove the 'if' if its condition is always false Step #3 - "compile-honggfuzz-address-x86_64": torture_assert_ntstatus_ok_goto(tctx, status, ret, done, Step #3 - "compile-honggfuzz-address-x86_64": ^ Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:748:3: note: expanded from macro 'torture_assert_ntstatus_ok_goto' Step #3 - "compile-honggfuzz-address-x86_64": torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt) Step #3 - "compile-honggfuzz-address-x86_64": ^ Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:316:2: note: expanded from macro 'torture_assert_ntstatus_equal_goto' Step #3 - "compile-honggfuzz-address-x86_64": if (!NT_STATUS_EQUAL(__got, __expected)) { \ Step #3 - "compile-honggfuzz-address-x86_64": ^ Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1434:2: note: variable 'dir_handle' is declared here Step #3 - "compile-honggfuzz-address-x86_64": struct smb2_handle dir_handle; Step #3 - "compile-honggfuzz-address-x86_64": ^ Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Dec 13 07:45:20 UTC 2022 on sn-devel-184
* torture: test that a find with a mangled name worksRalph Boehme2022-12-101-0/+83
| | | | | | | | | | | This was spawned by https://bugzilla.samba.org/show_bug.cgi?id=13472 back then. Samba implement this correctly, just add this test found in the attic. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Dec 10 00:07:09 UTC 2022 on sn-devel-184
* torture: convert mangling test to a suiteRalph Boehme2022-12-092-3/+14
| | | | | | | More tests to come... Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add an interactive test that works out maximum name and path lenghtsRalph Boehme2022-12-091-1/+129
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add a test veryfing timestamps across renameRalph Boehme2022-12-091-0/+137
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add another large directory enumeration performance testRalph Boehme2022-12-091-0/+174
| | | | | | | | This one renames one file per iteration and can also be used to torture any directory caching the server may employ. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: print duration of smb2.dir.test_large_filesRalph Boehme2022-12-091-0/+9
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: increase find buffer to 1 MB in multiple_smb2_search()Ralph Boehme2022-12-091-1/+1
| | | | | | | | This is used by performance tests that don't want to measure network latency but fileserver IO latency. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add another simple DOS attributes testRalph Boehme2022-12-092-0/+58
| | | | | | | | | - create file with ARCHIVE - open file with ARCHIVE+HIDDEN+... - check DOS attrs are still only ARCHIVE from the initial create Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture: remove remaining checks if alloc_size is 0 on empty filesRalph Boehme2022-12-095-8/+3
| | | | | | | | commit 55b2f247f9ba56516efba52481418966a777343e already remove a few of these, but a few remained. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/comression: convert test_lzxpress_plain to cmockaDouglas Bagnall2022-12-012-2/+0
| | | | | | | | | | | | | | Mainly so I can go make bin/test_lzxpress_plain && bin/test_lzxpress_plain valgrind bin/test_lzxpress_plain rr bin/test_lzxpress_plain rr replay in a tight loop. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* lib/compression: move lzxpress_plain test into tests/Douglas Bagnall2022-12-011-1/+2
| | | | | | | | We are going to add more tests for lib/compression, and they can't all be called "testsuite.c". Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* s4: torture: Add compound_async.read_read test to show we don't go async on ↵Jeremy Allison2022-12-011-0/+107
| | | | | | | | | the last read in a compound. Add knownfail. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Add compound_async.write_write test to show we don't go async ↵Jeremy Allison2022-12-011-0/+104
| | | | | | | | | on the last write in a compound. Add knownfail. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Tweak the compound padding streamfile test to send 3 reads ↵Jeremy Allison2022-12-011-1/+22
| | | | | | | | | | | | | | | | instead of 2, and check the middle read padding. The protocol allows the last read in a related compound to be split off and possibly go async (and smbd soon will do this). If the last read is split off, then the padding is different. By sending 3 reads and checking the padding on the 2nd read, we cope with the smbd change and are still correctly checking the padding on a compound related read. Do this for the stream filename compound padding test. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Tweak the compound padding basefile test to send 3 reads ↵Jeremy Allison2022-12-011-1/+23
| | | | | | | | | | | | | | | | instead of 2, and check the middle read padding. The protocol allows the last read in a related compound to be split off and possibly go async (and smbd soon will do this). If the last read is split off, then the padding is different. By sending 3 reads and checking the padding on the 2nd read, we cope with the smbd change and are still correctly checking the padding on a compound related read. Do this for the base filename compound padding test. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:torture: Fix segfault in multichannel testAndreas Schneider2022-12-011-2/+1
| | | | | | | | | | | | | The timer for the timeout_cb() handler was created on a memory context which doesn't get freed, so the timer was still valid when running the next test and fired there. It was then writing into random memory leading to segfaults. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Dec 1 15:03:19 UTC 2022 on sn-devel-184
* torture: add a test trying to set FILE_ATTRIBUTE_TEMPORARY on a directoryRalph Boehme2022-11-281-0/+47
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15252 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_FLUSH test to ↵Jeremy Allison2022-11-171-0/+115
| | | | | | | | | | | | | | | | | | | | | | smb2.compound_async. Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_FLUSH compound if we immediately close the file afterward. Internally the flushes go async and we free the req, then we process the close. When the flushes complete they try to access already freed data. Extra test which will allow me to test when the final component (flush) of the compound goes async and returns NT_STATUS_PENDING. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15172 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_CLOSE test to ↵Jeremy Allison2022-11-172-0/+118
| | | | | | | | | | | | | | | | | | | smb2.compound_async. Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_CLOSE compound. Internally the flush goes async and we free the req, then we process the close. When the flush completes it tries to access already freed data. Found using the Apple MacOSX client at SNIA SDC 2022. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15172 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Add test to show smbd crashes when doing an FSCTL on a named ↵Jeremy Allison2022-11-142-0/+76
| | | | | | | | | | | stream handle. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15236 Signed-off-by: Andrew Walker <awalker@ixsystems.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: Show return value for smbc_getxattr() is incorrect (returns >0 ↵Jeremy Allison2022-11-011-0/+94
| | | | | | | | | | | | | | for success, should return zero). Add torture test to show smbc_getxattr() should return -1 on failure, 0 on success. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14808 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
* s3:rpcclient: Pass salt down to init_samr_CryptPasswordAES()Andreas Schneider2022-10-251-0/+27
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15206 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* s4: torture: libsmbclient: Add a torture test to ensure smbc_stat() returns ↵Jeremy Allison2022-10-181-0/+63
| | | | | | | | | | | ENOENT on a non-existent file. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15195 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* s4: smbtorture: Add fsync_resource_fork test to fruit tests.Jeremy Allison2022-10-061-0/+80
| | | | | | | | | | | | This shows we currently hang when sending an SMB2_OP_FLUSH on an AFP_Resource fork. Adds knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15182 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* selftest: Add tests for GetNCChanges GET_ANC using samba-tool drs ↵Andrew Bartlett2022-10-041-0/+98
| | | | | | | | | | | | | clone-dc-database This test, compared with the direct to RPC tests, will succeed, then fail once the server is changed to emulate Samba 4.5 and and again succeed once the python code changes to allow skipping the DRSUAPI_DRS_CRITICAL_ONLY step BUG: https://bugzilla.samba.org/show_bug.cgi?id=15189 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* pytests:s4/drs/getnc_schema: avoid unused importsDouglas Bagnall2022-09-161-4/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytests:s4/drs/repl_move: avoid unused and star importsDouglas Bagnall2022-09-161-2/+34
| | | | | | | | | | Found the names using something like: flake8 repl_move.py | \ grep -oP "(?<=F405 ')[\w.]+" /tmp/repl_move | sort | uniq Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytests:s4/drs/repl_rodc: avoid unused importsDouglas Bagnall2022-09-161-2/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytests:s4/drs/linked_attributes_drs: avoid unused importsDouglas Bagnall2022-09-161-15/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytests:s4/drs/ridalloc_exop: avoid unused importsDouglas Bagnall2022-09-161-3/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture: Zero samr_UserInfo union in password set testJoseph Sutton2022-09-121-0/+2
| | | | | | | | | | If init_samr_CryptPasswordAES() does not fill the u.info31.password.auth_data array completely, we may be comparing uninitialised bytes. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix spelling mistakes.Michael Tokarev2022-09-122-14/+14
| | | | | | | | | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Sep 12 02:29:32 UTC 2022 on sn-devel-184
* s4/tests/samba-tool drs showrepl: test NO_COLOR and --color variantsDouglas Bagnall2022-09-061-1/+30
| | | | | | | | "--color variants" meaning --color=always instead of --color=yes, etc. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* s4/tests/samba-tool drs showrepl: use vars for common stringsDouglas Bagnall2022-09-061-4/+8
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* pytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirsDouglas Bagnall2022-09-061-11/+3
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* pytest/samba_tool_drs: use TestCaseInTempDir.rm_files/.rm_dirsDouglas Bagnall2022-09-061-10/+3
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* smbtorture: add a test trying to create a stream on share without streams ↵Ralph Boehme2022-09-022-0/+49
| | | | | | | | | | support BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15161 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbtorture: add a test opening a READ-ONLY file with SEC_FLAG_MAXIMUM_ALLOWEDRalph Boehme2022-08-291-0/+48
| | | | | | | | | | Passes against Windows, currently fails against Samba. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 RN: Requesting maximum allowed permission of file with DOS read-only attribute results in access denied error Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtorture: turn maximum_allowed test into a test suiteRalph Boehme2022-08-292-3/+11
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtorture: close handle and delete file in tree_base()Ralph Boehme2022-08-291-0/+5
| | | | | | | | | | Otherwise the session might still be around with the open handle when the next test starts and then fails to delete the testfile. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtorture: check required access for SMB2-GETINFORalph Boehme2022-08-231-0/+147
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/libcli/smb2: avoid using smb2_composite_setpathinfo() in smb2_util_setatr()Ralph Boehme2022-08-231-8/+2
| | | | | | | | | | | | | | smb2_composite_setpathinfo() uses SEC_FLAG_MAXIMUM_ALLOWED which can have unwanted side effects like breaking oplocks if the effective access includes [READ|WRITE]_DATA. For changing the DOS attributes we only need SEC_FILE_WRITE_ATTRIBUTE. With this change test_smb2_oplock_batch25() doesn't trigger an oplock break anymore. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture: Fix shellcheck errors in test_masktest.shAndreas Schneider2022-08-221-1/+1
| | | | | | | source4/torture/tests/test_masktest.sh:26:117: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* s4:tortue: Fix shellcheck errors in test_locktest.shAndreas Schneider2022-08-221-1/+1
| | | | | | | source4/torture/tests/test_locktest.sh:26:137: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* s4:torture: Fix shellcheck errors in test_gentest.shAndreas Schneider2022-08-221-1/+1
| | | | | | | source4/torture/tests/test_gentest.sh:31:235: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* smbtorture: add test smb2.stream.attributes2Ralph Boehme2022-08-221-0/+355
| | | | | | | | | | Specifically torture the creation date is the same for the file and its streams. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>