]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 months agopycredentials: add py_creds_encrypt_netr_PasswordInfo helper
Stefan Metzmacher [Mon, 28 Oct 2024 14:22:47 +0000 (15:22 +0100)] 
pycredentials: add py_creds_encrypt_netr_PasswordInfo helper

This will replace py_creds_encrypt_samr_password in the next steps
and prepares the introduction of netr_ServerAuthenticateKerberos().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agopycredentials: make use of netlogon_creds_encrypt_samr_CryptPassword in py_creds_encr...
Stefan Metzmacher [Mon, 28 Oct 2024 13:06:28 +0000 (14:06 +0100)] 
pycredentials: make use of netlogon_creds_encrypt_samr_CryptPassword in py_creds_encrypt_netr_crypt_password

These will simplify adding the logic for netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: add netlogon_creds_{de,en}crypt_SendToSam()
Stefan Metzmacher [Mon, 28 Oct 2024 12:13:50 +0000 (13:13 +0100)] 
libcli/auth: add netlogon_creds_{de,en}crypt_SendToSam()

These will simplify adding the logic for netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: add netlogon_creds_{de,en}crypt_samr_CryptPassword()
Stefan Metzmacher [Mon, 28 Oct 2024 12:12:24 +0000 (13:12 +0100)] 
libcli/auth: add netlogon_creds_{de,en}crypt_samr_CryptPassword()

These will simplify adding the logic for netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: add netlogon_creds_{de,en}crypt_samr_Password()
Stefan Metzmacher [Mon, 28 Oct 2024 12:03:37 +0000 (13:03 +0100)] 
libcli/auth: add netlogon_creds_{de,en}crypt_samr_Password()

These will simplify adding the logic for netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: pass auth_{type,level} to netlogon_creds_{de,en}crypt_samlogon_logon()
Stefan Metzmacher [Mon, 28 Oct 2024 11:55:12 +0000 (12:55 +0100)] 
libcli/auth: pass auth_{type,level} to netlogon_creds_{de,en}crypt_samlogon_logon()

This will be needed when we implement netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: pass auth_{type,level} to netlogon_creds_{de,en}crypt_samlogon_validation()
Stefan Metzmacher [Mon, 28 Oct 2024 11:43:44 +0000 (12:43 +0100)] 
libcli/auth: pass auth_{type,level} to netlogon_creds_{de,en}crypt_samlogon_validation()

This will be needed when we implement netr_ServerAuthenticateKerberos...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agonetlogon.idl: add netr_ServerAuthenticateKerberos() and related stuff
Stefan Metzmacher [Tue, 30 Apr 2024 13:14:47 +0000 (15:14 +0200)] 
netlogon.idl: add netr_ServerAuthenticateKerberos() and related stuff

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server: add DCESRV_COMPAT_NOT_USED_ON_WIRE() helper macro
Stefan Metzmacher [Tue, 10 Sep 2024 11:56:38 +0000 (13:56 +0200)] 
s3:rpc_server: add DCESRV_COMPAT_NOT_USED_ON_WIRE() helper macro

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agodcesrv_core: add DCESRV_NOT_USED_ON_WIRE() helper macro
Stefan Metzmacher [Tue, 10 Sep 2024 11:56:38 +0000 (13:56 +0200)] 
dcesrv_core: add DCESRV_NOT_USED_ON_WIRE() helper macro

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:rpc_server/netlogon: split out dcesrv_netr_ServerAuthenticateGeneric()
Stefan Metzmacher [Wed, 16 Oct 2024 15:55:41 +0000 (17:55 +0200)] 
s4:rpc_server/netlogon: split out dcesrv_netr_ServerAuthenticateGeneric()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:dsdb/common: dsdb_trust_get_incoming_passwords only needs a const ldb_message
Stefan Metzmacher [Wed, 16 Oct 2024 15:49:26 +0000 (17:49 +0200)] 
s4:dsdb/common: dsdb_trust_get_incoming_passwords only needs a const ldb_message

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: split out netlogon_creds_alloc()
Stefan Metzmacher [Wed, 16 Oct 2024 15:47:22 +0000 (17:47 +0200)] 
libcli/auth: split out netlogon_creds_alloc()

Review with: git show --patience

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: let netlogon_creds_cli_store_internal check netlogon_creds_CredentialSta...
Stefan Metzmacher [Thu, 10 Oct 2024 11:39:38 +0000 (13:39 +0200)] 
libcli/auth: let netlogon_creds_cli_store_internal check netlogon_creds_CredentialState_legacy

Before storing the structure into a ctdb managed volatile database
we check against netlogon_creds_CredentialState_legacy (the structure
used before recent changes). This makes sure unpatched cluster nodes
would not get a parsing error.

We'll remove this again in master when we try to implement
netr_ServerAuthenticateKerberos() and the related changes
to netlogon_creds_CredentialState, which will break the compat...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: let netlogon_creds_cli_store_internal() use talloc_stackframe()
Stefan Metzmacher [Thu, 10 Oct 2024 11:24:37 +0000 (13:24 +0200)] 
libcli/auth: let netlogon_creds_cli_store_internal() use talloc_stackframe()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: also use netlogon_creds_CredentialState_extra_info for the client
Stefan Metzmacher [Wed, 2 Oct 2024 17:06:59 +0000 (19:06 +0200)] 
libcli/auth: also use netlogon_creds_CredentialState_extra_info for the client

In order to allow backports and cluster updates we simulate a
dom_sid, so that the old code is able to parse the blob.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:torture/rpc: let test_netlogon_capabilities() fail on legacy servers
Stefan Metzmacher [Tue, 29 Oct 2024 08:27:30 +0000 (09:27 +0100)] 
s4:torture/rpc: let test_netlogon_capabilities() fail on legacy servers

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:rpc_server/netlogon: implement netr_LogonGetCapabilities query_level=2
Stefan Metzmacher [Wed, 19 Jul 2023 16:00:31 +0000 (18:00 +0200)] 
s4:rpc_server/netlogon: implement netr_LogonGetCapabilities query_level=2

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server/netlogon: implement netr_LogonGetCapabilities query_level=2
Stefan Metzmacher [Wed, 19 Jul 2023 16:03:09 +0000 (18:03 +0200)] 
s3:rpc_server/netlogon: implement netr_LogonGetCapabilities query_level=2

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: remember client_requested_flags and auth_time in netlogon_creds_server_i...
Stefan Metzmacher [Wed, 2 Oct 2024 17:06:59 +0000 (19:06 +0200)] 
libcli/auth: remember client_requested_flags and auth_time in netlogon_creds_server_init()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: remove unused creds->sid
Stefan Metzmacher [Wed, 2 Oct 2024 17:04:02 +0000 (19:04 +0200)] 
libcli/auth: remove unused creds->sid

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:rpc_server/netlogon: make use of creds->ex->client_sid
Stefan Metzmacher [Wed, 2 Oct 2024 17:01:39 +0000 (19:01 +0200)] 
s4:rpc_server/netlogon: make use of creds->ex->client_sid

creds->sid will be removed soon...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server/netlogon: make use of creds->ex->client_sid
Stefan Metzmacher [Wed, 2 Oct 2024 17:01:39 +0000 (19:01 +0200)] 
s3:rpc_server/netlogon: make use of creds->ex->client_sid

creds->sid will be removed soon...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibrpc/rpc: make use of creds->ex->client_sid in dcesrv_netr_check_schannel_get_state()
Stefan Metzmacher [Wed, 2 Oct 2024 17:00:45 +0000 (19:00 +0200)] 
librpc/rpc: make use of creds->ex->client_sid in dcesrv_netr_check_schannel_get_state()

creds->sid will be removed soon.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: split out netlogon_creds_CredentialState_extra_info
Stefan Metzmacher [Wed, 2 Oct 2024 16:54:05 +0000 (18:54 +0200)] 
libcli/auth: split out netlogon_creds_CredentialState_extra_info

As server we are free to change the netlogon_creds_CredentialState
database record format at will as it uses CLEAR_IF_FIRST.

For now that format doesn't really changes, because we
only move dom_sid into a wrapper structure.

In order to avoid changing all callers in this commit,
we maintain creds->sid as in memory pointer.

In the following patches we'll also use it in order
to store client related information...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: pass client_sid to netlogon_creds_server_init()
Stefan Metzmacher [Wed, 2 Oct 2024 16:46:43 +0000 (18:46 +0200)] 
libcli/auth: pass client_sid to netlogon_creds_server_init()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:rpc_server/netlogon: add client_sid helper variables
Stefan Metzmacher [Wed, 2 Oct 2024 16:06:44 +0000 (18:06 +0200)] 
s4:rpc_server/netlogon: add client_sid helper variables

This will make the following changes simpler...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server/netlogon: add client_sid helper variables
Stefan Metzmacher [Wed, 2 Oct 2024 16:06:44 +0000 (18:06 +0200)] 
s3:rpc_server/netlogon: add client_sid helper variables

This will make the following changes simpler...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:dsdb/common: samdb_confirm_rodc_allowed_to_repl_to() only needs a const sid
Stefan Metzmacher [Wed, 2 Oct 2024 16:04:27 +0000 (18:04 +0200)] 
s4:dsdb/common: samdb_confirm_rodc_allowed_to_repl_to() only needs a const sid

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:cli_netlogon: let rpccli_connect_netlogon() use force_reauth = true on retry
Stefan Metzmacher [Wed, 30 Oct 2024 11:10:49 +0000 (12:10 +0100)] 
s3:cli_netlogon: let rpccli_connect_netlogon() use force_reauth = true on retry

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:torture/rpc/netlogon: adjust test_netlogon_capabilities query_level=2 to request_flags
Stefan Metzmacher [Thu, 20 Jul 2023 11:29:12 +0000 (13:29 +0200)] 
s4:torture/rpc/netlogon: adjust test_netlogon_capabilities query_level=2 to request_flags

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:librpc/rpc: use netr_LogonGetCapabilities query_level=2 to verify the proposed...
Stefan Metzmacher [Wed, 2 Oct 2024 14:38:53 +0000 (16:38 +0200)] 
s4:librpc/rpc: use netr_LogonGetCapabilities query_level=2 to verify the proposed capabilities

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:librpc/rpc: define required schannel flags and enforce them
Stefan Metzmacher [Wed, 2 Oct 2024 14:38:53 +0000 (16:38 +0200)] 
s4:librpc/rpc: define required schannel flags and enforce them

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:librpc/rpc: don't allow any unexpected upgrades of negotiate_flags
Stefan Metzmacher [Wed, 2 Oct 2024 14:44:26 +0000 (16:44 +0200)] 
s4:librpc/rpc: don't allow any unexpected upgrades of negotiate_flags

Only remove the unsupported flags from local_negotiate_flags for
the next try...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:librpc/rpc: do LogonControl after LogonGetCapabilities downgrade
Stefan Metzmacher [Wed, 2 Oct 2024 14:15:46 +0000 (16:15 +0200)] 
s4:librpc/rpc: do LogonControl after LogonGetCapabilities downgrade

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: use netr_LogonGetCapabilities query_level=2 to verify the proposed capab...
Stefan Metzmacher [Wed, 2 Oct 2024 11:43:36 +0000 (13:43 +0200)] 
libcli/auth: use netr_LogonGetCapabilities query_level=2 to verify the proposed capabilities

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: use a LogonControl after a LogonGetCapabilities downgrade
Stefan Metzmacher [Wed, 2 Oct 2024 12:25:19 +0000 (14:25 +0200)] 
libcli/auth: use a LogonControl after a LogonGetCapabilities downgrade

If LogonGetCapabilities was downgraded by an DCERPC Fault, we
rely on the schannel message ordering to detect failures.

Instead of letting any real winbindd request trigger this,
we do it directly in netlogon_creds_cli_check() with
a LogonControl that is also used for 'wbinfo --ping-dc'.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: if we require aes we don't need to require arcfour nor strong key
Stefan Metzmacher [Thu, 10 Oct 2024 10:31:18 +0000 (12:31 +0200)] 
libcli/auth: if we require aes we don't need to require arcfour nor strong key

But we can send arcfour and strong key on the wire and don't need to
remove them from the proposed flags.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: don't allow any unexpected upgrades of negotiate_flags
Stefan Metzmacher [Wed, 2 Oct 2024 13:03:21 +0000 (15:03 +0200)] 
libcli/auth: don't allow any unexpected upgrades of negotiate_flags

Only remove the unsupported flags from state->current_flags for
the next try...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: make use of netlogon_creds_cli_store_internal() in netlogon_creds_cli_au...
Stefan Metzmacher [Wed, 19 Jul 2023 15:43:00 +0000 (17:43 +0200)] 
libcli/auth: make use of netlogon_creds_cli_store_internal() in netlogon_creds_cli_auth_srvauth_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agolibcli/auth: remove unused netlogon_creds_client_init_session_key()
Stefan Metzmacher [Wed, 2 Oct 2024 17:06:59 +0000 (19:06 +0200)] 
libcli/auth: remove unused netlogon_creds_client_init_session_key()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agonetlogon.idl: the capabilities in query_level=2 are the ones send by the client
Stefan Metzmacher [Wed, 19 Jul 2023 07:27:48 +0000 (09:27 +0200)] 
netlogon.idl: the capabilities in query_level=2 are the ones send by the client

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:rpc_server/netlogon: if we require AES there's no need to remove the ARCFOUR flag
Stefan Metzmacher [Thu, 10 Oct 2024 10:34:33 +0000 (12:34 +0200)] 
s4:rpc_server/netlogon: if we require AES there's no need to remove the ARCFOUR flag

With SAMBA_WEAK_CRYPTO_DISALLOWED dcesrv_netr_ServerAuthenticate3_check_downgrade()
will return DOWNGRADE_DETECTED with negotiate_flags = 0, if AES was not
negotiated...

And if AES was negotiated there's no harm in returning the ARCFOUR
flag...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server/netlogon: if we require AES there's no need to remove the ARCFOUR flag
Stefan Metzmacher [Thu, 10 Oct 2024 10:34:33 +0000 (12:34 +0200)] 
s3:rpc_server/netlogon: if we require AES there's no need to remove the ARCFOUR flag

With SAMBA_WEAK_CRYPTO_DISALLOWED we will return DOWNGRADE_DETECTED with negotiate_flags = 0,
if AES was not negotiated...

And if AES was negotiated there's no harm in returning the ARCFOUR
flag...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos3:rpc_server/netlogon: correctly negotiate flags in ServerAuthenticate2/3
Stefan Metzmacher [Wed, 19 Jul 2023 10:55:33 +0000 (12:55 +0200)] 
s3:rpc_server/netlogon: correctly negotiate flags in ServerAuthenticate2/3

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:torture/rpc: without weak crypto we should require AES
Stefan Metzmacher [Thu, 10 Oct 2024 13:02:16 +0000 (15:02 +0200)] 
s4:torture/rpc: without weak crypto we should require AES

We should check that we can actually negotiated the strong AES
crypto instead of just checking that NETLOGON_NEG_ARCFOUR is not
there...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agos4:torture/rpc: check that DOWNGRADE_DETECTED has no bits negotiated
Stefan Metzmacher [Thu, 10 Oct 2024 13:08:01 +0000 (15:08 +0200)] 
s4:torture/rpc: check that DOWNGRADE_DETECTED has no bits negotiated

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
9 months agosmbd: fix sharing access check for directories
Ralph Boehme [Fri, 25 Oct 2024 15:22:57 +0000 (17:22 +0200)] 
smbd: fix sharing access check for directories

This was missing from commit 6140c3177a0330f42411618c3fca28930ea02a21 and causes
all opens of directories to be handled as stat opens, bypassing the sharemode
check.

Not adding a test at this time, as my (hopefully) soon to be merged Directory
Leases branch has a test which actually detected this problem.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 29 12:44:49 UTC 2024 on atb-devel-224

9 months agosmbd: convert fsp->posix_flags to fsp->fsp_flags.posix_open
Ralph Boehme [Fri, 4 Oct 2024 17:22:39 +0000 (19:22 +0200)] 
smbd: convert fsp->posix_flags to fsp->fsp_flags.posix_open

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Oct 25 11:50:01 UTC 2024 on atb-devel-224

9 months agosmbd: remove seperate flag FSP_POSIX_FLAGS_PATHNAMES
Ralph Boehme [Fri, 4 Oct 2024 17:05:36 +0000 (19:05 +0200)] 
smbd: remove seperate flag FSP_POSIX_FLAGS_PATHNAMES

Essentially FSP_POSIX_FLAGS_OPEN implies FSP_POSIX_FLAGS_PATHNAMES, so we can
just remove FSP_POSIX_FLAGS_PATHNAMES and simplify things.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agosmbd: remove "fruit:posix_rename"
Ralph Boehme [Fri, 4 Oct 2024 17:01:19 +0000 (19:01 +0200)] 
smbd: remove "fruit:posix_rename"

This option of the vfs_fruit VFS module that could be used to enable POSIX
directory rename behaviour for OS X clients has been removed as it could result
in severe problems for Windows clients.

As a possible workaround it is possible to prevent creation of .DS_Store files
(a Finder thingy to store directory view settings) on network mounts by running

  $ defaults write com.apple.desktopservices DSDontWriteNetworkStores true

on the Mac.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agovfs_ceph_new: switch to ceph_readdir_r
Shachar Sharon [Tue, 3 Sep 2024 13:54:03 +0000 (16:54 +0300)] 
vfs_ceph_new: switch to ceph_readdir_r

Prefer a safe version of ceph_readdir, where the directory entry struct
is allocated by the caller. Use a dynamic-allocated 'struct dirent'
which is associated with a directory vfs_ceph_fh (optional), which is
allocated on-the-fly upon start of READDIR and released at the end or
CLOSEDIR (or unlikely readdir error).

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Oct 25 10:29:44 UTC 2024 on atb-devel-224

9 months agocldap: Save a few lines in cldap_netlogon
Volker Lendecke [Thu, 24 Oct 2024 11:59:42 +0000 (13:59 +0200)] 
cldap: Save a few lines in cldap_netlogon

Follow recent convention to write sync wrappers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct 25 09:04:11 UTC 2024 on atb-devel-224

9 months agocldap: Simplify cldap_netlogon with tevent_req_poll_ntstatus
Volker Lendecke [Thu, 24 Oct 2024 11:58:04 +0000 (13:58 +0200)] 
cldap: Simplify cldap_netlogon with tevent_req_poll_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agoidl: nbt.idl references NTTIME
Volker Lendecke [Thu, 24 Oct 2024 11:51:49 +0000 (13:51 +0200)] 
idl: nbt.idl references NTTIME

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibads: Modernize DEBUGs
Volker Lendecke [Thu, 24 Oct 2024 10:10:42 +0000 (12:10 +0200)] 
libads: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agonet_ads: Fix indentation in net_ads_cldap_netlogon_json
Volker Lendecke [Thu, 24 Oct 2024 09:51:41 +0000 (11:51 +0200)] 
net_ads: Fix indentation in net_ads_cldap_netlogon_json

This was not easy to read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibads: Simplify get_kdc_ip_string with talloc_asprintf_addbuf
Volker Lendecke [Thu, 24 Oct 2024 09:37:55 +0000 (11:37 +0200)] 
libads: Simplify get_kdc_ip_string with talloc_asprintf_addbuf

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibads: Init a variable to NULL
Volker Lendecke [Thu, 24 Oct 2024 09:19:09 +0000 (11:19 +0200)] 
libads: Init a variable to NULL

README.Coding

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibads: Simplify cldap_multi_netlogon_send()
Volker Lendecke [Tue, 22 Oct 2024 11:43:23 +0000 (13:43 +0200)] 
libads: Simplify cldap_multi_netlogon_send()

Save a few lines with a struct initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agonmbd: Remove the "nmbd proxy logon" feature
Volker Lendecke [Thu, 24 Oct 2024 11:43:09 +0000 (13:43 +0200)] 
nmbd: Remove the "nmbd proxy logon" feature

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agos3:libsmb: Make parse_node_status() more robust
Andreas Schneider [Fri, 18 Oct 2024 06:07:47 +0000 (08:07 +0200)] 
s3:libsmb: Make parse_node_status() more robust

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Oct 24 12:05:10 UTC 2024 on atb-devel-224

9 months agos3:winbind: Fix heap buffer overflow in winbind
Andreas Schneider [Thu, 17 Oct 2024 17:33:47 +0000 (19:33 +0200)] 
s3:winbind: Fix heap buffer overflow in winbind

==36258==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x51300000b096 at pc 0x7fb6b4880b46 bp 0x7ffc67d44b40 sp 0x7ffc67d44300
READ of size 1 at 0x51300000b096 thread T0
    #0 0x7fb6b4880b45 in strlen ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:391
    #1 0x560fe898cde3 in winbindd_wins_byip_done ../../source3/winbindd/winbindd_wins_byip.c:111
    #2 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #3 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #4 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #5 0x7fb6b1e24c80 in node_status_query_done ../../source3/libsmb/namequery.c:904
    #6 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #7 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #8 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #9 0x7fb6b1e250bc in nb_trans_done ../../source3/libsmb/namequery.c:756
    #10 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #11 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #12 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #13 0x7fb6b1e270af in sock_packet_read_got_socket ../../source3/libsmb/namequery.c:537
    #14 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #15 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #16 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #17 0x7fb6b33db183 in tdgram_recvfrom_done ../../lib/tsocket/tsocket.c:240
    #18 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #19 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #20 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #21 0x7fb6b33e0d99 in tdgram_bsd_recvfrom_handler ../../lib/tsocket/tsocket_bsd.c:1087
    #22 0x7fb6b33e0263 in tdgram_bsd_fde_handler ../../lib/tsocket/tsocket_bsd.c:811
    #23 0x7fb6b4ef5ac1 in tevent_common_invoke_fd_handler ../../lib/tevent/tevent_fd.c:174
    #24 0x7fb6b4f0b185 in epoll_event_loop ../../lib/tevent/tevent_epoll.c:696
    #25 0x7fb6b4f0b185 in epoll_event_loop_once ../../lib/tevent/tevent_epoll.c:926
    #26 0x7fb6b4f037b8 in std_event_loop_once ../../lib/tevent/tevent_standard.c:110
    #27 0x7fb6b4ef3549 in _tevent_loop_once ../../lib/tevent/tevent.c:820
    #28 0x560fe8a15198 in main ../../source3/winbindd/winbindd.c:1729
    #29 0x7fb6afe2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #30 0x7fb6afe2a378 in __libc_start_main_impl ../csu/libc-start.c:360
    #31 0x560fe89454e4 in _start ../sysdeps/x86_64/start.S:115

0x51300000b096 is located 12 bytes after 330-byte region [0x51300000af40,0x51300000b08a)
allocated by thread T0 here:
    #0 0x7fb6b48fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7fb6b3a64c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7fb6b3a66acf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7fb6b3a66acf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7fb6b3a66acf in _talloc_array ../../lib/talloc/talloc.c:2784
    #5 0x7fb6b1e2b43e in parse_node_status ../../source3/libsmb/namequery.c:337
    #6 0x7fb6b1e2b43e in node_status_query_recv ../../source3/libsmb/namequery.c:921
    #7 0x560fe898cc4f in winbindd_wins_byip_done ../../source3/winbindd/winbindd_wins_byip.c:87
    #8 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #9 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #10 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #11 0x7fb6b1e24c80 in node_status_query_done ../../source3/libsmb/namequery.c:904
    #12 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #13 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #14 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #15 0x7fb6b1e250bc in nb_trans_done ../../source3/libsmb/namequery.c:756
    #16 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #17 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #18 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #19 0x7fb6b1e270af in sock_packet_read_got_socket ../../source3/libsmb/namequery.c:537
    #20 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #21 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #22 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #23 0x7fb6b33db183 in tdgram_recvfrom_done ../../lib/tsocket/tsocket.c:240
    #24 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #25 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #26 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #27 0x7fb6b33e0d99 in tdgram_bsd_recvfrom_handler ../../lib/tsocket/tsocket_bsd.c:1087
    #28 0x7fb6b33e0263 in tdgram_bsd_fde_handler ../../lib/tsocket/tsocket_bsd.c:811
    #29 0x7fb6b4ef5ac1 in tevent_common_invoke_fd_handler ../../lib/tevent/tevent_fd.c:174
    #30 0x7fb6b4f0b185 in epoll_event_loop ../../lib/tevent/tevent_epoll.c:696
    #31 0x7fb6b4f0b185 in epoll_event_loop_once ../../lib/tevent/tevent_epoll.c:926
    #32 0x7fb6b4f037b8 in std_event_loop_once ../../lib/tevent/tevent_standard.c:110
    #33 0x7fb6b4ef3549 in _tevent_loop_once ../../lib/tevent/tevent.c:820

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos3:utils: Fix memory leak in test_lmv2_ntlmv2_broken()
Andreas Schneider [Fri, 18 Oct 2024 13:32:58 +0000 (15:32 +0200)] 
s3:utils: Fix memory leak in test_lmv2_ntlmv2_broken()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos3:utils: Fix memory leak in ntlm_auth_diagnostics
Andreas Schneider [Thu, 17 Oct 2024 13:10:22 +0000 (15:10 +0200)] 
s3:utils: Fix memory leak in ntlm_auth_diagnostics

Direct leak of 120 byte(s) in 1 object(s) allocated from:
    #0 0x7f2f7f0fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7f2f7ee24c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7f2f7ee26acf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7f2f7ee26acf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7f2f7ee26acf in _talloc_array ../../lib/talloc/talloc.c:2784
    #5 0x7f2f7e3f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58
    #6 0x7f2f7e3f6b1b in data_blob_named ../../lib/util/data_blob.c:40
    #7 0x5570b9e36100 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:56
    #8 0x5570b9e36b5d in test_ntlm ../../source3/utils/ntlm_auth_diagnostics.c:180
    #9 0x5570b9e387f3 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:707
    #10 0x5570b9e34efd in main ../../source3/utils/ntlm_auth.c:2855
    #11 0x7f2f7ba2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos3:utils: Remove trailing spaces in ntlm_auth_diagnostics.c
Andreas Schneider [Thu, 17 Oct 2024 13:12:02 +0000 (15:12 +0200)] 
s3:utils: Remove trailing spaces in ntlm_auth_diagnostics.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos3:utils: Fix memory leak in ntlm_auth
Andreas Schneider [Tue, 15 Oct 2024 15:49:38 +0000 (17:49 +0200)] 
s3:utils: Fix memory leak in ntlm_auth

Direct leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x7fc5afefc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7fc5afaefc57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7fc5afaf18cf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7fc5afaf18cf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7fc5afaf18cf in _talloc_zero ../../lib/talloc/talloc.c:2421
    #5 0x7fc5aeac4809 in loadparm_init_s3 ../../lib/param/loadparm.c:3223
    #6 0x560ee34b3949 in main ../../source3/utils/ntlm_auth.c:2806
    #7 0x7fc5ac62a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos4:client: Fix memory leaks in smblcient4
Andreas Schneider [Tue, 15 Oct 2024 15:41:57 +0000 (17:41 +0200)] 
s4:client: Fix memory leaks in smblcient4

==375711==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20 byte(s) in 1 object(s) allocated from:
    #0 0x7f83838f6880 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x55a06cc7c244 in main ../../source4/client/client.c:3470
    #2 0x7f837fe2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos4:client: Remove trailing spaces in client.c
Andreas Schneider [Wed, 16 Oct 2024 06:46:43 +0000 (08:46 +0200)] 
s4:client: Remove trailing spaces in client.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos4:torture: Fix memory leak in torture_decode_compare_pac()
Andreas Schneider [Thu, 17 Oct 2024 13:04:34 +0000 (15:04 +0200)] 
s4:torture: Fix memory leak in torture_decode_compare_pac()

Direct leak of 200 byte(s) in 1 object(s) allocated from:
    #0 0x7f42972fc130 in calloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f4296cf3054 in wbcAllocateMemory ../../nsswitch/libwbclient/wbclient.c:216
    #2 0x7f4296cf386c in wbc_create_auth_info ../../nsswitch/libwbclient/wbc_pam.c:96
    #3 0x7f4296cf59a1 in wbcCtxAuthenticateUserEx ../../nsswitch/libwbclient/wbc_pam.c:561
    #4 0x7f4296cf5d98 in wbcAuthenticateUserEx ../../nsswitch/libwbclient/wbc_pam.c:578
    #5 0x55f8ff6023f1 in torture_decode_compare_pac ../../source4/torture/winbind/winbind.c:120
    #6 0x55f8ff6023f1 in torture_winbind_pac ../../source4/torture/winbind/winbind.c:291
    #7 0x55f8ff603c98 in torture_winbind_pac_gss_spnego ../../source4/torture/winbind/winbind.c:303
    #8 0x7f4295ff560c in wrap_simple_test ../../lib/torture/torture.c:712
    #9 0x7f4295ff748d in internal_torture_run_test ../../lib/torture/torture.c:520
    #10 0x7f4295ff7904 in torture_run_tcase_restricted ../../lib/torture/torture.c:585
    #11 0x7f4295ff7e69 in torture_run_suite_restricted ../../lib/torture/torture.c:439
    #12 0x55f8ff7980ba in run_matching ../../source4/torture/smbtorture.c:96
    #13 0x55f8ff798141 in run_matching ../../source4/torture/smbtorture.c:106
    #14 0x55f8ff798e41 in torture_run_named_tests ../../source4/torture/smbtorture.c:173
    #15 0x55f8ff79cf03 in main ../../source4/torture/smbtorture.c:754
    #16 0x7f4291a2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agos4:torture: Remove trailing spaces in winbind.c
Andreas Schneider [Thu, 17 Oct 2024 13:11:26 +0000 (15:11 +0200)] 
s4:torture: Remove trailing spaces in winbind.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agonsswitch: Fix memory leak in wbcDomainInfoList
Andreas Schneider [Tue, 15 Oct 2024 15:46:24 +0000 (17:46 +0200)] 
nsswitch: Fix memory leak in wbcDomainInfoList

==379167==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 44 byte(s) in 2 object(s) allocated from:
    #0 0x7f54522f6880 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f54520d5a95 in process_domain_info_string ../../nsswitch/libwbclient/wbc_util.c:471
    #2 0x7f54520d5a95 in wbcCtxListTrusts ../../nsswitch/libwbclient/wbc_util.c:612
    #3 0x7f54520d6426 in wbcListTrusts ../../nsswitch/libwbclient/wbc_util.c:632
    #4 0x558c48799cf7 in wbinfo_list_domains ../../nsswitch/wbinfo.c:515
    #5 0x558c487a72db in main ../../nsswitch/wbinfo.c:3300
    #6 0x7f544f42a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agonsswitch: Fix memory leak in nsstest
Andreas Schneider [Tue, 15 Oct 2024 15:12:07 +0000 (17:12 +0200)] 
nsswitch: Fix memory leak in nsstest

Direct leak of 832 byte(s) in 13 object(s) allocated from:
    #0 0x7efc8e0fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x562cb6e96d44 in nss_test_initgroups ../../nsswitch/nsstest.c:381
    #2 0x562cb6e96d44 in nss_test_users ../../nsswitch/nsstest.c:424
    #3 0x562cb6e96d44 in main ../../nsswitch/nsstest.c:493
    #4 0x7efc8dc2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agonsswitch: Fix memory leak in wbinfo_auth_krb5()
Andreas Schneider [Tue, 15 Oct 2024 06:51:43 +0000 (08:51 +0200)] 
nsswitch: Fix memory leak in wbinfo_auth_krb5()

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff206afc130 in calloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7ff206837054 in wbcAllocateMemory ../../nsswitch/libwbclient/wbclient.c:216
    #2 0x7ff20683c76a in wbc_create_password_policy_info ../../nsswitch/libwbclient/wbc_pam.c:295
    #3 0x7ff20683c76a in wbcCtxLogonUser ../../nsswitch/libwbclient/wbc_pam.c:1290
    #4 0x7ff20683caec in wbcLogonUser ../../nsswitch/libwbclient/wbc_pam.c:1307
    #5 0x556ea348db12 in wbinfo_auth_krb5 ../../nsswitch/wbinfo.c:1723
    #6 0x556ea348db12 in main ../../nsswitch/wbinfo.c:3238
    #7 0x7ff203c2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 months agoFix pam failure to register Pin following mfa poll
David Mulder [Mon, 9 Sep 2024 19:30:55 +0000 (13:30 -0600)] 
Fix pam failure to register Pin following mfa poll

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Oct 23 15:39:09 UTC 2024 on atb-devel-224

10 months agoautobuild: Configure samba-o3 for himmelblau testing
David Mulder [Fri, 30 Aug 2024 14:58:43 +0000 (08:58 -0600)] 
autobuild: Configure samba-o3 for himmelblau testing

The 'samba' build excludes the 'none' tests,
which is where the Rust tests are located.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoFix usage test broken by rust vendor sources
David Mulder [Thu, 29 Aug 2024 20:09:56 +0000 (14:09 -0600)] 
Fix usage test broken by rust vendor sources

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoautobuild: Only enable rust build if cargo exists
David Mulder [Thu, 29 Aug 2024 17:22:59 +0000 (11:22 -0600)] 
autobuild: Only enable rust build if cargo exists

We need to do this to prevent CI systems which
are missing cargo (Debian) from attempting to
configure with Rust.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd configure checks for glibc and openssl versions
David Mulder [Wed, 28 Aug 2024 20:32:30 +0000 (14:32 -0600)] 
Add configure checks for glibc and openssl versions

Add configure checks to determine if rust or
specifically himmelblau sources can be compiled.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoglibc needs to be at least vers 2.32 for rust
David Mulder [Wed, 28 Aug 2024 19:34:09 +0000 (13:34 -0600)] 
glibc needs to be at least vers 2.32 for rust

The libc crate won't build on versions older than
2.32.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoautobuild: Only configure himmelblau if openssl >= 3
David Mulder [Tue, 27 Aug 2024 21:39:36 +0000 (15:39 -0600)] 
autobuild: Only configure himmelblau if openssl >= 3

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd pyglue for Rust for disabling tests
David Mulder [Tue, 27 Aug 2024 21:06:02 +0000 (15:06 -0600)] 
Add pyglue for Rust for disabling tests

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoDisable the rust build by default
David Mulder [Tue, 27 Aug 2024 20:47:29 +0000 (14:47 -0600)] 
Disable the rust build by default

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoFix Rocky8 build for utf8proc-devel
David Mulder [Tue, 27 Aug 2024 20:26:45 +0000 (14:26 -0600)] 
Fix Rocky8 build for utf8proc-devel

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoFix pam echo not displayed via ssh
David Mulder [Mon, 26 Aug 2024 17:06:31 +0000 (11:06 -0600)] 
Fix pam echo not displayed via ssh

Necessary because of OpenSSH bug
https://bugzilla.mindrot.org/show_bug.cgi?id=2876 -
PAM_TEXT_INFO and PAM_ERROR_MSG conversation not
honoured during PAM authentication

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd the user's primary group to the cache
David Mulder [Mon, 26 Aug 2024 13:33:25 +0000 (07:33 -0600)] 
Add the user's primary group to the cache

We create a fake primary group which simply
matches the user's upn. This is because Entra ID
does not have primary groups, but we can fake it
with a primary group which is a member of all the
users groups.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoFetch the target join os via std::env::consts
David Mulder [Fri, 23 Aug 2024 21:27:51 +0000 (15:27 -0600)] 
Fetch the target join os via std::env::consts

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoProperly handle read/write from the client socket
David Mulder [Fri, 23 Aug 2024 20:51:24 +0000 (14:51 -0600)] 
Properly handle read/write from the client socket

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoEnsure clients can write to the himmelblau pipe
David Mulder [Fri, 23 Aug 2024 20:29:49 +0000 (14:29 -0600)] 
Ensure clients can write to the himmelblau pipe

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoRemove the existing socket if present
David Mulder [Fri, 23 Aug 2024 20:07:08 +0000 (14:07 -0600)] 
Remove the existing socket if present

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoUse the s4 param functions to access idmap values
David Mulder [Fri, 23 Aug 2024 18:45:44 +0000 (12:45 -0600)] 
Use the s4 param functions to access idmap values

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAlways print a newline at the end of debug msgs
David Mulder [Fri, 23 Aug 2024 15:02:51 +0000 (09:02 -0600)] 
Always print a newline at the end of debug msgs

Otherwise the message doesn't flush to the log
and could be lost when the program terminates.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd talloc stackframe handling
David Mulder [Fri, 23 Aug 2024 14:02:01 +0000 (08:02 -0600)] 
Add talloc stackframe handling

This appeases errors from libsmbconf that no
talloc stackframe was created.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoFix display of function names in debug
David Mulder [Thu, 22 Aug 2024 21:23:15 +0000 (15:23 -0600)] 
Fix display of function names in debug

Rust adds some odd `{{closure}}` bits to the
function name that need to be removed, otherwise
the debug is unreadable.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd warnings for missing directories at runtime
David Mulder [Thu, 22 Aug 2024 20:46:17 +0000 (14:46 -0600)] 
Add warnings for missing directories at runtime

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoOnly set the debug logfile if not stdout
David Mulder [Thu, 22 Aug 2024 20:24:31 +0000 (14:24 -0600)] 
Only set the debug logfile if not stdout

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAdd tests for rust himmelblaud build
David Mulder [Thu, 22 Aug 2024 14:16:44 +0000 (08:16 -0600)] 
Add tests for rust himmelblaud build

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoAlways normalize cache inputs to lowercase
David Mulder [Thu, 22 Aug 2024 18:54:32 +0000 (12:54 -0600)] 
Always normalize cache inputs to lowercase

This prevents mixed case issues when storing/
retrieving data from the cache.

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

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 months agoImprove cargo test output
David Mulder [Tue, 13 Aug 2024 21:06:42 +0000 (15:06 -0600)] 
Improve cargo test output

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>