]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 months agolibsmb: Use netlogon_pings() in dsgetdcname
Volker Lendecke [Mon, 28 Oct 2024 11:06:05 +0000 (12:06 +0100)] 
libsmb: Use netlogon_pings() in dsgetdcname

Use parallel requests and req_flags filtering provided by
netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agokerberos: Use netlogon_pings()
Volker Lendecke [Fri, 25 Oct 2024 15:38:04 +0000 (17:38 +0200)] 
kerberos: Use netlogon_pings()

This also makes sure we've got a KDC via DS_KDC_REQUIRED

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoldap: Use netlogon_pings
Volker Lendecke [Fri, 25 Oct 2024 15:25:13 +0000 (17:25 +0200)] 
ldap: Use netlogon_pings

This already requests the flags that ads_fill_cldap_reply() will later
check for, so netlogon_pings will only feed sufficient DCs into
ads_fill_cldap_reply.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Use netlogon_pings()
Volker Lendecke [Fri, 25 Oct 2024 14:45:29 +0000 (16:45 +0200)] 
cldap: Use netlogon_pings()

Allow LDAPS for ads_cldap_netlogon()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Add netlogon_pings()
Volker Lendecke [Thu, 24 Oct 2024 11:55:35 +0000 (13:55 +0200)] 
libads: Add netlogon_pings()

This encapsulates our logic that we send CLDAP requests on UDP/389,
sending them with 100msec timeouts until someone replies. It also
contains the code to do this over LDAP/389 or LDAPS/636.

It also contains code to filter for domain controller flags like
DS_ONLY_LDAP_NEEDED, this logic exists in several places right now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotldap: Add tldap_context_create_from_plain_stream()
Volker Lendecke [Thu, 31 Oct 2024 16:04:44 +0000 (17:04 +0100)] 
tldap: Add tldap_context_create_from_plain_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoparam: Add "client netlogon ping protocol"
Volker Lendecke [Thu, 24 Oct 2024 14:52:46 +0000 (16:52 +0200)] 
param: Add "client netlogon ping protocol"

Allow "net ads join" in environments where UDP/389 is blocked. Code
will follow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolib: Add a few required includes
Volker Lendecke [Thu, 24 Oct 2024 14:15:55 +0000 (16:15 +0200)] 
lib: Add a few required includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agobuild: Remove the big samba3util dependency from TLDAP
Volker Lendecke [Mon, 28 Oct 2024 09:44:47 +0000 (10:44 +0100)] 
build: Remove the big samba3util dependency from TLDAP

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agobuild: Make util_tsock its own subsystem
Volker Lendecke [Mon, 28 Oct 2024 09:40:26 +0000 (10:40 +0100)] 
build: Make util_tsock its own subsystem

One step to strip TLDAP deps

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoparam: Remove parameter "cldap port"
Volker Lendecke [Mon, 28 Oct 2024 12:46:20 +0000 (13:46 +0100)] 
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>
9 months agocldap: Make finddcs.out.netlogon a pointer
Volker Lendecke [Wed, 30 Oct 2024 10:10:28 +0000 (11:10 +0100)] 
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>
9 months agocldap: Make cldap_netlogon.out.netlogon a pointer
Volker Lendecke [Wed, 30 Oct 2024 10:07:53 +0000 (11:07 +0100)] 
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>
9 months agolib: Fix trailing whitespace
Volker Lendecke [Wed, 30 Oct 2024 09:54:12 +0000 (10:54 +0100)] 
lib: Fix trailing whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Remove cldap_netlogon->in.map_response
Volker Lendecke [Tue, 29 Oct 2024 08:02:19 +0000 (09:02 +0100)] 
cldap: Remove cldap_netlogon->in.map_response

We should not pass booleans down where the caller can do the same
thing with equal effort

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 08:01:43 +0000 (09:01 +0100)] 
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>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 08:00:34 +0000 (09:00 +0100)] 
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>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 07:59:29 +0000 (08:59 +0100)] 
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>
9 months agolibcli4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 07:57:53 +0000 (08:57 +0100)] 
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>
9 months agotorture4: Simplifiy [tcp|udp]_ldap_netlogon()
Volker Lendecke [Tue, 29 Oct 2024 07:55:13 +0000 (08:55 +0100)] 
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>
9 months agotldap_tls: Remove tldap_[gs]et_starttls_needed()
Volker Lendecke [Thu, 7 Nov 2024 10:17:12 +0000 (11:17 +0100)] 
tldap_tls: Remove tldap_[gs]et_starttls_needed()

The caller setting up a tldap connection is aware of whether to use
starttls, which is one single ldap extended operation before the tls
crypto starts. There is no complex logic behind this that is
worthwhile to be hidden behind a flag and an API. If there was more to
it than just a simple call to tldap_extended(), I would all be for
passing down that flag, but for this case I would argue the logic
after this patch is simpler.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotldap_tls: Move creation of tls_params out of tldap_tls_connect()
Volker Lendecke [Thu, 7 Nov 2024 09:53:48 +0000 (10:53 +0100)] 
tldap_tls: Move creation of tls_params out of tldap_tls_connect()

Soon we will have a tldap user which does not want to verify the
certs. Instead of passing another boolean down, hand in pre-created
tstream_tls_params.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotstream_tls: Add tstream_tls_params_peer_name()
Volker Lendecke [Thu, 7 Nov 2024 09:48:52 +0000 (10:48 +0100)] 
tstream_tls: Add tstream_tls_params_peer_name()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: use torture_assert_ntstatus_equal_goto() in CHECK_STATUS() in unlink.c
Ralph Boehme [Sat, 2 Nov 2024 14:49:41 +0000 (16:49 +0200)] 
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

9 months agosmbtorture: move hardlink test in test_ntrename() to its own test
Ralph Boehme [Fri, 8 Nov 2024 13:13:28 +0000 (14:13 +0100)] 
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>
9 months agosmbtorture: remove more allocation size checks
Ralph Boehme [Fri, 8 Nov 2024 12:09:15 +0000 (13:09 +0100)] 
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 fba4b290856faaf17305103efc65f6383ea4f61c and
55b2f247f9ba56516efba52481418966a777343e.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
9 months agolib/util: Include grp.h for setgroups during autoconf
Samuel Thibault [Tue, 5 Nov 2024 23:57:37 +0000 (00:57 +0100)] 
lib/util: Include grp.h for setgroups during autoconf

Otherwise setresuid and friends don't get detected on GNU/Hurd because the
inclusion of <grp.h> is missing for the declaration of setgroups.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 12:51:17 UTC 2024 on atb-devel-224

9 months agoctdb: Include replace.h for PATH_MAX
Samuel Thibault [Sun, 10 Nov 2024 00:59:39 +0000 (01:59 +0100)] 
ctdb: Include replace.h for PATH_MAX

Fixes build on GNU/Hurd.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 10:28:24 UTC 2024 on atb-devel-224

9 months agoDescribe implication of upstream ICU-22610
Earl Chew [Fri, 27 Sep 2024 13:50:31 +0000 (06:50 -0700)] 
Describe implication of upstream ICU-22610

Add commentary to link commit 86c7688 (MR !3447) to the upstream
fix for ICU-22610 in case there is subsequent breakage.

Signed-off-by: Earl Chew <earl_chew@yahoo.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  8 00:20:38 UTC 2024 on atb-devel-224

9 months agosmbd: initialize delete_on_close in smbd_smb2_setinfo_lease_break_fsp_check()
Ralph Boehme [Thu, 7 Nov 2024 13:11:48 +0000 (14:11 +0100)] 
smbd: initialize delete_on_close in smbd_smb2_setinfo_lease_break_fsp_check()

CID 1634488:  Uninitialized variables  (UNINIT)

/source3/smbd/smb2_setinfo.c: 475 in smbd_smb2_setinfo_lease_break_fsp_check()
469      &delete_on_close);
470      if (tevent_req_nterror(req, status)) {
471      return;
472      }
473      }
474
>>>     CID 1634488:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "delete_on_close".
475      if (!rename && !delete_on_close) {
476      return;
477      }
478
479      state->lck = get_existing_share_mode_lock(state, fsp->file_id);
480      if (state->lck == NULL) {

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov  7 17:21:53 UTC 2024 on atb-devel-224

9 months agolibcli/auth: make use of netlogon_creds_cli_check_transport() in more places
Stefan Metzmacher [Wed, 6 Nov 2024 16:18:58 +0000 (17:18 +0100)] 
libcli/auth: make use of netlogon_creds_cli_check_transport() in more places

This was somehow missing in commit
7a5ad9f64a905f5744430c6e0796c646baf9432e

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov  7 09:14:33 UTC 2024 on atb-devel-224

9 months agoctdb-scripts: Add configuration variable CTDB_KILLTCP_USE_SS_KILL
Martin Schwenke [Tue, 22 Aug 2023 02:13:44 +0000 (12:13 +1000)] 
ctdb-scripts: Add configuration variable CTDB_KILLTCP_USE_SS_KILL

This allows CTDB to be configured to use "ss -K" to reset TCP
connections on "releaseip".  This is only supported when the kernel is
configured with CONFIG_INET_DIAG_DESTROY enabled.

From the documentation:

   ss -K has been supported in ss since iproute 4.5 in March 2016 and
   in the Linux kernel since 4.4 in December 2015.  However, the
   required kernel configuration item CONFIG_INET_DIAG_DESTROY is
   disabled by default.  Although enabled in Debian kernels since
   ~2017 and in Ubuntu since at least 18.04,, this has only recently
   been enabled in distributions such as RHEL.  There seems to be no
   way, including running ss -K, to determine if this is supported, so
   use of this feature needs to be configurable.  When available, it
   should be the fastest, most reliable way of killing connections.

For RHEL and derivatives, this was enabled as follows:

* RHEL 8 via https://bugzilla.redhat.com/show_bug.cgi?id=2230213,
  arriving in version kernel-4.18.0-513.5.1.el8_9

* RHEL 9 via https://issues.redhat.com/browse/RHEL-212, arriving in
  kernel-5.14.0-360.el9

Enabling this option results in a small behaviour change because ss -K
always does a 2-way kill (i.e. it also sends a RST to the client).
Only a 1-way kill is done for SMB connections when ctdb_killtcp is
used - the reasons for this are shrouded in history and the 2-way kill
seems to work fine.

For the summary that is logged, when CTDB_KILLTCP_USE_SS_KILL is "yes"
or "try", always log the method used, even the fallback to
ctdb_killtcp.  However, when set to "no", maintain the existing
output.

The decision to use -K rather than --kill is because short options are
trivial to implement in test stubs.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Nov  7 00:12:34 UTC 2024 on atb-devel-224

9 months agoctdb-scripts: Factor out function kill_tcp_summarise()
Martin Schwenke [Fri, 25 Aug 2023 00:00:57 +0000 (10:00 +1000)] 
ctdb-scripts: Factor out function kill_tcp_summarise()

This will be used in a slightly different context in a subsequent
commit.  In that case, the number of killed connections will be passed
instead of the total number of connections, so support this here via
different modes instead of churning later.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Track connections for all ports for public IPs
Martin Schwenke [Mon, 23 Oct 2023 03:17:36 +0000 (14:17 +1100)] 
ctdb-scripts: Track connections for all ports for public IPs

Currently TCP ports like NFS lock manager are not tracked.  It is
easier to track all connections than to add a configuration system to
try to track specified ports, so do that.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Get connections after tickle list
Martin Schwenke [Mon, 30 Sep 2024 00:50:00 +0000 (10:50 +1000)] 
ctdb-scripts: Get connections after tickle list

Running ss to get current connections before running ctdb gettickles
means the ss output might be out of date when the 2 lists are
compared.  Some tickles might have been added after ss was run by some
other means (e.g. SMB tickles, added internally) and they would be
deleted according to the stale ss output.

This isn't currently a problem because update_tickles() is currently
only called with port 2049, so all tickles are managed by this code.
That will change in a subsequent commit.

Changing the order means the reverse problem can occur, where
update_tickles() attempts to delete an already deleted tickle.  That
may happen occasionally but is harmless because it doesn't result in
missing information.  It (currently) just causes a message to be
logged at DEBUG level.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Move connection tracking to 10.interface
Martin Schwenke [Mon, 23 Oct 2023 03:05:21 +0000 (14:05 +1100)] 
ctdb-scripts: Move connection tracking to 10.interface

This should really be done for all connections to public IP addresses.
Leave the port number there for now - this is just the first step.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Use ctdb_connection_same() to simplify
Martin Schwenke [Mon, 30 Sep 2024 02:21:59 +0000 (12:21 +1000)] 
ctdb-server: Use ctdb_connection_same() to simplify

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb: Don't leak a pointer on talloc_realloc failure
Volker Lendecke [Wed, 6 Nov 2024 10:51:04 +0000 (11:51 +0100)] 
ctdb: Don't leak a pointer on talloc_realloc failure

We should not directly overwrite the pointer we are realloc'ing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agoctdb: Save a few lines with talloc_zero()
Volker Lendecke [Wed, 6 Nov 2024 10:49:36 +0000 (11:49 +0100)] 
ctdb: Save a few lines with talloc_zero()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agoctdb-server: Remove duplicate logic
Martin Schwenke [Mon, 30 Sep 2024 02:40:57 +0000 (12:40 +1000)] 
ctdb-server: Remove duplicate logic

Initialise the pointer to NULL and fall through to let
talloc_realloc() do the allocation.  talloc_realloc() does the right
thing with a NULL pointer...

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Handle pre-existing connection first
Martin Schwenke [Mon, 30 Sep 2024 02:37:57 +0000 (12:37 +1000)] 
ctdb-server: Handle pre-existing connection first

This is cheap when tcparray is NULL and let's the code that now
follows be simplified.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Drop an unnecessary variable
Martin Schwenke [Mon, 30 Sep 2024 02:34:18 +0000 (12:34 +1000)] 
ctdb-server: Drop an unnecessary variable

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Drop a log message to DEBUG level
Martin Schwenke [Mon, 30 Sep 2024 02:30:13 +0000 (12:30 +1000)] 
ctdb-server: Drop a log message to DEBUG level

This is harmless, so it doesn't generally need to be logged.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Clean up connection tracking functions
Martin Schwenke [Mon, 30 Sep 2024 02:22:46 +0000 (12:22 +1000)] 
ctdb-server: Clean up connection tracking functions

Apply README.Coding, modernise logging, pre-render connection as a
string for logging, switch terminology from "tickle" to "connection",
tidy up comments.

No changes in functionality.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Use ss -H option to simplify
Martin Schwenke [Mon, 16 Sep 2024 02:26:53 +0000 (12:26 +1000)] 
ctdb-scripts: Use ss -H option to simplify

This option has been available since ~2018 and has been implemented in
the stub since then.  I guess we didn't use it because CentOS 7?

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Remove superseded compatibility code
Martin Schwenke [Mon, 23 Oct 2023 03:23:45 +0000 (14:23 +1100)] 
ctdb-scripts: Remove superseded compatibility code

Since commit 224e99804efef960ef4ce2ff2f4f6dced1e74146, square brackets
have been parsed by daemon and tool code, so drop the compatibility
code from here.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: update_tickles() should use the public IPs cache
Martin Schwenke [Thu, 19 Sep 2024 04:32:46 +0000 (14:32 +1000)] 
ctdb-scripts: update_tickles() should use the public IPs cache

This avoids duplicating logic.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Don't list connections when not hosting IPs
Martin Schwenke [Thu, 19 Sep 2024 03:52:48 +0000 (13:52 +1000)] 
ctdb-scripts: Don't list connections when not hosting IPs

With an empty IP filter, all incoming connections to port 2049 will be
listed, not just those to public IP addresses.  This causes error
messages like the following to be logged:

  ctdb-eventd[...]: 60.nfs: Failed to add 1 tickles

since the connection being added seems to be for a random NFS mount
that doesn't use a public IP addresses.

This has been a problem for a long time (probably since commit
04fe9e20749985c71fef1bce7f6e4c439fe11c81 in 2015).  It isn't currently
a huge deal because it only affects NFS connections.  However, this
code will soon be used to track connections to public IP addresses on
all ports.  This would result in a constant stream of log messages,
since there will always be some active connections.

The theory behind the fix is that if a node hosts no public IPs then
it should have no relevant connections and has no business changing
the list of registered tickles.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Fri, 13 Sep 2024 06:21:24 +0000 (16:21 +1000)] 
ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"

Massage a couple of lines manually so they're formatted sanely given
the new indentation.   Re-run shfmt to ensure no further changes.

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-doc: Improve 10.interface documentation and comments
Martin Schwenke [Tue, 22 Aug 2023 02:12:50 +0000 (12:12 +1000)] 
ctdb-doc: Improve 10.interface documentation and comments

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Fix ss -a not supported
Martin Schwenke [Mon, 16 Sep 2024 02:32:02 +0000 (12:32 +1000)] 
ctdb-tests: Fix ss -a not supported

This is currently just a series of typos.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Drop unsupported long options from ss stub usage
Martin Schwenke [Mon, 16 Sep 2024 02:19:00 +0000 (12:19 +1000)] 
ctdb-tests: Drop unsupported long options from ss stub usage

These have not been supported since commit
896c77df1ce2645c6dd7898b59ea802e204dc7d9 in 2018.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Ensure ss stub handles square brackets around addresses
Martin Schwenke [Fri, 27 Oct 2023 00:06:23 +0000 (11:06 +1100)] 
ctdb-tests: Ensure ss stub handles square brackets around addresses

It isn't unreasonable for unit test cases to use square brackets in
their input.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agolibndr: specialise ndr_token_find() for key pointer comparison
Douglas Bagnall [Thu, 17 Oct 2024 02:54:22 +0000 (15:54 +1300)] 
libndr: specialise ndr_token_find() for key pointer comparison

Usually we are doing a pointer comparison. Because we are doing it
in a tight loop, the cost of the comparison function call can be
noticeable.

There is a fuzz case that before f43ae1ab1a8803d8c5ad4e5f3dad63ccbe91aa54
took 3.957s, after that took 6.438s, and now again takes 3.960s.

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): Wed Nov  6 12:06:04 UTC 2024 on atb-devel-224

9 months agoldb:test:lmdb_free_list: s/the the/to the/ in comment
Douglas Bagnall [Fri, 13 Sep 2024 02:31:54 +0000 (14:31 +1200)] 
ldb:test:lmdb_free_list: s/the the/to the/ in comment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos4:reg: s/the there/there/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:31:09 +0000 (14:31 +1200)] 
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>
9 months agos4: s/the the\b/the/ in miscellaneous comments
Douglas Bagnall [Fri, 13 Sep 2024 02:30:42 +0000 (14:30 +1200)] 
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>
9 months agos4:ldb_mods:group_audit: s/the the/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:28:52 +0000 (14:28 +1200)] 
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>
9 months agos3:smbd:posix_acls: s/the the/that the/ in comment
Douglas Bagnall [Fri, 13 Sep 2024 02:27:57 +0000 (14:27 +1200)] 
s3:smbd:posix_acls: s/the the/that the/ in comment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos3:printing and spoolss: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:27:05 +0000 (14:27 +1200)] 
s3:printing and spoolss: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos3:headers: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:26:35 +0000 (14:26 +1200)] 
s3:headers: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos3:client:clitar: s/the the/to the/ in comment
Douglas Bagnall [Fri, 13 Sep 2024 02:25:36 +0000 (14:25 +1200)] 
s3:client:clitar: s/the the/to the/ in comment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agopytest: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:24:55 +0000 (14:24 +1200)] 
pytest: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agosamba-tool:: s/the the\b/the/ in docstring
Douglas Bagnall [Fri, 13 Sep 2024 02:24:20 +0000 (14:24 +1200)] 
samba-tool:: s/the the\b/the/ in docstring

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agonsswitch:: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:23:47 +0000 (14:23 +1200)] 
nsswitch:: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agolibcli:auth:msrpc_parse: s/the the/is the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:22:30 +0000 (14:22 +1200)] 
libcli:auth:msrpc_parse: s/the the/is the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agoutil:charset: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:21:33 +0000 (14:21 +1200)] 
util:charset: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agotevent docs: s/the the\b/the/
Douglas Bagnall [Fri, 13 Sep 2024 02:21:12 +0000 (14:21 +1200)] 
tevent docs: s/the the\b/the/

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agopyldb: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:19:41 +0000 (14:19 +1200)] 
pyldb: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agoldb:pack: s/the the/in the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:19:23 +0000 (14:19 +1200)] 
ldb:pack: s/the the/in the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agolib/afs: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:18:00 +0000 (14:18 +1200)] 
lib/afs: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agoctdb:tests: s/the the\b/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:17:30 +0000 (14:17 +1200)] 
ctdb:tests: s/the the\b/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agoWHATSNEW: SMB3 Directory Leases
Ralph Boehme [Thu, 24 Oct 2024 19:32:49 +0000 (21:32 +0200)] 
WHATSNEW: SMB3 Directory Leases

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Nov  5 15:51:27 UTC 2024 on atb-devel-224

9 months agosmbtorture: Directory Leases vs unlink
Ralph Boehme [Wed, 23 Oct 2024 18:11:59 +0000 (20:11 +0200)] 
smbtorture: Directory Leases vs unlink

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs hardlink
Ralph Boehme [Mon, 21 Oct 2024 10:33:08 +0000 (12:33 +0200)] 
smbtorture: Directory Leases vs hardlink

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs overwrite
Ralph Boehme [Fri, 18 Oct 2024 16:29:09 +0000 (18:29 +0200)] 
smbtorture: Directory Leases vs overwrite

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs renaming
Ralph Boehme [Mon, 9 Sep 2024 14:03:59 +0000 (16:03 +0200)] 
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>
9 months agosmbtorture: Directory Leases vs setting access date
Ralph Boehme [Mon, 9 Sep 2024 09:19:32 +0000 (11:19 +0200)] 
smbtorture: Directory Leases vs setting access date

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs setting inode change date
Ralph Boehme [Mon, 9 Sep 2024 08:37:19 +0000 (10:37 +0200)] 
smbtorture: Directory Leases vs setting inode change date

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs setting modification date
Ralph Boehme [Mon, 9 Sep 2024 08:35:09 +0000 (10:35 +0200)] 
smbtorture: Directory Leases vs setting modification date

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs setting creation date
Ralph Boehme [Fri, 18 Oct 2024 10:56:31 +0000 (12:56 +0200)] 
smbtorture: Directory Leases vs setting creation date

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs setting DOS attributes
Ralph Boehme [Fri, 18 Oct 2024 10:55:42 +0000 (12:55 +0200)] 
smbtorture: Directory Leases vs setting DOS attributes

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: Directory Leases vs setting EOF
Ralph Boehme [Fri, 18 Oct 2024 11:02:45 +0000 (13:02 +0200)] 
smbtorture: Directory Leases vs setting EOF

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli/smb: only copy the parent lease key if SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET...
Ralph Boehme [Thu, 24 Oct 2024 17:35:00 +0000 (19:35 +0200)] 
libcli/smb: only copy the parent lease key if SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET is set

MS-SMB2 3.3.5.9.11 Handling the SMB2_CREATE_REQUEST_LEASE_V2 Create Context:

  If the SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET bit is set in the Flags field of
  the request, Lease.ParentLeaseKey MUST be set to the ParentLeaseKey of the
  request.

Found by MS-SMB2-Prototocol-Testsuite test "Compare_Zero_LeaseFlag_ParentLeaseKey".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: check parent leasekey is ignored unless SMB2_LEASE_FLAG_PARENT_LEASE_KEY_...
Ralph Boehme [Thu, 24 Oct 2024 10:00:40 +0000 (12:00 +0200)] 
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>
9 months agolibcli/smb: only allow SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET in lease_flag
Ralph Boehme [Tue, 22 Oct 2024 13:05:58 +0000 (15:05 +0200)] 
libcli/smb: only allow SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET in lease_flag

MS-SMB2 3.3.5.9.11 Handling the SMB2_CREATE_REQUEST_LEASE_V2 Create Context:

  The server MUST attempt to locate a Lease by performing a lookup in the
  LeaseTable.LeaseList using the LeaseKey ...

  If no lease is found, one MUST be allocated with the following values set:

  ...

  * Lease.Breaking is set to FALSE.

  ...

Ensures we ignore SMB2_LEASE_FLAG_BREAK_IN_PROGRESS. Found by
MS-SMB2-Prototocol-Testsuite "BreakReadLeaseV2TestCaseS0".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: check SMB2_LEASE_FLAG_BREAK_IN_PROGRESS when client requests new lease
Ralph Boehme [Thu, 24 Oct 2024 09:52:19 +0000 (11:52 +0200)] 
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>
9 months agosmbtorture: expand Directory Leases test "v2_request
Ralph Boehme [Fri, 18 Oct 2024 15:25:56 +0000 (17:25 +0200)] 
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>
9 months agosmbtorture: simplify test_lease_v2_request()
Ralph Boehme [Fri, 6 Sep 2024 16:07:35 +0000 (18:07 +0200)] 
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>
9 months agosmbtorture: add test smb2.dirleases.leases
Ralph Boehme [Fri, 18 Oct 2024 15:19:34 +0000 (17:19 +0200)] 
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>
9 months agos4/torture: give smb2_generic_create_share() caller some flexibility
Ralph Boehme [Sun, 27 Feb 2022 17:48:49 +0000 (18:48 +0100)] 
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>
9 months agoselftest: add "smb2.dirlease" test suite
Ralph Boehme [Fri, 18 Oct 2024 12:51:09 +0000 (14:51 +0200)] 
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>
9 months agosmbd: grant Directory Lease if requested
Ralph Boehme [Tue, 3 Sep 2024 20:08:11 +0000 (22:08 +0200)] 
smbd: grant Directory Lease if requested

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbd: add option "smb3 directory leases"
Ralph Boehme [Wed, 12 May 2021 09:24:45 +0000 (11:24 +0200)] 
smbd: add option "smb3 directory leases"

By default enabled on non-clustered Samba, disabled on clustered Samba, the
reason being the expected additional load caused by forcing strict rename to be
enabled.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agodocs: fix indentation of "strict rename"
Ralph Boehme [Fri, 18 Oct 2024 14:17:08 +0000 (16:17 +0200)] 
docs: fix indentation of "strict rename"

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbd: allow directory leases in close_directory()
Ralph Boehme [Fri, 6 Sep 2024 10:28:46 +0000 (12:28 +0200)] 
smbd: allow directory leases in close_directory()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbd: use get_deferred_open_message_state() in open_directory()
Ralph Boehme [Fri, 6 Sep 2024 09:46:12 +0000 (11:46 +0200)] 
smbd: use get_deferred_open_message_state() in open_directory()

"deferred" will be used in the function by a later commit...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli/smb: ignore lease_flags and lease_duration for leasev1 in smb2_lease_pull()
Ralph Boehme [Mon, 21 Oct 2024 10:51:20 +0000 (12:51 +0200)] 
libcli/smb: ignore lease_flags and lease_duration for leasev1 in smb2_lease_pull()

MS-SMB2 2.2.13.2.8 SMB2_CREATE_REQUEST_LEASE:

  LeaseFlags (4 bytes): This field MUST NOT be used and MUST be reserved.
  The client MUST set this to 0, and the server MUST ignore it on receipt.

  LeaseDuration (8 bytes): This field MUST NOT be used and MUST be reserved.
  The client MUST set this to 0, and the server MUST ignore it on receipt.

So let's really, really ignore it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli/smb: rely on the caller zero-initializing "lease" in smb2_lease_pull()
Ralph Boehme [Mon, 21 Oct 2024 10:48:19 +0000 (12:48 +0200)] 
libcli/smb: rely on the caller zero-initializing "lease" in smb2_lease_pull()

Doing the zero initialization per struct member just feels like a way for bugs
to creep in, even when leasev1 is not going to change ever. The only caller has
already zero-initialized state->lease twice via 1) __tevent_req_create() and 2)
a struct initializer of "state".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when creating hardlink
Ralph Boehme [Sun, 20 Oct 2024 19:37:41 +0000 (21:37 +0200)] 
smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when creating hardlink

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>