]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
12 months agosmbd: add fsp_get_smb2_lease()
Ralph Boehme [Wed, 19 May 2021 14:58:21 +0000 (16:58 +0200)] 
smbd: add fsp_get_smb2_lease()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: ndrprint lease value in leases_db_set_fn()
Ralph Boehme [Wed, 12 May 2021 19:31:27 +0000 (21:31 +0200)] 
smbd: ndrprint lease value in leases_db_set_fn()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: check for handle lease break on destination when renaming
Ralph Boehme [Fri, 18 Oct 2024 06:02:21 +0000 (08:02 +0200)] 
smbd: check for handle lease break on destination when renaming

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: Split out smb2_parse_file_rename_information()
Ralph Boehme [Fri, 20 Sep 2024 03:14:12 +0000 (05:14 +0200)] 
smbd: Split out smb2_parse_file_rename_information()

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: expand test test_lease_v2_rename_target_overwrite()
Ralph Boehme [Mon, 14 Oct 2024 15:20:16 +0000 (17:20 +0200)] 
smbtorture: expand test test_lease_v2_rename_target_overwrite()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: recursive delay_for_handle_lease_break_send()
Ralph Boehme [Thu, 17 Oct 2024 17:18:57 +0000 (19:18 +0200)] 
smbd: recursive delay_for_handle_lease_break_send()

Check for open files recursively when renaming a directory and wait for handle
lease breaks.

As delay_for_handle_lease_break_send() does the same check as
have_file_open_below(), remove have_file_open_below() from can_rename() so it is
not called twice for SMB2 renames, and add calls to have_file_open_below() to the
SMB1 entry rename entry points.

This is a bit ugly, but I don't see any other good way of doing this.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: consolidate "have_file_open_below" logic in have_file_open_below()
Ralph Boehme [Sun, 13 Oct 2024 15:44:18 +0000 (17:44 +0200)] 
smbd: consolidate "have_file_open_below" logic in have_file_open_below()

Let have_file_open_below() be the single function to check if
"have_file_open_below" and let it check internally whether to just search the
fsp list in the process or traversing locking.tdb based on the setting of
"strict rename".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3/locking: pass file_id instead of lck to share_mode_watch_send()
Ralph Boehme [Sun, 13 Oct 2024 09:57:45 +0000 (11:57 +0200)] 
s3/locking: pass file_id instead of lck to share_mode_watch_send()

In the future not all callers will have a share_mode_lock around.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: print lease key using hex format in get_lease_type()
Ralph Boehme [Wed, 2 Oct 2024 05:46:48 +0000 (07:46 +0200)] 
smbd: print lease key using hex format in get_lease_type()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: add has_nonposix_opens()
Ralph Boehme [Wed, 16 Oct 2024 05:37:25 +0000 (07:37 +0200)] 
smbd: add has_nonposix_opens()

...reusing has_other_nonposix_opens_fn().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: ignore POSIX opens in file_find_subpath()
Ralph Boehme [Sun, 6 Oct 2024 14:37:47 +0000 (16:37 +0200)] 
smbd: ignore POSIX opens in file_find_subpath()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: ignore POSIX and stale opens in have_file_open_below()
Ralph Boehme [Mon, 30 Sep 2024 14:50:49 +0000 (16:50 +0200)] 
smbd: ignore POSIX and stale opens in have_file_open_below()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: add opens_below_forall() and opens_below_forall_read()
Ralph Boehme [Sat, 12 Oct 2024 14:33:47 +0000 (16:33 +0200)] 
smbd: add opens_below_forall() and opens_below_forall_read()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3/locking: add share_entry_forall_read() and share_entry_forall() varients
Ralph Boehme [Sun, 13 Oct 2024 09:11:32 +0000 (11:11 +0200)] 
s3/locking: add share_entry_forall_read() and share_entry_forall() varients

All existing callers use share_entry_forall_read, so no change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3/locking: tweak share_entry_forall()
Ralph Boehme [Sat, 12 Oct 2024 14:03:56 +0000 (16:03 +0200)] 
s3/locking: tweak share_entry_forall()

Gives the callback function more control about when of a locking.tdb
traverse is stopped. If the callback function returns:

  0 => continue traverse
  1 => stop loop over share_mode_entries, but continue share_mode_data traverse
 -1 => stop whole share_mode_data traverse

All existing callers of share_entry_forall() either return 0 or -1 from their
callback functions, so no change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3/locking: add share_mode_forall() and share_mode_forall_read() varients
Ralph Boehme [Sat, 12 Oct 2024 15:32:01 +0000 (17:32 +0200)] 
s3/locking: add share_mode_forall() and share_mode_forall_read() varients

All existing callers use share_mode_forall_read(), so no change in behaviour.

Note: doing the indirection via the function pointers "ro_fn" and "rw_fn" in a
single state "struct share_mode_forall_state" avoids duplicating
share_mode_forall_dump_fn() and share_mode_forall_fn() and has the benefit of
code sharing of these functions for both read-only and read-write cases.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agos3/g_lock: add g_lock_locks() and g_lock_locks_read() varients
Ralph Boehme [Sat, 12 Oct 2024 14:36:21 +0000 (16:36 +0200)] 
s3/g_lock: add g_lock_locks() and g_lock_locks_read() varients

Gives callers the option to modify data if needed. All existing
callers use g_lock_locks_read(), so no change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: add a test for recursive h-lease break when renaming
Ralph Boehme [Wed, 2 Oct 2024 05:47:25 +0000 (07:47 +0200)] 
smbtorture: add a test for recursive h-lease break when renaming

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: add handle lease breaking when deleting files in tree disconnect
Ralph Boehme [Sat, 28 Sep 2024 14:48:31 +0000 (16:48 +0200)] 
smbd: add handle lease breaking when deleting files in tree disconnect

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: let smbd_server_connection_terminate_ex() always go through smbXsrv_connection_...
Ralph Boehme [Sat, 28 Sep 2024 14:44:31 +0000 (16:44 +0200)] 
smbd: let smbd_server_connection_terminate_ex() always go through smbXsrv_connection_shutdown_send()

This ensures common cleanup code via

  smbXsrv_connection_shutdown_send() ->
  -> smbXsrv_session_disconnect_xconn()
  -> smbXsrv_session_remove_channel()
  -> smb2srv_session_shutdown_send()

is used if the last (only) connection goes away as well. In the future this
should be implemented for the

  xconn->has_cluster_movable_ip

case.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: smbd_server_connection_terminate() may return
Ralph Boehme [Tue, 22 Oct 2024 05:56:53 +0000 (07:56 +0200)] 
smbd: smbd_server_connection_terminate() may return

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: add handle lease breaking when deleting files at session shutdown time
Ralph Boehme [Tue, 17 Sep 2024 05:16:51 +0000 (07:16 +0200)] 
smbd: add handle lease breaking when deleting files at session shutdown time

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: check initial-delete-on-close breaks H-lease for tdis, logoff and disconnect
Ralph Boehme [Sat, 14 Sep 2024 11:22:20 +0000 (13:22 +0200)] 
smbtorture: check initial-delete-on-close breaks H-lease for tdis, logoff and disconnect

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: use delay_for_handle_lease_break_send() for initial delete on close
Ralph Boehme [Sat, 14 Sep 2024 17:19:51 +0000 (19:19 +0200)] 
smbd: use delay_for_handle_lease_break_send() for initial delete on close

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: break handle leases when setting SMB_FILE_DISPOSITION_INFORMATION
Ralph Boehme [Mon, 14 Oct 2024 16:47:48 +0000 (18:47 +0200)] 
smbd: break handle leases when setting SMB_FILE_DISPOSITION_INFORMATION

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: split out smb_check_file_disposition_info()
Ralph Boehme [Fri, 11 Oct 2024 13:30:46 +0000 (15:30 +0200)] 
smbd: split out smb_check_file_disposition_info()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: expand test test_lease_unlink() with set-delete-on-close
Ralph Boehme [Mon, 16 Sep 2024 19:29:10 +0000 (21:29 +0200)] 
smbtorture: expand test test_lease_unlink() with set-delete-on-close

Currently the test only uses initial-delete-on-close. Expand the test to also
use set-delete-on-close.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: rework async rename check for handle lease breaks
Ralph Boehme [Mon, 16 Sep 2024 00:36:00 +0000 (02:36 +0200)] 
smbd: rework async rename check for handle lease breaks

Add a version of delay_rename_for_lease_break() that is usable in other places
where we have to check for handle lease breaks. No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: use a DATA_BLOB and avoid data copy in delay_rename_for_lease_break()
Ralph Boehme [Fri, 11 Oct 2024 12:25:44 +0000 (14:25 +0200)] 
smbd: use a DATA_BLOB and avoid data copy in delay_rename_for_lease_break()

in_input_buffer just points into the smbd_smb2_request iovecs data which is
guarenteed to have the same lifetime as the deferred rename processing, no need
to make a copy.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: smbd_do_setfilepathinfo(): pass data as pointer, not pointer-to-pointer
Ralph Boehme [Fri, 11 Oct 2024 12:15:32 +0000 (14:15 +0200)] 
smbd: smbd_do_setfilepathinfo(): pass data as pointer, not pointer-to-pointer

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: smbd_do_setfilepathinfo(): one arg per line
Ralph Boehme [Fri, 11 Oct 2024 12:05:08 +0000 (14:05 +0200)] 
smbd: smbd_do_setfilepathinfo(): one arg per line

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agoselftest: run smb2.lease test only against the fileserver environment
Ralph Boehme [Fri, 11 Oct 2024 11:44:05 +0000 (13:44 +0200)] 
selftest: run smb2.lease test only against the fileserver environment

...and expect SMB2_CAP_LEASING.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agovfs_ceph_new: Remove unused symbol for ceph_readdir
Anoop C S [Mon, 28 Oct 2024 05:43:10 +0000 (11:13 +0530)] 
vfs_ceph_new: Remove unused symbol for ceph_readdir

ce459ddbcd0f32252858a7640f6871057eb14645 recently switched the readdir
implementation to use ceph_readdir_r(). Thus ceph_readdir() is
unnecessarily loaded which is no longer used.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sun Nov  3 11:07:23 UTC 2024 on atb-devel-224

12 months agovfs_ceph_new: log open-flags upon release-fh
Shachar Sharon [Sun, 6 Oct 2024 10:26:48 +0000 (13:26 +0300)] 
vfs_ceph_new: log open-flags upon release-fh

Store the set of open O_XXX flags as part of the referenced file-handle
to allow more verbose debug-logging info upon close. This should ease
the developer's logging analysis where same inode is opened multiple
times but with different flags set.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: improved vfs-opers logging
Shachar Sharon [Wed, 11 Sep 2024 06:58:53 +0000 (09:58 +0300)] 
vfs_ceph_new: improved vfs-opers logging

Have more verbose and explicit values in various DBG_DEBUG logging. In
particular, do not use the redundant '__func__' argument as it's info is
already provided via the DBG_ logging macros.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: improved mount logging
Shachar Sharon [Thu, 5 Sep 2024 12:08:38 +0000 (15:08 +0300)] 
vfs_ceph_new: improved mount logging

Add extra debug-logging to mount/umount flows, with more verbose info.
Try to make logging messages follow a 'key=value' format.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: improve mount cache-entry add
Shachar Sharon [Sun, 20 Oct 2024 08:50:13 +0000 (11:50 +0300)] 
vfs_ceph_new: improve mount cache-entry add

Use boolean return value from cephmount_cache_add, to align code-style
with other caphmount helper functions. Returns false in case of memory
allocation failure, true otherwise (success).

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: improve mount cache-entry ref-count
Shachar Sharon [Thu, 5 Sep 2024 14:14:59 +0000 (17:14 +0300)] 
vfs_ceph_new: improve mount cache-entry ref-count

Use singed int32_t for cached mount-entries reference counting. Define
helper function for inc/dec ref-count which also provides proper
logging. Prefer boolean return-value for 'cephmount_cache_remove' as
'int' is often used as error indicator within the context of libcephfs
and this VFS module.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: avoid setting errno in cephmount_cache_update
Shachar Sharon [Wed, 4 Sep 2024 12:59:21 +0000 (15:59 +0300)] 
vfs_ceph_new: avoid setting errno in cephmount_cache_update

Do not set 'errno' to ENOENT in cephmount_cache_update. Setting this
errno value upon newly inserted entry may cause vfs_ceph_connect to
change errno to non-zero value even though the final result is OK.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agovfs_ceph_new: refactor error-case in cephmount_mount_fs
Shachar Sharon [Wed, 4 Sep 2024 11:55:50 +0000 (14:55 +0300)] 
vfs_ceph_new: refactor error-case in cephmount_mount_fs

Align code-style of 'cephmount_mount_fs' with rest of the code: use
'goto' for bail-out upon error case (with proper cleanups). For the
common case of successful operation complete execution and return final
value. Added extra debug-logging for good-path case.

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

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
12 months agos3:winbindd: call process_set_title() for locator child
Stefan Metzmacher [Wed, 16 Oct 2024 07:45:21 +0000 (07:45 +0000)] 
s3:winbindd: call process_set_title() for locator child

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Oct 31 14:02:39 UTC 2024 on atb-devel-224

12 months agos3:cli_netlogon: don't change remote_name in rpccli_setup_netlogon_creds_locked()
Stefan Metzmacher [Wed, 30 Oct 2024 13:33:45 +0000 (13:33 +0000)] 
s3:cli_netlogon: don't change remote_name in rpccli_setup_netlogon_creds_locked()

This was missing in commit 628d7b6f2e626c9c530473d06c038dfec9cbd17a.

We should not alter the name to '<UNKNOWN>'!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
12 months agosmbd: fix breaking leases on rename
Ralph Boehme [Thu, 10 Oct 2024 17:29:09 +0000 (19:29 +0200)] 
smbd: fix breaking leases on rename

We must also break leases on other opens if the open of the rename doesn't have
a lease itself. The existing test test_lease_v2_rename() that was added
alongside the deferred rename server code didn't cover this case.

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

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): Thu Oct 31 12:47:24 UTC 2024 on atb-devel-224

12 months agosmbd: force sync rename with lease break
Ralph Boehme [Thu, 10 Oct 2024 17:25:30 +0000 (19:25 +0200)] 
smbd: force sync rename with lease break

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbd: return correct error for compound related requests that went async
Ralph Boehme [Mon, 26 Aug 2024 08:48:34 +0000 (10:48 +0200)] 
smbd: return correct error for compound related requests that went async

For a compound related request chain of eg CREATE+NOTIFY+GETINFO, the NOTIFY
will typically go async. When this is noted in smbd_smb2_request_pending_queue()
the pending async tevent_req is cancelled which means we return
NT_STATUS_CANCELLED to the client while Windows returns
NT_STATUS_INTERNAL_ERROR.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: test rename with other opens on the file
Ralph Boehme [Fri, 20 Sep 2024 23:28:07 +0000 (01:28 +0200)] 
smbtorture: test rename with other opens on the file

Windows allows this. Samba also already implements this correctly.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: add a bunch of tests for async rename and async interim responses
Ralph Boehme [Thu, 17 Oct 2024 15:45:26 +0000 (17:45 +0200)] 
smbtorture: add a bunch of tests for async rename and async interim responses

All tests pass against Windows 2022, we have some bugs.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: rename CHECK_VALUE() to CHECK_VAL() in smb2/compound.c
Ralph Boehme [Thu, 17 Oct 2024 15:44:13 +0000 (17:44 +0200)] 
smbtorture: rename CHECK_VALUE() to CHECK_VAL() in smb2/compound.c

Prepares for using macros from lease_break_handler.h which makes use of
CHECK_VAL() while relying on a definition of CHECK_VAL() in the .c file.

While at it, add a goto done which is always a good thing to get clear failures
from tests.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agonetcmd: More explicit warning when python-gpg is missing
Andréas Leroux [Wed, 30 Oct 2024 14:34:35 +0000 (15:34 +0100)] 
netcmd: More explicit warning when python-gpg is missing

Signed-off-by: Andréas Leroux <aleroux@tranquil.it>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Oct 31 00:23:09 UTC 2024 on atb-devel-224

12 months agolibcli/auth: split out netlogon_creds_cli_check_transport()
Stefan Metzmacher [Tue, 29 Oct 2024 12:42:06 +0000 (13:42 +0100)] 
libcli/auth: split out netlogon_creds_cli_check_transport()

This will make it easier to implement netr_ServerAuthenticateKerberos()
later...

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>
12 months agolibcli/auth: let netlogon_creds_copy() copy all scalar elements
Stefan Metzmacher [Wed, 19 Jul 2023 19:02:23 +0000 (21:02 +0200)] 
libcli/auth: let netlogon_creds_copy() copy all scalar elements

This version is good for now, as we want it to be backportable.
For master we'll add a ndr_deepcopy_struct() helper in order
to avoid future problems.

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>
12 months agos4:librpc/rpc: make use of netlogon_creds_client_verify()
Stefan Metzmacher [Tue, 29 Oct 2024 09:31:52 +0000 (10:31 +0100)] 
s4:librpc/rpc: make use of netlogon_creds_client_verify()

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>
12 months agolibcli/auth: make use of netlogon_creds_client_verify()
Stefan Metzmacher [Tue, 29 Oct 2024 09:02:40 +0000 (10:02 +0100)] 
libcli/auth: make use of netlogon_creds_client_verify()

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>
12 months agolibcli/auth: split out netlogon_creds_client_verify() that takes auth_{type,level}
Stefan Metzmacher [Tue, 29 Oct 2024 08:54:42 +0000 (09:54 +0100)] 
libcli/auth: split out netlogon_creds_client_verify() that takes auth_{type,level}

This will make it easier to implement netr_ServerAuthenticateKerberos()
later...

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>
12 months agolibcli/auth: pass auth_{type,level} to netlogon_creds_server_step_check()
Stefan Metzmacher [Tue, 29 Oct 2024 08:46:07 +0000 (09:46 +0100)] 
libcli/auth: pass auth_{type,level} to netlogon_creds_server_step_check()

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agolibcli/auth: pass auth_{type,level} to schannel_check_creds_state()
Stefan Metzmacher [Tue, 29 Oct 2024 08:44:52 +0000 (09:44 +0100)] 
libcli/auth: pass auth_{type,level} to schannel_check_creds_state()

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agolibcli/auth: return INVALID_PARAMETER for DES in netlogon_creds_{de,en}crypt_samlogon...
Stefan Metzmacher [Mon, 28 Oct 2024 15:54:48 +0000 (16:54 +0100)] 
libcli/auth: return INVALID_PARAMETER for DES in netlogon_creds_{de,en}crypt_samlogon_logon

For the NetlogonGenericInformation case we want an error instead of no
encryption if only DES was 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>
12 months agolibcli/auth: make sure low level crypto function are not used directly
Stefan Metzmacher [Mon, 28 Oct 2024 16:51:21 +0000 (17:51 +0100)] 
libcli/auth: make sure low level crypto function are not used directly

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>
12 months agos4:rpc_server/netlogon: make use of netlogon_creds_decrypt_SendToSam
Stefan Metzmacher [Mon, 28 Oct 2024 15:30:19 +0000 (16:30 +0100)] 
s4:rpc_server/netlogon: make use of netlogon_creds_decrypt_SendToSam

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agos4:rpc_server/netlogon: make use of netlogon_creds_decrypt_samr_CryptPassword
Stefan Metzmacher [Mon, 28 Oct 2024 15:30:19 +0000 (16:30 +0100)] 
s4:rpc_server/netlogon: make use of netlogon_creds_decrypt_samr_CryptPassword

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agos4:rpc_server/netlogon: make use of netlogon_creds_{de,en}crypt_samr_Password()
Stefan Metzmacher [Mon, 28 Oct 2024 15:28:47 +0000 (16:28 +0100)] 
s4:rpc_server/netlogon: make use of netlogon_creds_{de,en}crypt_samr_Password()

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agos3:rpc_server/netlogon: make use of netlogon_creds_decrypt_samr_CryptPassword()
Stefan Metzmacher [Mon, 28 Oct 2024 15:25:11 +0000 (16:25 +0100)] 
s3:rpc_server/netlogon: make use of netlogon_creds_decrypt_samr_CryptPassword()

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>
12 months agos3:rpc_server/netlogon: make use of netlogon_creds_{de,en}crypt_samr_Password
Stefan Metzmacher [Mon, 28 Oct 2024 16:12:16 +0000 (17:12 +0100)] 
s3:rpc_server/netlogon: make use of netlogon_creds_{de,en}crypt_samr_Password

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>
12 months agos4:torture/rpc: make use of netlogon_creds_{de,en}crypt_samr_Password
Stefan Metzmacher [Mon, 28 Oct 2024 16:43:40 +0000 (17:43 +0100)] 
s4:torture/rpc: make use of netlogon_creds_{de,en}crypt_samr_Password

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>
12 months agos4:torture/rpc: make use of netlogon_creds_encrypt_samr_CryptPassword()
Stefan Metzmacher [Mon, 28 Oct 2024 15:22:36 +0000 (16:22 +0100)] 
s4:torture/rpc: make use of netlogon_creds_encrypt_samr_CryptPassword()

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agos4:torture/rpc: make use of netlogon_creds_decrypt_samlogon_validation()
Stefan Metzmacher [Mon, 28 Oct 2024 15:57:53 +0000 (16:57 +0100)] 
s4:torture/rpc: make use of netlogon_creds_decrypt_samlogon_validation()

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agos4:torture/rpc: make use of netlogon_creds_encrypt_samlogon_logon()
Stefan Metzmacher [Mon, 28 Oct 2024 11:58:11 +0000 (12:58 +0100)] 
s4:torture/rpc: make use of netlogon_creds_encrypt_samlogon_logon()

This will make it easier to catch all places where we need to
implement 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>
12 months agolibcli/auth: make use of netlogon_creds_{de,en}crypt_samr_Password
Stefan Metzmacher [Mon, 28 Oct 2024 16:19:09 +0000 (17:19 +0100)] 
libcli/auth: make use of netlogon_creds_{de,en}crypt_samr_Password

This will make it easier to implement netr_ServerAuthenticateKerberos() later...

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>
12 months agolibcli/auth: make use of netlogon_creds_encrypt_SendToSam
Stefan Metzmacher [Mon, 28 Oct 2024 15:00:52 +0000 (16:00 +0100)] 
libcli/auth: make use of netlogon_creds_encrypt_SendToSam

This will help when implementing 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>
12 months agolibcli/auth: make use of netlogon_creds_encrypt_samr_CryptPassword
Stefan Metzmacher [Mon, 28 Oct 2024 14:56:09 +0000 (15:56 +0100)] 
libcli/auth: make use of netlogon_creds_encrypt_samr_CryptPassword

This will help when implementing 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>
12 months agolibcli/auth: make netlogon_creds_des_{de,en}crypt_LMKey() static
Stefan Metzmacher [Mon, 28 Oct 2024 14:52:13 +0000 (15:52 +0100)] 
libcli/auth: make netlogon_creds_des_{de,en}crypt_LMKey() static

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>
12 months agoauth/credentials: remove unused netlogon_creds_session_encrypt()
Stefan Metzmacher [Mon, 28 Oct 2024 14:44:07 +0000 (15:44 +0100)] 
auth/credentials: remove unused netlogon_creds_session_encrypt()

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>
12 months agopycredentials: remove unused .encrypt_samr_password()
Stefan Metzmacher [Mon, 28 Oct 2024 13:04:52 +0000 (14:04 +0100)] 
pycredentials: remove unused .encrypt_samr_password()

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>
12 months agopython/tests: use encrypt_netr_PasswordInfo in KDCBaseTest._test_samlogon()
Stefan Metzmacher [Mon, 28 Oct 2024 14:39:57 +0000 (15:39 +0100)] 
python/tests: use encrypt_netr_PasswordInfo in KDCBaseTest._test_samlogon()

This will make it easier to implement netr_ServerAuthenticateKerberos()
later...

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