summaryrefslogtreecommitdiff
path: root/source3/script/tests/test_smbclient_s3.sh
AgeCommit message (Collapse)AuthorFilesLines
2025-03-27smbd: remove get_change_timespec()Ralph Boehme1-6/+0
Return ctime from the filesystem instead of mtime. Adjust existing tests by removing ctime check. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-11-22smbd: Return NT_STATUS_STOPPED_ON_SYMLINKVolker Lendecke1-2/+8
Do this for "follow symlinks = now" and smb2 unix extensions Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-11-02tests: Convert the regression test for bug15505 to pythonVolker Lendecke1-39/+0
The shell version is flapping, but I can't really figure out why. Maybe this version is not flapping, and it also shows the failure if you revert 952d6c2cf48. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-27tests: Get a file through an absolute symlink within a subdirectoryVolker Lendecke1-0/+39
This shows that read_symlink_reparse() is broken when trying to replace an absolute with a relative filename within a share. read_symlink_reparse() is used only in openat_pathref_fsp_nosymlink() so far to chase symlinks for non-lcomp path components. Chasing lcomp symlinks is done through non_widelink_open(), which gets it right. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15505 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-07-19s3:script: Fix code spellingAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-08-22s3:script: Fix shellcheck errors in test_smbclient_s3.shAndreas Schneider1-1/+1
source3/script/tests/test_smbclient_s3.sh:270:5: error: Couldn't parse this test expression. Fix to allow more checks. [SC1073] source3/script/tests/test_smbclient_s3.sh:270:11: error: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again. [SC1072] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-07-25smbd: Userspace symlink eval in filename_convert_dirfsp()Volker Lendecke1-6/+4
This converts filename_convert_dirfsp to do symlink evaluation in user space. It uses openat_pathref_dirfsp_nosymlink() to open the dirpath and looks at the proper NT_STATUS_STOPPED_ON_SYMLINK response. Using this avoids filename_convert() and thus unix_convert() completely for the SMB2_CREATE case. The tests samba3.blackbox.smbclient_s3.NT1.plain.Recursive ls across MS-DFS links now correctly stop the symlink lookup recursion with NT_STATUS_OBJECT_PATH_NOT_FOUND. Previously we did not correcly pass up the ELOOP coming back from the stat-call. 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): Mon Jul 25 12:56:08 UTC 2022 on sn-devel-184
2022-06-17Add test smbclient 'delree' of dir (on DFS share)Noel Power1-0/+51
deltree of a file on a DFS share results in NT_STATUS_OBJECT_PATH_NOT_FOUND Addionally add a knownfail for this (to be removed in subsequent patch to fix bug) We also need to add a knownfail (which will not be removed) for the new test which will fail in smb1 envs BUG: https://bugzilla.samba.org/show_bug.cgi?id=15100 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-17Add test smbclient 'del' of file (on DFS share)Noel Power1-0/+45
del of a file on a DFS share results in NT_STATUS_OBJECT_PATH_NOT_FOUND Addionally add a knownfail (will be removed in following patch to fix the bug) We also need to add a knownfail (which will not be removed) for the new test which will fail in smb1 envs BUG: https://bugzilla.samba.org/show_bug.cgi?id=15100 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-15s3:tests: Reformat test_smbclient_s3.shAndreas Schneider1-1619/+1616
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Jun 15 06:54:49 UTC 2022 on sn-devel-184
2022-06-09Revert "s3:smbd: Remove NIS support"Samuel Cabrero1-0/+13
This partly reverts commit edda7a329e5bed442418de9782cec9f567092aae. Revert the chunks related to netgroups and skip NIS support related ones. Use getdomainname() from glibc instead of yp_get_default_domain() from libnsl to get the NIS domain name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15087 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-05-24s3/script/tests: Test smbclient -E redirects output to stderrNoel Power1-0/+45
Add new test to ensure smbclient is writing to stderr (with '-E') Add knownfail for this test (will be removed when issue is fixed in later commit) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075 Signed-off-by: Noel Power <noel.power@suse.com>
2022-02-04s3: tests: Add a new test test_msdfs_rename() that does simple renames on ↵Jeremy Allison1-0/+51
MSDFS root shares. We fail this on SMB2 for a subtle reason. Our client code called from smbclient only sets the SMB2_HDR_FLAG_DFS flag in the outgoing packet on the SMB2_CREATE call, and SMB2 rename does the following operations: SMB2_CREATE(src_path) // We set SMB2_HDR_FLAG_DFS here for a MSDFS share. SMB2_SETINFO: SMB2_FILE_RENAME_INFO(dst_path). // We don't set SMB2_HDR_FLAG_DFS However, from smbclient, dst_path is a MSDFS path but we don't set the flag, so even though the rename code inside smbd will cope with a MSDFS path (as used in the SMB1 SMBmv call) it fails as the correct flag isn't set. Add knownfail selftest/knownfail.d/msdfs-rename. Note we need to add the new test to "selftest/knownfail.d/smb1-tests" as test_smbclient_s3.sh is run against the (ad_member|nt4_member) environments first using NT1 (SMB1) protocol and then using SMB3, but the (ad_member|nt4_member) environments don't support SMB1. Seems a bit strange to me, but all the other SMB1 tests inside test_smbclient_s3.sh have already been added to "selftest/knownfail.d/smb1-tests" so just go with the test environment. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2022-02-04s3: tests: Add a new test test_msdfs_hardlink() that does simple hardlinks ↵Jeremy Allison1-0/+48
on MSDFS root shares. We pass this already as the cmd_hardlink in smbclient doesn't do the DFS path conversion on the hardlink target. But it's good to have the test. Note we need to add the new test to "selftest/knownfail.d/smb1-tests" as test_smbclient_s3.sh is run against the (ad_member|nt4_member) environments first using NT1 (SMB1) protocol and then using SMB3, but the (ad_member|nt4_member) environments don't support SMB1. Seems a bit strange to me, but all the other SMB1 tests inside test_smbclient_s3.sh have already been added to "selftest/knownfail.d/smb1-tests" so just go with the test environment. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2022-01-31CVE-2021-44141: s3: torture: In test_smbclient_s3, change the error codes ↵Jeremy Allison1-5/+5
expected for test_widelinks() and test_nosymlinks() from ACCESS_DENIED to NT_STATUS_OBJECT_NAME_NOT_FOUND. For SMB1/2/3 (minus posix) we need to treat bad symlinks as though they don't exist. Add to knwownfail.d/symlink_traversal BUG: https://bugzilla.samba.org/show_bug.cgi?id=14911 Signed-off-by: Jeremy Allison <jra@samba.org>
2021-05-20s3:client: Migrate smbclient to new cmdline option parserAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-04-22s3:smbd: Remove NIS supportAndreas Schneider1-13/+0
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-04-13s3:script:tests: create temporary files under $PREFIX/SELFTEST_TMPDIRStefan Metzmacher1-4/+5
Tests should not create files in the build nor the source directory! They should cope with read only access to them. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-11-04torture: Show that recursive ls across dfs is brokenVolker Lendecke1-0/+38
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-21s3:tests: Add tests for 'valid users'.Denis Karpelevich1-0/+138
Extending testsuite for option 'valid/invalid users' from smb.conf. Signed-off-by: Denis Karpelevich <dkarpele@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 21 01:17:05 UTC 2020 on sn-devel-184
2020-08-18selftest: Do not let deprecated option warnings muck this test upAndrew Bartlett1-0/+4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14460 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-04-16test_smbclient_s3: Test four-digit year in smbclient utimesChristof Schmitt1-5/+18
Modify the test to also set the create_time, and specify the year with using four digits to test the new codepath. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2019-12-05s3/script/tests: Use protocol param passed to selectively run testsNoel Power1-6/+15
samba3.blackbox.smbclient_s3 passes NT1 or SMB3 to run tests however the PROTOCOL param is not used consistently within the script which results in NT1 and SMB3 traffic being produced during testing. This obviously causes issues when running the tests in an test environment where SMB1 cannot be negiotiated. These changes fix this Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-09-03CVE-2019-10197: test_smbclient_s3.sh: add regression test for the no ↵Stefan Metzmacher1-0/+30
permission on share root problem BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
2018-08-10s3: tests: smbclient. Regression test to ensure we get ↵Jeremy Allison1-0/+42
NT_STATUS_DIRECTORY_NOT_EMPTY on rmdir. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13204 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 10 21:08:14 CEST 2018 on sn-devel-144
2018-06-26s3:tests: Add test for smbclient --quietJustin Stephenson1-0/+34
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Björn Baumbach <bb@sernet.de> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jun 26 20:29:19 CEST 2018 on sn-devel-144
2018-04-12s3: tests: Regression test to ensure we can never return a DIRECTORY ↵Jeremy Allison1-0/+76
attribute on a stream. Tests streams_xattr and also streams_depot. Inspired from a real-world test case by Andrew Walker <awalker@ixsystems.com>. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13380 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Apr 12 02:04:28 CEST 2018 on sn-devel-144
2018-04-06test_smbclient_s3.sh: Use correct separator in "list with backup privilege" testChristof Schmitt1-3/+7
Samba selftest uses the forward slash as winbind separator and in the USERNAME passed to the test. "net sam rights" expect the backslash. Map the separator used in selftest to a backslash to avoid creating an incorrect username DOMAIN\DOMAIN/USERNAME. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-16test_smbclient_s3.sh: force LANG=C during test_utimes()Stefan Metzmacher1-0/+8
This makes the test independent from the developers environment. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-02-19Remove some bashisms from the test scriptsTimur I. Bakeyev1-2/+2
Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2017-12-08s3: test_smbclient_s3: Fix restore of TZ.Jeremy Allison1-2/+2
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-12-05s3: test_smbclient_s3: Correctly set and unset TZ variable for test.Jeremy Allison1-0/+10
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): Tue Dec 5 08:55:44 CET 2017 on sn-devel-144
2017-11-15s3: smbclient: tests: Test "volume" command over SMB1 and SMB2+.Jeremy Allison1-0/+31
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13140 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): Wed Nov 15 19:50:54 CET 2017 on sn-devel-144
2017-10-24s3: smbclient: Test we can rename with a name containing.Jeremy Allison1-0/+49
Samba always allowed this anyway, but it's a good place to ensure we don't regress. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13093 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 24 23:32:58 CEST 2017 on sn-devel-144
2017-10-20s3:tests: Fix the smblcient utimes test in EuropeAndreas Schneider1-7/+11
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 20 03:37:31 CEST 2017 on sn-devel-144
2017-10-19s3: tests: Add smbclient test for utimes command.Jeremy Allison1-0/+67
Signed-off-by: Jeremy Allison <jra@samba.org>
2017-08-07source3/client: Fix typo in help message displayed by defaultAnoop C S1-2/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12936 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-07-19s3:tests: Fix directory creation and deletion of test_nosymlinks()Andreas Schneider1-11/+78
This should fix flakey autobuild. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12914 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 19 11:59:52 CEST 2017 on sn-devel-144
2017-07-19s3:tests: Fix directory creation and deletion of test_local_symlinks()Andreas Schneider1-8/+77
This should fix flakey autobuild. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12914 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-07-18s3: smbclient: Add a test for the setmode command.Jeremy Allison1-0/+51
Tested over SMB1 and SMB2. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 18 14:05:18 CEST 2017 on sn-devel-144
2017-07-07s3: tests: Add test for new smbclient "deltree" command.Jeremy Allison1-0/+47
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 7 13:38:24 CEST 2017 on sn-devel-144
2017-06-27s3:smbclient: remove unreliable Domain=[...] OS=[Windows 6.1] Server=[...] ↵Stefan Metzmacher1-30/+14
banner On interactive sessions we print the following instead now: Try "help" do get a list of possible commands. smb: > The reason for this is that we don't get these information via SMB2 and the we only get the domain name via some layering violations from the NTLMSSP state. It's better to remove this consitently for all SMB and auth protocol combinations. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-27s3:test_smbclient_s3.sh: improve the error handlingStefan Metzmacher1-170/+109
We should directly return if he hit an error. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-26s3: smbd: Add regression test for non-wide symlinks to directories fail over ↵Jeremy Allison1-0/+55
SMB3. Mark as knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12860 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-06-22s3:test_smbclient_s3.sh: pass the protocol (NT1) to the scriptStefan Metzmacher1-14/+13
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-22s3:test_smbclient_s3.sh: make it explizit where we want to force SMB1 or SMB3Stefan Metzmacher1-6/+10
We need to use -mNT1 or -mSMB3 at the end of the command line in order to overwrite possible '-m' arguments in $ADDARGS. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-13s3:script/tests: don't use hardcoded Domain Name in test_smbclient_s3.shStefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-06-07s3:tests: Add a test which checks that the smbclient session setup worksAndreas Schneider1-0/+34
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-10selftest: Test for bug 12558Volker Lendecke1-0/+11
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12558 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-08s3:tests: Create a test directory for a clean testAndreas Schneider1-19/+16
The test fails on openSUSE Tumbleweed with: NT_STATUS_FILE_IS_A_DIRECTORY opening remote file \foo\bar\testfile This cleans up the code to create a directory 'test' which can be completely removed so nothing will stay behind. It also makes sure that all parent directories are created and the files have some content. https://bugzilla.samba.org/show_bug.cgi?id=12721 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 8 12:29:19 CEST 2017 on sn-devel-144