samba.git
14 months agos3:modules: Fix code spelling
Andreas Schneider [Thu, 13 Jul 2023 06:52:45 +0000 (08:52 +0200)]
s3:modules: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:modules: Remove fruit:ressource option with incorrect spelling
Andreas Schneider [Thu, 13 Jul 2023 07:03:18 +0000 (09:03 +0200)]
s3:modules: Remove fruit:ressource option with incorrect spelling

The plan was to remove it in 4.7. I think it is safe to remove it with
4.19.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:modules: Remove trailing white spaces of README.nfs4acls.txt
Andreas Schneider [Thu, 13 Jul 2023 06:55:31 +0000 (08:55 +0200)]
s3:modules: Remove trailing white spaces of README.nfs4acls.txt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:modules: Remove trailing white spaces of vfs_hpuxacl.c
Andreas Schneider [Thu, 13 Jul 2023 06:53:26 +0000 (08:53 +0200)]
s3:modules: Remove trailing white spaces of vfs_hpuxacl.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:locking: Fix code spelling
Andreas Schneider [Thu, 13 Jul 2023 06:50:21 +0000 (08:50 +0200)]
s3:locking: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:librpc: Fix code spelling
Andreas Schneider [Thu, 13 Jul 2023 06:47:11 +0000 (08:47 +0200)]
s3:librpc: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agowscript: Fix code spelling
Andreas Schneider [Thu, 13 Jul 2023 06:46:20 +0000 (08:46 +0200)]
wscript: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agoexamples: Remove outdated validchars
Andreas Schneider [Thu, 13 Jul 2023 05:52:02 +0000 (07:52 +0200)]
examples: Remove outdated validchars

I don't think we even look into this anymore and have other tests in
place.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agoexample: Remove outdated config files from tridge
Andreas Schneider [Thu, 13 Jul 2023 05:44:44 +0000 (07:44 +0200)]
example: Remove outdated config files from tridge

I don't think he still runs Windows 95 ...

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:rpc_server:netlogon: generate FAULT_INVALID_TAG for invalid netr_LogonGetCapabilit...
Stefan Metzmacher [Sat, 15 Jul 2023 14:11:48 +0000 (16:11 +0200)]
s3:rpc_server:netlogon: generate FAULT_INVALID_TAG for invalid netr_LogonGetCapabilities levels

This is important as Windows clients with KB5028166 seem to
call netr_LogonGetCapabilities with query_level=2 after
a call with query_level=1.

An unpatched Windows Server returns DCERPC_NCA_S_FAULT_INVALID_TAG
for query_level values other than 1.
While Samba tries to return NT_STATUS_NOT_SUPPORTED, but
later fails to marshall the response, which results
in DCERPC_FAULT_BAD_STUB_DATA instead.

Because we don't have any documentation for level 2 yet,
we just try to behave like an unpatched server and
generate DCERPC_NCA_S_FAULT_INVALID_TAG instead of
DCERPC_FAULT_BAD_STUB_DATA.
Which allows patched Windows clients to keep working
against a Samba DC.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 17 07:35:09 UTC 2023 on atb-devel-224

14 months agos4:rpc_server:netlogon: generate FAULT_INVALID_TAG for invalid netr_LogonGetCapabilit...
Stefan Metzmacher [Sat, 15 Jul 2023 14:11:48 +0000 (16:11 +0200)]
s4:rpc_server:netlogon: generate FAULT_INVALID_TAG for invalid netr_LogonGetCapabilities levels

This is important as Windows clients with KB5028166 seem to
call netr_LogonGetCapabilities with query_level=2 after
a call with query_level=1.

An unpatched Windows Server returns DCERPC_NCA_S_FAULT_INVALID_TAG
for query_level values other than 1.
While Samba tries to return NT_STATUS_NOT_SUPPORTED, but
later fails to marshall the response, which results
in DCERPC_FAULT_BAD_STUB_DATA instead.

Because we don't have any documentation for level 2 yet,
we just try to behave like an unpatched server and
generate DCERPC_NCA_S_FAULT_INVALID_TAG instead of
DCERPC_FAULT_BAD_STUB_DATA.
Which allows patched Windows clients to keep working
against a Samba DC.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos4:torture/rpc: let rpc.schannel also check netr_LogonGetCapabilities with different...
Stefan Metzmacher [Sat, 15 Jul 2023 15:25:05 +0000 (17:25 +0200)]
s4:torture/rpc: let rpc.schannel also check netr_LogonGetCapabilities with different levels

The important change it that we expect DCERPC_NCA_S_FAULT_INVALID_TAG
for unsupported query_levels, we allow it to work with servers
with or without support for query_level=2.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agonetlogon.idl: add support for netr_LogonGetCapabilities response level 2
Stefan Metzmacher [Sat, 15 Jul 2023 15:20:32 +0000 (17:20 +0200)]
netlogon.idl: add support for netr_LogonGetCapabilities response level 2

We don't have any documentation about this yet, but tests against
a Windows Server 2022 patched with KB5028166 revealed that
the response for query_level=2 is exactly the same as
for querey_level=1.

Until we know the reason for query_level=2 we won't
use it as client nor support it in the server, but
we want ndrdump to work.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:libsmb: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:26:30 +0000 (11:26 +0200)]
s3:libsmb: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 13 06:34:01 UTC 2023 on atb-devel-224

14 months agos3:libads: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:21:39 +0000 (11:21 +0200)]
s3:libads: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agos3:lib: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:16:18 +0000 (11:16 +0200)]
s3:lib: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agos3:include: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:10:23 +0000 (11:10 +0200)]
s3:include: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agos3:include: Remove trailing whitepaces in MacExtensions.h
Andreas Schneider [Wed, 5 Jul 2023 09:11:20 +0000 (11:11 +0200)]
s3:include: Remove trailing whitepaces in MacExtensions.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agopython:tests: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:07:52 +0000 (11:07 +0200)]
python:tests: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agopython: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:05:09 +0000 (11:05 +0200)]
python: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agoexamples: Fix code spelling
Andreas Schneider [Wed, 5 Jul 2023 09:02:04 +0000 (11:02 +0200)]
examples: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agoexamples: Make codespell happy
Andreas Schneider [Wed, 5 Jul 2023 09:01:25 +0000 (11:01 +0200)]
examples: Make codespell happy

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
14 months agoconfigure: ensure sizeof(int) >= 4
Douglas Bagnall [Fri, 7 Jul 2023 00:50:13 +0000 (12:50 +1200)]
configure: ensure sizeof(int) >= 4

There are multiple places we make this assumption. For example, in
source3/lib/tldap.c, we have this line

      if (ld->msgid == 2147483647) {

where ld->msgid is an int. And in librpc/idl/security.idl we have
several lines like:

      const int SEC_MASK_GENERIC        = 0xF0000000;

In lib/replace/inet_pton.c and inet_ntop.c we have

  /*
   * WARNING: Don't even consider trying to compile this on a system where
   * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
   */

but no attempt to enforce that as far as I can see, until now.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 11 22:44:15 UTC 2023 on atb-devel-224

14 months agodocs-xml: Fix script idmap backend documentation
Martin Schwenke [Tue, 4 Jul 2023 00:49:39 +0000 (10:49 +1000)]
docs-xml: Fix script idmap backend documentation

This was clearly copied from the tdb2 backend and incompletely edited.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jul 10 23:47:12 UTC 2023 on atb-devel-224

14 months agodocs-xml: Tweak autorid idmap backend documentation
Martin Schwenke [Tue, 4 Jul 2023 00:51:59 +0000 (10:51 +1000)]
docs-xml: Tweak autorid idmap backend documentation

The name of the placeholder is misleading.  It certainly isn't per
domain, so we might as well indicate that it is per range.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agodocs-xml: Fix rid idmap backend documentation
Martin Schwenke [Tue, 4 Jul 2023 00:55:19 +0000 (10:55 +1000)]
docs-xml: Fix rid idmap backend documentation

The statement just above the example says the example demonstrates the
use of the base_rid parameter.  It doesn't, so fix this.

Also fix a typo.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agosmbd: don't leak the fsp if close_file_smb() fails
Ralph Boehme [Mon, 10 Jul 2023 14:34:23 +0000 (16:34 +0200)]
smbd: don't leak the fsp if close_file_smb() fails

This can happen if DELETE-ON-CLOSE is set, but the deletion fails for some
reason.

The bug was introduced by 1808e5c133474eabc9d3cf91c2a92ec4d92d9fdd.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 10 21:32:32 UTC 2023 on atb-devel-224

14 months agoctdb-server: Avoid logging a count of 0 resent calls
Martin Schwenke [Thu, 15 Jun 2023 00:31:07 +0000 (10:31 +1000)]
ctdb-server: Avoid logging a count of 0 resent calls

This fixes a little thinko in commit
80de84d36e9c29d9506976f991560fb5dde99471, where this was overlooked.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jul 10 15:15:06 UTC 2023 on atb-devel-224

14 months agoctdb-tools: Switch tickle ACK sending message to INFO level
Martin Schwenke [Tue, 28 Feb 2023 21:51:08 +0000 (08:51 +1100)]
ctdb-tools: Switch tickle ACK sending message to INFO level

DEBUG level logging in ctdb_killtcp is very noisy.  The most important
messages when debugging are those for tickle ACKs and TCP RSTs.  TCP
RSTs are already logged at INFO level, so promote tickle ACKs to INFO
level too.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
14 months agoctdb-tools: Fix a typo in a log message
Martin Schwenke [Tue, 28 Feb 2023 21:43:30 +0000 (08:43 +1100)]
ctdb-tools: Fix a typo in a log message

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: Ulrich Sibiller <ulrich.sibiller@atos.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
14 months agoctdb-logging: Really make NOTICE the default debug level
Martin Schwenke [Fri, 10 Feb 2023 06:57:13 +0000 (17:57 +1100)]
ctdb-logging: Really make NOTICE the default debug level

NOTICE level debug messages in common/run_event.c are not logged by
default.

Currently eventd ends up using ERROR, since this is specified as
LOGGING_LOG_LEVEL_DEFAULT.  It doesn't inherit the debug level from
ctdbd and only uses NOTICE level when interactive.

Change the real logging default to NOTICE and use it everywhere.

Followups might be:

* Remove the default_log_level argument to logging_conf_init()
* Kick eventd to update debug level when "ctdb setdebug" is used

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
14 months agolibrpc/nbt: Avoid reading invalid member of union
Joseph Sutton [Wed, 5 Jul 2023 22:57:59 +0000 (10:57 +1200)]
librpc/nbt: Avoid reading invalid member of union

WACK packets use the ‘data’ member of the ‘nbt_rdata’ union, but they
claim to be a different type — NBT_QTYPE_NETBIOS — than would normally
be used with that union member. This means that if rr_type is equal to
NBT_QTYPE_NETBIOS, ndr_push_nbt_res_rec() has to guess which type the
structure really is by examining the data member. However, if the
structure is actually of a different type, that union member will not be
valid and accessing it will invoke undefined behaviour.

To fix this, eliminate all the guesswork and introduce a new type,
NBT_QTYPE_WACK, which can never appear on the wire, and which indicates
that although the ‘data’ union member should be used, the wire type is
actually NBT_QTYPE_NETBIOS.

This means that as far as NDR is concerned, the ‘netbios’ member of the
‘nbt_rdata’ union will consistently be used for all NBT_QTYPE_NETBIOS
structures; we shall no longer access the wrong member of the union.

Credit to OSS-Fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38480

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Jul  7 01:14:06 UTC 2023 on atb-devel-224

14 months agolibrpc:ndr: Fix overflow in ndr_push_expand
Joseph Sutton [Wed, 5 Jul 2023 22:50:05 +0000 (10:50 +1200)]
librpc:ndr: Fix overflow in ndr_push_expand

If ‘size’ was equal to UINT32_MAX, the expression ‘size+1’ could
overflow to zero.

This could result in inadequate memory being allocated, which could
cause ndr_pull_compression_xpress_huff_raw_chunk() to overflow memory
with zero bytes.

Credit to OSS-Fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57728

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
14 months agos3:rpc_server: Fix double blackslash issue in dfs path
Pavel Filipenský [Tue, 20 Jun 2023 14:24:55 +0000 (16:24 +0200)]
s3:rpc_server: Fix double blackslash issue in dfs path

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  5 20:24:35 UTC 2023 on atb-devel-224

14 months agos3:rpc_server: Initialize consumedcnt to 0 in _dfs_GetInfo()
Pavel Filipenský [Fri, 23 Jun 2023 08:08:39 +0000 (10:08 +0200)]
s3:rpc_server: Initialize consumedcnt to 0 in _dfs_GetInfo()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agos3:tests: Add rpcclient 'dfsgetinfo' test
Pavel Filipenský [Fri, 23 Jun 2023 10:03:30 +0000 (12:03 +0200)]
s3:tests: Add rpcclient 'dfsgetinfo' test

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agosmbd: call exit_server_cleanly() to avoid panicking
Ralph Boehme [Wed, 5 Jul 2023 09:33:58 +0000 (11:33 +0200)]
smbd: call exit_server_cleanly() to avoid panicking

The parent smdb forwards SIGTERM to its process group in order to kill all
children like the scavenger. This happens from a function registered via
atexit() which means the signal forwarding is happening very briefly before the
main smbd process exits. When exiting the pipe between smbd and scavenger is
closed which triggers a file event in the scavenger.

However, due to kernel sheduling it is possible that the file descriptor event
is received before the signal, where we call exit_server() which call
smb_panic() at the end.

Change the exit to exit_server_cleanly() and just log this event at level 2
which we already do.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  5 13:14:08 UTC 2023 on atb-devel-224

14 months agos3:winbindd: let winbind_samlogon_retry_loop() fallback to NT_STATUS_NO_LOGON_SERVERS
Stefan Metzmacher [Tue, 4 Jul 2023 12:12:03 +0000 (14:12 +0200)]
s3:winbindd: let winbind_samlogon_retry_loop() fallback to NT_STATUS_NO_LOGON_SERVERS

When we were not able to get a valid response from any DC we should
report NT_STATUS_NO_LOGON_SERVERS with authoritative = 1.

This matches what windows does. In a chain of transitive
trusts the ACCESS_DENIED/authoritative=0 is not propagated,
instead NT_STATUS_NO_LOGON_SERVERS/authoritative=1 is
passed along the chain if there's no other DC is available.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
14 months agos3:winbindd: make use of reset_cm_connection_on_error() in winbind_samlogon_retry_loop()
Stefan Metzmacher [Tue, 4 Jul 2023 11:01:24 +0000 (13:01 +0200)]
s3:winbindd: make use of reset_cm_connection_on_error() in winbind_samlogon_retry_loop()

Note this is more than a simple invalidate_cm_connection() as it may set
domain->conn.netlogon_force_reauth = true, which is important in order
to recover from NT_STATUS_RPC_SEC_PKG_ERROR errors.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
14 months agos3:winbindd: let winbind_samlogon_retry_loop() always start with authoritative = 1
Stefan Metzmacher [Wed, 16 Feb 2022 13:19:16 +0000 (14:19 +0100)]
s3:winbindd: let winbind_samlogon_retry_loop() always start with authoritative = 1

Otherwise we could treat a local problem as non-authoritative.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
14 months agos3:winbindd: make use of reset_cm_connection_on_error() for winbindd_lookup_{names...
Stefan Metzmacher [Tue, 4 Jul 2023 10:32:34 +0000 (12:32 +0200)]
s3:winbindd: make use of reset_cm_connection_on_error() for winbindd_lookup_{names,sids}()

Note this is more than a simple invalidate_cm_connection() as it may set
domain->conn.netlogon_force_reauth = true.

This is not strictly needed as the callers call
reset_cm_connection_on_error() via reconnect_need_retry().
But it might avoid one roundtrip.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
14 months agos3:winbindd: call reset_cm_connection_on_error() in wb_cache_query_user_list()
Stefan Metzmacher [Tue, 4 Jul 2023 10:32:34 +0000 (12:32 +0200)]
s3:winbindd: call reset_cm_connection_on_error() in wb_cache_query_user_list()

This is mostly for consistency, every remote call should call
reset_cm_connection_on_error(). Note this is more than
a simple invalidate_cm_connection() as it may set
domain->conn.netlogon_force_reauth = true.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
14 months agoctdb-tests: Run ShellCheck on event-script unit test support scripts
Martin Schwenke [Mon, 3 Jul 2023 02:02:36 +0000 (12:02 +1000)]
ctdb-tests: Run ShellCheck on event-script unit test support scripts

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Jul  5 12:16:57 UTC 2023 on atb-devel-224

14 months agoctdb-tests: Avoid ShellCheck warnings
Martin Schwenke [Sun, 2 Jul 2023 23:32:26 +0000 (09:32 +1000)]
ctdb-tests: Avoid ShellCheck warnings

These are all trivial, so handle them in bulk.

* Change code to avoid (approximately sorted by frequency):

  SC2004 $/${} is unnecessary on arithmetic variables.
  SC2086 Double quote to prevent globbing and word splitting.
  SC2162 read without -r will mangle backslashes.
  SC2254 Quote expansions in case patterns to match literally rather than as a glob.
  SC2154 (warning): <variable> is referenced but not assigned.
  SC3037 (warning): In POSIX sh, echo flags are undefined.
  SC2016 (info): Expressions don't expand in single quotes, use double quotes for that.
  SC2069 (warning): To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).
  SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
  SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
  SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.

* Locally disable checks:

  SC2034 (warning): <variable> appears unused. Verify use (or export if used externally).
  SC2086 (info): Double quote to prevent globbing and word splitting. [once]
  SC2120 (warning): <function> references arguments, but none are ever passed.
  SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

While touching reads for SC2162, switch unused variables to "_"
instead of "_x", which seems to be preferred by ShellCheck.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Avoid ShellCheck warning SC2059
Martin Schwenke [Tue, 4 Jul 2023 00:30:05 +0000 (10:30 +1000)]
ctdb-tests: Avoid ShellCheck warning SC2059

  SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo".

Move the format string to the function and just parameterise the share
type.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Avoid ShellCheck warnings SC2046, SC2005
Martin Schwenke [Mon, 3 Jul 2023 01:54:15 +0000 (11:54 +1000)]
ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005

In ./tests/UNIT/eventscripts/scripts/local.sh line 328:
echo $(ctdb ifaces -X | awk -F'|' 'FNR > 1 {print $2}')
             ^-- SC2046 (warning): Quote this to prevent word splitting.
             ^-- SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.

Use xargs to get output on 1 line.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Drop unreachable code
Martin Schwenke [Mon, 3 Jul 2023 01:42:56 +0000 (11:42 +1000)]
ctdb-tests: Drop unreachable code

This generates ShellCheck warnings:

In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 412:
if [ -n "$service_check_cmd" ]; then
                                 ^----------------^ SC2031 (info): service_check_cmd was modified in a subshell. That change might be lost.

In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 413:
if eval "$service_check_cmd"; then
                                         ^----------------^ SC2031 (info): service_check_cmd was modified in a subshell. That change might be lost.

service_check_cmd will never be set here because it is only set in a
sub-shell in rpc_set_service_failure_response().

This reverts some of commit 713ec217507d2f0d5f516efc45c8cd8773fccc14.

If testcases requiring use of service_check_cmd are later added then
this will need to be redone properly.  This would probably start by
renaming this function nfs_iterate_rpc_test().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Sun, 2 Jul 2023 23:26:34 +0000 (09:26 +1000)]
ctdb-tests: Reformat with "shfmt -w -p -i 0 -fn"

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Drop unused test code for tunables
Martin Schwenke [Fri, 16 Jun 2023 03:28:40 +0000 (13:28 +1000)]
ctdb-tests: Drop unused test code for tunables

This is unused since loading tunables was moved to ctdbd.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tests: Avoid ShellCheck warning SC2086
Martin Schwenke [Mon, 3 Jul 2023 02:10:28 +0000 (12:10 +1000)]
ctdb-tests: Avoid ShellCheck warning SC2086

  SC2086 Double quote to prevent globbing and word splitting.

Apparently ShellCheck is more picky about some of these than it used
to be.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-scripts: Avoid ShellCheck warnings SC2317, SC2086
Martin Schwenke [Mon, 3 Jul 2023 03:34:58 +0000 (13:34 +1000)]
ctdb-scripts: Avoid ShellCheck warnings SC2317, SC2086

New in ShellCheck 0.9.0:

  SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

Also:

  SC2086 (info): Double quote to prevent globbing and word splitting.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoctdb-tools: Avoid ShellCheck warning SC2317
Martin Schwenke [Mon, 3 Jul 2023 03:26:20 +0000 (13:26 +1000)]
ctdb-tools: Avoid ShellCheck warning SC2317

New in ShellCheck 0.9.0:

  SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agos3:libads: re-initialize num_requests to 0 for cldap_ping_list retries
Stefan Metzmacher [Tue, 4 Jul 2023 16:07:12 +0000 (18:07 +0200)]
s3:libads: re-initialize num_requests to 0 for cldap_ping_list retries

Commit 8132edf119757ee91070facffef016c93de9c2a6 introduced a retry loop
arround cldap_multi_netlogon(), but it forgot to reset num_requests to 0
for the retries.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jul  5 11:17:43 UTC 2023 on atb-devel-224

14 months agos3-net: no secrets access required when processing a ODJ provisioning
Günther Deschner [Tue, 6 Jun 2023 09:14:01 +0000 (11:14 +0200)]
s3-net: no secrets access required when processing a ODJ provisioning

It should be possible to call "net offlinejoin provision" as non-root,
no access to secrets.tdb required in that case.

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jul  5 09:23:22 UTC 2023 on atb-devel-224

14 months agos3:include: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 10:10:26 +0000 (12:10 +0200)]
s3:include: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul  5 07:32:15 UTC 2023 on atb-devel-224

14 months agos4:client: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 10:06:20 +0000 (12:06 +0200)]
s4:client: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agos3:auth: Use new debug macros for logging
Andreas Schneider [Mon, 3 Jul 2023 09:19:33 +0000 (11:19 +0200)]
s3:auth: Use new debug macros for logging

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agos3:auth: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 10:06:01 +0000 (12:06 +0200)]
s3:auth: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agoselftest: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 10:04:33 +0000 (12:04 +0200)]
selftest: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agoscript: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 09:57:55 +0000 (11:57 +0200)]
script: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agopython:tests: Fix code spelling
Andreas Schneider [Fri, 30 Jun 2023 09:56:06 +0000 (11:56 +0200)]
python:tests: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
14 months agolibcli/smb: Remove unused fallback case for ALLOW_GNUTLS_AEAD_CIPHER_ENCRYPTV2_AES_GCM
Andrew Bartlett [Fri, 30 Jun 2023 20:02:36 +0000 (08:02 +1200)]
libcli/smb: Remove unused fallback case for ALLOW_GNUTLS_AEAD_CIPHER_ENCRYPTV2_AES_GCM

We now require a GnuTLS version that is not impacted for AES-GCM
(fixed in 3.6.11, we require 3.6.13).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  4 07:42:35 UTC 2023 on atb-devel-224

14 months agobuild: We don't need SEEKDIR_RETURNS_VOID
Volker Lendecke [Wed, 14 Jun 2023 06:02:07 +0000 (08:02 +0200)]
build: We don't need SEEKDIR_RETURNS_VOID

We don't call seekdir() in source3 anymore

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): Mon Jul  3 20:40:05 UTC 2023 on atb-devel-224

14 months agolib: Move IO_REPARSE_TAG_NFS subtypes to toplevel
Volker Lendecke [Mon, 26 Jun 2023 06:55:59 +0000 (08:55 +0200)]
lib: Move IO_REPARSE_TAG_NFS subtypes to toplevel

They should be generally available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agolib: Translate ENXIO to NT_STATUS_ILLEGAL_FUNCTION
Volker Lendecke [Mon, 15 May 2023 15:23:43 +0000 (17:23 +0200)]
lib: Translate ENXIO to NT_STATUS_ILLEGAL_FUNCTION

ENXIO is returned when trying to openat() a unix domain socket or a
FIFO without anything at the other end. [MS-ERREF] has
ILLEGAL_FUNCTION as "The specified handle is not open to the server
end of the named pipe.", which comes pretty close to me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agosmbd: Fix a typo
Volker Lendecke [Mon, 19 Jun 2023 19:10:14 +0000 (21:10 +0200)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agoerror_inject: Reduce indentation with an early return
Volker Lendecke [Mon, 26 Jun 2023 10:48:16 +0000 (12:48 +0200)]
error_inject: Reduce indentation with an early return

Review with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agotorture4: Fix an error message
Volker Lendecke [Mon, 26 Jun 2023 14:15:25 +0000 (16:15 +0200)]
torture4: Fix an error message

The fsctl is called FSCTL_SET_ZERO_DATA

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agotests: Enable a few tests for FreeBSD
Volker Lendecke [Mon, 26 Jun 2023 13:45:39 +0000 (15:45 +0200)]
tests: Enable a few tests for FreeBSD

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agosmbd: Save 76 bytes of .text
Volker Lendecke [Wed, 28 Jun 2023 09:48:34 +0000 (11:48 +0200)]
smbd: Save 76 bytes of .text

Probably not really measurable, but as this is a pretty frequently
accessed table, maybe this saves us some cache misses. And it's very
cheap to get :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agosmbd: Avoid a direct reference to smb_messages[]
Volker Lendecke [Thu, 9 Mar 2023 16:49:50 +0000 (17:49 +0100)]
smbd: Avoid a direct reference to smb_messages[]

That's what we have smb_fn_name() for

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agosmbclient3: Use talloc_asprintf(), no explicit SAFE_FREE required
Volker Lendecke [Thu, 29 Jun 2023 09:46:35 +0000 (11:46 +0200)]
smbclient3: Use talloc_asprintf(), no explicit SAFE_FREE required

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agoutils3: Remove the "split_tokens" utility
Volker Lendecke [Mon, 3 Jul 2023 09:08:38 +0000 (11:08 +0200)]
utils3: Remove the "split_tokens" utility

This is not tested as far as I can see, and as this is explicity meant
as a testing utility I think we can live without it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 months agowb_dsgetdcname: don't use stack variables for async code
Stefan Metzmacher [Thu, 29 Jun 2023 12:02:17 +0000 (14:02 +0200)]
wb_dsgetdcname: don't use stack variables for async code

This is not really a problem because we call ndr_push from
with a _send() function, but still we leave dangling pointers
arround...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Sun Jul  2 17:42:56 UTC 2023 on atb-devel-224

14 months agowb_dsgetdcname: log also the domain name for failures
Björn Jacke [Thu, 29 Jun 2023 11:51:46 +0000 (13:51 +0200)]
wb_dsgetdcname: log also the domain name for failures

Signed-off-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
14 months agowb_dsgetdcname.c: move common message to higher log level
Björn Jacke [Wed, 28 Jun 2023 11:56:53 +0000 (13:56 +0200)]
wb_dsgetdcname.c: move common message to higher log level

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agowb_dsgetdcname.c: don't use statis log level numbers
Björn Jacke [Wed, 28 Jun 2023 11:51:35 +0000 (13:51 +0200)]
wb_dsgetdcname.c: don't use statis log level numbers

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agotallocmsg.c: move info log message to appropriate level
Björn Jacke [Wed, 28 Jun 2023 11:24:50 +0000 (13:24 +0200)]
tallocmsg.c: move info log message to appropriate level

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agogarbage_collect_tombstone.c: use DBG* macros instead of static numeric log levels
Björn Jacke [Wed, 28 Jun 2023 11:12:17 +0000 (13:12 +0200)]
garbage_collect_tombstone.c: use DBG* macros instead of static numeric log levels

Some log levels changed slightly because the macros don't cover all the
previously used levels.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agogarbage_collect_tombstones.c: move info log message to appropriate level
Björn Jacke [Wed, 28 Jun 2023 10:55:35 +0000 (12:55 +0200)]
garbage_collect_tombstones.c: move info log message to appropriate level

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agowinbindd_cache.c: use DBG* macros instead of static log level numbers
Björn Jacke [Wed, 28 Jun 2023 10:34:26 +0000 (12:34 +0200)]
winbindd_cache.c: use DBG* macros instead of static log level numbers

Some log levels changed slightly because the macros don't cover all the
previously used levels.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agowinbindd_cache.c: move some some notice messages from ERR to NOTICE level
Björn Jacke [Wed, 28 Jun 2023 10:00:49 +0000 (12:00 +0200)]
winbindd_cache.c: move some some notice messages from ERR to NOTICE level

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agowinbindd_cache: adjust some debug levels to more appropriate severities
Björn Jacke [Wed, 28 Jun 2023 09:52:32 +0000 (11:52 +0200)]
winbindd_cache: adjust some debug levels to more appropriate severities

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agobuild: Remove unused check for SHA1_Update and SHA1_RENAME_NEEDED
Andrew Bartlett [Fri, 30 Jun 2023 10:41:51 +0000 (22:41 +1200)]
build: Remove unused check for SHA1_Update and SHA1_RENAME_NEEDED

I can not find the code that required this, even in the history.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun 30 14:59:46 UTC 2023 on atb-devel-224

14 months agoRemove redundant check and fallback for AES CMAC 128 as we now require GnuTLS 3.6.13
Andrew Bartlett [Wed, 26 Oct 2022 22:09:19 +0000 (11:09 +1300)]
Remove redundant check and fallback for AES CMAC 128 as we now require GnuTLS 3.6.13

This allows us to remove a lot of conditionally compiled code and so
know with more certainly that our tests are covering our code-paths.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agocrypto: Remove aesni-intel accelerated AES crypto functions
Andrew Bartlett [Wed, 26 Oct 2022 22:05:17 +0000 (11:05 +1300)]
crypto: Remove aesni-intel accelerated AES crypto functions

These will shortly be unused as we will rely on GnuTLS for all AES cryptography
now that we require GnuTLS 3.6.13

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoRemove rudundent check and fallback for AES CFB8 as we now require GnuTLS 3.6.13
Andrew Bartlett [Wed, 26 Oct 2022 21:53:53 +0000 (10:53 +1300)]
Remove rudundent check and fallback for AES CFB8 as we now require GnuTLS 3.6.13

This allows us to remove a lot of conditionally compiled code and so
know with more certaintly that our tests are covering our codepaths.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoRemove rudundent check/workaround for buggy GnuTLS 3.5.2 as we now require GnuTLS...
Andrew Bartlett [Wed, 26 Oct 2022 21:48:42 +0000 (10:48 +1300)]
Remove rudundent check/workaround for buggy GnuTLS 3.5.2 as we now require GnuTLS 3.6.13

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoRemove rudundent check for gnutls_pkcs7_get_embedded_data_oid as we now require GnuTL...
Andrew Bartlett [Wed, 26 Oct 2022 21:47:27 +0000 (10:47 +1300)]
Remove rudundent check for gnutls_pkcs7_get_embedded_data_oid as we now require GnuTLS 3.6.13

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agoRemove check for gnutls_set_default_priority_append as it unused
Andrew Bartlett [Wed, 26 Oct 2022 21:03:48 +0000 (10:03 +1300)]
Remove check for gnutls_set_default_priority_append as it unused

This became unused with d30865014569f4b9a1261d9f0c40bc4fc98f883e

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agocrypto: Rely on GnuTLS 3.6.13 and gnutls_pbkdf2()
Andrew Bartlett [Wed, 26 Oct 2022 20:57:06 +0000 (09:57 +1300)]
crypto: Rely on GnuTLS 3.6.13 and gnutls_pbkdf2()

This removes a lot of inline #ifdef and means this feature is always tested.

We can do this as we have chosen GnuTLS 3.6.13 as the new minimum version.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agobuild: Set minimum required GnuTLS version to 3.6.13
Andrew Bartlett [Wed, 26 Oct 2022 20:51:09 +0000 (09:51 +1300)]
build: Set minimum required GnuTLS version to 3.6.13

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 months agosmbd: Merge openat_pathref_fsp_nosymlink() into _internal()
Volker Lendecke [Fri, 30 Jun 2023 09:18:42 +0000 (11:18 +0200)]
smbd: Merge openat_pathref_fsp_nosymlink() into _internal()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 30 11:43:46 UTC 2023 on atb-devel-224

14 months agosmbd: Factor out create_open_symlink_err()
Volker Lendecke [Fri, 30 Jun 2023 08:57:58 +0000 (10:57 +0200)]
smbd: Factor out create_open_symlink_err()

3 times talloc_zero() and read_symlink_reparse() makes a nice separate
function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Remove "atname" from smbd_dirptr_get_entry()'s mode_fn
Volker Lendecke [Sat, 24 Jun 2023 08:02:05 +0000 (10:02 +0200)]
smbd: Remove "atname" from smbd_dirptr_get_entry()'s mode_fn

Unused.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Rewrite smbd_dirptr_get_entry()
Volker Lendecke [Thu, 22 Jun 2023 13:12:25 +0000 (15:12 +0200)]
smbd: Rewrite smbd_dirptr_get_entry()

Move filtering of entries, in particular symlinks, fully into
smbd_dirptr_get_entry(). Before, this was hidden in magic code inside
openat_pathref_fsp() and the mode_fn()s. Changing anything file open
code led to changes in very distant code paths because of unforeseen
consequences to directory listing. This change centralizes the
decision what directory entries to show into
smbd_dirptr_get_entry(). It uses openat_pathref_fsp_nosymlink()
without any symlink magic. It might need some tweaking when we also
want to show other special files, but this will hopefully be easier.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Factor out full_path_from_dirfsp_at_basename()
Volker Lendecke [Thu, 22 Jun 2023 12:46:01 +0000 (14:46 +0200)]
smbd: Factor out full_path_from_dirfsp_at_basename()

Will use this logic in the next patch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Introduce dir_fname helper var in smbd_dirptr_get_entry()
Volker Lendecke [Thu, 22 Jun 2023 09:33:05 +0000 (11:33 +0200)]
smbd: Introduce dir_fname helper var in smbd_dirptr_get_entry()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Modernize two DEBUG statements
Volker Lendecke [Thu, 22 Jun 2023 09:19:29 +0000 (11:19 +0200)]
smbd: Modernize two DEBUG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agosmbd: Pass name and stat_ex to dos_mode_msdfs()
Volker Lendecke [Tue, 20 Jun 2023 14:28:19 +0000 (16:28 +0200)]
smbd: Pass name and stat_ex to dos_mode_msdfs()

We'll use it in a place without a smb_fname soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>