]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 months agos4:torture: remove unused ports from masktests.c
Stefan Metzmacher [Thu, 3 Apr 2025 08:55:00 +0000 (10:55 +0200)] 
s4:torture: remove unused ports from masktests.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:client: remove unused ports from cifsdd* functions
Stefan Metzmacher [Thu, 3 Apr 2025 08:53:35 +0000 (10:53 +0200)] 
s4:client: remove unused ports from cifsdd* functions

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports from smbcli_full_connection()
Stefan Metzmacher [Thu, 3 Apr 2025 08:49:30 +0000 (10:49 +0200)] 
s4:libcli: remove unused ports from smbcli_full_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:client: remove unused destports from do_message_op()
Stefan Metzmacher [Thu, 3 Apr 2025 08:41:59 +0000 (10:41 +0200)] 
s4:client: remove unused destports from do_message_op()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports from smbcli_socket_connect()
Stefan Metzmacher [Thu, 3 Apr 2025 08:40:51 +0000 (10:40 +0200)] 
s4:libcli: remove unused ports from smbcli_socket_connect()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused dest_ports from smbcli_tree_full_connection()
Stefan Metzmacher [Thu, 3 Apr 2025 08:38:15 +0000 (10:38 +0200)] 
s4:libcli: remove unused dest_ports from smbcli_tree_full_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused dest_ports struct smb_composite_fsinfo
Stefan Metzmacher [Thu, 3 Apr 2025 08:35:05 +0000 (10:35 +0200)] 
s4:libcli: remove unused dest_ports struct smb_composite_fsinfo

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports from struct smb_composite_fetchfile
Stefan Metzmacher [Thu, 3 Apr 2025 08:33:32 +0000 (10:33 +0200)] 
s4:libcli: remove unused ports from struct smb_composite_fetchfile

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:torture/raw: remove unused dest_port handling from openbench.c
Stefan Metzmacher [Thu, 3 Apr 2025 08:31:05 +0000 (10:31 +0200)] 
s4:torture/raw: remove unused dest_port handling from openbench.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused dest_ports from struct smb_composite_connect
Stefan Metzmacher [Thu, 3 Apr 2025 08:28:26 +0000 (10:28 +0200)] 
s4:libcli: remove unused dest_ports from struct smb_composite_connect

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports from smb2_connect()
Stefan Metzmacher [Thu, 3 Apr 2025 08:21:42 +0000 (10:21 +0200)] 
s4:libcli: remove unused ports from smb2_connect()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports argument from smb2_connect_ext()
Stefan Metzmacher [Thu, 3 Apr 2025 06:46:27 +0000 (08:46 +0200)] 
s4:libcli: remove unused ports argument from smb2_connect_ext()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused ports argument from smb2_connect_send
Stefan Metzmacher [Thu, 3 Apr 2025 06:44:24 +0000 (08:44 +0200)] 
s4:libcli: remove unused ports argument from smb2_connect_send

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: remove unused dest_ports from smb_connect_nego_send()
Stefan Metzmacher [Thu, 3 Apr 2025 06:40:24 +0000 (08:40 +0200)] 
s4:libcli: remove unused dest_ports from smb_connect_nego_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: pass struct smbcli_options to smbcli_sock_connect() instead of port strings
Stefan Metzmacher [Thu, 3 Apr 2025 06:35:40 +0000 (08:35 +0200)] 
s4:libcli: pass struct smbcli_options to smbcli_sock_connect() instead of port strings

This allows us to build the ports array from options.transports.

Pair-Programmed-With: Ralph Boehme <slow@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli: introduce smbcli_options.transports based on lpcfg_smb_ports()
Stefan Metzmacher [Wed, 2 Apr 2025 19:14:10 +0000 (21:14 +0200)] 
s4:libcli: introduce smbcli_options.transports based on lpcfg_smb_ports()

This will allow us to avoid passing lpcfg_smb_ports() explicitly
in a lot of places in the following commits.

Once that's done we will change away from "smb ports" to
something like "client smb transports".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agolibcli/smb: add struct smb_transports infrastructure
Stefan Metzmacher [Wed, 2 Apr 2025 17:51:50 +0000 (19:51 +0200)] 
libcli/smb: add struct smb_transports infrastructure

This will be able to use a structure instead of
a string array with int string values for 'smb ports'.

We'll soon add support for smb over quic, so
we need something better than tcp ports with
139 being special.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agos4:libcli/smb_composite: remove unused struct smb_composite_connectmulti
Stefan Metzmacher [Wed, 2 Apr 2025 17:16:48 +0000 (19:16 +0200)] 
s4:libcli/smb_composite: remove unused struct smb_composite_connectmulti

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agolibcli/smb: make smb2_lease_{pull,push} endian safe
Stefan Metzmacher [Wed, 16 Apr 2025 13:18:12 +0000 (15:18 +0200)] 
libcli/smb: make smb2_lease_{pull,push} endian safe

smbd_smb2_send_lease_break() is already endian safe,
which means we'll get a mismatch on big endian systems,
so that smbd_smb2_send_lease_break() sends the lease key
in reversed order.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Apr 17 11:30:58 UTC 2025 on atb-devel-224

4 months agolibcli/smb: convert smb2_lease_push() to PUSH_LE_U*
Stefan Metzmacher [Wed, 16 Apr 2025 13:18:12 +0000 (15:18 +0200)] 
libcli/smb: convert smb2_lease_push() to PUSH_LE_U*

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
4 months agolibcli/smb: make the last 2 reserved bytes explicit in smb2_lease_push()
Stefan Metzmacher [Wed, 16 Apr 2025 13:18:12 +0000 (15:18 +0200)] 
libcli/smb: make the last 2 reserved bytes explicit in smb2_lease_push()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
4 months agolibcli/smb: convert smb2_lease_pull() to PULL_LE_U*
Stefan Metzmacher [Wed, 16 Apr 2025 13:18:12 +0000 (15:18 +0200)] 
libcli/smb: convert smb2_lease_pull() to PULL_LE_U*

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
4 months agos3:smbd: work around broken "vfs mkdir use tmp name" on FAT
Stefan Metzmacher [Wed, 16 Apr 2025 09:51:28 +0000 (11:51 +0200)] 
s3:smbd: work around broken "vfs mkdir use tmp name" on FAT

"vfs mkdir use tmp name" creates a name with ":" because the file should
be invisible for Windows clients. ":" however is an invalid character on
FAT filesystems and we get EINVAL back. In that case we fall back to not
using tmp names for mkdir.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
4 months agovfs: Fix "wide links = yes"
Volker Lendecke [Thu, 3 Apr 2025 08:04:42 +0000 (10:04 +0200)] 
vfs: Fix "wide links = yes"

vfs_wide_links hides symlinks from the rest of smbd, and it implicitly
follows symlinks. Also, O_PATH will expose symlinks to the rest of
smbd, remove that.

We also need to do this for posix paths, as deep inside
rename_internals we want to avoid case-insensitive lookups by setting
SMB_FILENAME_POSIX_PATH.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 16 20:56:33 UTC 2025 on atb-devel-224

4 months agolib:cmdline: POPT_CALLBACK_REASON_POST should handle if we skip the password callback
Andreas Schneider [Fri, 11 Apr 2025 08:56:43 +0000 (10:56 +0200)] 
lib:cmdline: POPT_CALLBACK_REASON_POST should handle if we skip the password callback

It is already checking if there is a valid ccache and disabling the callback.
In case of IAKerb we specify a ccache but might to fill one with a krbtgt.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 15 12:54:57 UTC 2025 on atb-devel-224

4 months agolib:cmdline: Make sure --use-krb5-ccache sets the ccache
Andreas Schneider [Fri, 4 Apr 2025 08:27:50 +0000 (10:27 +0200)] 
lib:cmdline: Make sure --use-krb5-ccache sets the ccache

Pair-Programmed-With: Alexander Bokovoy <ab@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 months agoauth:creds: Do a kinit if we have a password and the ccache is empty
Andreas Schneider [Fri, 11 Apr 2025 11:49:22 +0000 (13:49 +0200)] 
auth:creds: Do a kinit if we have a password and the ccache is empty

This implements the same behaviour for s4 clients as we have with s3
clients.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 months agos3-wscript: make sure to build with selftest without libevent
Günther Deschner [Tue, 18 Mar 2025 13:41:46 +0000 (14:41 +0100)] 
s3-wscript: make sure to build with selftest without libevent

No need to stop running selftest in absence of libevent anymore.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Apr 11 19:47:24 UTC 2025 on atb-devel-224

4 months agos3-selftest: only run prometheus exporter tests when configured
Günther Deschner [Tue, 18 Mar 2025 13:41:08 +0000 (14:41 +0100)] 
s3-selftest: only run prometheus exporter tests when configured

Extract the configure info for building with prometheus exporter and
only run the blackbox test in case it is enabled.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agobuild: use '--with-prometheus-exporter' configure option
Shachar Sharon [Mon, 10 Mar 2025 12:23:01 +0000 (14:23 +0200)] 
build: use '--with-prometheus-exporter' configure option

Prefer '--with-prometheus-exporter' configure option over
'--with-libevent', which in turn, requires libevent.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoselftest: Add test for smb_prometheus_endpoint utility
Shachar Sharon [Wed, 5 Feb 2025 14:20:10 +0000 (16:20 +0200)] 
selftest: Add test for smb_prometheus_endpoint utility

Basic test for smb_prometheus_endpoint utility. Requires valid metrics
output using 'curl'. Start/stop the endpoint utility from within the
test script itself.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agos3/smb_prometheus_endpoint: add authentication metrics
Ralph Boehme [Mon, 5 Feb 2024 17:19:31 +0000 (18:19 +0100)] 
s3/smb_prometheus_endpoint: add authentication metrics

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agosmbprofile: add authentication metrics
Ralph Boehme [Mon, 5 Feb 2024 17:04:57 +0000 (18:04 +0100)] 
smbprofile: add authentication metrics

"authentication" is the total number of requests and "authentication_failed" is
obviously the number of failed authentications.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agosmbprofile: SMB2-READ result NT_STATUS_END_OF_FILE is not an error
Ralph Boehme [Mon, 29 Jan 2024 15:33:41 +0000 (16:33 +0100)] 
smbprofile: SMB2-READ result NT_STATUS_END_OF_FILE is not an error

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agosmbprofile: Count failed requests
Volker Lendecke [Tue, 9 Jan 2024 15:12:20 +0000 (16:12 +0100)] 
smbprofile: Count failed requests

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoutils: Initial version of smb_prometheus_endpoint
Volker Lendecke [Fri, 17 Nov 2023 14:15:13 +0000 (15:15 +0100)] 
utils: Initial version of smb_prometheus_endpoint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoprofile: Add number of sessions, tcons and files to smbstatus -P
Volker Lendecke [Wed, 22 Nov 2023 15:12:01 +0000 (16:12 +0100)] 
profile: Add number of sessions, tcons and files to smbstatus -P

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoprofile: Add sessions, tcons and files to profile data
Volker Lendecke [Tue, 21 Nov 2023 12:34:03 +0000 (13:34 +0100)] 
profile: Add sessions, tcons and files to profile data

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoprofile: Pass dummy smbd_server_connection to smbprofile_dump()
Volker Lendecke [Tue, 21 Nov 2023 11:34:02 +0000 (12:34 +0100)] 
profile: Pass dummy smbd_server_connection to smbprofile_dump()

It will need access to its fields soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoprofile: Return number of workers from smbprofile_collect_tdb()
Volker Lendecke [Wed, 22 Nov 2023 14:11:09 +0000 (15:11 +0100)] 
profile: Return number of workers from smbprofile_collect_tdb()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agoprofile: Add time buckets to smbprofile_stats_iobytes
Volker Lendecke [Fri, 17 Nov 2023 14:14:33 +0000 (15:14 +0100)] 
profile: Add time buckets to smbprofile_stats_iobytes

Enable a histogram of time taken for smb2 requests. This puts all smb2
requests into buckets of <1, <2, <4, ... <256 msecs duration and
beyond.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agobuild: Detect libevent
Ralph Boehme [Thu, 16 Jan 2025 08:35:22 +0000 (09:35 +0100)] 
build: Detect libevent

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 months agotestprogs: Use 'sync machine password to keytab' for keytab creation
Andreas Schneider [Fri, 11 Apr 2025 07:32:30 +0000 (09:32 +0200)] 
testprogs: Use 'sync machine password to keytab' for keytab creation

We want to get rid of dedicatedkeytabfile for writing keytabs.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 11 08:38:49 UTC 2025 on atb-devel-224

4 months agotestprogs: Remove dead code
Andreas Schneider [Fri, 11 Apr 2025 07:27:02 +0000 (09:27 +0200)] 
testprogs: Remove dead code

The test for this has been removed already, this is just leftover.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
4 months agodocs-xml: Document 'net ads keytab list'
Andreas Schneider [Thu, 10 Apr 2025 15:34:10 +0000 (17:34 +0200)] 
docs-xml: Document 'net ads keytab list'

Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
4 months agos3:net: 'net ads keytab list' should only list default keytab
Andreas Schneider [Thu, 10 Apr 2025 14:13:42 +0000 (16:13 +0200)] 
s3:net: 'net ads keytab list' should only list default keytab

If you don't specify a keytab, assume we just want the default keytab. This will
make upcoming changes to the code easier.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
4 months agos3:net: Remove `net ads keytab flush`
Andreas Schneider [Thu, 10 Apr 2025 14:07:46 +0000 (16:07 +0200)] 
s3:net: Remove `net ads keytab flush`

This removes all entries from a keytab *and* removes all SPNs from the AD
machine account. We should not do that and if you want to get rid of the keytab
you can use `rm`.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
4 months agosmbd: convert all fsp->fh->private_options to fsp_flags
Ralph Boehme [Fri, 28 Mar 2025 12:22:22 +0000 (13:22 +0100)] 
smbd: convert all fsp->fh->private_options to fsp_flags

Use fsp_apply_private_ntcreatex_flags() to store the private_flags as fsp_flags
and convert all users to check the fsp_flags.

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): Wed Apr  9 14:39:26 UTC 2025 on atb-devel-224

4 months agosmbd: remove broken initial-delete-on-close logic from rename_internals_fsp()
Ralph Boehme [Fri, 28 Mar 2025 14:04:52 +0000 (15:04 +0100)] 
smbd: remove broken initial-delete-on-close logic from rename_internals_fsp()

fh_get_private_options() return private_flags, not create_options and thus can
never contain FILE_DELETE_ON_CLOSE.

Afaict fsp_flags.initial_delete_on_close is already correctly filled in
open_file_ntcreate():

        /* Handle strange delete on close create semantics. */
        if (create_options & FILE_DELETE_ON_CLOSE) {
                if (!new_file_created) {
                        status = can_set_delete_on_close(fsp,
                                         existing_dos_attributes);

                        if (!NT_STATUS_IS_OK(status)) {
                                /* Remember to delete the mode we just added. */
                                lck_state.cleanup_fn =
                                        open_ntcreate_lock_cleanup_entry;
                                goto unlock;
                        }
                }
                /* Note that here we set the *initial* delete on close flag,
                   not the regular one. The magic gets handled in close. */
                fsp->fsp_flags.initial_delete_on_close = true;
        }

so we can just remove the broken handling here.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agosmbd: add fsp_apply_private_ntcreatex_flags()
Ralph Boehme [Fri, 28 Mar 2025 12:10:13 +0000 (13:10 +0100)] 
smbd: add fsp_apply_private_ntcreatex_flags()

Not used yet, comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agovfs: add fsp_flags ntcreatex_deny_[dos|fcb] and ntcreatex_stream_baseopen
Ralph Boehme [Thu, 27 Mar 2025 18:39:52 +0000 (19:39 +0100)] 
vfs: add fsp_flags ntcreatex_deny_[dos|fcb] and ntcreatex_stream_baseopen

Not used for now.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agosmbd: remove unused private_flags from open_file()
Ralph Boehme [Thu, 27 Mar 2025 17:42:22 +0000 (18:42 +0100)] 
smbd: remove unused private_flags from open_file()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agos3/locking: remove now unused private_options from share_mode_entry
Ralph Boehme [Mon, 17 Mar 2025 11:44:45 +0000 (12:44 +0100)] 
s3/locking: remove now unused private_options from share_mode_entry

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agos3/locking: store NTCREATEX_FLAG_DENY_[DOS|FCB] as share_entry_flags
Ralph Boehme [Mon, 17 Mar 2025 13:59:49 +0000 (14:59 +0100)] 
s3/locking: store NTCREATEX_FLAG_DENY_[DOS|FCB] as share_entry_flags

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agos3/locking: store NTCREATEX_FLAG_STREAM_BASEOPEN as share_entry_flag
Ralph Boehme [Mon, 17 Mar 2025 13:56:24 +0000 (14:56 +0100)] 
s3/locking: store NTCREATEX_FLAG_STREAM_BASEOPEN as share_entry_flag

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agos3/locking: add and use fsp_[get|apply]_share_entry_flags()
Ralph Boehme [Thu, 3 Apr 2025 20:01:09 +0000 (22:01 +0200)] 
s3/locking: add and use fsp_[get|apply]_share_entry_flags()

Prepares for converting private_options to flags.

Fixes Durable Handle reconnect of POSIX opens which weren't setting the fsp_flags
when reconnecting, so fsp_flags.posix_open wasn't set.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agos3/librpc: open_files.idl: move flag definition into open_files.idl
Ralph Boehme [Mon, 17 Mar 2025 11:20:02 +0000 (12:20 +0100)] 
s3/librpc: open_files.idl: move flag definition into open_files.idl

Nice to have everything in one place. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agosmbd: rename SHARE_MODE_FLAG_POSIX_OPEN to SHARE_ENTRY_FLAG_POSIX_OPEN
Ralph Boehme [Mon, 17 Mar 2025 11:16:40 +0000 (12:16 +0100)] 
smbd: rename SHARE_MODE_FLAG_POSIX_OPEN to SHARE_ENTRY_FLAG_POSIX_OPEN

share_mode_data has flags and share_mode_entry has flags, this change allows
to distinguish between both more easily. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 months agowinbindd: let update_trusted_domains_dc() also call pdb_filter_hints()
Stefan Metzmacher [Sat, 22 Mar 2025 00:03:26 +0000 (01:03 +0100)] 
winbindd: let update_trusted_domains_dc() also call pdb_filter_hints()

On an AD DC we need to update sam_domain->fti, so that
find_routing_from_namespace_noinit() uses the correct
uPNSuffixes and msDS-SPNSuffixes values for the local forest.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Apr  3 10:35:10 UTC 2025 on atb-devel-224

4 months agowinbindd: add find_local_sam_domain() helper
Stefan Metzmacher [Fri, 21 Mar 2025 16:38:35 +0000 (17:38 +0100)] 
winbindd: add find_local_sam_domain() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agowinbindd: pass for_netlogon to winbind_dual_SamLogon to avoid caching
Stefan Metzmacher [Fri, 21 Mar 2025 17:49:16 +0000 (18:49 +0100)] 
winbindd: pass for_netlogon to winbind_dual_SamLogon to avoid caching

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:auth/ntlm: let auth_winbind pass WB_SAMLOGON_FOR_NETLOGON
Stefan Metzmacher [Fri, 21 Mar 2025 17:37:49 +0000 (18:37 +0100)] 
s4:auth/ntlm: let auth_winbind pass WB_SAMLOGON_FOR_NETLOGON

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:auth: let auth_context_create_for_netlogon() remember for_netlogon = true;
Stefan Metzmacher [Fri, 21 Mar 2025 17:34:03 +0000 (18:34 +0100)] 
s4:auth: let auth_context_create_for_netlogon() remember for_netlogon = true;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos3:auth: let auth_winbind pass WBC_AUTH_PARAM_FLAGS_FOR_NETLOGON if needed
Stefan Metzmacher [Fri, 21 Mar 2025 16:08:24 +0000 (17:08 +0100)] 
s3:auth: let auth_winbind pass WBC_AUTH_PARAM_FLAGS_FOR_NETLOGON if needed

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos3:auth: remember make_auth3_context_for_netlogon() was used
Stefan Metzmacher [Fri, 21 Mar 2025 16:04:05 +0000 (17:04 +0100)] 
s3:auth: remember make_auth3_context_for_netlogon() was used

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agowinbind.idl: add WB_SAMLOGON_FOR_NETLOGON
Stefan Metzmacher [Fri, 21 Mar 2025 17:36:02 +0000 (18:36 +0100)] 
winbind.idl: add WB_SAMLOGON_FOR_NETLOGON

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agolibwbclient: add WBC_AUTH_PARAM_FLAGS_FOR_NETLOGON to pass WBFLAG_PAM_FOR_NETLOGON
Stefan Metzmacher [Fri, 21 Mar 2025 17:19:34 +0000 (18:19 +0100)] 
libwbclient: add WBC_AUTH_PARAM_FLAGS_FOR_NETLOGON to pass WBFLAG_PAM_FOR_NETLOGON

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agowinbind_struct_protocol.h: add WBFLAG_PAM_FOR_NETLOGON
Stefan Metzmacher [Fri, 21 Mar 2025 16:06:26 +0000 (17:06 +0100)] 
winbind_struct_protocol.h: add WBFLAG_PAM_FOR_NETLOGON

This will be used when auth_winbind is used with
make_auth3_context_for_netlogon().

This will allow winbindd to use different rules
for LogonSamLogon requests compared to
local authentications for smbd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:librpc/idl: remove unused legacy copy of winbind.idl
Stefan Metzmacher [Fri, 21 Mar 2025 17:06:25 +0000 (18:06 +0100)] 
s4:librpc/idl: remove unused legacy copy of winbind.idl

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agoauth: let make_user_info_dc_pac() cross check PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID
Stefan Metzmacher [Wed, 12 Mar 2025 14:23:11 +0000 (15:23 +0100)] 
auth: let make_user_info_dc_pac() cross check PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID

If there's a mismatch someone doing strange things...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: let _{get,modify}_tgt() also change the objectsid in UPN_DNS_INFO
Stefan Metzmacher [Wed, 12 Mar 2025 20:02:03 +0000 (21:02 +0100)] 
python:tests/krb5: let _{get,modify}_tgt() also change the objectsid in UPN_DNS_INFO

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: allow set_pac_sids() to take upn_dns_sid
Stefan Metzmacher [Wed, 12 Mar 2025 14:42:58 +0000 (15:42 +0100)] 
python:tests/krb5: allow set_pac_sids() to take upn_dns_sid

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: let check_device_info() allow an empty rid array
Stefan Metzmacher [Wed, 12 Mar 2025 13:14:51 +0000 (14:14 +0100)] 
python:tests/krb5: let check_device_info() allow an empty rid array

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: allow create_account_opts() to take selective_auth_allowed_sid
Stefan Metzmacher [Mon, 10 Mar 2025 18:08:31 +0000 (19:08 +0100)] 
python:tests/krb5: allow create_account_opts() to take selective_auth_allowed_sid

This will add a GUID_DRS_ALLOWED_TO_AUTHENTICATE ace with CONTROL_ACCESS
to the created account.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: allow tgs_exchange_dict() to take expected_[device_]duplicated_groups
Stefan Metzmacher [Mon, 10 Mar 2025 20:03:16 +0000 (21:03 +0100)] 
python:tests/krb5: allow tgs_exchange_dict() to take expected_[device_]duplicated_groups

This allows us to expect duplicated sids in the PAC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: let check_device_info() handle EXTRA_DOMAIN_SID
Stefan Metzmacher [Mon, 10 Mar 2025 19:51:22 +0000 (20:51 +0100)] 
python:tests/krb5: let check_device_info() handle EXTRA_DOMAIN_SID

device info does not really have RESOURCE_SID,
so we need to map RESOURCE_SID as well as EXTRA_SID (with a S-1-5-21-
prefix) to EXTRA_DOMAIN_SID.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: create_account_opts() can't handle self.AccountType.TRUST
Stefan Metzmacher [Mon, 10 Mar 2025 18:06:39 +0000 (19:06 +0100)] 
python:tests/krb5: create_account_opts() can't handle self.AccountType.TRUST

create_trust() is used for that...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agopython:tests/krb5: add KDC_ERR_PATH_NOT_ACCEPTED
Stefan Metzmacher [Wed, 12 Mar 2025 23:44:27 +0000 (00:44 +0100)] 
python:tests/krb5: add KDC_ERR_PATH_NOT_ACCEPTED

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: samba_kdc_add_compounded_auth() should add Compounded_Authentication again...
Stefan Metzmacher [Wed, 12 Mar 2025 15:17:58 +0000 (16:17 +0100)] 
s4:kdc: samba_kdc_add_compounded_auth() should add Compounded_Authentication again if it's already there

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: only use compound authentication with an explicit FAST armor
Stefan Metzmacher [Thu, 13 Mar 2025 00:50:23 +0000 (01:50 +0100)] 
s4:kdc: only use compound authentication with an explicit FAST armor

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: samba_kdc_update_pac() doesn't need explicit delegated_proxy_principal
Stefan Metzmacher [Thu, 13 Mar 2025 00:46:09 +0000 (01:46 +0100)] 
s4:kdc: samba_kdc_update_pac() doesn't need explicit delegated_proxy_principal

It comes along as delegated_proxy.pac_princ now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: store pac_princ in struct samba_kdc_entry_pac
Stefan Metzmacher [Thu, 13 Mar 2025 00:41:40 +0000 (01:41 +0100)] 
s4:kdc: store pac_princ in struct samba_kdc_entry_pac

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: pass pac_princ to samba_kdc_entry_pac()
Stefan Metzmacher [Thu, 13 Mar 2025 00:40:18 +0000 (01:40 +0100)] 
s4:kdc: pass pac_princ to samba_kdc_entry_pac()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: pass pac_princ to samba_kdc_entry_pac_from_trusted()
Stefan Metzmacher [Thu, 13 Mar 2025 00:21:03 +0000 (01:21 +0100)] 
s4:kdc: pass pac_princ to samba_kdc_entry_pac_from_trusted()

For mit_samba_update_pac() we can only pass it optionally.
This should be fixed in future, but it requires changes
in MIT Kerberos.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let samba_kdc_entry_pac[_from_trusted]() assert krbtgt is valid if pac is...
Stefan Metzmacher [Tue, 11 Mar 2025 10:44:25 +0000 (11:44 +0100)] 
s4:kdc: let samba_kdc_entry_pac[_from_trusted]() assert krbtgt is valid if pac is valid

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let hdb_samba4_check_rbcd() fill device_pac_entry() without device_entry
Stefan Metzmacher [Tue, 11 Mar 2025 11:09:43 +0000 (12:09 +0100)] 
s4:kdc: let hdb_samba4_check_rbcd() fill device_pac_entry() without device_entry

If we have a device_pac we also have device_server/krbtgt_entry, while
device_entry is optional.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let samba_wdc_get_pac() use samba_kdc_get_device_pac()
Stefan Metzmacher [Tue, 11 Mar 2025 11:08:47 +0000 (12:08 +0100)] 
s4:kdc: let samba_wdc_get_pac() use samba_kdc_get_device_pac()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let samba_kdc_get_device_pac() always extract device_krbtgt_skdc_entry
Stefan Metzmacher [Mon, 10 Mar 2025 23:13:20 +0000 (00:13 +0100)] 
s4:kdc: let samba_kdc_get_device_pac() always extract device_krbtgt_skdc_entry

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let samba_wdc_reget_pac() use krbtgt_skdc_entry as delegated_proxy_krbtgt_entry
Stefan Metzmacher [Tue, 11 Mar 2025 10:40:45 +0000 (11:40 +0100)] 
s4:kdc: let samba_wdc_reget_pac() use krbtgt_skdc_entry as delegated_proxy_krbtgt_entry

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let mit_samba_check_allowed_to_delegate_from() fetch krbtgt_entry
Stefan Metzmacher [Tue, 11 Mar 2025 10:37:30 +0000 (11:37 +0100)] 
s4:kdc: let mit_samba_check_allowed_to_delegate_from() fetch krbtgt_entry

samba_kdc_entry_pac_from_trusted() will soon assert that
it has a valid krbtgt_entry.

In the long run this should be passed from the caller...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: add some checks for SDB_F_S4U2{SELF,PROXY}_PRINCIPAL
Stefan Metzmacher [Thu, 20 Mar 2025 01:15:28 +0000 (02:15 +0100)] 
s4:kdc: add some checks for SDB_F_S4U2{SELF,PROXY}_PRINCIPAL

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: let SDB_F_CROSS_REALM_PRINCIPAL result in SDB_ERR_NOT_FOUND_HERE
Stefan Metzmacher [Thu, 20 Mar 2025 01:02:11 +0000 (02:02 +0100)] 
s4:kdc: let SDB_F_CROSS_REALM_PRINCIPAL result in SDB_ERR_NOT_FOUND_HERE

It means the client is remote and the kdc logic has to live without
an sdb_entry.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: pass HDB_F_{CROSS_REALM,S4U2SELF,S4U2PROXY}_PRINCIPAL as SDB_F_*
Stefan Metzmacher [Thu, 20 Mar 2025 00:50:11 +0000 (01:50 +0100)] 
s4:kdc: pass HDB_F_{CROSS_REALM,S4U2SELF,S4U2PROXY}_PRINCIPAL as SDB_F_*

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: adjust to HDB_INTERFACE_VERSION=12
Stefan Metzmacher [Thu, 13 Mar 2025 01:59:22 +0000 (02:59 +0100)] 
s4:kdc: adjust to HDB_INTERFACE_VERSION=12

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agothird_party/heimdal: Import lorikeet-heimdal-202503211313 (commit f5c091eff46b975ede0...
Stefan Metzmacher [Fri, 21 Mar 2025 12:23:41 +0000 (13:23 +0100)] 
third_party/heimdal: Import lorikeet-heimdal-202503211313 (commit f5c091eff46b975ede09860066239aee5f563bdf)

This is a rebase on Heimdal master as well as
some patches to prepare sid-filtering support in Samba.

NOTE: THIS COMMIT WON’T COMPILE/WORK ON ITS OWN!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agothird_party/heimdal: Import lorikeet-heimdal-202503211047 (commit 752fd2fc0d7e48791df...
Stefan Metzmacher [Wed, 19 Mar 2025 23:22:34 +0000 (00:22 +0100)] 
third_party/heimdal: Import lorikeet-heimdal-202503211047 (commit 752fd2fc0d7e48791df91dd2b45899e64ef65a7a)

kdc: Constrained delegation requires a local delegating server

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15837
MR: https://github.com/heimdal/heimdal/pull/1274

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agos4:kdc: specify SDB_F_ values as hex
Stefan Metzmacher [Thu, 20 Mar 2025 00:47:23 +0000 (01:47 +0100)] 
s4:kdc: specify SDB_F_ values as hex

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agolib/ldb-samba: allow ldb_get_opaque(ldb, "backend_no_debug_connect")
Stefan Metzmacher [Thu, 6 Mar 2025 16:23:39 +0000 (17:23 +0100)] 
lib/ldb-samba: allow ldb_get_opaque(ldb, "backend_no_debug_connect")

We don't want expected connect/bind failures in the log output...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agolib/ldb: allow ldb_get_opaque(ldb, "backend_no_debug_connect")
Stefan Metzmacher [Thu, 6 Mar 2025 16:23:39 +0000 (17:23 +0100)] 
lib/ldb: allow ldb_get_opaque(ldb, "backend_no_debug_connect")

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agolibcli/security: split trust_forest_info_* functions into samba-security-trusts
Stefan Metzmacher [Fri, 14 Mar 2025 08:30:03 +0000 (09:30 +0100)] 
libcli/security: split trust_forest_info_* functions into samba-security-trusts

This will avoid dependency loops in following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>