summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbd: avoid dereferencing client->connectionsStefan Metzmacher2020-07-084-9/+7
| | | | | | | | | There're typically better ways to get the same information. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: setup client->global->client_guid even without multichannel supportStefan Metzmacher2020-07-081-0/+6
| | | | | | | | | | It's too confusing if client->global->client_guid and client->connections->smb2.client.guid don't have the same value. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: pass down smbXsrv_client to smbd_smb2_send_{oplock,lease}_break()Stefan Metzmacher2020-07-084-18/+13
| | | | | | | | | Which connection is actually used should not matter to the main logic. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: pass smbXsrv_client to downgrade_lease()Stefan Metzmacher2020-07-083-10/+12
| | | | | | | | | | This prepares for multichannel support, where breaks are not bound to a single connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: add smbd_server_disconnect_client[_ex]()Stefan Metzmacher2020-07-082-0/+24
| | | | | | | | | | | | | | | | | | With multichannel things may not happen only on one connection. We may need to disconnect all connections of a client, when something bad happens. The first users of this will be the lease/oplock break code, if they are not able allocate memory or something similar we need to bail out. Having a special smbXsrv_client based function is better than calling exit_server*() directly. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: remove unused session,tcon parameters from ↵Stefan Metzmacher2020-07-083-28/+12
| | | | | | | | | | | | | smbd_smb2_send_oplock_break() They are no longer used. However we'll make use of op->compat->vuid in the next commits, as the session id should be part of oplock breaks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: pass down session_id to smbd_smb2_send_break()Stefan Metzmacher2020-07-081-5/+12
| | | | | | | | | | Oplock break should contain a valid session id of the open file handle, as file handles are relative to a session. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: remove dead code from smbd_smb2_send_break()Stefan Metzmacher2020-07-081-55/+6
| | | | | | | | | | | Starting with commit 0a924d13cf4bb570cce3955cf0de9d8678b37dbe ("smbd: Send SMB2 oplock breaks unencrypted") we always passed in session=NULL and tcon=NULL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: add smb2.multichannel.oplocks.test3{_windows,specification}Stefan Metzmacher2020-07-081-0/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to the smb2.multichannel.leases.test5, but it tests the oplock case instead of leases. With Oplocks Windows only sends a single break on the latest channel, this is not what the spec says... Maybe we should have a similar test that would expect the behavior from the [MS-SMB2] (3/4/2020 rev 60.0) "3.3.4.6 Object Store Indicates an Oplock Break": ... If the server implements the SMB 3.x dialect family, SMB2 Oplock Break Notification MUST be sent to the client using the first available connection in Open.Session.ChannelList where Channel.Connection is not NULL. If the server fails to send the notification to the client, the server MUST retry the send using an alternate connection, if available, in Open.Session.ChannelList. ... Here I add one test that demonstrates the Windows behavior: smb2.multichannel.oplocks.test3_windows and a 2nd test that demonstrates the behavior from MS-SMB2. smb2.multichannel.oplocks.test3_specification Note that Windows 10 seems to behave differently and it's not possible to open all 32 channel used by this test. Against remote servers it's required to run iptables as root: #> smbtorture //server/torture -Uu%p \ --option="torture:use_iptables=yes" \ --option="torture:iptables_command=sudo /sbin/iptables" \ smb2.multichannel.oplocks.test3_windows #> smbtorture //server/torture -Uu%p \ --option="torture:use_iptables=yes" \ --option="torture:iptables_command=sudo /sbin/iptables" \ smb2.multichannel.oplocks.test3_specification The test will also work against a Samba server with 'smbd:FSCTL_SMBTORTURE = yes', and won't require iptables in that case. Samba will get a "smb2 disable oplock break retry" configuration option to switch between both behaviors, as it's much more common with Samba that leases are not supported and clients will fallback to oplocks together with multichannel. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: (re-)add smb2.multichannel.leases.test4Stefan Metzmacher2020-07-081-0/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests 32 channels, which is the maximum Windows Server versions support. (Note that Windows 10 (a Client OS as SMB server, seems to support only 20 channels and may differ in other aspects, so we ignore that for now). This works at least against Windows Server 2019 and we see lease break notification retries every ~ 1.3 seconds with ~ 5 TCP retransmissions. At that rate we see the remaining 5 retries after the conflicting SMB2 Create already returned. Older Windows Server versions use much longer timeouts in the TCP-stack, they send lease break notification retries less often and only 4 in total, all other channels get TCP-RST packets because of missing TCP keepalive packets before they're used. The intervals between lease break notification retries are ~19 seconds for 2012[_R2] and ~25 seconds for 2016. It means that only ~2 lease break notifications arrive before the open returns after ~35 seconds. Note that Windows 10 seems to behave differently and it's not possible to open all 32 channel used by this test. Against remote servers it's required to run iptables as root: #> smbtorture //server/torture -Uu%p \ --option="torture:use_iptables=yes" \ --option="torture:iptables_command=sudo /sbin/iptables" \ smb2.multichannel.leases.test4 The test will also work against a Samba server with 'smbd:FSCTL_SMBTORTURE = yes', and won't require iptables in that case. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: remove useless 'smb2.multichannel.leases.test4'Stefan Metzmacher2020-07-081-190/+0
| | | | | | | | | | | | | | Having a test that would only pass against Samba makes things way to complex, they're already complex and we should try to behave like windows as much as possible. The next commit will add a better test that will work against Windows Servers and the future Samba servers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: fix smb2.multichannel.leases.test2 against windowsStefan Metzmacher2020-07-081-1/+11
| | | | | | | | | | | We still receive the break on the blocked channel, it's only the response ACKs, which we are blocking (or simulate to block). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: split smb2.oplock.batch22 into a and bStefan Metzmacher2020-07-083-6/+102
| | | | | | | | | | batch22a tests the timeout on a valid connection and batch22b tests the timeout on a broken/blocked connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: move smb2_transport blocking to the generic block.[ch]Stefan Metzmacher2020-07-083-225/+236
| | | | | | | | | We may want to use this in other places too, not only multichannel.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: make use of FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUTStefan Metzmacher2020-07-081-24/+131
| | | | | | | | | This is a way to test without being able to use iptables. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: refactor block.c to block the OUTPUT pathStefan Metzmacher2020-07-083-246/+116
| | | | | | | | | | | | In order to create useful tests, we should block the outgoing tcp packets only. That means we're able to see incoming break notifications, but prevent outgoing TCP ACKs to be delivered to the server. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: add break_info.oplock_skip_ackStefan Metzmacher2020-07-082-0/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: move interface_info test to smb2.multichannel.genericGünther Deschner2020-07-081-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:torture/smb2: make use of transport_options.only_negprot for multichannel ↵Stefan Metzmacher2020-07-081-3/+14
| | | | | | | | | | | connections This avoid useless session setups and tree connects on the wire. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:torture/smb2: simplify code to generate list of smb2 channelsGünther Deschner2020-07-081-46/+60
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:torture/smb2: add const to options for test_multichannel_create_channel()Stefan Metzmacher2020-07-081-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:libcli/smb2: add const to struct smbcli_options *options for smb2_connect()Stefan Metzmacher2020-07-081-1/+1
| | | | | | | | | | It will just be passed to smb2_connect_ext(), which already takes a const pointer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:libcli/smb2: allow smb2_connect*() to fake session and tconStefan Metzmacher2020-07-082-0/+10
| | | | | | | | | | | For multichannel connection we want a way to have just a connection with a negprot finished. For now we just fake a tcon and session in order to avoid changes in the caller. We can clean that up later if needed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:param: use struct initializer in lpcfg_smbcli_session_options()Stefan Metzmacher2020-07-081-3/+5
| | | | | | | We should zero all fields not initialiazed explicitly. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s4:param: use struct initializer in lpcfg_smbcli_options()Stefan Metzmacher2020-07-081-14/+16
| | | | | | | We should zero all fields not initialiazed explicitly. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* libcli/smb: define FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUTStefan Metzmacher2020-07-081-0/+8
| | | | | | | | | | This will be used by smbtorture in order to simulate channel failures without relying on iptables. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:includes: change OPLOCK_BREAK_TIMEOUT from 30 to 35 secondsStefan Metzmacher2020-07-081-1/+1
| | | | | | | | | | | | This is what windows is using for normal oplock and lease breaks. Note that windows uses higher values for persistent handles, they use 60 seconds for oplocks and 180 seconds for leases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* lib/util: allow to set TCP_USER_TIMEOUT socket optionGünther Deschner2020-07-082-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:dbwrap_watch: avoid recursion into dbwrap_do_locked() from ↵Stefan Metzmacher2020-07-081-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbwrap_watched_do_locked_{storev,delete}() This avoids a lot of overhead! Using smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 500000 under valgrind --tool=callgrind... This change replaces this: 6,877,542,529 PROGRAM TOTALS 590,000,773 lib/tdb/common/lock.c:tdb_lock_list 479,000,608 lib/tdb/common/lock.c:tdb_unlock 446,500,532 lib/tdb/common/io.c:tdb_read 364,000,824 lib/tdb/common/hash.c:tdb_jenkins_hash 285,000,532 lib/tdb/common/io.c:tdb_write 262,054,669 /x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms 206,500,496 lib/tdb/common/mutex.c:tdb_mutex_lock 193,000,176 lib/tdb/common/tdb.c:tdb_find 160,000,256 lib/talloc/talloc.c:_talloc_get_type_abort 148,500,297 lib/tdb/common/tdb.c:tdb_storev 140,000,196 lib/tdb/common/lock.c:tdb_lock 130,000,858 lib/util/debug.c:debuglevel_get_class 128,003,722 lib/talloc/talloc.c:_talloc_free 128,000,118 lib/tdb/common/tdb.c:tdb_parse_record 126,000,576 lib/tdb/common/lock.c:tdb_brlock.part.3 121,000,272 lib/tdb/common/mutex.c:tdb_mutex_unlock 118,000,225 /nptl/pthread_mutex_lock.c:__pthread_mutex_lock_full 112,750,222 lib/tdb/common/freelist.c:tdb_allocate_from_freelist 108,500,168 lib/tdb/common/io.c:tdb_ofs_read 102,500,000 lib/tdb/common/io.c:tdb_parse_data by this: 5,706,522,398 PROGRAM TOTALS 434,000,617 lib/tdb/common/lock.c:tdb_lock_list 389,500,494 lib/tdb/common/io.c:tdb_read 359,000,488 lib/tdb/common/lock.c:tdb_unlock 285,000,532 lib/tdb/common/io.c:tdb_write 237,554,655 /x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms 208,000,668 lib/tdb/common/hash.c:tdb_jenkins_hash 206,500,496 lib/tdb/common/mutex.c:tdb_mutex_lock 160,000,256 lib/talloc/talloc.c:_talloc_get_type_abort 148,500,297 lib/tdb/common/tdb.c:tdb_storev 136,000,132 lib/tdb/common/tdb.c:tdb_find 130,000,858 lib/util/debug.c:debuglevel_get_class 126,000,576 lib/tdb/common/lock.c:tdb_brlock.part.3 121,000,272 lib/tdb/common/mutex.c:tdb_mutex_unlock 118,000,225 /nptl/pthread_mutex_lock.c:__pthread_mutex_lock_full 112,750,222 lib/tdb/common/freelist.c:tdb_allocate_from_freelist 112,000,168 lib/tdb/common/lock.c:tdb_lock 94,500,154 lib/tdb/common/io.c:tdb_ofs_read 94,000,188 /nptl/pthread_mutex_unlock.c:__pthread_mutex_unlock_full 86,000,086 lib/dbwrap/dbwrap.c:dbwrap_lock_order_lock 83,000,083 lib/dbwrap/dbwrap_tdb.c:db_tdb_do_locked time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 5000000 gives: 902834 locks/sec real 0m11,103s user 0m8,233s sys 0m2,868s vs. 1037262 locks/sec real 0m9,685s user 0m6,788s sys 0m2,896s Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jul 8 11:02:39 UTC 2020 on sn-devel-184
* s3:locking: convert share_mode_lock.c to generate_unique_u64()Stefan Metzmacher2020-07-082-16/+15
| | | | | | | | | | | | | | Instead of a sequence number that gets incremented we just need a value that's not reused. The is a similar change like the commit before at the g_lock.c layer. I expect a similar performance improvement here, but I don't know a specific benchmark test to check. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:g_lock: avoid very expensive generate_random_buffer() in g_lock_parse()Stefan Metzmacher2020-07-081-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't require a sequence number that is incremented, we just need a value that's not reused. We use the new generate_unique_u64(), which is much cheaper! Using smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 500000 under valgrind --tool=callgrind... This change replaces this: 13,129,925,659 PROGRAM TOTALS 4,125,752,958 ???:_nettle_sha256_compress [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4] 1,257,005,866 ???:_nettle_aes_encrypt [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4] 590,000,773 bin/default/../../lib/tdb/common/lock.c:tdb_lock_list 571,503,429 ???:_nettle_aes_set_key [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4] 479,000,608 bin/default/../../lib/tdb/common/lock.c:tdb_unlock ... by this: 6,877,826,377 PROGRAM TOTALS 590,000,773 bin/default/../../lib/tdb/common/lock.c:tdb_lock_list 479,000,608 bin/default/../../lib/tdb/common/lock.c:tdb_unlock ... 12,500,033 bin/default/../../lib/util/genrand_util.c:generate_unique_u64 ... 8,996,970 ???:_nettle_sha256_compress [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4] time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 5000000 gives: 537426 locks/sec real 0m19,071s user 0m15,061s sys 0m3,999s vs. 900956 locks/sec real 0m11,155s user 0m8,293s sys 0m2,860s Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib/util: add generate_unique_u64() helper functionStefan Metzmacher2020-07-082-1/+51
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smbcacls: Add support for DFS pathAnubhav Rakshit2020-07-072-5/+19
| | | | | | | | | | | | | | | | | smbcacls does not handle DFS paths correctly. This is beacuse once the command encounters a path which returns STATUS_PATH_NOT_COVERED, it does not attempt a GET REFERRAL. We use cli_resolve_path API to perform a DFS path resolution to solve the above problem. Additionally this removes the known fail against smbcacls tests Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 7 23:03:00 UTC 2020 on sn-devel-184
* selftest: run smbcacls test against a share with a DFS linkNoel Power2020-07-073-0/+14
| | | | | | | | | | | | | The commit creates a dfs link in existing 'fileserver' env share msdfs_share. Additionally we create a new dfs target in a new share (with associated directory) Additionally add a known fail as smbcacls doesn't not yet navigate DFS links. A subsequent commit will fix smcacls to handle DFS (and remove the knownfail) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Add basic smbcacls test(s)Noel Power2020-07-074-0/+285
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: Implement epmapper LookupHandleFreeSamuel Cabrero2020-07-072-2/+10
| | | | | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Samuel Cabrero <scabrero@samba.org> Autobuild-Date(master): Tue Jul 7 13:43:14 UTC 2020 on sn-devel-184
* s4:torture: Do not skip epmapper lookup terminate test in samba4Samuel Cabrero2020-07-071-4/+0
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest: Split samba4 epmapper expected failures into individual testsSamuel Cabrero2020-07-071-1/+4
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:selftest: test for smbtorture subunit names with and without --fullnameSachin Prabhu2020-07-072-0/+50
| | | | | | | | | | | | | | | | We check the output with both --fullname and with the default shortname to ensure it works as expected. We also do tests for each level and test relative names are used. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User((no branch)): Stefan Metzmacher <metze@samba.org> Autobuild-Date((no branch)): Tue Jul 7 12:16:34 UTC 2020 on sn-devel-184
* s4:torture/local: Add new test to check smbtorture --fullnameSachin Prabhu2020-07-073-1/+34
| | | | | | | | | | | | Add new always pass test to test smbtorture --fullname. Since we test the printing of the fullname of the test, the test is placed at the bottom of several levels of test suites. test : local.smbtorture.level1.level2.level3.always_pass Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture: Add command line parameter --fullnameSachin Prabhu2020-07-071-0/+24
| | | | | | | | | | | | | | | | This argument is used to print out the the full name which includes the name of the test suite. For example, the name in the output for the test smb2.read.dir is "dir". By using the --fullname parameter, the name used will be "smb2.read.dir". The default continues to be to use the shortname. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture: avoid multiple recursions into the test listsStefan Metzmacher2020-07-071-4/+11
| | | | | | | | | | | torture_run_suite_restricted() and torture_run_tcase_restricted() already handle recursion. If we call them from smbtorture we should avoid our own recursion. Without this passing 'smb2.multichannel.*' results in running tests more than once. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture: use prefix_name() for all names in run_matching()Stefan Metzmacher2020-07-071-4/+4
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/torture: fix subunit names of nested suitesStefan Metzmacher2020-07-073-4/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. passing 'smb2.multichannel.generic' to smbtorture results in - interface_info - num_channels While passing 'smb2.multichannel' to smbtorture results in: - generic.interface_info - genetic.num_channels - oplocks.test1 ... - leases.test1 ... Before we got this: - interface_info - num_channels - test1 ... - test1 That made it impossible to add knownfail entries for leases.test1 vs. oplocks.test1 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/torture: add back links to the parent objectsStefan Metzmacher2020-07-072-0/+7
| | | | | | | This makes would allow the full name of a test to be constructed if needed in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/torture: make torture_subunit_test_name() publicStefan Metzmacher2020-07-073-18/+16
| | | | | | This makes it easier to modify. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/Samba4: split out _setup_ad_dc()Stefan Metzmacher2020-07-071-2/+8
| | | | | | | | | | | | | | | | | | | setup_ad_dc() was used for more than 'ad_dc'. Setting up 'ad_dc' means not all missing arguments are passed as undef. The following had no effect if (!defined($conf_opts)) { $conf_opts = ""; } and $conf_opts results in a string of 'HASH(....)' So we better pass explicit undef arguments from setup_ad_dc() to _setup_ad_dc() now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:wscript: vfs_gpfs needs kernel oplock supportStefan Metzmacher2020-07-071-1/+1
| | | | | | | | | | | | | | | It uses symbols, which are only available if we have HAVE_KERNEL_OPLOCKS_LINUX defined. This is not the case when building withing the Windows Subsystem for Liux (WSL). So we better don't try to build the vfs_gpfs module there. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jul 7 09:37:37 UTC 2020 on sn-devel-184
* s3:smbd: check for stale pid in delay_for_oplock_fn() when leases_db_get() failsStefan Metzmacher2020-07-071-1/+36
| | | | | | | | | | | | | | | | | | If leases_db_get() failed the leases_db record might have been cleaned up for stale processes. Check if the share-mode-entry owner is stale in this case and return ignore the entry. In any other case, log a debug messages and panic. Commit 05d4466a6d1ad048fa86aea09ec0a56a7b961369 "smbd: check for stale pid in get_lease_type()" fixed only one half of this. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428 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): Tue Jul 7 02:47:46 UTC 2020 on sn-devel-184
* s3:leases: log errors with level 0 in leases_db_do_locked_fn()Stefan Metzmacher2020-07-071-4/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>