]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
12 months agoctdb-tests: Argument 3 to nfs_iterate_test() is up iteration
Martin Schwenke [Thu, 4 Jul 2024 00:44:18 +0000 (10:44 +1000)] 
ctdb-tests: Argument 3 to nfs_iterate_test() is up iteration

Nothing more complex is ever done, so we might as well simplify and
reduce coupling.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
12 months agoctdb-tests: nfs_iterate_test() marks RPC service down
Martin Schwenke [Thu, 4 Jul 2024 00:55:07 +0000 (10:55 +1000)] 
ctdb-tests: nfs_iterate_test() marks RPC service down

If an RPC service is given, it is automatically marked down.  This
avoids repetition in test cases and loosens coupling.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
12 months agoctdb-tcp: Remove a use of ctdb_addr_to_str()
Martin Schwenke [Sun, 18 Aug 2024 22:48:43 +0000 (08:48 +1000)] 
ctdb-tcp: Remove a use of ctdb_addr_to_str()

This one is in a rarely used error path, so call a function that
talloc()s the string instead.

Again, this will also print the port, which might be useful if we ever
add the ability to also specify ports in the nodes list.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Aug 20 14:24:14 UTC 2024 on atb-devel-224

12 months agoctdb-tcp: Consolidate failure code
Martin Schwenke [Sun, 18 Aug 2024 22:45:43 +0000 (08:45 +1000)] 
ctdb-tcp: Consolidate failure code

Same thing several times, so change to common failure code.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-tcp: Use already constructed node name
Martin Schwenke [Sun, 18 Aug 2024 10:49:30 +0000 (20:49 +1000)] 
ctdb-tcp: Use already constructed node name

Node has been found, so use the pre-constructed name instead of
calling ctdb_addr_to_str().

This will also print the port, which might be useful if we ever add
the ability to also specify ports in the nodes list.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-tcp: Use path_rundir_append() to construct lock_path
Martin Schwenke [Fri, 9 Aug 2024 01:20:06 +0000 (11:20 +1000)] 
ctdb-tcp: Use path_rundir_append() to construct lock_path

The current constant value doesn't respect CTDB_TEST_MODE/CTDB_BASE.
Instead use the path module to allow automatic listening in test mode
with local daemons.

A single node can be tested with local daemons, using something like:

  $ tests/local_daemons.sh foo setup -n 1 -C "node address"
  $ grep "node address" foo/node.0/ctdb.conf
      # node address = 127.0.0.1
  $ tests/local_daemons.sh foo start all
  $ tests/local_daemons.sh foo print-log 0 | grep -i chose
  ... node.0 ctdbd[24546]: ctdb chose network address 127.0.0.1:4379

The trick is that commenting out the node address in ctdb.conf means
the chosen node address is the first one from the nodes file that
allows bind/listen.  In this case it is the only line.

The following ensures that automatic listening works for a node that
isn't the first:

  $ cat >mynodes
  192.168.1.1
  127.0.0.1
  $ tests/local_daemons.sh foo setup -n 2 -N mynodes -C "node address"
  $ grep "node address" foo/node.1/ctdb.conf
      # node address = 127.0.0.1
  $ tests/local_daemons.sh foo start 1
  $ tests/local_daemons.sh foo print-log 1 | grep -i chose
  [...] node.1 ctdbd[22787]: ctdb chose network address 127.0.0.1:4379

Note that the first address isn't local on this host, so will always
fail.

So, doing the above and starting both nodes yields...

  ...
  $ tests/local_daemons.sh foo start 1
  $ sleep 3; tests/local_daemons.sh foo start 0
  $ tests/local_daemons.sh foo print-log all | grep -i 'chose\|bind'
  [...] node.1 ctdbd[26351]: ctdb chose network address 127.0.0.1:4379
  [...] node.0 ctdbd[26438]: ctdb_tcp_listen_addr: Failed to bind() to socket - Address already in use (98)
  [...] node.0 ctdbd[26438]: Unable to bind to any node address - giving up

... as expected.

It would be nice to add tests for this, but we don't really have
infrastructure for that.  At least manual testing shows, for the
obvious cases, the previous commits didn't break anything.  :-)

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-ib: Remove a use of ctdb_set_error()
Martin Schwenke [Fri, 26 Jul 2024 00:45:36 +0000 (10:45 +1000)] 
ctdb-ib: Remove a use of ctdb_set_error()

Now the transport code is free of ctdb_set_error().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-tcp: Factor out listening code to avoid repetition
Martin Schwenke [Fri, 5 Jul 2024 05:51:25 +0000 (15:51 +1000)] 
ctdb-tcp: Factor out listening code to avoid repetition

Modernise debug and comments while here.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-tcp: Use talloc_strdup() instead of repeating logic
Martin Schwenke [Fri, 5 Jul 2024 05:52:51 +0000 (15:52 +1000)] 
ctdb-tcp: Use talloc_strdup() instead of repeating logic

The node name is already constructed when the nodes file is loaded, so
just copy the node name.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agoctdb-daemon: Remove a use of ctdb_errstr()
Martin Schwenke [Fri, 26 Jul 2024 00:49:16 +0000 (10:49 +1000)] 
ctdb-daemon: Remove a use of ctdb_errstr()

Code to setup the transport is about to be cleaned up, including
removing uses of ctdb_set_error(), so avoid logging a NULL pointer or
some other old error.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agolibsmb: Remove cli_state->raw_status
Volker Lendecke [Mon, 19 Aug 2024 09:36:02 +0000 (11:36 +0200)] 
libsmb: Remove cli_state->raw_status

All callers which looked at this are gone

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Aug 20 10:57:12 UTC 2024 on atb-devel-224

12 months agolibsmb: Remove unused cli_is_error()
Volker Lendecke [Mon, 19 Aug 2024 09:25:52 +0000 (11:25 +0200)] 
libsmb: Remove unused cli_is_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove a call to cli_is_error()
Volker Lendecke [Mon, 19 Aug 2024 09:24:24 +0000 (11:24 +0200)] 
libsmb: Remove a call to cli_is_error()

We are already in the !NT_STATUS_IS_OK if-branch, so this call was
redundant

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove unused cli_errno()
Volker Lendecke [Mon, 19 Aug 2024 07:30:42 +0000 (09:30 +0200)] 
libsmb: Remove unused cli_errno()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Don't set errno in cli_NetServerEnum()
Volker Lendecke [Mon, 19 Aug 2024 07:28:45 +0000 (09:28 +0200)] 
libsmb: Don't set errno in cli_NetServerEnum()

No caller looks at it, and if someone should ever want to return a
more informative error, we now have NTSTATUS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_NetServerEnum() to return NTSTATUS
Volker Lendecke [Mon, 19 Aug 2024 07:26:51 +0000 (09:26 +0200)] 
libsmb: Convert cli_NetServerEnum() to return NTSTATUS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove a reference to cli_errno()
Volker Lendecke [Mon, 19 Aug 2024 07:10:03 +0000 (09:10 +0200)] 
libsmb: Remove a reference to cli_errno()

If I see it correctly, this case was already covered by checking the
return code of cli_trans() a few lines above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove unused cli_nt_error()
Volker Lendecke [Sun, 18 Aug 2024 19:47:01 +0000 (21:47 +0200)] 
libsmb: Remove unused cli_nt_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Make cli_api() static to clirap2.c
Volker Lendecke [Sun, 18 Aug 2024 19:45:58 +0000 (21:45 +0200)] 
libsmb: Make cli_api() static to clirap2.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agotorture3: Convert run_randomipc() away from cli_api()
Volker Lendecke [Sun, 18 Aug 2024 19:40:29 +0000 (21:40 +0200)] 
torture3: Convert run_randomipc() away from cli_api()

Not that it matters much, but I want to make cli_api() static in
clirap2.c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_NetServerEnum() away from cli_api()
Volker Lendecke [Sun, 18 Aug 2024 19:30:24 +0000 (21:30 +0200)] 
libsmb: Convert cli_NetServerEnum() away from cli_api()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_RNetShareEnum() to NTSTATUS
Volker Lendecke [Sun, 18 Aug 2024 18:48:48 +0000 (20:48 +0200)] 
libsmb: Convert cli_RNetShareEnum() to NTSTATUS

Avoid a call to cli_nt_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_RNetShareEnum() away from cli_api()
Volker Lendecke [Sun, 18 Aug 2024 18:36:45 +0000 (20:36 +0200)] 
libsmb: Convert cli_RNetShareEnum() away from cli_api()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Reduce indentation in cli_RNetShareEnum()
Volker Lendecke [Sun, 18 Aug 2024 18:19:56 +0000 (20:19 +0200)] 
libsmb: Reduce indentation in cli_RNetShareEnum()

Use a "goto done", review with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_oem_change_password() to NTSTATUS
Volker Lendecke [Sun, 18 Aug 2024 10:55:34 +0000 (12:55 +0200)] 
libsmb: Convert cli_oem_change_password() to NTSTATUS

Remove a few calls to cli_nt_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Simplify smb1cli_trans_recv()
Volker Lendecke [Sun, 18 Aug 2024 09:29:46 +0000 (11:29 +0200)] 
libsmb: Simplify smb1cli_trans_recv()

tevent_req_received() called below takes care of this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove a pointless variable
Volker Lendecke [Sun, 18 Aug 2024 09:22:13 +0000 (11:22 +0200)] 
libsmb: Remove a pointless variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agoutils: Fix "net rap password" return code
Volker Lendecke [Sun, 18 Aug 2024 10:40:29 +0000 (12:40 +0200)] 
utils: Fix "net rap password" return code

cli_oem_change_password() returns a bool, net_rap_password must return
0 for success

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Fix cli_oem_change_password()
Volker Lendecke [Sun, 18 Aug 2024 10:37:13 +0000 (12:37 +0200)] 
libsmb: Fix cli_oem_change_password()

"(rdrcnt < 2)" was wrong, we don't look at rdata but at rparam. Use
"min_rparam" to cli_trans and the fact that if that succeeds "rparam"
is not NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Convert cli_oem_change_password() away from cli_api()
Volker Lendecke [Sun, 18 Aug 2024 07:37:13 +0000 (09:37 +0200)] 
libsmb: Convert cli_oem_change_password() away from cli_api()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agosamr: Avoid a "ret == false" for a bool
Volker Lendecke [Sun, 18 Aug 2024 10:07:51 +0000 (12:07 +0200)] 
samr: Avoid a "ret == false" for a bool

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agobuild: Fix LIBCLI_SAMR dependencies
Volker Lendecke [Tue, 6 Aug 2024 07:05:15 +0000 (09:05 +0200)] 
build: Fix LIBCLI_SAMR dependencies

cli_samr.c calls init_Lsa_String

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Remove a pointless variable assignment
Volker Lendecke [Mon, 5 Aug 2024 15:31:15 +0000 (17:31 +0200)] 
libsmb: Remove a pointless variable assignment

We right away overwrite this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Avoid an "else", we return in the "true" branch
Volker Lendecke [Mon, 5 Aug 2024 15:29:46 +0000 (17:29 +0200)] 
libsmb: Avoid an "else", we return in the "true" branch

Reduce indentation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Swap if/else branches in remote_password_change
Volker Lendecke [Mon, 5 Aug 2024 15:28:02 +0000 (17:28 +0200)] 
libsmb: Swap if/else branches in remote_password_change

bail out with an early return next

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Avoid an "else", we return in the "true" branch.
Volker Lendecke [Mon, 5 Aug 2024 15:22:02 +0000 (17:22 +0200)] 
libsmb: Avoid an "else", we return in the "true" branch.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Modernize two DEBUGs
Volker Lendecke [Mon, 5 Aug 2024 15:11:43 +0000 (17:11 +0200)] 
libsmb: Modernize two DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agolibsmb: Make cli_qpathinfo_standard() static
Volker Lendecke [Mon, 5 Aug 2024 13:10:00 +0000 (15:10 +0200)] 
libsmb: Make cli_qpathinfo_standard() static

Only used to get the size as a fallback

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agosmbd: add options "fs:[logical|aligned|performance|effective aligned] bytes per sector"
Ralph Boehme [Fri, 5 Apr 2024 13:25:03 +0000 (15:25 +0200)] 
smbd: add options "fs:[logical|aligned|performance|effective aligned] bytes per sector"

In order to support certain Windows applications that make use of copy reflink,
we need some way to allow configuring these values. According to testing, the
application somehow uses the value of phys_bytes_per_sector_atomic for some check
when requesting server-side reflink copies, eg for ZFS the following is needed

 block size = 131072
 fs:aligned bytes per sector = 131072

For some reason "block size" must also be set to the value of fs:aligned bytes
per sector, but fs:logical bytes per sector, which according to the spec should
match "block size", must stay at the default of 512, otherwise the application
does not work.

As the whole client behaviour could not be fully understood, I'm proposing to
introduce these options as undocumented parametric options, so we can at least
start testing with them.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug 20 07:01:19 UTC 2024 on atb-devel-224

12 months agovfs_default: implement FSCTL_DUP_EXTENTS_TO_FILE with copy_reflink()
Ralph Boehme [Sun, 24 Mar 2024 16:40:50 +0000 (17:40 +0100)] 
vfs_default: implement FSCTL_DUP_EXTENTS_TO_FILE with copy_reflink()

According to MS-FSA 2.1.5.9.4 FSCTL_DUPLICATE_EXTENTS_TO_FILE ReFS on Windows
does not check for byte range lock conflicts:

 * The object store SHOULD<81> check for byte range lock conflicts ...

 * <81>: The ReFS file system in Windows Server 2016 and later does not check
 for byte range lock conflicts

To match Windows behaviour we also don't check for conflicts.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
12 months agolibreplace: add rep_copy_reflink()
Ralph Boehme [Sun, 24 Mar 2024 16:02:21 +0000 (17:02 +0100)] 
libreplace: add rep_copy_reflink()

FICLONERANGE was introduced in kernel version 4.5, so I guess we can just assume
it is present if HAVE_LINUX_IOCTL is defined.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
12 months agosmbd: consolidate fs capabilities code in vfswrap_fs_capabilities()
Ralph Boehme [Thu, 6 Jun 2024 13:38:16 +0000 (15:38 +0200)] 
smbd: consolidate fs capabilities code in vfswrap_fs_capabilities()

This ensures the values we return via SMB_FS_ATTRIBUTE_INFORMATION is the same
we use internally via conn->fs_capabilities.

This deliberately preserves existing behaviour as much as possible and leaves
possible improvements as a future excercize. Particularily FILE_VOLUME_QUOTAS is
already set insided SMB_VFS_STATVFS() depending on backend filesystem flags
which is probably the correct way to do it instead of just setting the
capability when Samba was built with quota support.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
12 months agodocs: document SUPPORTS_BLOCK_REFCOUNTING for share:fake_fscaps
Ralph Boehme [Wed, 5 Jun 2024 12:40:15 +0000 (14:40 +0200)] 
docs: document SUPPORTS_BLOCK_REFCOUNTING for share:fake_fscaps

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
12 months agos3:libads: Do not print error message for a default configuration
Pavel Filipenský [Fri, 16 Aug 2024 14:37:32 +0000 (16:37 +0200)] 
s3:libads: Do not print error message for a default configuration

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Mon Aug 19 13:21:08 UTC 2024 on atb-devel-224

12 months agokdc: warn if DES-only keys enforced on the account
Alexander Bokovoy [Fri, 16 Aug 2024 08:24:12 +0000 (11:24 +0300)] 
kdc: warn if DES-only keys enforced on the account

With MIT Kerberos 1.21+ DES is not available by default and will be
refused. This means userAccountFlags with UF_DES_KEYS_ONLY will result
in a likely authentication falure (unless allow_des=true is set in
krb5.conf).

Warn about such cases to give admins yet another chance to detect an
error in setting userAccountFlags.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Sat Aug 17 11:59:01 UTC 2024 on atb-devel-224

12 months agodocs-xml: Fix script location in syncmachinepasswordscript.xml
Anoop C S [Wed, 14 Aug 2024 14:19:04 +0000 (19:49 +0530)] 
docs-xml: Fix script location in syncmachinepasswordscript.xml

Update the change in installation path for winbind_ctdb_updatekeytab.sh
from SAMBA_DATADIR to newly defined CTDB_DATADIR.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Aug 16 09:49:30 UTC 2024 on atb-devel-224

12 months agosource3/script: Fix installation of winbind_ctdb_updatekeytab.sh
Anoop C S [Wed, 14 Aug 2024 14:17:35 +0000 (19:47 +0530)] 
source3/script: Fix installation of winbind_ctdb_updatekeytab.sh

winbind_ctdb_updatekeytab.sh assumes the presence `onnode` utility to
execute `net ads` command on all nodes in the cluster. But `onnode`
is only built when configured with clustering support. Therefore perform
the script installation only with ctdb configuration. Also fix the
installation path to /usr/share/ctdb/scripts.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15689
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
12 months agos3:smb2_server: return NT_STATUS_NETWORK_SESSION_EXPIRED for compound requests
Stefan Metzmacher [Tue, 13 Aug 2024 12:07:06 +0000 (14:07 +0200)] 
s3:smb2_server: return NT_STATUS_NETWORK_SESSION_EXPIRED for compound requests

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 22:29:28 UTC 2024 on atb-devel-224

12 months agos4:torture/smb2: let smb2.session.expire2* also check compound requests
Stefan Metzmacher [Tue, 13 Aug 2024 10:47:59 +0000 (12:47 +0200)] 
s4:torture/smb2: let smb2.session.expire2* also check compound requests

This shows that all compound related requests should get
NT_STATUS_NETWORK_SESSION_EXPIRED.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agodocs:smbdotconf: Update 'kerberos method' with 'sync machine password to keytab'
Pavel Filipenský [Mon, 12 Aug 2024 09:49:14 +0000 (11:49 +0200)] 
docs:smbdotconf: Update 'kerberos method' with 'sync machine password to keytab'

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 13 15:27:26 UTC 2024 on atb-devel-224

12 months agodocs:smbdotconf: Improve documentation for 'sync machine password to keytab'
Pavel Filipenský [Mon, 12 Aug 2024 09:49:14 +0000 (11:49 +0200)] 
docs:smbdotconf: Improve documentation for 'sync machine password to keytab'

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agodocs:smbdotconf: Improve documentation for 'sync machine password script'
Pavel Filipenský [Mon, 12 Aug 2024 09:49:14 +0000 (11:49 +0200)] 
docs:smbdotconf: Improve documentation for 'sync machine password script'

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
12 months agos3:script: Install winbind_ctdb_updatekeytab.sh
Pavel Filipenský [Mon, 12 Aug 2024 08:44:19 +0000 (10:44 +0200)] 
s3:script: Install winbind_ctdb_updatekeytab.sh

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3:script: Rename updatekeytab.sh ==> winbind_ctdb_updatekeytab.sh
Pavel Filipenský [Mon, 12 Aug 2024 09:49:35 +0000 (11:49 +0200)] 
s3:script: Rename updatekeytab.sh ==> winbind_ctdb_updatekeytab.sh

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agodocs: Add examples to net.8 that use 'sync machine password to keytab'
Pavel Filipenský [Tue, 6 Aug 2024 21:31:21 +0000 (23:31 +0200)] 
docs: Add examples to net.8 that use 'sync machine password to keytab'

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
12 months agoRevert "docs-xml: Delete descriptions for removed commands "net ads keytab add" and...
Pavel Filipenský [Tue, 6 Aug 2024 21:22:42 +0000 (23:22 +0200)] 
Revert "docs-xml: Delete descriptions for removed commands "net ads keytab add" and "net ads keytab add_update_ads""

This reverts commit a5f47f6efe67e02d7a12f30b4e6fb76bcd6aa71c.

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agodocs-xml/manpages: 'ceph_new' prefix for config-param of vfs_ceph_new
Shachar Sharon [Mon, 5 Aug 2024 16:12:29 +0000 (19:12 +0300)] 
docs-xml/manpages: 'ceph_new' prefix for config-param of vfs_ceph_new

With 'ceph_new' prefix used by vfs_ceph_new for config parameters,
update the relevant man-page accordingly.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Aug  8 13:54:34 UTC 2024 on atb-devel-224

12 months agovfs_ceph_new: use 'ceph_new' for config-param prefix
Shachar Sharon [Mon, 5 Aug 2024 13:21:10 +0000 (16:21 +0300)] 
vfs_ceph_new: use 'ceph_new' for config-param prefix

Use explicit 'ceph_new' prefix to each of the ceph specific config
parameters to avoid confusion with legacy 'vfs_ceph' module. Hence,
users will have in their smb.conf a format similar to:

...
[smbshare]
        vfs objects = ceph_new
        ceph_new: config_file = /etc/ceph/ceph.conf
        ceph_new: user_id = user1
        ceph_new: filesystem = fs1
        ...

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
12 months agovfs_ceph_new: handle errno properly for 'readdir'
Shachar Sharon [Tue, 30 Jul 2024 14:36:09 +0000 (17:36 +0300)] 
vfs_ceph_new: handle errno properly for 'readdir'

Take special care for readdir errno setting: in case of error, update
errno by libcephfs (and protect from possible over-write by debug
logging); in the case of successful result or end-of-stream restore
errno to its previous value before calling the readdir_fn VFS hook.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Aug  7 14:20:02 UTC 2024 on atb-devel-224

12 months agovfs_ceph{_new}: do not set errno upon successful call to libcephfs
Shachar Sharon [Tue, 30 Jul 2024 06:55:44 +0000 (09:55 +0300)] 
vfs_ceph{_new}: do not set errno upon successful call to libcephfs

There is code in Samba that expects errno from a previous system call
to be preserved through a subsequent system call. Thus, avoid setting
"errno = 0" in status_code() and lstatus_code() upon successful return
from libcephfs API call.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
12 months agoscript/autobuild.py: do some basic testing using --without-winbind
Stefan Metzmacher [Tue, 6 Aug 2024 15:45:37 +0000 (17:45 +0200)] 
script/autobuild.py: do some basic testing using --without-winbind

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Aug  7 07:38:35 UTC 2024 on atb-devel-224

12 months agos3:lib: add winbind_lookup_name_ex() fallback for --without-winbind
Stefan Metzmacher [Tue, 6 Aug 2024 15:20:38 +0000 (17:20 +0200)] 
s3:lib: add winbind_lookup_name_ex() fallback for --without-winbind

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agosmbd: Assert we have an fsp in smbd_do_setfilepathinfo
Volker Lendecke [Mon, 22 Jul 2024 09:59:40 +0000 (11:59 +0200)] 
smbd: Assert we have an fsp in smbd_do_setfilepathinfo

With this in the future we can avoid some special cases in our callees

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug  6 17:37:39 UTC 2024 on atb-devel-224

12 months agosmbd: filename_convert_dirfsp always gives an fsp
Volker Lendecke [Mon, 22 Jul 2024 08:42:11 +0000 (10:42 +0200)] 
smbd: filename_convert_dirfsp always gives an fsp

We're in setpathinfo, so if there's without an fsp it's
OBJECT_NAME_NOT_FOUND, the last component is missing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Simplify check_user_ok()
Volker Lendecke [Mon, 29 Jul 2024 11:24:30 +0000 (04:24 -0700)] 
smbd: Simplify check_user_ok()

Don't walk the cache at all if we get UID_FIELD_INVALID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Make parent_override_delete a bit more readable
Volker Lendecke [Mon, 22 Jul 2024 18:56:25 +0000 (20:56 +0200)] 
smbd: Make parent_override_delete a bit more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Remove some dead code
Volker Lendecke [Wed, 24 Jul 2024 07:58:47 +0000 (09:58 +0200)] 
smbd: Remove some dead code

We have returned from this function if fsp==NULL above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Fix some DBGs
Volker Lendecke [Wed, 24 Jul 2024 08:00:22 +0000 (10:00 +0200)] 
smbd: Fix some DBGs

DBG_DEBUG already has the function name prefix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Modernize a DEBUG
Volker Lendecke [Wed, 24 Jul 2024 08:00:44 +0000 (10:00 +0200)] 
smbd: Modernize a DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Fix a comment and an error message
Volker Lendecke [Mon, 22 Jul 2024 17:53:40 +0000 (19:53 +0200)] 
smbd: Fix a comment and an error message

Tested manually, but OBJECT_NAME_NOT_FOUND makes much more sense given
the new semantics of filename_convert_dirfsp.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Save a few lines with a "goto done;"
Volker Lendecke [Mon, 22 Jul 2024 08:41:47 +0000 (10:41 +0200)] 
smbd: Save a few lines with a "goto done;"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolib: Fix a typo
Volker Lendecke [Mon, 29 Jul 2024 10:39:32 +0000 (03:39 -0700)] 
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agovfs: Fix a DBG message
Volker Lendecke [Mon, 29 Jul 2024 10:39:32 +0000 (03:39 -0700)] 
vfs: Fix a DBG message

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbclient: Modernize a d_printf
Volker Lendecke [Sun, 21 Jul 2024 10:38:25 +0000 (12:38 +0200)] 
smbclient: Modernize a d_printf

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolib: Fix whitespace
Volker Lendecke [Wed, 17 Jul 2024 08:23:26 +0000 (10:23 +0200)] 
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agotsocket: Use iov_buflen
Volker Lendecke [Fri, 12 Jul 2024 15:58:58 +0000 (17:58 +0200)] 
tsocket: Use iov_buflen

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agotsocket: Use iov_buflen
Volker Lendecke [Fri, 12 Jul 2024 15:52:32 +0000 (17:52 +0200)] 
tsocket: Use iov_buflen

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: Modernize DEBUGs
Volker Lendecke [Sun, 7 Jul 2024 18:09:46 +0000 (20:09 +0200)] 
smbd: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Remove cli_posix_chmod
Volker Lendecke [Fri, 2 Aug 2024 21:09:07 +0000 (23:09 +0200)] 
libsmb: Remove cli_posix_chmod

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agotorture3: Use cli_chmod instead of cli_posix_chmod
Volker Lendecke [Fri, 2 Aug 2024 21:06:17 +0000 (23:06 +0200)] 
torture3: Use cli_chmod instead of cli_posix_chmod

Show that it works the same even for dangling posix symlinks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbclient: Use cli_chmod instead of cli_posix_chmod
Volker Lendecke [Fri, 2 Aug 2024 11:06:58 +0000 (13:06 +0200)] 
smbclient: Use cli_chmod instead of cli_posix_chmod

Skip the smb1-only SERVER_HAS_UNIX_CIFS(), chmod now also does SMB2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Add cli_fchmod for smb311 posix extensions
Volker Lendecke [Fri, 2 Aug 2024 10:53:05 +0000 (12:53 +0200)] 
libsmb: Add cli_fchmod for smb311 posix extensions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Add cli_chmod
Volker Lendecke [Fri, 26 Jul 2024 15:27:30 +0000 (17:27 +0200)] 
libsmb: Add cli_chmod

Go via create/fchmod/close. Only fchmod has to be smb2-specific this way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Add cli_fchmod
Volker Lendecke [Sat, 27 Jul 2024 13:43:55 +0000 (15:43 +0200)] 
libsmb: Add cli_fchmod

Do a posix-level fchmod on a fnum. This will be used for smb2 soon as
well which does not have setpathinfo.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Add cli_smb2_fnum_is_posix
Volker Lendecke [Fri, 2 Aug 2024 09:18:40 +0000 (11:18 +0200)] 
libsmb: Add cli_smb2_fnum_is_posix

Will be used in smb311 unix chmod soon: We should only do the special
setsd on real posix handles. Otherwise we would probably destroy a
valid acl.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agolibsmb: Slightly restructure map_smb2_handle_to_fnum
Volker Lendecke [Fri, 2 Aug 2024 09:04:31 +0000 (11:04 +0200)] 
libsmb: Slightly restructure map_smb2_handle_to_fnum

Pass the persistent/volatile handle as uint64's. Why? I found the
talloc_memdup() slightly misleading, and smbXcli handles those 2 id's
separately. map_smb2_handle_to_fnum() is the function to create the
smb2_hnd.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agosmbd: protect check_smb2_posix_chmod_ace against invalid trustees
Volker Lendecke [Fri, 2 Aug 2024 11:06:28 +0000 (13:06 +0200)] 
smbd: protect check_smb2_posix_chmod_ace against invalid trustees

Found because I got this wrong in new code coming soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 months agotdb: version 1.4.12 tdb-1.4.12
Stefan Metzmacher [Tue, 6 Aug 2024 13:11:36 +0000 (15:11 +0200)] 
tdb: version 1.4.12

* Regression fix for ABI problem
  TDB_1_4_11 vs. TDB_1.4.11

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug  6 16:16:27 UTC 2024 on atb-devel-224

12 months agoautobuild: Add ABI checks for libtalloc, libtevent and libtdb
Andreas Schneider [Tue, 6 Aug 2024 12:43:29 +0000 (14:43 +0200)] 
autobuild: Add ABI checks for libtalloc, libtevent and libtdb

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

Signed-off-by: Andreas Schneider <asn@samba.org>
12 months agoctdb-doc: document nodes list configuration parameter
John Mulligan [Fri, 2 Aug 2024 17:58:59 +0000 (13:58 -0400)] 
ctdb-doc: document nodes list configuration parameter

Add the initial documentation of the node list configuration parameter.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Aug  6 01:50:12 UTC 2024 on atb-devel-224

12 months agoctdb-tests: add a nodestatus test that uses the nodes list command
John Mulligan [Wed, 31 Jul 2024 22:30:24 +0000 (18:30 -0400)] 
ctdb-tests: add a nodestatus test that uses the nodes list command

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-tests: add reloadnodes unit tests that use the nodes list command
John Mulligan [Wed, 31 Jul 2024 20:30:13 +0000 (16:30 -0400)] 
ctdb-tests: add reloadnodes unit tests that use the nodes list command

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-tests: add USENODESCOMMAND directive to fake ctdb
John Mulligan [Wed, 31 Jul 2024 20:29:44 +0000 (16:29 -0400)] 
ctdb-tests: add USENODESCOMMAND directive to fake ctdb

Add a single line USENODESCOMMAND directive to the fake ctdb in order to
enable use of a nodes script instead of a nodes file. For simplicity
the fake ctdb always uses `nodes.sh` in the CTDB_BASE.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-tests: add unit test coverage for listnodes with command
John Mulligan [Wed, 31 Jul 2024 19:36:26 +0000 (15:36 -0400)] 
ctdb-tests: add unit test coverage for listnodes with command

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-tools: update cli tool to optionally load nodes from command
John Mulligan [Fri, 7 Jun 2024 15:12:17 +0000 (11:12 -0400)] 
ctdb-tools: update cli tool to optionally load nodes from command

Similar to the recent changes to the ctdb server code, add the ability
to load the nodes from a subprocess stdout.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-conf: add boolean arg for verbosity when loading config
John Mulligan [Thu, 1 Aug 2024 18:25:38 +0000 (14:25 -0400)] 
ctdb-conf: add boolean arg for verbosity when loading config

In a future commit we will add support for loading the config file from
the `ctdb` command line tool. Prior to this change the config file load
func always called D_NOTICE that causes the command to emit new text and
thus break all the tests that rely on the specific test output (not to
mention something users could notice). This change plumbs a new
`verbose` argument into some of the config file loading functions.
Generally, all existing functions will have verbose set to true to match
the existing behavior. Future callers of this function can set it to
false in order to avoid emitting the extra text.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-server: rename ctdb_load_nodes_file to ctdb_load_nodes
John Mulligan [Thu, 6 Jun 2024 17:53:43 +0000 (13:53 -0400)] 
ctdb-server: rename ctdb_load_nodes_file to ctdb_load_nodes

Rename ctdb_load_nodes_file to ctdb_load_nodes as it can now load nodes
from more than a regular file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-server: rename nodes_file field to nodes_source
John Mulligan [Thu, 6 Jun 2024 17:50:02 +0000 (13:50 -0400)] 
ctdb-server: rename nodes_file field to nodes_source

Rename the `struct ctdb_context` field nodes_file to nodes_source to
better match that the field may indicate something other than a true
file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-server: use the new "nodes list" configuration option
John Mulligan [Thu, 6 Jun 2024 14:00:10 +0000 (10:00 -0400)] 
ctdb-server: use the new "nodes list" configuration option

Use the new "nodes list" configuration option. Executing the given path
if the path is prefixed by a `!`. The use case is to decouple the nodes
file from the shared storage, especially in the case where the shared
storage is provided by a vfs module.

For an example, imagine a script that runs `curl` on a URL for a
highly-available web server where the URL provides the content
of the nodes file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoctdb-conf: add "nodes list" configuration option
John Mulligan [Thu, 6 Jun 2024 14:00:09 +0000 (10:00 -0400)] 
ctdb-conf: add "nodes list" configuration option

Add a "nodes list" configuration option to the [cluster] section of the
ctdb server config. This option will be used similarly to the `cluster
lock` parameter works. When unset it defaults to the same value as
before (/etc/ctdb/nodes). If given a path that is not prefixed by `!` it
instead loads the nodes file from the given path If given a path
prefixed by `!` then it executes the path as a command and reads the
standard output as if it were the content of the nodes file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>