metze/samba/wip.git
6 months agosource3/librpc/crypto/gse.c channel_bindings master-winbindd
Stefan Metzmacher [Fri, 29 Sep 2023 09:55:45 +0000 (11:55 +0200)]
source3/librpc/crypto/gse.c channel_bindings

6 months agosq source4/libcli/ldap/ldap_bind.c
Stefan Metzmacher [Thu, 28 Sep 2023 15:16:32 +0000 (17:16 +0200)]
sq source4/libcli/ldap/ldap_bind.c

6 months agoldap_bind_sasl tstream_tls_channel_bindings
Stefan Metzmacher [Thu, 28 Sep 2023 15:11:03 +0000 (17:11 +0200)]
ldap_bind_sasl tstream_tls_channel_bindings

6 months agosource4/auth/gensec/gensec_gssapi.c support channel bindings
Stefan Metzmacher [Thu, 28 Sep 2023 15:09:37 +0000 (17:09 +0200)]
source4/auth/gensec/gensec_gssapi.c support channel bindings

6 months agosource4/lib/tls/tls_tstream.c tstream_tls_channel_bindings
Stefan Metzmacher [Thu, 28 Sep 2023 10:34:35 +0000 (12:34 +0200)]
source4/lib/tls/tls_tstream.c tstream_tls_channel_bindings

6 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

6 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>
6 months agos4:netlogon: return NT_STATUS_NO_TRUST_SAM_ACCOUNT if we don't have an NTHASH for...
Stefan Metzmacher [Thu, 16 Aug 2018 13:29:45 +0000 (15:29 +0200)]
s4:netlogon: return NT_STATUS_NO_TRUST_SAM_ACCOUNT if we don't have an NTHASH for an account

This matters mostly when we're an RODC and don't have the password
attributes localy.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agos3:libads: make check_cldap_reply_required_flags() static
Stefan Metzmacher [Thu, 17 Feb 2022 14:18:13 +0000 (15:18 +0100)]
s3:libads: make check_cldap_reply_required_flags() static

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq dsgetdcname_cache_fetch use check_cldap_reply_usable
Stefan Metzmacher [Thu, 17 Feb 2022 14:23:20 +0000 (15:23 +0100)]
sq dsgetdcname_cache_fetch use check_cldap_reply_usable

6 months agoTODO s3:dsgetdcname: make use of check_cldap_reply_usable()
Stefan Metzmacher [Thu, 17 Feb 2022 14:17:11 +0000 (15:17 +0100)]
TODO s3:dsgetdcname: make use of check_cldap_reply_usable()

TODO explain...

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

6 months agowinbindd: blacklist servers returning ACCESS_DENIED/authoritative=0
Stefan Metzmacher [Wed, 16 Feb 2022 13:23:16 +0000 (14:23 +0100)]
winbindd: blacklist servers returning ACCESS_DENIED/authoritative=0

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq cldap_ping_list check_negative_conn_cache
Stefan Metzmacher [Thu, 17 Feb 2022 13:12:23 +0000 (14:12 +0100)]
sq cldap_ping_list check_negative_conn_cache

6 months agos3:libads: let cldap_ping_list() check for a blacklisted server name
Stefan Metzmacher [Wed, 16 Feb 2022 12:09:14 +0000 (13:09 +0100)]
s3:libads: let cldap_ping_list() check for a blacklisted server name

If we black listed a server we should not use it even if
it responses to CLDAP requests.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq ads_try_connect check_cldap_reply_usable
Stefan Metzmacher [Thu, 17 Feb 2022 14:22:53 +0000 (15:22 +0100)]
sq ads_try_connect check_cldap_reply_usable

6 months agosq ads_try_connect use check_cldap_reply_usable
Stefan Metzmacher [Thu, 17 Feb 2022 14:12:24 +0000 (15:12 +0100)]
sq ads_try_connect use check_cldap_reply_usable

6 months agos3:libads: let ads_try_connect() check for a valid response command
Stefan Metzmacher [Wed, 16 Feb 2022 15:26:43 +0000 (16:26 +0100)]
s3:libads: let ads_try_connect() check for a valid response command

We should not use servers responding with LOGON_SAM_LOGON_PAUSE_RESPONSE_EX.

This happens if SysvolReady is still 0 under
HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq add check_cldap_reply_usable
Stefan Metzmacher [Thu, 17 Feb 2022 14:22:27 +0000 (15:22 +0100)]
sq add check_cldap_reply_usable

6 months agosq check_cldap_reply_usable no const
Stefan Metzmacher [Thu, 17 Feb 2022 14:19:29 +0000 (15:19 +0100)]
sq check_cldap_reply_usable no const

6 months agoTODO s3:libads: add check_cldap_reply_usable() helper function
Stefan Metzmacher [Thu, 17 Feb 2022 14:09:22 +0000 (15:09 +0100)]
TODO s3:libads: add check_cldap_reply_usable() helper function

TODO MS-ADTS 6.3.5 Mailslot Ping ...

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

6 months agoTODO s3:dsgetdcname: make use of ads_cldap_netlogon_5() to simplify the code
Stefan Metzmacher [Thu, 17 Feb 2022 12:24:38 +0000 (13:24 +0100)]
TODO s3:dsgetdcname: make use of ads_cldap_netlogon_5() to simplify the code

ads_cldap_netlogon_5() already calls map_netlogon_samlogon_response()
so there's no custom mapping code required anymore.

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

TODO: map_ds_flags_to_nt_version removal???

6 months agos3:dsgetdcname: remove unused nt_version argument of store_cldap_reply()
Stefan Metzmacher [Thu, 17 Feb 2022 14:14:49 +0000 (15:14 +0100)]
s3:dsgetdcname: remove unused nt_version argument of store_cldap_reply()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agos3:dsgetdcname: check_cldap_reply_required_flags() should check against the cached...
Stefan Metzmacher [Thu, 17 Feb 2022 12:21:53 +0000 (13:21 +0100)]
s3:dsgetdcname: check_cldap_reply_required_flags() should check against the cached reply

We should check against the raw CLDAP reply we stored in the cache.
This is much simpler to understand. It will also simplify further
fixes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq ads_cldap_netlogon_5 map_netlogon_samlogon_response
Stefan Metzmacher [Thu, 17 Feb 2022 14:22:40 +0000 (15:22 +0100)]
sq ads_cldap_netlogon_5 map_netlogon_samlogon_response

6 months agos3:libads: let ads_cldap_netlogon_5() call map_netlogon_samlogon_response()
Stefan Metzmacher [Thu, 17 Feb 2022 12:11:25 +0000 (13:11 +0100)]
s3:libads: let ads_cldap_netlogon_5() call map_netlogon_samlogon_response()

It's unlikely but possible that the server responded with a legacy response,
so there's no reason to fail instead of mapping the values.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agos3:libads: avoid changing ADS->server.workgroup
Stefan Metzmacher [Fri, 15 Oct 2021 01:34:11 +0000 (03:34 +0200)]
s3:libads: avoid changing ADS->server.workgroup

ads_find_dc() uses c_domain = ads->server.workgroup and
don't expect it to get out of scope deep in resolve_and_ping_dns().

The result are corrupted domain values in the debug output.

Valgrind shows this:

 Invalid read of size 1
    at 0x483EF46: strlen (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x608BE94: __vfprintf_internal (vfprintf-internal.c:1688)
    by 0x609ED49: __vasprintf_internal (vasprintf.c:57)
    by 0x5D2EC0F: __dbgtext_va (debug.c:1860)
    by 0x5D2ED3F: dbgtext (debug.c:1881)
    by 0x4BFFB50: ads_find_dc (ldap.c:570)
    by 0x4C001F4: ads_connect (ldap.c:704)
    by 0x4C1DC12: ads_dc_name (namequery_dc.c:84)
  Address 0xb69f6f0 is 0 bytes inside a block of size 11 free'd
    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4BFF0AF: ads_try_connect (ldap.c:299)
    by 0x4BFF40E: cldap_ping_list (ldap.c:367)
    by 0x4BFF75F: resolve_and_ping_dns (ldap.c:468)
    by 0x4BFFA91: ads_find_dc (ldap.c:556)
    by 0x4C001F4: ads_connect (ldap.c:704)
    by 0x4C1DC12: ads_dc_name (namequery_dc.c:84)
  Block was alloc'd at
    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x60B250E: strdup (strdup.c:42)
    by 0x4FF1492: smb_xstrdup (util.c:743)
    by 0x4C10E62: ads_init (ads_struct.c:148)
    by 0x4C1DB68: ads_dc_name (namequery_dc.c:73)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agoRevert "s3:libads: split out ads_fill_cldap_reply() out of ads_try_connect()"
Stefan Metzmacher [Wed, 7 Sep 2022 06:03:31 +0000 (08:03 +0200)]
Revert "s3:libads: split out ads_fill_cldap_reply() out of ads_try_connect()"

This reverts commit 1ae9106ba593f52095c1184ecfca32855aa454a7.

6 months agoRevert "s3:libads: let cldap_ping_list() use cldap_multi_netlogon()"
Stefan Metzmacher [Wed, 7 Sep 2022 06:03:31 +0000 (08:03 +0200)]
Revert "s3:libads: let cldap_ping_list() use cldap_multi_netlogon()"

This reverts commit 51fa91241bdbc80034e33eb95870caa222bd1e9e.

6 months agoRevert "s3:conncache: improve debugging for the negative connection cache"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "s3:conncache: improve debugging for the negative connection cache"

This reverts commit 5cf686c9757c8b0ef31f83b19d032a0d6d25bef6.

6 months agoRevert "winbindd: always use winbind_add_failed_connection_entry() wrapper"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "winbindd: always use winbind_add_failed_connection_entry() wrapper"

This reverts commit 4bbfbf80e53aa823adc054e40c8ef7e7c4792e18.

6 months agoRevert "winbindd: blacklist servers returning ACCESS_DENIED/authoritative=0"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "winbindd: blacklist servers returning ACCESS_DENIED/authoritative=0"

This reverts commit 21329a99985d29654501ef5ea1cc284e68eb537f.

6 months agoRevert "s3:libads: let cldap_ping_list() check for a blacklisted server name"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "s3:libads: let cldap_ping_list() check for a blacklisted server name"

This reverts commit 0772b26335423f76fab0636ff32849c0584136fe.

6 months agoRevert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1"

This reverts commit 8e16b123c33d434be979d8ac083e573956bdbfe9.

6 months agoRevert "Revert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received...
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "Revert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1""

This reverts commit 841662580fb0fa959b314ed91d749ae35789b128.

6 months agoRevert "sq s3:libads: let cldap_ping_list() check for a blacklisted server name"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "sq s3:libads: let cldap_ping_list() check for a blacklisted server name"

This reverts commit eab05ddacf1733e9fcf7ea60d12e3405da1dc27a.

6 months agoRevert "cldap_ping_list num_requests = 0"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "cldap_ping_list num_requests = 0"

This reverts commit c374eb24d6d6717393d76084bac6fc6a55161861.

6 months agoRevert "TODO source3/libads/ldap.c cldap_ping_list blacklist"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "TODO source3/libads/ldap.c cldap_ping_list blacklist"

This reverts commit 4916bc3e5839414d981da25464c46d1af8f4e502.

6 months agoRevert "TODO source3/libads/kerberos.c cldap_ping_list blacklist"
Stefan Metzmacher [Tue, 4 Jul 2023 16:09:11 +0000 (18:09 +0200)]
Revert "TODO source3/libads/kerberos.c cldap_ping_list blacklist"

This reverts commit 4dd3acbe4d6db46dbc5e765b44879d86f6ba0983.

6 months agoTODO source3/libads/kerberos.c cldap_ping_list blacklist
Stefan Metzmacher [Tue, 4 Jul 2023 16:07:51 +0000 (18:07 +0200)]
TODO source3/libads/kerberos.c cldap_ping_list blacklist

6 months agoTODO source3/libads/ldap.c cldap_ping_list blacklist
Stefan Metzmacher [Tue, 4 Jul 2023 16:07:26 +0000 (18:07 +0200)]
TODO source3/libads/ldap.c cldap_ping_list blacklist

6 months agosq s3:libads: let cldap_ping_list() check for a blacklisted server name
Stefan Metzmacher [Tue, 4 Jul 2023 15:26:01 +0000 (17:26 +0200)]
sq s3:libads: let cldap_ping_list() check for a blacklisted server name

6 months agoRevert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1"
Stefan Metzmacher [Tue, 4 Jul 2023 15:20:33 +0000 (17:20 +0200)]
Revert "TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1"

This reverts commit 8e16b123c33d434be979d8ac083e573956bdbfe9.

6 months agoTODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1
Stefan Metzmacher [Tue, 4 Jul 2023 15:20:07 +0000 (17:20 +0200)]
TODO/LATER: source3/libads/cldap.c PAUSE not state->num_good_received += 1

6 months agos3:libads: let cldap_ping_list() check for a blacklisted server name
Stefan Metzmacher [Wed, 16 Feb 2022 12:09:14 +0000 (13:09 +0100)]
s3:libads: let cldap_ping_list() check for a blacklisted server name

If we black listed a server we should not use it even if
it responses to CLDAP requests.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agowinbindd: blacklist servers returning ACCESS_DENIED/authoritative=0
Stefan Metzmacher [Wed, 16 Feb 2022 13:23:16 +0000 (14:23 +0100)]
winbindd: blacklist servers returning ACCESS_DENIED/authoritative=0

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agowinbindd: always use winbind_add_failed_connection_entry() wrapper
Stefan Metzmacher [Wed, 16 Feb 2022 13:18:50 +0000 (14:18 +0100)]
winbindd: always use winbind_add_failed_connection_entry() wrapper

We should not use add_failed_connection_entry() directly.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agos3:conncache: improve debugging for the negative connection cache
Stefan Metzmacher [Wed, 16 Feb 2022 13:18:20 +0000 (14:18 +0100)]
s3:conncache: improve debugging for the negative connection cache

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agoRevert "HACK nsswitch/wb_common.c no HAVE_PTHREAD"
Stefan Metzmacher [Thu, 7 Sep 2023 14:03:12 +0000 (16:03 +0200)]
Revert "HACK nsswitch/wb_common.c no HAVE_PTHREAD"

This reverts commit f8e0bbdf431cb3b989421496f620e1f82c91105a.

6 months agoHACK nsswitch/wb_common.c no HAVE_PTHREAD
Stefan Metzmacher [Thu, 7 Sep 2023 14:00:32 +0000 (16:00 +0200)]
HACK nsswitch/wb_common.c no HAVE_PTHREAD

6 months agoRevert "HACK nsswitch/wb_common.c no HAVE_PTHREAD"
Stefan Metzmacher [Thu, 7 Sep 2023 14:36:02 +0000 (16:36 +0200)]
Revert "HACK nsswitch/wb_common.c no HAVE_PTHREAD"

This reverts commit 59a135a54f96f686ae761d978cf83e498413e12f.

6 months agoHACK nsswitch/wb_common.c no HAVE_PTHREAD
Stefan Metzmacher [Thu, 7 Sep 2023 14:00:32 +0000 (16:00 +0200)]
HACK nsswitch/wb_common.c no HAVE_PTHREAD

6 months agoRevert "source4/torture/smb2/read_write.c"
Stefan Metzmacher [Tue, 12 Sep 2023 14:59:35 +0000 (16:59 +0200)]
Revert "source4/torture/smb2/read_write.c"

This reverts commit c22ff934bb57304e9d1f5bb06aa94061ee18cf75.

6 months agosource4/torture/smb2/read_write.c
Stefan Metzmacher [Tue, 12 Sep 2023 14:59:24 +0000 (16:59 +0200)]
source4/torture/smb2/read_write.c

6 months agoscript/autobuild.py check_symbols awk print
Stefan Metzmacher [Tue, 12 Sep 2023 14:22:35 +0000 (16:22 +0200)]
script/autobuild.py check_symbols awk print

6 months agosq TODO ldb compat ABI
Stefan Metzmacher [Wed, 13 Sep 2023 13:01:05 +0000 (15:01 +0200)]
sq TODO ldb compat ABI

6 months agoHACK lib/ldb/wscript private_library = False
Stefan Metzmacher [Wed, 13 Sep 2023 12:56:12 +0000 (14:56 +0200)]
HACK lib/ldb/wscript private_library = False

6 months agoRevert "HACK lib/ldb/wscript private_library = False"
Stefan Metzmacher [Wed, 13 Sep 2023 12:56:41 +0000 (14:56 +0200)]
Revert "HACK lib/ldb/wscript private_library = False"

This reverts commit c00a2d82f03f1e8802224f0801b4908671ca615f.

6 months agoHACK lib/ldb/wscript private_library = False
Stefan Metzmacher [Wed, 13 Sep 2023 12:56:12 +0000 (14:56 +0200)]
HACK lib/ldb/wscript private_library = False

6 months agosq TODO ldb compat ABI
Stefan Metzmacher [Wed, 13 Sep 2023 12:53:42 +0000 (14:53 +0200)]
sq TODO ldb compat ABI

6 months agoRevert "HACK lib/ldb/wscript force public_library"
Stefan Metzmacher [Wed, 13 Sep 2023 12:42:49 +0000 (14:42 +0200)]
Revert "HACK lib/ldb/wscript force public_library"

This reverts commit fe9afe6cda053ce2cbeb0428b9177b79cac6824d.

6 months agoHACK lib/ldb/wscript force public_library
Stefan Metzmacher [Wed, 13 Sep 2023 12:42:01 +0000 (14:42 +0200)]
HACK lib/ldb/wscript force public_library

6 months agoTODO ldb compat ABI
Stefan Metzmacher [Wed, 13 Sep 2023 12:41:31 +0000 (14:41 +0200)]
TODO ldb compat ABI

6 months agoRevert "lib/replace: avoid using libbsd for builtin linking"
Stefan Metzmacher [Wed, 13 Sep 2023 15:22:58 +0000 (17:22 +0200)]
Revert "lib/replace: avoid using libbsd for builtin linking"

This reverts commit bb9189df666e62098441120b7d3c1c1a1e772c1f.

6 months agoscript/autobuild.py: check that plugins are not against libbsd
Stefan Metzmacher [Tue, 12 Sep 2023 14:26:40 +0000 (16:26 +0200)]
script/autobuild.py: check that plugins are not against libbsd

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agolib/replace: avoid using libbsd for builtin linking
Stefan Metzmacher [Tue, 12 Sep 2023 13:22:03 +0000 (15:22 +0200)]
lib/replace: avoid using libbsd for builtin linking

This is similar to commit 66e90b7391bd404580f3919c4f2b8625c9c89c0e:
nsswitch: reduce dependecies to private libraries and link static/builtin if possible

There we tried to hide our internal symbols from applications loading
our plugins (e.g. libnss_winbind.so.2 or pam_winbind.so)

If we find libbsd in the system we link our plugins against it
and inject the symbols from it into the application, as the
symbols in libbsd have very common names, there's a change to
generate symbol conflicts causing unexpected behavior.

So we better use our own replacement functions from lib/replace
for the plugins instead of using the ones from libbsd
as we most likely not really need them. Currently we only
seem to use strlcpy() and we have our own version of it...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agowafsamba: add -D_SAMBA_BUILTIN_LINKING_ to detect builtin linking
Stefan Metzmacher [Tue, 12 Sep 2023 12:45:32 +0000 (14:45 +0200)]
wafsamba: add -D_SAMBA_BUILTIN_LINKING_ to detect builtin linking

This will help us to provide a stripped down version of libreplace
when doing builtin linking

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agowafsamba: allow explicit builtin_{source,deps}
Stefan Metzmacher [Tue, 12 Sep 2023 12:29:53 +0000 (14:29 +0200)]
wafsamba: allow explicit builtin_{source,deps}

This will be used in order to provide a mininal version
of libreplace...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agosq lib/crypto/tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c
Stefan Metzmacher [Fri, 15 Sep 2023 10:34:10 +0000 (12:34 +0200)]
sq lib/crypto/tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c

6 months agosq source3/utils/ntlm_auth.c
Stefan Metzmacher [Fri, 15 Sep 2023 10:32:03 +0000 (12:32 +0200)]
sq source3/utils/ntlm_auth.c

6 months agosource3/nmbd/nmbd_serverlistdb.c
Stefan Metzmacher [Fri, 15 Sep 2023 09:35:57 +0000 (11:35 +0200)]
source3/nmbd/nmbd_serverlistdb.c

6 months agolib/util/tests/test_talloc_keep_secret.c
Stefan Metzmacher [Fri, 15 Sep 2023 08:45:49 +0000 (10:45 +0200)]
lib/util/tests/test_talloc_keep_secret.c

6 months agoBINARY hide_symbols=False/True
Stefan Metzmacher [Wed, 13 Sep 2023 15:15:30 +0000 (17:15 +0200)]
BINARY hide_symbols=False/True

6 months agosource3/torture/test_idmap_tdb_common.c
Stefan Metzmacher [Wed, 13 Sep 2023 08:59:02 +0000 (10:59 +0200)]
source3/torture/test_idmap_tdb_common.c

6 months agosource3/utils/ntlm_auth.c
Stefan Metzmacher [Wed, 13 Sep 2023 08:57:14 +0000 (10:57 +0200)]
source3/utils/ntlm_auth.c

fedora38-samba-o3
==> /builds/samba-team/devel/samba/samba-o3.stderr <==
../../source3/utils/ntlm_auth.c: In function
‘manage_ntlm_server_1_request’:
../../source3/utils/ntlm_auth.c:1939:63: error: ‘%s’ directive argument
is null [-Werror=format-overflow=]
 1939 |                                 printf("Authentication-Error:
      %s\n.\n",
      |                                                               ^~
cc1: all warnings being treated as errors

6 months agolib/crypto/tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c
Stefan Metzmacher [Wed, 13 Sep 2023 08:54:06 +0000 (10:54 +0200)]
lib/crypto/tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c

6 months agolib/cmdline: CMDLINE_S3/S4 are linked into binaries and don't need to export symbols
Stefan Metzmacher [Tue, 12 Sep 2023 19:15:34 +0000 (21:15 +0200)]
lib/cmdline: CMDLINE_S3/S4 are linked into binaries and don't need to export symbols

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agowafsamba: use hide_symbols=True in SAMBA_BINARY()
Stefan Metzmacher [Tue, 12 Sep 2023 19:14:07 +0000 (21:14 +0200)]
wafsamba: use hide_symbols=True in SAMBA_BINARY()

binaries don't need to expose symbols by default.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agolib/util: fix possible truncation in dump_data_block16()
Stefan Metzmacher [Tue, 12 Sep 2023 19:42:32 +0000 (21:42 +0200)]
lib/util: fix possible truncation in dump_data_block16()

Prefix is a 1 or 0 characters, then 64bit hex value
can take 16 charachters + '[' + ']' + '\0', means
we need a buffer of 20 characters.

The next commit will cause some code to be inlined with -O3
in use, which found this possible truncation and complained
about it.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 months agos4/torture: fix exit status of raw.bench-lookup
Oleg Kravtsov [Fri, 6 Oct 2023 09:20:05 +0000 (12:20 +0300)]
s4/torture: fix exit status of raw.bench-lookup

Use correct value of 'result' when the test passes.

Signed-off-by: Oleg Kravtsov <oleg@tuxera.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Oct 16 02:01:17 UTC 2023 on atb-devel-224

6 months agogpdupate: Implement Drive Maps Client Side Extension
David Mulder [Fri, 10 Mar 2023 21:30:17 +0000 (14:30 -0700)]
gpdupate: Implement Drive Maps Client Side Extension

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agogpupdate: Test Drive Maps Client Side Extension
David Mulder [Fri, 10 Mar 2023 21:29:24 +0000 (14:29 -0700)]
gpupdate: Test Drive Maps Client Side Extension

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotevent: version 0.16.0 samba-upstream/tags/tevent-0.16.0
Stefan Metzmacher [Wed, 19 Jul 2023 21:04:01 +0000 (23:04 +0200)]
tevent: version 0.16.0

- the epoll backend is no longer limited to 2 event handlers
  per low level fd.
- finally add support for TEVENT_FD_ERROR

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct 13 10:45:51 UTC 2023 on atb-devel-224

6 months agotevent: add support for TEVENT_FD_ERROR
Stefan Metzmacher [Wed, 13 Jul 2011 07:46:26 +0000 (09:46 +0200)]
tevent: add support for TEVENT_FD_ERROR

After 12 years we finally got TEVENT_FD_ERROR support :-)

TEVENT_FD_WRITE event handlers never get errors reported
instead the event handler is silently disabled.
There are likely callers relying on that behavior, so
we are not able to chance it.

Now TEVENT_FD_WRITE can be used together with TEVENT_FD_ERROR
in order to get errors reported without waiting for TEVENT_FD_READ.

TEVENT_FD_ERROR can also be used alone in order to detect errors
on sockets in order to cleanup resources.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: add test_event_fd3
Stefan Metzmacher [Wed, 28 Dec 2022 15:54:24 +0000 (16:54 +0100)]
tevent: add test_event_fd3

The tests the interaction of multiple event handlers on
the same low level fd.

It shows that poll and epoll backends behave in the
same fair way.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: add test_fd_speed3
Stefan Metzmacher [Mon, 24 Apr 2023 14:37:38 +0000 (14:37 +0000)]
tevent: add test_fd_speed3

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: let tevent_epoll.c use new generic mpx infrastructure
Stefan Metzmacher [Fri, 11 Nov 2022 21:30:35 +0000 (22:30 +0100)]
tevent: let tevent_epoll.c use new generic mpx infrastructure

This allows any number of event handlers per low level fd.

It means the epoll backend behaves like the poll backend now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: add tevent_common_fd_mpx infrastructure
Stefan Metzmacher [Wed, 9 Nov 2022 21:48:10 +0000 (22:48 +0100)]
tevent: add tevent_common_fd_mpx infrastructure

Backends may require to map individual tevent_fd instances to
a single low level kernel state (e.g. for epoll).

This generic infrastructure adds helper functions using
a generic (sub)part of struct tevent_fd.

The new code will allow us to support more than 2 tevent_fd
instances per fd, which makes sure all backends can provide
a similar behavior. This will be important when we add
TEVENT_FD_ERROR as a 3rd kind of fd event.

The aim is to use this in order to replace the limited implementation
we already have in tevent_epoll.c.

As these helpers are typically called from within
'void tevent_fd_set_flags(struct tevent_fd *fde, uint16_t flags)'
there's no way to report errors. So in order avoid additional
error handling complexity the helpers try to avoid
any allocations which may fail. It also means the logic in
tevent_epoll.c doesn't have to change much.

These are implemented as static line functions in order to avoid
the function call overhead, which showed up in profiles of the
early implementation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: split out a tevent_common_fd_disarm() helper
Stefan Metzmacher [Thu, 31 Aug 2023 16:09:28 +0000 (18:09 +0200)]
tevent: split out a tevent_common_fd_disarm() helper

It means tevent_trace_fd_callback(TEVENT_EVENT_TRACE_DETACH)
is always called and similar future changes are only
needed in one place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agoldb: sync DLIST_DEMOTE_SHORT() changes to include/dlinklist.h
Stefan Metzmacher [Mon, 30 Jan 2023 15:10:07 +0000 (16:10 +0100)]
ldb: sync DLIST_DEMOTE_SHORT() changes to include/dlinklist.h

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agolib/util: sync DLIST_DEMOTE_SHORT() changes to dlinklist.h
Stefan Metzmacher [Mon, 30 Jan 2023 15:10:07 +0000 (16:10 +0100)]
lib/util: sync DLIST_DEMOTE_SHORT() changes to dlinklist.h

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agotevent: introduce DLIST_DEMOTE_SHORT()
Stefan Metzmacher [Mon, 30 Jan 2023 15:10:07 +0000 (16:10 +0100)]
tevent: introduce DLIST_DEMOTE_SHORT()

It turns out that the overhead of DLIST_DEMOTE() implemented
as DLIST_REMOVE();DLIST_ADD_END(), is very high if the list
contains only 1 or 2 elements.

The next commits will make use of DLIST_DEMOTE_SHORT() for
multiplexing multiple tevent_fd structures for a single fd
and the most important and common case is a list with just
one element.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 months agowintest: Fix invalid escape sequences
Joseph Sutton [Sun, 10 Sep 2023 23:59:55 +0000 (11:59 +1200)]
wintest: Fix invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct 13 04:55:06 UTC 2023 on atb-devel-224

6 months agoselftest: Use now() instead of utcnow()
Joseph Sutton [Mon, 2 Oct 2023 00:58:18 +0000 (13:58 +1300)]
selftest: Use now() instead of utcnow()

utcnow() is deprecated and will be removed in a future version of Python.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:torture: Use assertEqual() instead of assertEquals()
Joseph Sutton [Mon, 2 Oct 2023 00:35:32 +0000 (13:35 +1300)]
s4:torture: Use assertEqual() instead of assertEquals()

assertEquals() was removed in Python 3.12.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:dsdb:tests: Use loadTestsFromTestCase() instead of makeSuite()
Joseph Sutton [Mon, 2 Oct 2023 02:07:54 +0000 (15:07 +1300)]
s4:dsdb:tests: Use loadTestsFromTestCase() instead of makeSuite()

makeSuite() is deprecated and will be removed in Python 3.13.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:dsdb:tests: Fix assertion messages
Joseph Sutton [Mon, 2 Oct 2023 01:25:52 +0000 (14:25 +1300)]
s4:dsdb:tests: Fix assertion messages

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:dsdb:tests: Remove unused variables
Joseph Sutton [Mon, 2 Oct 2023 01:25:16 +0000 (14:25 +1300)]
s4:dsdb:tests: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos4:dsdb:tests: Remove unused imports
Joseph Sutton [Mon, 2 Oct 2023 01:24:49 +0000 (14:24 +1300)]
s4:dsdb:tests: Remove unused imports

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agos3:script: Remove semicolons
Joseph Sutton [Wed, 16 Aug 2023 23:20:40 +0000 (11:20 +1200)]
s3:script: Remove semicolons

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 months agotests/krb5: Fix assertion messages
Joseph Sutton [Mon, 2 Oct 2023 02:06:45 +0000 (15:06 +1300)]
tests/krb5: Fix assertion messages

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>