]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
10 months agoAdd USING_SYSTEM_TDB test for rust config
David Mulder [Tue, 13 Aug 2024 20:06:00 +0000 (14:06 -0600)] 
Add USING_SYSTEM_TDB test for rust config

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd tests for rust chelps crate
David Mulder [Tue, 13 Aug 2024 19:57:37 +0000 (13:57 -0600)] 
Add tests for rust chelps crate

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoDebian cargo is far to old for building
David Mulder [Tue, 13 Aug 2024 19:26:37 +0000 (13:26 -0600)] 
Debian cargo is far to old for building

Debian ships a very old version of cargo, and
none of our rust code can build with it.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoVendor the rust sources for CI tests
David Mulder [Tue, 13 Aug 2024 14:53:33 +0000 (08:53 -0600)] 
Vendor the rust sources for CI tests

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoRust WAF detect dependant files from crates
David Mulder [Mon, 12 Aug 2024 21:04:47 +0000 (15:04 -0600)] 
Rust WAF detect dependant files from crates

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoModify rust build to share target dir w/ cargo test
David Mulder [Mon, 12 Aug 2024 20:25:12 +0000 (14:25 -0600)] 
Modify rust build to share target dir w/ cargo test

The build needs to share the target directory
with the cargo test command to prevent duplicate
dependency downloads.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoEnable rust cargo test in Samba make test
David Mulder [Mon, 12 Aug 2024 15:39:06 +0000 (09:39 -0600)] 
Enable rust cargo test in Samba make test

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdding Cargo.lock file for Rust build
David Mulder [Fri, 9 Aug 2024 20:08:11 +0000 (14:08 -0600)] 
Adding Cargo.lock file for Rust build

This ensures that all builds of this particular
version of Samba will use the same Rust
dependency versions.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoA Rust 'crate' is not a misspelling of 'create'
David Mulder [Fri, 9 Aug 2024 16:43:05 +0000 (10:43 -0600)] 
A Rust 'crate' is not a misspelling of 'create'

Also fix a misspelling in himmelblaud main.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoutf8proc-devel is missing from CentOS 8 Stream
David Mulder [Thu, 8 Aug 2024 20:48:59 +0000 (14:48 -0600)] 
utf8proc-devel is missing from CentOS 8 Stream

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoIntroduce build option to enable Himmelblau
David Mulder [Thu, 8 Aug 2024 20:06:22 +0000 (14:06 -0600)] 
Introduce build option to enable Himmelblau

The build for Himmelblau will be disabled by
default.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd clang and openssl deps
David Mulder [Thu, 8 Aug 2024 16:54:23 +0000 (10:54 -0600)] 
Add clang and openssl deps

Ensure CI images are generated with the necessary
clang and openssl packages for building.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd build config for proper TDB build linkage
David Mulder [Thu, 8 Aug 2024 16:51:02 +0000 (10:51 -0600)] 
Add build config for proper TDB build linkage

The tdb build needs to know whether Samba is
building with TDB bundled or not, otherwise
linking will fail.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoUpdate libhimmelblau
David Mulder [Mon, 5 Aug 2024 19:34:06 +0000 (13:34 -0600)] 
Update libhimmelblau

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoPam prompt for Pin if hello enrolled and enabled
David Mulder [Mon, 5 Aug 2024 19:05:52 +0000 (13:05 -0600)] 
Pam prompt for Pin if hello enrolled and enabled

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoIsolate hsm auth value from the cache
David Mulder [Mon, 5 Aug 2024 18:57:12 +0000 (12:57 -0600)] 
Isolate hsm auth value from the cache

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoReorganize rust file tree
David Mulder [Thu, 1 Aug 2024 21:12:33 +0000 (15:12 -0600)] 
Reorganize rust file tree

Place all rust code under samba/rust, similar to
how we organize python code in the samba tree.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd pam_open_session stub to the himmelblau daemon
David Mulder [Thu, 1 Aug 2024 16:08:41 +0000 (10:08 -0600)] 
Add pam_open_session stub to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd pam_acct_mgmt to the himmelblau daemon
David Mulder [Thu, 1 Aug 2024 15:52:45 +0000 (09:52 -0600)] 
Add pam_acct_mgmt to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getgrgid to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 20:27:05 +0000 (14:27 -0600)] 
Add nss getgrgid to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getgrnam to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 20:14:32 +0000 (14:14 -0600)] 
Add nss getgrnam to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getgrent to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 17:39:38 +0000 (11:39 -0600)] 
Add nss getgrent to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getpwuid to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 16:36:56 +0000 (10:36 -0600)] 
Add nss getpwuid to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getpwnam to the himmelblau daemon
David Mulder [Tue, 30 Jul 2024 20:40:09 +0000 (14:40 -0600)] 
Add nss getpwnam to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd nss getpwent to the himmelblau daemon
David Mulder [Tue, 30 Jul 2024 17:18:59 +0000 (11:18 -0600)] 
Add nss getpwent to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd pam_auth to himmelblau daemon
David Mulder [Tue, 30 Jul 2024 17:27:35 +0000 (11:27 -0600)] 
Add pam_auth to himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd PAM module for himmelblaud
David Mulder [Thu, 1 Aug 2024 19:36:58 +0000 (13:36 -0600)] 
Add PAM module for himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd Samba versioning
David Mulder [Tue, 30 Jul 2024 15:09:43 +0000 (09:09 -0600)] 
Add Samba versioning

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd NSS module for himmelblaud
David Mulder [Thu, 18 Jul 2024 16:27:14 +0000 (10:27 -0600)] 
Add NSS module for himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd the Azure Entra Id Daemon
David Mulder [Wed, 10 Jul 2024 20:04:28 +0000 (14:04 -0600)] 
Add the Azure Entra Id Daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd a daemon caching layer that wraps tdb
David Mulder [Tue, 30 Jul 2024 18:56:41 +0000 (12:56 -0600)] 
Add a daemon caching layer that wraps tdb

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd by-upn idmapping for Himmelblaud
David Mulder [Tue, 30 Jul 2024 15:53:56 +0000 (09:53 -0600)] 
Add by-upn idmapping for Himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd rust tdb bindings
David Mulder [Tue, 30 Jul 2024 15:49:22 +0000 (09:49 -0600)] 
Add rust tdb bindings

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd lp Rust bindings
David Mulder [Tue, 30 Jul 2024 15:43:46 +0000 (09:43 -0600)] 
Add lp Rust bindings

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoBuild the Rust ntstatus generated code
David Mulder [Tue, 30 Jul 2024 15:38:48 +0000 (09:38 -0600)] 
Build the Rust ntstatus generated code

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd rust bindings to Samba utils debug
David Mulder [Tue, 30 Jul 2024 15:17:34 +0000 (09:17 -0600)] 
Add rust bindings to Samba utils debug

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd Rust formatting for 80 char lines
David Mulder [Tue, 30 Jul 2024 19:28:31 +0000 (13:28 -0600)] 
Add Rust formatting for 80 char lines

This option helps force `cargo fmt` to follow
Samba's coding conventions. The 80 char max
is only lightly enforced here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd ntstatus_gen for Rust
David Mulder [Fri, 5 Jul 2024 21:00:31 +0000 (15:00 -0600)] 
Add ntstatus_gen for Rust

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd simple WAF commands for building Rust bininaries
David Mulder [Fri, 5 Jul 2024 20:23:09 +0000 (14:23 -0600)] 
Add simple WAF commands for building Rust bininaries

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoctdb-scripts: Don't set arp_filter=1 by default in 10.interface
Martin Schwenke [Tue, 15 Oct 2024 03:11:15 +0000 (14:11 +1100)] 
ctdb-scripts: Don't set arp_filter=1 by default in 10.interface

That is, no longer set sysctl net.ipv4.conf.all.arp_filter=1 in
10.interface.  Only do this in 13.per_ip_routing.

This effectively reverts commit
0ebd7beb4bcae324acf8e733500a983d22b47e9b by Ronnie Sahlberg from 2007.
I have discussed this with Ronnie.  This setting was originally added
to force incoming traffic to the interface hosting each IP.  This
would spread the load across multiple interfaces hosting the same
subnet.  Without the setting, incoming traffic would go to the first
interface to answer an ARP request, so could be unbalanced if one
interface tended to answer more quickly.

However, networks are now faster and interface bonding/teaming works
well in Linux, so it is less likely that multiple interfaces will be
used in this way.

Also, problems are occurring in exactly the case this is meant to
help: when multiple interfaces host the same subnet.

The Linux kernel documentation for this option says:

  arp_filter - BOOLEAN
        - 1 - Allows you to have multiple network interfaces on the same
          subnet, and have the ARPs for each interface be answered
          based on whether or not the kernel would route a packet from
          the ARP'd IP out that interface (therefore you must use source
          based routing for this to work). In other words it allows control
          of which cards (usually 1) will respond to an arp request.

        - 0 - (default) The kernel can respond to arp requests with addresses
          from other interfaces. This may seem wrong but it usually makes
          sense, because it increases the chance of successful communication.
          IP addresses are owned by the complete host on Linux, not by
          particular interfaces. Only for more complex setups like load-
          balancing, does this behaviour cause problems.

        arp_filter for the interface will be enabled if at least one of
        conf/{all,interface}/arp_filter is set to TRUE,
        it will be disabled otherwise

Note the part for arp_filter=1 that says "you must use source based
routing for this to work".  The problems are probably due to a lack of
source-based routing when this is only used with 10.interface.  In
this case, outbound packets can come from a different
interface (corresponding to the first matching route), with a
different MAC address.  There is clearly some infrastructure or packet
filtering out there that objects to such asymmetric packet flows.

So, drop this setting from 10.interface because it isn't working as
intended.  Continue to enable it in 13.per_ip_routing, which exists to
set up the required source-based routing.

This change may affect balancing of packet flows when public IP
addresses can be hosted by multiple interfaces, but does not stop that
feature from working.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Oct 17 18:53:32 UTC 2024 on atb-devel-224

10 months agothird_party/heimdal: Import lorikeet-heimdal-202410161454 (commit 0d61538a16b5051c820...
Stefan Metzmacher [Tue, 30 Apr 2024 16:24:33 +0000 (18:24 +0200)] 
third_party/heimdal: Import lorikeet-heimdal-202410161454 (commit 0d61538a16b5051c820702f0711102112cd01a83)

gsskrb5: let GSS_C_DCE_STYLE imply GSS_C_MUTUAL_FLAG as acceptor

Windows clients forget GSS_C_MUTUAL_FLAG in some situations where they
use GSS_C_DCE_STYLE, in the assumption that GSS_C_MUTUAL_FLAG is
implied.

Both Windows and MIT as server already imply GSS_C_MUTUAL_FLAG
when GSS_C_DCE_STYLE is used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15740
PR: https://github.com/heimdal/heimdal/pull/1266

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): Wed Oct 16 19:05:15 UTC 2024 on atb-devel-224

10 months agosmbd: fix share access check for overwrite dispostions
Ralph Boehme [Wed, 2 Oct 2024 12:09:33 +0000 (14:09 +0200)] 
smbd: fix share access check for overwrite dispostions

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

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): Mon Oct 14 12:23:04 UTC 2024 on atb-devel-224

10 months agosmbtorture: add subtests for overwrite dispositions vs sharemodes
Ralph Boehme [Wed, 2 Oct 2024 12:08:36 +0000 (14:08 +0200)] 
smbtorture: add subtests for overwrite dispositions vs sharemodes

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 months agosmbtorture: fix smb2.notify.mask test
Ralph Boehme [Wed, 2 Oct 2024 16:17:17 +0000 (18:17 +0200)] 
smbtorture: fix smb2.notify.mask test

The strange function custom_smb2_create() was somehow causing
NT_STATUS_DELETE_PENDING failures:

  failure: mask [
  (../../source4/torture/smb2/notify.c:490) Incorrect status NT_STATUS_DELETE_PENDING - should be NT_STATUS_OK
  ]

I couldn't figure out what was causing this exactly, but after doing these
cleanups the error went away.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 months agosmbtorture: prepare test_overwrite_read_only_file() for more subtests
Ralph Boehme [Wed, 2 Oct 2024 12:07:49 +0000 (14:07 +0200)] 
smbtorture: prepare test_overwrite_read_only_file() for more subtests

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 months agotests: add test for cli_get_posix_fs_info
Jule Anger [Mon, 19 Aug 2024 09:09:53 +0000 (11:09 +0200)] 
tests: add test for cli_get_posix_fs_info

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 14 08:48:07 UTC 2024 on atb-devel-224

10 months agopylibsmb: add python binding for cli_get_posix_fs_info
Jule Anger [Mon, 19 Aug 2024 09:03:47 +0000 (11:03 +0200)] 
pylibsmb: add python binding for cli_get_posix_fs_info

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agosmbd: check negotiate before the create context is handled
Jule Anger [Tue, 3 Sep 2024 12:42:03 +0000 (14:42 +0200)] 
smbd: check negotiate before the create context is handled

So far, the create context is used as it is sent by the client.
Now we first check whether posix extensions are negotiated.

Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agolibsmb: add cli_get_posix_fs_info() for smb2
Jule Anger [Tue, 3 Sep 2024 12:41:40 +0000 (14:41 +0200)] 
libsmb: add cli_get_posix_fs_info() for smb2

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agosmbd: add SMB2_FS_POSIX_INFORMATION
Ralph Boehme [Wed, 26 Jun 2024 11:11:18 +0000 (13:11 +0200)] 
smbd: add SMB2_FS_POSIX_INFORMATION

Needed as in_file_info_class type to query posix filesystem information.
Used in the subsequent commit.

Pair-Programmed-With: Jule Anger <janger@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agolibsmb: make cli_get_posix_fs_info() asynchronous
Jule Anger [Mon, 30 Sep 2024 13:48:16 +0000 (15:48 +0200)] 
libsmb: make cli_get_posix_fs_info() asynchronous

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agosmbtorture: Allow debugging output to be configured using smb.conf parameters
Pavel Filipenský [Sun, 13 Oct 2024 19:57:27 +0000 (21:57 +0200)] 
smbtorture: Allow debugging output to be configured using smb.conf parameters

It might be useful to see timestamps for some smbtorture tests.

Timestamps can be printed via 'debug syslog format=always'.
It can be specified either in smb.conf or directly via smbtorture option
-T 'OPTION=VALUE'     smb.conf option line

However, smbtorture is not evaluating the option. It needs to call
reopen_logs()->debug_set_settings() to copy
'Globals.debug_syslog_format' to 'state->settings.debug_syslog_format'

$ bin/smbtorture3 //foo/bar -U% LOCAL-G-LOCK4 -d10 -T 'debug syslog format=always'

Before:

dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473726 exited with 0
g_lock_lock_retry: watch_recv returned NT_STATUS_OK

After (see 1 sec delay):

2024-10-13T21:26:56.476859+00:00 addc.addom.samba.example.com smbtorture[2473806]: dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473807 exited with 0
2024-10-13T21:26:57.487363+00:00 addc.addom.samba.example.com smbtorture[2473806]: g_lock_lock_retry: watch_recv returned NT_STATUS_OK

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 months agodcesrv_core: better fault codes dcesrv_auth_prepare_auth3()
Stefan Metzmacher [Fri, 13 Nov 2020 01:47:51 +0000 (02:47 +0100)] 
dcesrv_core: better fault codes dcesrv_auth_prepare_auth3()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 10 15:17:46 UTC 2024 on atb-devel-224

10 months agodcesrv_core: fix the auth3 for large ntlmssp messages
Stefan Metzmacher [Fri, 13 Nov 2020 09:55:43 +0000 (10:55 +0100)] 
dcesrv_core: fix the auth3 for large ntlmssp messages

I know finding any real logic in reading the patch,
doesn't really show what's going on. I tried hard
to simplify it, but this is the only way I found
that fixed the test_auth_pad_ntlm_2889_auth3 test
without breaking other tests...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agogensec:spnego: ignore trailing bytes in SPNEGO_SERVER_START state
Stefan Metzmacher [Wed, 11 Nov 2020 16:03:29 +0000 (17:03 +0100)] 
gensec:spnego: ignore trailing bytes in SPNEGO_SERVER_START state

This matches Windows (at least Server 2012_R2).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agogensec:ntlmssp: only allow messages up to 2888 bytes
Stefan Metzmacher [Thu, 12 Nov 2020 09:00:07 +0000 (10:00 +0100)] 
gensec:ntlmssp: only allow messages up to 2888 bytes

This matches Windows (at least Server 2012_R2).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: alter_context logon failures should result in DCERPC_FAULT_ACCESS_DENIED
Stefan Metzmacher [Thu, 12 Nov 2020 15:41:21 +0000 (16:41 +0100)] 
dcesrv_core: alter_context logon failures should result in DCERPC_FAULT_ACCESS_DENIED

We should use DCERPC_FAULT_ACCESS_DENIED as default for
gensec status results of e.g. NT_STATUS_LOGON_FAILURE or
NT_STATUS_INVALID_PARAMTER.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: a failure from gensec_update results in NAK_REASON_INVALID_CHECKSUM
Stefan Metzmacher [Thu, 12 Nov 2020 15:41:05 +0000 (16:41 +0100)] 
dcesrv_core: a failure from gensec_update results in NAK_REASON_INVALID_CHECKSUM

We already report that for gensec_start_mech_by_authtype() failures,
but we also need to do that for any invalid authentication.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcerpc_util: let dcerpc_pull_auth_trailer() ignore data_and_pad for bind, alter,...
Stefan Metzmacher [Wed, 11 Nov 2020 16:07:54 +0000 (17:07 +0100)] 
dcerpc_util: let dcerpc_pull_auth_trailer() ignore data_and_pad for bind, alter, auth3

Sometimes Windows sends 3 presentation contexts (NDR32, NDR64,
BindTimeFeatureNegotiation) in the first BIND of an association.

Binding an additional connection to the association seems to
reuse the BIND buffer and just changes the num_contexts field from
3 to 2 and leaves the BindTimeFeatureNegotiation context as padding
in places.

Note, the auth_pad_length field is send as 0 in that case,
which means we need to ignore it completely, as well as any
padding before the auth header.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcerpc_util: let dcerpc_pull_auth_trailer() expose the reject reason
Stefan Metzmacher [Wed, 11 Nov 2020 16:59:45 +0000 (17:59 +0100)] 
dcerpc_util: let dcerpc_pull_auth_trailer() expose the reject reason

If dcerpc_pull_auth_trailer() returns NT_STATUS_RPC_PROTOCOL_ERROR
it will return the BIND reject code in auth->auth_context_id.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcerpc_util: let dcerpc_pull_auth_trailer() check that auth_offset is 4 bytes aligned
Stefan Metzmacher [Wed, 11 Nov 2020 16:05:21 +0000 (17:05 +0100)] 
dcerpc_util: let dcerpc_pull_auth_trailer() check that auth_offset is 4 bytes aligned

That what Windows also asserts.

It also makes sure that ndr_pull_dcerpc_auth() will
start with ndr->offset = 0 and don't tries to eat
possible padding.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: test invalid schannel binds
Stefan Metzmacher [Thu, 12 Nov 2020 10:10:46 +0000 (11:10 +0100)] 
tests/dcerpc/raw_protocol: test invalid schannel binds

Note the ad_member will keep these as expected failures,
as it doesn't provide the netlogon service,
while the knownfail for the ADDC is only temporary.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: add more tests for auth_pad alignment
Stefan Metzmacher [Thu, 12 Nov 2020 16:22:19 +0000 (17:22 +0100)] 
tests/dcerpc/raw_protocol: add more tests for auth_pad alignment

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: add tests for max auth_padding, auth_len or auth_offset
Stefan Metzmacher [Wed, 11 Nov 2020 00:19:23 +0000 (01:19 +0100)] 
tests/dcerpc/raw_protocol: add tests for max auth_padding, auth_len or auth_offset

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: fix comment in test_spnego_change_auth_type1
Stefan Metzmacher [Tue, 17 Nov 2020 16:44:51 +0000 (17:44 +0100)] 
tests/dcerpc/raw_protocol: fix comment in test_spnego_change_auth_type1

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: test_no_auth_ctx_request
Stefan Metzmacher [Tue, 17 Nov 2020 09:05:41 +0000 (10:05 +0100)] 
tests/dcerpc/raw_protocol: test_no_auth_ctx_request

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: introduce dcesrv_connection->transport_max_recv_frag
Stefan Metzmacher [Thu, 12 Nov 2020 15:38:32 +0000 (16:38 +0100)] 
dcesrv_core: introduce dcesrv_connection->transport_max_recv_frag

The max fragment size depends on the transport.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: run test_neg_xmit_ffff_ffff over tcp and smb
Stefan Metzmacher [Mon, 16 Nov 2020 14:01:49 +0000 (15:01 +0100)] 
tests/dcerpc/raw_protocol: run test_neg_xmit_ffff_ffff over tcp and smb

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: add more verbose debugging for missing association groups
Stefan Metzmacher [Mon, 16 Nov 2020 15:58:35 +0000 (16:58 +0100)] 
dcesrv_core: add more verbose debugging for missing association groups

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agoRawDCERPCTest: add some more auth_length related asserts
Stefan Metzmacher [Wed, 11 Nov 2020 15:49:25 +0000 (16:49 +0100)] 
RawDCERPCTest: add some more auth_length related asserts

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agoRawDCERPCTest: split prepare_pdu() and send_pdu_blob() out of send_pdu()
Stefan Metzmacher [Mon, 9 Nov 2020 13:00:43 +0000 (14:00 +0100)] 
RawDCERPCTest: split prepare_pdu() and send_pdu_blob() out of send_pdu()

This will make it possible to alter pdus before sending them to the
server.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos4:librpc: provide py_schannel bindings
Stefan Metzmacher [Thu, 12 Nov 2020 09:34:38 +0000 (10:34 +0100)] 
s4:librpc: provide py_schannel bindings

This will be used in the dcerpc.raw_protocol test.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcerpc_util: don't allow auth_padding for BIND, ALTER_CONTEXT and AUTH3 pdus
Stefan Metzmacher [Tue, 24 Sep 2024 07:32:24 +0000 (09:32 +0200)] 
dcerpc_util: don't allow auth_padding for BIND, ALTER_CONTEXT and AUTH3 pdus

This is how Windows 2022 (and 2025 preview) behaves...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: add more test for auth padding during ALTER_CONTEXT/AUTH3
Stefan Metzmacher [Tue, 24 Sep 2024 07:56:05 +0000 (09:56 +0200)] 
tests/dcerpc/raw_protocol: add more test for auth padding during ALTER_CONTEXT/AUTH3

The aim is to keep testing the code paths, which are no longer
testing because allow_bind_auth_pad is false now, which
means the existing tests fail directly at the BIND,
but we also want to test the error handling on
ALTER_CONTEXT (and AUTH3).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: return NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED for binds without contexts
Stefan Metzmacher [Tue, 24 Sep 2024 07:05:15 +0000 (09:05 +0200)] 
dcesrv_core: return NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED for binds without contexts

This is the error Windows 2022 (and 2025 preview) return.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agodcesrv_core: disconnect after a fault with non AUTH_LEVEL_CONNECT bind
Stefan Metzmacher [Mon, 23 Sep 2024 14:09:39 +0000 (16:09 +0200)] 
dcesrv_core: disconnect after a fault with non AUTH_LEVEL_CONNECT bind

Without an auth context using DCERPC_AUTH_LEVEL_PACKET or higher
the fault to reject requests with an invalid auth level
should trigger a disconnect after sending the fault to
the client.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos4:selftest: only run ad_member with AUTH_LEVEL_CONNECT_LSA=1
Stefan Metzmacher [Mon, 23 Sep 2024 13:13:59 +0000 (15:13 +0200)] 
s4:selftest: only run ad_member with AUTH_LEVEL_CONNECT_LSA=1

We only want to test against
'allow dcerpc auth level connect:lsarpc = yes' once
in order to have the related code tests.
We use the ad_memeber for that special test and
use the default on the tested ADDC.

This reveals some knownfails, which will be fixed in
the next commit...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agotests/dcerpc/raw_protocol: pass against Windows 2022 and require special env vars...
Stefan Metzmacher [Mon, 23 Sep 2024 13:13:59 +0000 (15:13 +0200)] 
tests/dcerpc/raw_protocol: pass against Windows 2022 and require special env vars for legacy servers

Test works against Windows 2022 and works like this:

SMB_CONF_PATH=/dev/null SERVER=172.31.9.118 \
  TARGET_HOSTNAME=w2022-118.w2022-l7.base IGNORE_RANDOM_PAD=1 \
  DOMAIN=W2022-L7 REALM=W2022-L7.BASE \
  USERNAME=administrator PASSWORD=A1b2C3d4 \
  python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND

Against a legacy Windows2012R2 server this still works:

SMB_CONF_PATH=/dev/null SERVER=172.31.9.188 \
  TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base ALLOW_BIND_AUTH_PAD=1 \
  LEGACY_BIND_NACK_NO_REASON=1 AUTH_LEVEL_CONNECT_LSA=1 \
  IGNORE_RANDOM_PAD=1 DOMAIN=W2012R2-L6 REALM=W2012R2-L6.BASE \
  USERNAME=administrator PASSWORD=A1b2C3d4 \
  python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND

Currently Samba behaves like 2012R2, but the next commits
will change that...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agoRawDCERPCTest: ignore errors in smb_pipe_socket.close()
Stefan Metzmacher [Sat, 21 Sep 2024 10:32:55 +0000 (12:32 +0200)] 
RawDCERPCTest: ignore errors in smb_pipe_socket.close()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos4:tortore/rpc: let rpc.backupkey without privacy pass against Windows 2022
Stefan Metzmacher [Wed, 25 Sep 2024 21:10:25 +0000 (23:10 +0200)] 
s4:tortore/rpc: let rpc.backupkey without privacy pass against Windows 2022

The server disconnects after the first fault.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 months agos3:smbd: avoid false positives for got_oplock and have_other_lease in delay_for_oplock_fn
Stefan Metzmacher [Fri, 30 Aug 2024 12:16:12 +0000 (14:16 +0200)] 
s3:smbd: avoid false positives for got_oplock and have_other_lease in delay_for_oplock_fn

stat opens should not cause a oplock/lease downgrade if
they don't have a lease attached to itself.

Note that opens broken to NONE still count if they are
non-stat opens...

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

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 Oct 10 13:59:18 UTC 2024 on atb-devel-224

10 months agos3:smbd: allow reset_share_mode_entry() to handle more than one durable handle
Stefan Metzmacher [Thu, 29 Aug 2024 16:43:14 +0000 (18:43 +0200)] 
s3:smbd: allow reset_share_mode_entry() to handle more than one durable handle

This means that multiple durable handles with RH leases can
co-exist now... Before only the last remaining durable handle
was able to pass the SMB_VFS_DURABLE_DISCONNECT() step.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos3:smbd: let durable_reconnect_fn already check for a disconnected handle with the...
Stefan Metzmacher [Thu, 29 Aug 2024 18:20:23 +0000 (20:20 +0200)] 
s3:smbd: let durable_reconnect_fn already check for a disconnected handle with the correct file_id

We'll soon allow more than one disconnected durable handle, so
we need to find the correct one instead of assuming only a single
one.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: add smb2.durable-v2-open.{keep,purge}-disconnected-* tests
Stefan Metzmacher [Wed, 4 Sep 2024 16:18:43 +0000 (18:18 +0200)] 
s4:torture/smb2: add smb2.durable-v2-open.{keep,purge}-disconnected-* tests

These demonstrate which durables handles are kept and which are purged
because of various opens, writes or renames.

smb2.durable-v2-open.keep-disconnected-rh-with-stat-open
smb2.durable-v2-open.keep-disconnected-rh-with-rh-open
smb2.durable-v2-open.keep-disconnected-rh-with-rwh-open
smb2.durable-v2-open.keep-disconnected-rwh-with-stat-open

smb2.durable-v2-open.purge-disconnected-rwh-with-rwh-open
smb2.durable-v2-open.purge-disconnected-rwh-with-rh-open
smb2.durable-v2-open.purge-disconnected-rh-with-share-none-open
smb2.durable-v2-open.purge-disconnected-rh-with-write
smb2.durable-v2-open.purge-disconnected-rh-with-rename

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15649
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15651
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15708

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: add smb2.durable-v2-open.{[non]stat[RH]-and,two-same,two-different...
Stefan Metzmacher [Wed, 28 Aug 2024 14:48:27 +0000 (16:48 +0200)] 
s4:torture/smb2: add smb2.durable-v2-open.{[non]stat[RH]-and,two-same,two-different}-lease

These show that it's possible to have durable handles in addition
of stat opens, as well as multiple durable opens with RH leases.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos3:smbd: only store durable handles with byte range locks when having WRITE lease
Stefan Metzmacher [Fri, 30 Aug 2024 16:10:16 +0000 (18:10 +0200)] 
s3:smbd: only store durable handles with byte range locks when having WRITE lease

This simplifies the reconnect assumptions, when we want to allow
more than one durable handle on a file for multiple clients with
READ+HANDLE leases.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: add smb2.durable-v2-open.lock-{oplock,lease,noW-lease}
Stefan Metzmacher [Fri, 30 Aug 2024 15:38:02 +0000 (17:38 +0200)] 
s4:torture/smb2: add smb2.durable-v2-open.lock-{oplock,lease,noW-lease}

This demonstrates that a W lease is required for a
durable handle to be durable when it has byte range locks.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: add smb2.durable-open.lock-noW-lease
Stefan Metzmacher [Fri, 30 Aug 2024 15:38:02 +0000 (17:38 +0200)] 
s4:torture/smb2: add smb2.durable-open.lock-noW-lease

This demonstrates that a W lease is required for a
durable handle to be durable when it has byte range locks.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: improve error handling in durable_v2_open.c
Stefan Metzmacher [Fri, 30 Aug 2024 12:22:24 +0000 (14:22 +0200)] 
s4:torture/smb2: improve error handling in durable_v2_open.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agos4:torture/smb2: improve error handling in durable_open.c
Stefan Metzmacher [Fri, 30 Aug 2024 12:22:24 +0000 (14:22 +0200)] 
s4:torture/smb2: improve error handling in durable_open.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
10 months agoctdb-build: Add missing ctdb-tcp dependency
Anoop C S [Tue, 8 Oct 2024 06:50:45 +0000 (12:20 +0530)] 
ctdb-build: Add missing ctdb-tcp dependency

Since 02c9e7a63f00998bb0dae2e8c6bd8e020e9408da, common/path.h is
included within ctdb/tcp/tcp_connect.c. Therefore add ctdb-util
as a dependency for ctdb-tcp.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Oct  8 12:27:17 UTC 2024 on atb-devel-224

10 months agoctdb-server: Use find_public_ip_vnn() in a couple of extra places
Martin Schwenke [Thu, 29 Aug 2024 08:38:58 +0000 (18:38 +1000)] 
ctdb-server: Use find_public_ip_vnn() in a couple of extra places

Reorder code to use early returns, modernise debug.

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Oct  8 06:42:04 UTC 2024 on atb-devel-224

10 months agoctdb-server: Clean up find_public_ip_vnn()
Martin Schwenke [Thu, 29 Aug 2024 08:27:54 +0000 (18:27 +1000)] 
ctdb-server: Clean up find_public_ip_vnn()

Fix the comment (NULL versus -1), apply some README.Coding.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Ensure CTDB_BASE is set, don't fetch it
Martin Schwenke [Fri, 9 Aug 2024 00:53:46 +0000 (10:53 +1000)] 
ctdb-daemon: Ensure CTDB_BASE is set, don't fetch it

Uses of CTDB_BASE in the subsequent code are now handled by the path
module, so there is no point getting the value of CTDB_BASE.  Instead,
check that the attempt to set it worked, noting that:

  [...] if overwrite is zero, then the value of name is not
  changed (and setenv() returns a success status).

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Use path_etcdir_append() to construct some paths
Martin Schwenke [Tue, 6 Aug 2024 03:49:01 +0000 (13:49 +1000)] 
ctdb-daemon: Use path_etcdir_append() to construct some paths

No need to use CTDB_BASE directly.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Replace remaining uses of CTDB_NO_MEMORY() in this file
Martin Schwenke [Fri, 26 Jul 2024 01:38:07 +0000 (11:38 +1000)] 
ctdb-daemon: Replace remaining uses of CTDB_NO_MEMORY() in this file

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Clean up error handling and debug
Martin Schwenke [Fri, 26 Jul 2024 01:29:43 +0000 (11:29 +1000)] 
ctdb-daemon: Clean up error handling and debug

Add some missing error handling and error messages.

Remove a use of CTDB_NO_MEMORY(), which then renders the caller's use
of ctdb_errstr() pointless, so remove that too.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Use ctdb_vnn_address_string() in old-style debugging
Martin Schwenke [Thu, 25 Jul 2024 04:50:32 +0000 (14:50 +1000)] 
ctdb-daemon: Use ctdb_vnn_address_string() in old-style debugging

Modernise the debug macros along the way.

These are done separately because they will require a little more
patience to review.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Add ctdb_vnn_address_string() and use in trivial places
Martin Schwenke [Thu, 25 Jul 2024 04:47:06 +0000 (14:47 +1000)] 
ctdb-daemon: Add ctdb_vnn_address_string() and use in trivial places

Define a static function to return the string.  This clearly doesn't
need a ctdb_ prefix, but it matches ctdb_vnn_iface_string(), so
doesn't look out of place.

Use it in the places where review is trivial.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
10 months agoctdb-daemon: Store public address string in VNN
Martin Schwenke [Thu, 25 Jul 2024 04:40:18 +0000 (14:40 +1000)] 
ctdb-daemon: Store public address string in VNN

These are currently converted to strings constantly in log messages
and other places.  This clutters the code and probably has a minor
performance impact.

Add a new string field to the VNN structure.  Populate it when a
public address is added and the VNN structure is allocated.  This is
consistent with how node addresses are handled.

Don't use it yet, or this commit becomes huge.

A short-term goal is that each VNN public address will be converted to
a string only once.  A longer-term goal is to reduce use of
ctdb_addr_to_str().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>