metze/samba/wip.git
10 months agoRevert "source4/torture/krb5/kdc-heimdal.c only single test"
Stefan Metzmacher [Wed, 19 May 2021 20:57:17 +0000 (22:57 +0200)]
Revert "source4/torture/krb5/kdc-heimdal.c only single test"

This reverts commit 19c696116ee220da740d912a03bdd05323c75c9b.

10 months agoRevert "source4/torture/krb5/kdc-heimdal.c"
Stefan Metzmacher [Wed, 19 May 2021 20:57:17 +0000 (22:57 +0200)]
Revert "source4/torture/krb5/kdc-heimdal.c"

This reverts commit fe1301faa716865c1fd24bfba5eac96c16b52f95.

10 months agosource4/torture/krb5/kdc-heimdal.c
Stefan Metzmacher [Wed, 29 Apr 2020 05:59:58 +0000 (07:59 +0200)]
source4/torture/krb5/kdc-heimdal.c

10 months agosource4/torture/krb5/kdc-heimdal.c only single test
Stefan Metzmacher [Thu, 9 Apr 2020 08:56:25 +0000 (10:56 +0200)]
source4/torture/krb5/kdc-heimdal.c only single test

10 months agoTODO: convert source4/torture/krb5/kdc-heimdal.c to python
Stefan Metzmacher [Wed, 1 Apr 2020 22:22:55 +0000 (00:22 +0200)]
TODO: convert source4/torture/krb5/kdc-heimdal.c to python

10 months agoRevert "TODO: convert source4/torture/krb5/kdc-heimdal.c to python"
Stefan Metzmacher [Sat, 11 Apr 2020 18:46:14 +0000 (20:46 +0200)]
Revert "TODO: convert source4/torture/krb5/kdc-heimdal.c to python"

This reverts commit 1e6c6974655f424cb2eb3c89fefc71434031971a.

10 months agoRevert "source4/torture/krb5/kdc-heimdal.c only single test"
Stefan Metzmacher [Sat, 11 Apr 2020 18:46:14 +0000 (20:46 +0200)]
Revert "source4/torture/krb5/kdc-heimdal.c only single test"

This reverts commit 1fc12e93bb21cd4465a9267289743564862f0bb0.

10 months agosource4/torture/krb5/kdc-heimdal.c only single test
Stefan Metzmacher [Thu, 9 Apr 2020 08:56:25 +0000 (10:56 +0200)]
source4/torture/krb5/kdc-heimdal.c only single test

10 months agoTODO: convert source4/torture/krb5/kdc-heimdal.c to python
Stefan Metzmacher [Wed, 1 Apr 2020 22:22:55 +0000 (00:22 +0200)]
TODO: convert source4/torture/krb5/kdc-heimdal.c to python

10 months agoRevert "auth/gensec: add gensec_set_channel_bindings() function"
Stefan Metzmacher [Sat, 11 Apr 2020 18:45:04 +0000 (20:45 +0200)]
Revert "auth/gensec: add gensec_set_channel_bindings() function"

This reverts commit e0eac23ddce86a7ce09c7a7550f8b99a3d84c09d.

10 months agoRevert "TODO optional??? auth/ntlmssp: implement client side channel bindings"
Stefan Metzmacher [Sat, 11 Apr 2020 18:45:04 +0000 (20:45 +0200)]
Revert "TODO optional??? auth/ntlmssp: implement client side channel bindings"

This reverts commit 0469ecd0111b9fc30e31b00d0d52975639889d84.

10 months agoTODO optional??? auth/ntlmssp: implement client side channel bindings
Stefan Metzmacher [Tue, 11 Feb 2020 15:07:05 +0000 (16:07 +0100)]
TODO optional??? auth/ntlmssp: implement client side channel bindings

10 months agoauth/gensec: add gensec_set_channel_bindings() function
Stefan Metzmacher [Tue, 11 Feb 2020 14:26:07 +0000 (15:26 +0100)]
auth/gensec: add gensec_set_channel_bindings() function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
10 months agoRevert "NEEDED/LATER? selftest/target/Samba4.pm dnsforwarder"
Stefan Metzmacher [Thu, 27 Feb 2020 10:22:51 +0000 (11:22 +0100)]
Revert "NEEDED/LATER? selftest/target/Samba4.pm dnsforwarder"

This reverts commit 3047fbe992c5ace410029878adb7b896ccac70d1.

10 months agoNEEDED/LATER? selftest/target/Samba4.pm dnsforwarder
Stefan Metzmacher [Thu, 27 Feb 2020 10:22:26 +0000 (11:22 +0100)]
NEEDED/LATER? selftest/target/Samba4.pm dnsforwarder

10 months agoRevert "HACK selftest/target/Samba.pm only ipv6 nameservers"
Stefan Metzmacher [Thu, 12 Mar 2020 11:21:46 +0000 (12:21 +0100)]
Revert "HACK selftest/target/Samba.pm only ipv6 nameservers"

This reverts commit d04ae5d92238e44435cc5d3c7a454ecaa074c487.

10 months agoHACK selftest/target/Samba.pm only ipv6 nameservers
Stefan Metzmacher [Wed, 11 Mar 2020 16:13:42 +0000 (17:13 +0100)]
HACK selftest/target/Samba.pm only ipv6 nameservers

10 months agoRevert "rpccli_bh_do_ndr_print"
Stefan Metzmacher [Sat, 11 Apr 2020 18:45:03 +0000 (20:45 +0200)]
Revert "rpccli_bh_do_ndr_print"

This reverts commit cf381bb33ef44a721b81ad238828a90f191152f4.

10 months agoRevert "wbint_bh_do_ndr_print"
Stefan Metzmacher [Sat, 11 Apr 2020 18:45:03 +0000 (20:45 +0200)]
Revert "wbint_bh_do_ndr_print"

This reverts commit b49114f779d8ccadf139cb8a796f3ee878b12432.

10 months agoRevert "dcerpc_bh_do_ndr_print"
Stefan Metzmacher [Sat, 11 Apr 2020 18:45:03 +0000 (20:45 +0200)]
Revert "dcerpc_bh_do_ndr_print"

This reverts commit b9c44aaad6c3a2cb213557c796a12fc62c7555ee.

10 months agodcerpc_bh_do_ndr_print
Stefan Metzmacher [Thu, 27 Feb 2020 16:52:44 +0000 (16:52 +0000)]
dcerpc_bh_do_ndr_print

10 months agowbint_bh_do_ndr_print
Stefan Metzmacher [Thu, 27 Feb 2020 16:52:33 +0000 (16:52 +0000)]
wbint_bh_do_ndr_print

10 months agorpccli_bh_do_ndr_print
Stefan Metzmacher [Thu, 27 Feb 2020 16:52:22 +0000 (16:52 +0000)]
rpccli_bh_do_ndr_print

10 months agoRevert "TODO: tevent_req_cancel forward... if (req->internal.state != TEVENT_REQ_IN_P...
Stefan Metzmacher [Wed, 25 Mar 2020 09:03:03 +0000 (10:03 +0100)]
Revert "TODO: tevent_req_cancel forward... if (req->internal.state != TEVENT_REQ_IN_PROGRESS)"

This reverts commit 6784f02ac8f61089b5c39f6fa8dbc81e6c833c08.

10 months agoTODO: tevent_req_cancel forward... if (req->internal.state != TEVENT_REQ_IN_PROGRESS)
Stefan Metzmacher [Wed, 25 Mar 2020 08:48:20 +0000 (09:48 +0100)]
TODO: tevent_req_cancel forward... if (req->internal.state != TEVENT_REQ_IN_PROGRESS)

10 months agoRevert "CONFLICT: TODO: smb_krb5_send_and_recv_func* no tevent_context nesting..."
Stefan Metzmacher [Thu, 20 Jan 2022 07:27:46 +0000 (08:27 +0100)]
Revert "CONFLICT: TODO: smb_krb5_send_and_recv_func* no tevent_context nesting..."

This reverts commit b41a9c8b4294f20c2da45c35edd07b0fd2b3f04c.

10 months agoCONFLICT: TODO: smb_krb5_send_and_recv_func* no tevent_context nesting...
Stefan Metzmacher [Thu, 4 Jun 2020 15:35:52 +0000 (17:35 +0200)]
CONFLICT: TODO: smb_krb5_send_and_recv_func* no tevent_context nesting...

WAS 7b1fc167657112ce1942f9fb8ab896fc951c23df

10 months agoRevert "TODO: samba-tool: add virtualKerberos[Old[er]Key{1,3,23,17,18][;hex=yes]...
Stefan Metzmacher [Wed, 5 Jul 2023 19:43:20 +0000 (21:43 +0200)]
Revert "TODO: samba-tool: add virtualKerberos[Old[er]Key{1,3,23,17,18][;hex=yes] support"

This reverts commit 2560b7fe0d9b60677c7c94d53009afdb4b489bbc.

10 months agoTODO: samba-tool: add virtualKerberos[Old[er]Key{1,3,23,17,18][;hex=yes] support
Stefan Metzmacher [Wed, 19 May 2021 10:30:55 +0000 (12:30 +0200)]
TODO: samba-tool: add virtualKerberos[Old[er]Key{1,3,23,17,18][;hex=yes] support

This allows callers to get the kerberos keys as binary (base64) or
hexstring.

This will be extremly useful for testing.

TODO: update help messages ?!? and add tests

10 months agoRevert "HACK TGS-REQ flags.b.canonicalize"
Stefan Metzmacher [Sun, 23 Jan 2022 11:54:59 +0000 (12:54 +0100)]
Revert "HACK TGS-REQ flags.b.canonicalize"

This reverts commit 27ec14d3ca66a80665b3bd2cb47b1b0f18240e9d.

10 months agoHACK TGS-REQ flags.b.canonicalize
Stefan Metzmacher [Sun, 23 Jan 2022 11:54:08 +0000 (12:54 +0100)]
HACK TGS-REQ flags.b.canonicalize

10 months agosource4/heimdal_build/ enable pthread support
Stefan Metzmacher [Mon, 14 Dec 2020 13:10:01 +0000 (14:10 +0100)]
source4/heimdal_build/ enable pthread support

10 months agoRevert "s4:kdc: fix samba_kdc_lookup_realm() with krbtgt/OTHER.REALM/OUR.REALM"
Stefan Metzmacher [Wed, 19 Jan 2022 16:08:30 +0000 (17:08 +0100)]
Revert "s4:kdc: fix samba_kdc_lookup_realm() with krbtgt/OTHER.REALM/OUR.REALM"

This reverts commit 4042006ba42d98af645b835ae52c5acc0917adbd.

10 months agoRevert "DEBUG get_krbtgt samba_kdc_lookup_realm"
Stefan Metzmacher [Wed, 19 Jan 2022 16:08:30 +0000 (17:08 +0100)]
Revert "DEBUG get_krbtgt samba_kdc_lookup_realm"

This reverts commit 39925364fabeb7fbfa33603b5a1ef7a21513c1ec.

10 months agoDEBUG get_krbtgt samba_kdc_lookup_realm
Stefan Metzmacher [Thu, 10 Oct 2019 15:44:21 +0000 (17:44 +0200)]
DEBUG get_krbtgt samba_kdc_lookup_realm

10 months agos4:kdc: fix samba_kdc_lookup_realm() with krbtgt/OTHER.REALM/OUR.REALM
Stefan Metzmacher [Thu, 10 Oct 2019 14:22:35 +0000 (16:22 +0200)]
s4:kdc: fix samba_kdc_lookup_realm() with krbtgt/OTHER.REALM/OUR.REALM

10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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

10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>