1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

39684 Commits

Author SHA1 Message Date
Volker Lendecke
2459337a58 libcli: Move "struct cldap_netlogon" definition to torture
This structure is only used in torture/ldap/netlogon.c now for
historic reasons. Replacing it with something else would be the right
thing to do...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
4aff4c749b torture4: Replace direct netlogon ping calls with netlogon_pings()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
d260478195 torture4: Add ldap.netlogon-ping test
This will supersede the direct cldap based netlogon tests

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
462748afed torture4: Use netlogon_pings() in rpc.lsa tests
Allow LDAPS netlogon ping

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
63b5b5d05b torture4: Use netlogon_pings_send/recv in bench-cldap
This slightly changes behaviour: It uses separate client sockets per
ping instead of just one, but it allows to compare CLDAP with LDAP and
LDAPS (spoiler: LDAPS is *much* slower...)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
74cec52bab libnet4: Use netlogon_pings() in finddcs_cldap
Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
e7844537b6 libnet4: Use netlogon_pings() in unbecome_dc
Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
bfa6f18a0e libnet4: Use netlogon_pings() in become_dc
Allow LDAPS netlogon pings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
42cafe481d libnet4: Use netlogon_pings() in findsite
Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
3ecb665422 libnet: Initialize variables in libnet_FindSite()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
dcc2767185 libnet: Simplify error return in libnet_FindSite()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
ccfbb5c2ed libnet: Save a few lines with talloc_move()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
527d81fc5e param: Remove parameter "cldap port"
This was not used consistently across all of our code base, and I
don't see a reason why this should ever not be port 389.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
43b2d4104b cldap: Make finddcs.out.netlogon a pointer
struct netlogon_samlogon_response has subpointers, this patch enables
a proper talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
31d1fc0912 cldap: Make cldap_netlogon.out.netlogon a pointer
struct netlogon_samlogon_response has subpointers, this patch enables
a proper talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
a3f1cb1597 lib: Fix trailing whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
82d8f345f5 libnet4: Call map_netlogon_samlogon_response directly
Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
a3eb60e7c8 libnet4: Call map_netlogon_samlogon_response directly
Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
d41efadde3 libnet4: Call map_netlogon_samlogon_response directly
Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
fc9810051e libcli4: Call map_netlogon_samlogon_response directly
Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
b5af90bd5c torture4: Simplifiy [tcp|udp]_ldap_netlogon()
Both callers set "map_response=true", so we don't need that flag here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Volker Lendecke
19ab2db59a tstream_tls: Add tstream_tls_params_peer_name()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Ralph Boehme
f6d3e1117f smbtorture: use torture_assert_ntstatus_equal_goto() in CHECK_STATUS() in unlink.c
fixup

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>

Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Nov 11 14:01:18 UTC 2024 on atb-devel-224
2024-11-11 14:01:18 +00:00
Ralph Boehme
3a32246bf2 smbtorture: move hardlink test in test_ntrename() to its own test
Some filesystems may not support hardlinks.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2024-11-11 12:53:05 +00:00
Ralph Boehme
83bca29e9d smbtorture: remove more allocation size checks
If the requested allocation size was 0, the resulting allocation size may be
larger due to xattrs and other filesystem dependent factors.

Cf commits fba4b29085 and
55b2f247f9.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2024-11-11 12:53:05 +00:00
Douglas Bagnall
2b05eb22ba s4:reg: s/the there/there/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
26dd542928 s4: s/the the\b/the/ in miscellaneous comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
770df620be s4:ldb_mods:group_audit: s/the the/the/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Ralph Boehme
14f3f88a3c smbtorture: Directory Leases vs unlink
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
d805f6e22f smbtorture: Directory Leases vs hardlink
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
4ed15961d7 smbtorture: Directory Leases vs overwrite
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
b59a833107 smbtorture: Directory Leases vs renaming
Note that we must use defines for the DLEASE* values, as declaring them as const
int triggers a CI failure on one of the runners (opensuse155-samba-o3) likely
due to a bug in its gcc version:

  ../../source4/torture/smb2/lease.c:6242:22: error: initializer element is not constant
     .srcdir_leasekey = DLEASE1,
                        ^~~~~~~

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
f95867e8f5 smbtorture: Directory Leases vs setting access date
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
28e8aae6ad smbtorture: Directory Leases vs setting inode change date
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
b277c32dc1 smbtorture: Directory Leases vs setting modification date
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
1150efd21c smbtorture: Directory Leases vs setting creation date
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
aa50c19e6b smbtorture: Directory Leases vs setting DOS attributes
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
9b6592d696 smbtorture: Directory Leases vs setting EOF
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
dde84e5fd3 smbtorture: check parent leasekey is ignored unless SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET is set
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
9708aebcce smbtorture: check SMB2_LEASE_FLAG_BREAK_IN_PROGRESS when client requests new lease
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
cc5ca053a2 smbtorture: expand Directory Leases test "v2_request
Add three subtests:

- trigger a sharing violation, ack break, create fails with STATUS_SHARING_VIOLATION
- trigger a sharing violation, close conflicting open, create succeeds
- write with valid parent lease key.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
4aa0f90ac2 smbtorture: simplify test_lease_v2_request()
- Add and use test_rearm_dirlease().
- Rename variable "ls2" to "dirlease".
- Simplify lease epoch tracking by using dirlease.lease_epoch as a counter.
- Add comments.
- Zero out a handle after closing it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
9695cda30f smbtorture: add test smb2.dirleases.leases
Checks server accepts "RWH", "RH" and "R" lease request and grants at most
(lease_request & "RH"), so no "W", but "R" without "H" if requested.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
f10bbff928 s4/torture: give smb2_generic_create_share() caller some flexibility
This way callers can either create or open a directory.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
21d0a2a9ff selftest: add "smb2.dirlease" test suite
Move all existing Directory Leases tests to this test suite and require
SMB2_CAP_DIRECTORY_LEASING.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:31 +00:00
Ralph Boehme
a611e6d402 smbtorture: expand test test_lease_v2_rename_target_overwrite()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00
Ralph Boehme
5305e36194 smbtorture: add a test for recursive h-lease break when renaming
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00
Ralph Boehme
bb940c5bb6 smbtorture: check initial-delete-on-close breaks H-lease for tdis, logoff and disconnect
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00
Ralph Boehme
aaa9e60ddb smbtorture: expand test test_lease_unlink() with set-delete-on-close
Currently the test only uses initial-delete-on-close. Expand the test to also
use set-delete-on-close.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13458
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00
Ralph Boehme
3ce664243d selftest: run smb2.lease test only against the fileserver environment
...and expect SMB2_CAP_LEASING.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00