summaryrefslogtreecommitdiff
path: root/source4/torture
Commit message (Collapse)AuthorAgeFilesLines
...
* smbtorture: rename smb2.streams.attributes to smb2.streams.attributes1Ralph Boehme2022-08-221-3/+3
| | | | | | | | | | | A subsequent commit adds another streams test named "attributes2", this change avoids matching the new testname with the existing knownfail entries. 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>
* s4:torture/smb2: add smb2.lease.v[1,2]_bug_15148Stefan Metzmacher2022-08-181-0/+208
| | | | | | | | | | | | | | This demonstrates the bug that happens with a write to a file handle holding an R lease, while there are other openers without any lease. When one of the other openers writes to the file, the R lease of the only lease holder isn't broken to NONE. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15148 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:torture/smb2: add smb2.bench.echoStefan Metzmacher2022-08-111-0/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | This test calls SMB2_Echo in a loop per connection. For 4 connections with 2 parallel loops use this: time smbtorture //127.0.0.1/m -Uroot%test smb2.bench.echo \ --option="torture:timelimit=600" \ --option="torture:nprocs=1" \ --option="torture:qdepth=2" Sometimes the bottleneck is the smbtorture process. In order to bring the smbd process to 100% cpu, you can use '--option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4"' and run multiple instances of the test at the same time, which both talk to the same smbd process. This is a very useful test to show how many requests are possible at the raw SMB2 layer. 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): Thu Aug 11 19:23:37 UTC 2022 on sn-devel-184
* s4:torture/smb2: teach smb2.bench.path-contention-shared about ↵Stefan Metzmacher2022-08-111-105/+157
| | | | | | | | | | | | | | | | | | --option="torture:qdepth=4" This can now test more than one open/close loop per connection. time smbtorture //127.0.0.1/m -Uroot%test \ smb2.create.bench-path-contention-shared \ --option='torture:bench_path=' \ --option="torture:timelimit=60" \ --option="torture:nprocs=1" \ --option="torture:qdepth=4" The default is still 1, but it's very useful for tests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2022-32743 s4:torture/rpc: Fix tests to match WindowsJoseph Sutton2022-07-281-5/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14833 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4:torture: Add test for dcerpc_samr_ChangePasswordUser4Andreas Schneider2022-07-281-0/+122
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture: Implement test for SAMR SetUserInfo(2) level 32Andreas Schneider2022-07-281-1/+145
| | | | | | make test TESTS="samba4.rpc.samr.passwords" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture: Implement test for SAMR SetUserInfo(2) level 31Andreas Schneider2022-07-281-1/+119
| | | | | | | | | | We can't apply this patch earlier as there are no individual tests we could mark as knownfail. Reorganizing the whole test is a too big task for now. However this test is working and also found some bugs. make test TESTS="samba4.rpc.samr.passwords" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* samr:idl: add samr_SupportedFeatures for samr_Connect5()Andreas Schneider2022-07-283-3/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* CVE-2022-32742: s4: torture: Add raw.write.bad-write test.Jeremy Allison2022-07-271-0/+89
| | | | | | | | | | | Reproduces the test code in: BUG: https://bugzilla.samba.org/show_bug.cgi?id=15085 Add knownfail. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* CVE-2022-32746 s4:torture: Fix LDB flags comparisonJoseph Sutton2022-07-271-1/+3
| | | | | | | | | | | | | | LDB_FLAG_MOD_* values are not actually flags, and the previous comparison was equivalent to (el->flags & LDB_FLAG_MOD_MASK) == 0 which is only true if none of the LDB_FLAG_MOD_* values are set. Correct the expression to what it was probably intended to be. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* torture: Fix the 32-bit buildVolker Lendecke2022-07-231-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc:ndr: Update ndr_print_debug() to the new ndr ABIPavel Filipenský2022-07-154-11/+8
| | | | Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture: Rename rpc.samr.passwords testsAndreas Schneider2022-07-151-1/+1
| | | | | | This way it is easier to select them with 'make test'. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* CI: fix check for correct mdsvc resonse when connecting to a share with ↵Ralph Boehme2022-07-121-9/+8
| | | | | | | | | | | | | | Spotlight disabled A Mac SMB server returns an all zero handle and an empty path if Spotlight is disabled on a share. We must return the exact same error return in order to trigger client-side searching. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s4:torture: Reformat shell scriptsAndreas Schneider2022-07-083-13/+13
| | | | | | shfmt -f source4/torture/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* s4:torture/smb2: add smb2.bench.path-contention-sharedStefan Metzmacher2022-07-051-1/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test tortures contention on a single path where all opens are shared stat opens without any oplock/lease interaction. It opens 'nproc' connections to the share and runs for 'timelimit' seconds, while it opens and closes the 'bench_path' on each connection as fast as possible. The number of concurrent connections can be specified with: --option="torture:nprocs=256" while the default is 4. The runtime can be specified by --option='torture:timelimit=30' the default being 10. By default the test operates on the share root directory, but the path can be changed with: --option='torture:bench_path=Apps\1\2\3\4\5\6\7\8\9\10' pointing to an existing file or directory. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:torture/smb2: rename 'smb2.bench-oplock' to 'smb2.bench.oplock'Stefan Metzmacher2022-07-052-1/+12
| | | | | | | We should have a toplevel 'smb2.bench' suite for all benchmark tests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:torture: check return of ndr_pull_init_blob() via torture_assert()Pavel Filipenský2022-07-011-0/+1
| | | | | | | | | | | Reported by covscan. Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 1 08:12:49 UTC 2022 on sn-devel-184
* vfs_acl_xattr: add acl_xattr:security_acl_name optionRalph Boehme2022-06-273-0/+154
| | | | | Pair-Programmed-With: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org>
* s4/torture/unix_info2: return NULL on failureDouglas Bagnall2022-06-171-1/+1
| | | | | | | | | | false is also NULL, but NULL is NULLer. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 17 02:18:32 UTC 2022 on sn-devel-184
* tortures/dlz: more DNS update testsDouglas Bagnall2022-06-171-0/+1154
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture/bind_dlz: return the right kind of failureDouglas Bagnall2022-06-171-2/+5
| | | | | | | | | | torture_fail() is a macro that returns false, which evaluates to ISC_R_SUCCESS in int context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture/dlz: minor reformatting for README.CodingDouglas Bagnall2022-06-171-3/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture/dlz: reserve test_ prefix for actual testsDouglas Bagnall2022-06-171-11/+11
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture/dlz: putrr callback recognises more than A recordsDouglas Bagnall2022-06-171-1/+43
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15040 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* spelling: connnect encrytion exisit expection explicit invalide missmatch ↵Michael Tokarev2022-06-103-6/+6
| | | | | | | | | | | | | | | | | | paramater paramter partion privilige relase reponse seperate unkown verson authencication progagated Tree-wide spellcheck for some common misspellings. source3/utils/status.c has misspelled local variable (unkown_dialect). "missmatch" is a known historical misspelling, only the incorrect misspellings are fixed. source3/locale/net/de.po has the spelling error (unkown) in two msgids - it probably should be updated with current source. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: Add a new test - samba3.smb2.durable-open.stat-open.Jeremy Allison2022-04-291-0/+63
| | | | | | | | | | | | | | | | | Passes against Windows. Shows that Windows allows a durable handle on a leased open for READ_ATTRUBUTES only (a stat open). Mark as knownfail for now. NB. Not sure why we are testing smb2.durable-open against ad_dc as that provisioning has "smb2 leases = no" which precludes granting durable handles. Not changing for this bug but this should be looked at in future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15042 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:torture: let remote_pac test for asserted identity sidsAndreas Schneider2022-04-131-2/+60
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* selftest: Extend test_wbc_logon_user to test WBFLAG_PAM_UNIX_NAME flagSamuel Cabrero2022-04-081-1/+1
| | | | | | | | | Use the same function append_unix_username() uses to build the expected value as it depends on the server role. This requires linking winbindd-lib. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: Fix duplicated function name between s3 and s4Samuel Cabrero2022-04-081-1/+1
| | | | | | | | | | It can lead to link errors: /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: source3/rpc_server/rpc_server.c.24.o: in function `dcesrv_assoc_group_find': /home/scabrero/workspace/samba/samba/bin/default/../../source3/rpc_server/rpc_server.c:229: multiple definition of `dcesrv_assoc_group_find'; source4/rpc_server/dcerpc_server.c.5.o:/home/scabrero/workspace/samba/samba/bin/default/../../source4/rpc_server/dcerpc_server.c:121: first defined here Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove itime and file_id logic and codeRalph Boehme2022-03-311-16/+1
| | | | | | | | | | | | | | | | | | This bases File-Ids on the inode numbers again. The whole stuff was added because at that time Apple clients 1. would be upset by inode number reusage and 2. had a client side bug in their fallback implemetentation that assigns File-Ids on the client side in case the server provides File-Ids of 0. After discussion with folks at Apple it should be safe these days to rely on the Mac to generate its own File-Ids and let Samba return 0 File-Ids. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CI: consolidate SMB2-FILEID and SMB2-FILEID-UNIQUE torture test suitesRalph Boehme2022-03-312-22/+3
| | | | | | | | We don't need seperate test suites here, all tests are related to File-Ids. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CI: add a test listing a snapshotted directoryRalph Boehme2022-03-311-0/+168
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15035 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: Add test_smb2_close_full_information() test to smb2.rename.Jeremy Allison2022-03-301-0/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creates a file, opens it again on two different connections and then renames it. When we close and ask for SMB2_CLOSE_FLAGS_FULL_INFORMATION we expect this to succeed and return valid data on the handles that did not do the rename request. This currently succeeds by accident on master, so we are not adding a knownfail.d/ file here. When we back-port this test to 4.16.next, 4.15.next we will add a knownfail.d file. The rename request zeros out the fsp->fsp_name->st field on the handles that are open but are not being renamed, marking them as INVALID_STAT. This should not happen on any open handle. Fix to follow will preserve the field on rename in both the local connection and different connection case. Master gets away with this as in this branch, openat_pathref_fsp(), which we use in the setup_close_full_information() call to fetch the SMB2_CLOSE_FLAGS_FULL_INFORMATION data doesn't require an existing VALID_STAT struct in order to open the file. This hides the fact the rename zeroed out fsp->fsp_name->st. 4.16.x and 4.15.x don't have this fix, so expose the bug. Regardless, even in master we should not zero out any fsp->fsp_name->st values on rename. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15038 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Add CHECK_CREATED macro to smb2/rename.c. Not yet used.Jeremy Allison2022-03-301-0/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15038 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Add CHECK_VAL macro to smb2/rename.c. Not yet used.Jeremy Allison2022-03-301-0/+14
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15038 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: torture: Add regression test for re-opening a durable handle after ↵Jeremy Allison2022-03-241-0/+140
| | | | | | | | | | | | | | | calling SMB2 setinfo (end of file). This is an implementation of a test written by Apple for their client. Currently fails to reconnect due to btime being overwritten incorrectly in the SMB2 setinfo path. Add knownfail.d/durable-v2-setinfo BUG: https://bugzilla.samba.org/show_bug.cgi?id=15022 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture: Allow Samba as an AD DC to use zeros for LM keyAndrew Bartlett2022-03-171-27/+46
| | | | | | | | | | This is simple, explainable and secure. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Mar 17 02:47:13 UTC 2022 on sn-devel-184
* torture: Do not expect LM passwords to be accepted except by samba3Andrew Bartlett2022-03-171-0/+26
| | | | | | | | This allows Samba as an AD DC (compared with the fileserver/NT4-like DC mode) to match windows and refuse all LM passwords, no matter what. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Update rpc.samlogon to match Win19 and newer Samba behaviour for LM keyAndrew Bartlett2022-03-171-47/+19
| | | | | | | | Not all cases are covered, but this much covers the areas that Samba and Win19 will agree on. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Allow RPC-SAMR to cope with OemChangePasswordUser2 being ↵Andrew Bartlett2022-03-171-0/+12
| | | | | | | | | | un-implemented This is important to allow, after other changes, for the Samba AD DC to again pass rpc.samr after the removal of LM hash support from the DC. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Use more torture_assert_goto() et al in rpc.samlogon testAndrew Bartlett2022-03-171-56/+67
| | | | | | | | This testsuite can otherwise fail with an error, which cannot be covered with a knownfail. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-smbtorture: Fix typo in assertion messageJoseph Sutton2022-03-171-1/+1
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CI: add test "smb2.async_dosmode"Ralph Boehme2022-02-282-0/+72
| | | | | | | | | | Verifies async-dosmode sync fallback works with shadow_copy2 which returns ENOSYS for SMB_VFS_GET_DOS_ATTRIBUTES_SEND(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14957 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: torture: Add new SMB2 lease test test_lease_duplicate_open().Jeremy Allison2022-02-181-0/+70
| | | | | | | | | | | | | Checks we return INVALID_PARAMETER when trying to open a different file with a duplicate lease key on the same share. Checked against Windows10. Currently fails against smbd so add knownfail.d/smb2-lease-duplicateopen BUG: https://bugzilla.samba.org/show_bug.cgi?id=14737 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@suse.com>
* s4: torture: Add new SMB2 lease test test_lease_duplicate_create().Jeremy Allison2022-02-181-0/+54
| | | | | | | | | | | | | Checks we return INVALID_PARAMETER when trying to create a new file with a duplicate lease key on the same share. Checked against Windows10. Samba already passes this but we didn't have a test before. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14737 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@suse.com>
* source4/torture: Drop unused variable maskMartin Schwenke2022-02-171-3/+1
| | | | | | | | | | | | | | | | | clang complains: ../../source4/torture/smb2/notify.c:871:11: error: variable 'mask' set but not used [-Werror,-Wunused-but-set-variable] uint32_t mask; ^ That is, the variable is initialised and updated but the value is never used. Looks to have been this way since commit 15d93a5d8e21893e1cca5c989dbf97010aae1622 from 2009. Just drop it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* source4/torture: Drop unused variable tdifMartin Schwenke2022-02-171-3/+0
| | | | | | | | | | | | | | | | | | clang complains: ../../source4/torture/basic/denytest.c:1805:11: error: variable 'tdif' set but not used [-Werror,-Wunused-but-set-variable] int64_t tdif; ^ That is, the variable is initialised and updated but the value is never used. Perhaps it is meant to be used in the nearby torture_comment() call, but it has been this was since commit cb1cff90f165d82cbbf1dd87e475a1b13984d45e from 2004. Just drop it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* source4/torture: Avoid unused variableMartin Schwenke2022-02-171-1/+1
| | | | | | | | | | | | | | clang complains: ../../source4/torture/basic/delete.c:2342:7: error: variable 'correct' set but not used [-Werror,-Wunused-but-set-variable] bool correct = true; ^ That is, the variable is initialised and updated but the value is never used. Similar functions return this variable, so try that. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>