]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 weeks agoutils: Fixing CID 1508980 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 03:53:39 +0000 (09:23 +0530)] 
utils: Fixing CID 1508980 for time_t in DEBUG statement

Fix: typecast changing from (int)t  to (intmax_t)t
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agopassdb: Fixing CID 1508971 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 14:22:05 +0000 (19:52 +0530)] 
passdb: Fixing CID 1508971 for time_t in DEBUG statement

Fix: typecast changing from (unsigned int)badtime  to (intmax_t)badtime
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agopassdb: Fixing CID 1508970 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 12:57:00 +0000 (18:27 +0530)] 
passdb: Fixing CID 1508970 for time_t in DEBUG statement

Fix: typecast changing from (unsigned int)entry->bad_password_time  to
(intmax_t)entry->bad_password_time as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agowinbindd: Fixing CID 1508950 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 12:43:31 +0000 (18:13 +0530)] 
winbindd: Fixing CID 1508950 for time_t in DEBUG statement

Fix: typecast changing from (uint32_t)domain->last_seq_check  to
(intmax_t)domain->last_seq_check as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agonmbd: Fixing CID 1508948 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 10:21:18 +0000 (15:51 +0530)] 
nmbd: Fixing CID 1508948 for time_t in DEBUG statement

Fix: typecast changing from (int)namerec->data.death_time  to
(intmax_t)namerec->data.death_time as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agonmbd: Fixing CID 1509039 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 05:01:16 +0000 (10:31 +0530)] 
nmbd: Fixing CID 1509039 for time_t in DEBUG statement

Fix: typecast changing from (int)t to (intmax_t)t as intmax_t
can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agosmbd: Fix Bug 15897
Volker Lendecke [Sun, 7 Sep 2025 19:57:27 +0000 (21:57 +0200)] 
smbd: Fix Bug 15897

Don't leak smb_dirname->fsp->fh->fd == -1 coming from
openat_pathref_fsp_lcomp().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15897
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 10 09:37:33 UTC 2025 on atb-devel-224

3 weeks agosmbd: Add openat_pathref_fsp_dot()
Volker Lendecke [Sun, 7 Sep 2025 19:56:30 +0000 (21:56 +0200)] 
smbd: Add openat_pathref_fsp_dot()

Very simple reopen of a directory as pathref. Too much magic in
openat_pathref_fsp_lcomp() leads to Bug 15897:
openat_pathref_fsp_lcomp() can return NT_STATUS_OK but still leave the
file descriptor at -1 for msdfs and smb1 posix reasons. When using it
in filename_convert_dirfsp_nosymlink() this bites us, the -1 can leak
into vfswrap_openat(). Avoid any magic by directly calling
SMB_VFS_OPENAT() with maximum NOFOLLOW/etc safety for this use case
and fail when this does not work.

This adds another flavor of openat_pathref_fsp, and at some point we
need to consolidate them again.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15897
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib: Fix the build on FreeBSD
Volker Lendecke [Sun, 7 Sep 2025 19:23:07 +0000 (21:23 +0200)] 
lib: Fix the build on FreeBSD

FreeBSD does not need crypt.h for crypt_r(). Patch from
Peter Eriksson <pen@lysator.liu.se> via
https://bugzilla.samba.org/show_bug.cgi?id=15897#c8

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agobootstrap: Use slim images for Debian
Andreas Schneider [Fri, 8 Aug 2025 07:57:59 +0000 (09:57 +0200)] 
bootstrap: Use slim images for Debian

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): Wed Sep 10 03:13:07 UTC 2025 on atb-devel-224

3 weeks agobootstrap: Use minimal image for Fedora
Andreas Schneider [Fri, 8 Aug 2025 07:50:05 +0000 (09:50 +0200)] 
bootstrap: Use minimal image for Fedora

This will reduce the container image size.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 weeks agobootstrap: Remove unused ubuntu1804 images
Andreas Schneider [Fri, 8 Aug 2025 08:05:10 +0000 (10:05 +0200)] 
bootstrap: Remove unused ubuntu1804 images

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 weeks agos3:script: Avoid UnicodeDecodeError for samba-log-parser processing whole directory
Pavel Filipenský [Wed, 9 Jul 2025 20:38:02 +0000 (22:38 +0200)] 
s3:script: Avoid UnicodeDecodeError for samba-log-parser processing whole directory

When log directory contains zipped files like
old/log.rpcd_spoolss-20250831.gz we get error.
We want to ignore such files.

$ samba-log-parser --traceid 6 --merge-by-timestamp
Traceback (most recent call last):
  File "/usr/bin/samba-log-parser", line 382, in <module>
    main()
    ~~~~^^
  File "/usr/bin/samba-log-parser", line 311, in main
    process_file(
    ~~~~~~~~~~~~^
        record_list,
        ^^^^^^^^^^^^
    ...<3 lines>...
        options.traceid,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/bin/samba-log-parser", line 92, in process_file
    data = infile.readlines()
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Tue Sep  9 13:50:00 UTC 2025 on atb-devel-224

3 weeks agoprinting: Fix an uninitialized read
Volker Lendecke [Mon, 8 Sep 2025 16:19:01 +0000 (18:19 +0200)] 
printing: Fix an uninitialized read

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Sep  9 11:06:34 UTC 2025 on atb-devel-224

3 weeks agos4:torture: Fix stack buffer overflow in test_dirlease_oplocks()
Andreas Schneider [Tue, 9 Sep 2025 07:24:47 +0000 (09:24 +0200)] 
s4:torture: Fix stack buffer overflow in test_dirlease_oplocks()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  9 09:27:33 UTC 2025 on atb-devel-224

3 weeks agoctdb: fix build against PCP 7.0.0
Alexander Bokovoy [Wed, 3 Sep 2025 12:42:46 +0000 (15:42 +0300)] 
ctdb: fix build against PCP 7.0.0

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Sep  8 04:47:37 UTC 2025 on atb-devel-224

3 weeks agothird_party:heimdal: import lorikeet-heimdal-202508180154
Gary Lockyer [Mon, 18 Aug 2025 01:59:17 +0000 (13:59 +1200)] 
third_party:heimdal: import lorikeet-heimdal-202508180154

Import lorikeet-heimdal-202508180154 commits:
    beffefde5c6767589603cca98065378250eaae2c
    2073647157adb2791aa8b524e88e1a2d47268e5a
    dedeffb96b24288f6c3387cf48d82c7b9c3bbbf7

Add support for MS Key Trust Authentication

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Mon Sep  8 02:27:53 UTC 2025 on atb-devel-224

4 weeks agos3:shadow_copy: CID 1449539 talloc_realloc and error handling
Shwetha K Acharya [Mon, 1 Sep 2025 08:50:39 +0000 (14:20 +0530)] 
s3:shadow_copy: CID 1449539 talloc_realloc and error handling

- Replace TALLOC_REALLOC with talloc_realloc inorder to handle
  the integer overflow better.
- Rename tlabels as tmp_labels for clarity.
- Use shadow_copy_data->labels directly after successful
  reallocation instead of relying on a temporary variable.
- Ensure that  shadow_copy_data->num_volumes is set to 0 and
  shadow_copy_data->labels is freed on error paths inorder to
  address the potential resource leaks.

Fixes: CID_1449539
Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Sep  6 10:34:27 UTC 2025 on atb-devel-224

4 weeks agos3:net: Pass down the server from cmdline to sync_pw2keytabs()
Andreas Schneider [Mon, 28 Jul 2025 08:43:36 +0000 (10:43 +0200)] 
s3:net: Pass down the server from cmdline to sync_pw2keytabs()

This makes sure that during 'net ads join' the keytab create code
- sync_pw2keytabs() talks to the same DC at what the machine account
was created.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Pair-Programmed-With: Pavel Filipenský <pfilipensky@samba.org>

Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Sep  5 13:38:33 UTC 2025 on atb-devel-224

4 weeks agotests: Add test for 'net ads join' to a preferred DC
Pavel Filipenský [Mon, 4 Aug 2025 09:20:54 +0000 (11:20 +0200)] 
tests: Add test for 'net ads join' to a preferred DC

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 weeks agoselftest: Add the short name for localvampiredc to hosts file
Pavel Filipenský [Tue, 29 Jul 2025 09:19:07 +0000 (11:19 +0200)] 
selftest: Add the short name for localvampiredc to hosts file

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 weeks agos3:net: fix "net ads group"
MikeLiu [Fri, 29 Aug 2025 09:31:36 +0000 (17:31 +0800)] 
s3:net: fix "net ads group"

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep  4 09:33:27 UTC 2025 on atb-devel-224

4 weeks agokrb5: handle GSS-Proxy credentials lifetime
Alexander Bokovoy [Tue, 2 Sep 2025 07:36:11 +0000 (10:36 +0300)] 
krb5: handle GSS-Proxy credentials lifetime

GSS-Proxy stores its credential in encrypted form in the Kerberos ccache
with a start and end time of 0 and a server principal in the realm named
'X-GSSPROXY:'. This credential is accessed through GSS-Proxy interposer
mechanism in MIT Kerberos and cannot be analysed with raw krb5 API.

As MIT Kerberos has no krb5_cc_get_lifetime() implementation, add check
for the GSS-Proxy credential to smb_krb5_cc_get_lifetime() wrapper to
return KRB5_PLUGIN_NO_HANDLE. The two places where
smb_krb5_cc_get_lifetime() is used then handle this return code to avoid
deciding on the 'expired' lifetime to cause a kinit.

This fixes FreeIPA use case where an IPA API endpoint uses Samba Python
bindings with a GSS-Proxy-controlled credential cache.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Sep  3 10:15:50 UTC 2025 on atb-devel-224

4 weeks agodsdb:audit log: cmocka unit tests for KCL
Douglas Bagnall [Sun, 31 Aug 2025 09:24:34 +0000 (21:24 +1200)] 
dsdb:audit log: cmocka unit tests for KCL

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Sep  3 03:13:47 UTC 2025 on atb-devel-224

4 weeks agodsdb:audit: bump minor version of password logs (1.1 -> 1.2)
Douglas Bagnall [Thu, 28 Aug 2025 05:09:43 +0000 (17:09 +1200)] 
dsdb:audit: bump minor version of password logs (1.1 -> 1.2)

In https://wiki.samba.org/index.php/Interpreting_JSON_Audit_Logs we say:

> a version number for the JSON format. It has two parts.
>
>    major: incremented if fields change meaning
>    minor: incremented if a field is added
>
> A change in possible values does not usually trigger a version
> change. This is obviously true for client supplied data, but also
> applies to e.g. passwordType, where the set of supported password
> formats can change over time without changing the JSON version.

The last paragraph explicitly exempts us from a version change for
adding a new possible value ("Public key change") to the "action"
field. On the other hand we have expanded the scope of the log, which
deserves some version recognition.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agodsdb:audit: log if msDS-KeyCredentialLink changed
Douglas Bagnall [Thu, 28 Aug 2025 05:02:34 +0000 (17:02 +1200)] 
dsdb:audit: log if msDS-KeyCredentialLink changed

As noted in the comments, by "changed" we mean "set" or "unset".
Explicitly re-setting to the current value will be logged as if it
were a change.

This follows the behaviour of the password fields.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agodsdb:audit: password_change loggers take a new flag argument
Douglas Bagnall [Thu, 28 Aug 2025 05:03:51 +0000 (17:03 +1200)] 
dsdb:audit: password_change loggers take a new flag argument

This will allow a key credential link change to be logged, but we
don't do that anywhere in this commit.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agodsdb: audit: replace local min() with libreplace MIN()
Douglas Bagnall [Wed, 27 Aug 2025 04:02:56 +0000 (16:02 +1200)] 
dsdb: audit: replace local min() with libreplace MIN()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agodsdb:audit:test: test msDS-KeyCredentialLink change logging
Douglas Bagnall [Thu, 28 Aug 2025 21:57:48 +0000 (09:57 +1200)] 
dsdb:audit:test: test msDS-KeyCredentialLink change logging

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agolibrpc:idl: add windows event 5136 object change
Douglas Bagnall [Thu, 28 Aug 2025 00:37:13 +0000 (12:37 +1200)] 
librpc:idl: add windows event 5136 object change

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agowinbindd: Simplify parse_domain_user()
Volker Lendecke [Mon, 25 Aug 2025 10:59:32 +0000 (12:59 +0200)] 
winbindd: Simplify parse_domain_user()

We have talloc_strndup() for this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  2 09:08:59 UTC 2025 on atb-devel-224

4 weeks agolibsmb: Avoid an "else"
Volker Lendecke [Wed, 20 Aug 2025 16:23:50 +0000 (18:23 +0200)] 
libsmb: Avoid an "else"

We return in the if-branch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agovfs: Add some const to make in/out params more obvious
Volker Lendecke [Fri, 1 Aug 2025 16:07:25 +0000 (18:07 +0200)] 
vfs: Add some const to make in/out params more obvious

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Slightly simplify cli_tcon_andx_done()
Volker Lendecke [Fri, 20 Jun 2025 14:45:30 +0000 (16:45 +0200)] 
libsmb: Slightly simplify cli_tcon_andx_done()

We have tevent_req_nomem() for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Remove sync smb1cli_trans and _echo wrappers
Volker Lendecke [Fri, 20 Jun 2025 15:20:11 +0000 (17:20 +0200)] 
libsmb: Remove sync smb1cli_trans and _echo wrappers

Unused. If someone wants them back, they're easy to recreate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Fix Coverity ID 1509061 Use of 32-bit time_t
Volker Lendecke [Fri, 20 Jun 2025 07:48:11 +0000 (09:48 +0200)] 
lib: Fix Coverity ID 1509061 Use of 32-bit time_t

"man gnutls_x509_crt_set_serial" says that the serial number should be
a big-endian positive integer of up to 20 bytes....

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Use talloc_realloc_zero() in a few obvious places
Volker Lendecke [Tue, 29 Jul 2025 13:26:21 +0000 (15:26 +0200)] 
lib: Use talloc_realloc_zero() in a few obvious places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Add talloc_realloc_zero()
Volker Lendecke [Tue, 29 Jul 2025 12:50:40 +0000 (14:50 +0200)] 
lib: Add talloc_realloc_zero()

Like talloc_realloc, zeroing out expanded memory

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Slightly clarify format in set/get_secdesc
Volker Lendecke [Tue, 13 May 2025 09:31:12 +0000 (11:31 +0200)] 
libsmb: Slightly clarify format in set/get_secdesc

We have reserved fields after those 16-bit ones. With little endian
those are set to 0 with PUSH_LE32. That is unnecessary here, the
fields are already set to 0. This patch is not for efficiency, I just
got a bit confused by the subtlety.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Make map_fnum_to_smb2_handle type-safe
Volker Lendecke [Tue, 13 May 2025 09:12:25 +0000 (11:12 +0200)] 
libsmb: Make map_fnum_to_smb2_handle type-safe

"struct smb2_hnd" is talloced here, use talloc_get_type_abort()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Make dsgetdcname print flags in one DEBUG
Volker Lendecke [Mon, 12 May 2025 16:21:40 +0000 (18:21 +0200)] 
libsmb: Make dsgetdcname print flags in one DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Remove an unnecessary cast
Volker Lendecke [Tue, 13 May 2025 09:13:08 +0000 (11:13 +0200)] 
libsmb: Remove an unnecessary cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agotls: Reorder macro for easier readability
Volker Lendecke [Fri, 1 Aug 2025 14:06:23 +0000 (16:06 +0200)] 
tls: Reorder macro for easier readability

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Remove unused interpret_string_addr_prefer_ipv4()
Volker Lendecke [Wed, 25 Jun 2025 08:10:53 +0000 (10:10 +0200)] 
lib: Remove unused interpret_string_addr_prefer_ipv4()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Fix whitespace
Volker Lendecke [Wed, 25 Jun 2025 07:42:21 +0000 (09:42 +0200)] 
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Use tevent_req_nterror() properly
Volker Lendecke [Fri, 20 Jun 2025 15:21:49 +0000 (17:21 +0200)] 
libsmb: Use tevent_req_nterror() properly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolibsmb: Save a few lines with direct var initialization
Volker Lendecke [Mon, 23 Jun 2025 14:12:26 +0000 (16:12 +0200)] 
libsmb: Save a few lines with direct var initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agodnsserver: Align an integer type
Volker Lendecke [Thu, 3 Jul 2025 08:38:03 +0000 (10:38 +0200)] 
dnsserver: Align an integer type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agovfs: Simplify fruit_unlink_rsrc_stream()
Volker Lendecke [Sun, 2 Feb 2025 15:44:53 +0000 (16:44 +0100)] 
vfs: Simplify fruit_unlink_rsrc_stream()

We have the dirfsp around, no need to do a full stat()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agovfs_streams_xattr: Add some overflow protection to pread and pwrite
Volker Lendecke [Tue, 29 Jul 2025 12:49:33 +0000 (14:49 +0200)] 
vfs_streams_xattr: Add some overflow protection to pread and pwrite

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agovfs: Slightly streamline streams_xattr_renameat()
Volker Lendecke [Mon, 28 Jul 2025 08:44:24 +0000 (10:44 +0200)] 
vfs: Slightly streamline streams_xattr_renameat()

We have strequal() for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agotls: Make tstream_tls_params_quic_enabled a bit easier to read
Volker Lendecke [Mon, 4 Aug 2025 11:44:01 +0000 (13:44 +0200)] 
tls: Make tstream_tls_params_quic_enabled a bit easier to read

YMMV

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agotls: Fix a printf sign mismatch
Volker Lendecke [Mon, 4 Aug 2025 11:43:31 +0000 (13:43 +0200)] 
tls: Fix a printf sign mismatch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agotls: Fix whitespace
Volker Lendecke [Mon, 4 Aug 2025 11:40:17 +0000 (13:40 +0200)] 
tls: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Align integer types
Volker Lendecke [Mon, 4 Aug 2025 11:54:10 +0000 (13:54 +0200)] 
smbd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Align an integer type
Volker Lendecke [Thu, 7 Aug 2025 12:11:33 +0000 (14:11 +0200)] 
smbd: Align an integer type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: tevent_req_set_endtime() can fail
Volker Lendecke [Mon, 18 Aug 2025 08:50:33 +0000 (10:50 +0200)] 
lib: tevent_req_set_endtime() can fail

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agolib: Re-add dlclose(handle) when module initialization failed
Volker Lendecke [Tue, 26 Aug 2025 07:50:04 +0000 (09:50 +0200)] 
lib: Re-add dlclose(handle) when module initialization failed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  1 17:04:27 UTC 2025 on atb-devel-224

5 weeks agodsdb: Align an integer type
Volker Lendecke [Sat, 30 Aug 2025 12:04:11 +0000 (14:04 +0200)] 
dsdb: Align an integer type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Aug 31 07:23:20 UTC 2025 on atb-devel-224

5 weeks agodsdb: Fix CID 1665142, Null pointer dereferences (FORWARD_NULL)
Volker Lendecke [Sat, 30 Aug 2025 12:01:59 +0000 (14:01 +0200)] 
dsdb: Fix CID 1665142, Null pointer dereferences (FORWARD_NULL)

Do the ADD/MOD early, don't risk dereferencing msg without assignment.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 weeks agos4:dsdb:tests: Add tests for msDS-KeyCredentialLink attribute
Jennifer Sutton [Wed, 20 Aug 2025 07:10:43 +0000 (19:10 +1200)] 
s4:dsdb:tests: Add tests for msDS-KeyCredentialLink attribute

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Aug 27 04:44:59 UTC 2025 on atb-devel-224

5 weeks agos4:dsdb: Implement msDS-KeyCredentialLink attribute
Jennifer Sutton [Thu, 5 Jun 2025 00:28:20 +0000 (12:28 +1200)] 
s4:dsdb: Implement msDS-KeyCredentialLink attribute

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Add get_creds() method
Jennifer Sutton [Tue, 12 Aug 2025 23:41:53 +0000 (11:41 +1200)] 
s4:dsdb:tests: Add get_creds() method

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agolib:compression: Fix code spelling
Jennifer Sutton [Tue, 12 Aug 2025 22:17:46 +0000 (10:17 +1200)] 
lib:compression: Fix code spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb: Remove outdated comments
Jennifer Sutton [Tue, 12 Aug 2025 21:54:00 +0000 (09:54 +1200)] 
s4:dsdb: Remove outdated comments

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Remove outdated comment
Jennifer Sutton [Tue, 12 Aug 2025 05:19:55 +0000 (17:19 +1200)] 
s4:dsdb:tests: Remove outdated comment

The relevant tests were enabled in commit 8cb416a0b569017e1928a7a1cead723ce64ca314.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:acl: Fix LDB flags comparison
Jennifer Sutton [Tue, 12 Aug 2025 01:56:16 +0000 (13:56 +1200)] 
s4:dsdb:acl: Fix LDB flags comparison

LDB_FLAG_MOD_* values are not actually flags, and the previous
comparison was equivalent to

(el->flags & LDB_FLAG_MOD_MASK) == 0

which is only true if none of the LDB_FLAG_MOD_* values are set, so we
would not successfully return if the element was a DELETE. Correct the
expression to what it was intended to be.

Commit 99b805e4cbeec232c65adb1a6f3fb326b55c4496 fixed a similar issue.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb: Allow an SPN value to match the original dNSHostName with Validated Write
Jennifer Sutton [Tue, 29 Jul 2025 03:59:09 +0000 (15:59 +1200)] 
s4:dsdb: Allow an SPN value to match the original dNSHostName with Validated Write

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Correct unprefixed f‐string
Jennifer Sutton [Tue, 29 Jul 2025 03:02:32 +0000 (15:02 +1200)] 
s4:dsdb:tests: Correct unprefixed f‐string

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Correct test name
Jennifer Sutton [Tue, 29 Jul 2025 03:00:16 +0000 (15:00 +1200)] 
s4:dsdb:tests: Correct test name

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Reformat ACEs to be more readable
Jennifer Sutton [Tue, 29 Jul 2025 02:48:23 +0000 (14:48 +1200)] 
s4:dsdb:tests: Reformat ACEs to be more readable

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:dsdb:tests: Use sAMAccountName GUID constant
Jennifer Sutton [Tue, 29 Jul 2025 01:47:20 +0000 (13:47 +1200)] 
s4:dsdb:tests: Use sAMAccountName GUID constant

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agosetup:adprep: Import the latest {Domain-Wide,Forest-Wide,Read-Only-Domain-Controller...
Jennifer Sutton [Tue, 17 Jun 2025 05:04:45 +0000 (17:04 +1200)] 
setup:adprep: Import the latest {Domain-Wide,Forest-Wide,Read-Only-Domain-Controller,Schema}-Updates.md

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agopython:samba: Raise an exception if we can’t parse a Markdown operation
Jennifer Sutton [Tue, 12 Aug 2025 00:26:52 +0000 (12:26 +1200)] 
python:samba: Raise an exception if we can’t parse a Markdown operation

Otherwise we would continue with the wrong GUID and filename.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agopidl: Validate Python bytes objects
Jennifer Sutton [Tue, 17 Jun 2025 04:36:16 +0000 (16:36 +1200)] 
pidl: Validate Python bytes objects

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:setup: Fix spelling
Jennifer Sutton [Tue, 17 Jun 2025 04:28:03 +0000 (16:28 +1200)] 
s4:setup: Fix spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agoschema: Add Validated-Write-Computer Extended Right from Windows Server 2016
Jennifer Sutton [Tue, 17 Jun 2025 04:22:56 +0000 (16:22 +1200)] 
schema: Add Validated-Write-Computer Extended Right from Windows Server 2016

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agoldb: Do not return None from __str__()
Jennifer Sutton [Sun, 15 Jun 2025 23:51:14 +0000 (11:51 +1200)] 
ldb: Do not return None from __str__()

Python will complain with “__str__ returned non-string (type NoneType)”.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agotests/krb5: Remove redundant line
Jennifer Sutton [Tue, 10 Jun 2025 00:43:21 +0000 (12:43 +1200)] 
tests/krb5: Remove redundant line

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agolib:crypto: Don’t pass null pointer to memcpy()
Jennifer Sutton [Mon, 26 May 2025 00:00:16 +0000 (12:00 +1200)] 
lib:crypto: Don’t pass null pointer to memcpy()

This results in undefined behaviour.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agolib:crypto: Remove trailing whitespace
Jennifer Sutton [Sun, 25 May 2025 23:59:53 +0000 (11:59 +1200)] 
lib:crypto: Remove trailing whitespace

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agolib:async_req: Initialize variables
Jennifer Sutton [Sun, 18 May 2025 22:31:47 +0000 (10:31 +1200)] 
lib:async_req: Initialize variables

../../lib/async_req/async_sock.c: In function ‘writev_do’:
../../lib/async_req/async_sock.c:360:12: error: ‘written’ may be used uninitialized [-Werror=maybe-uninitialized]
  360 |         if ((written == -1) &&
      |            ^
../../lib/async_req/async_sock.c:343:17: note: ‘written’ was declared here
  343 |         ssize_t written;
      |                 ^~~~~~~
../../lib/async_req/async_sock.c: In function ‘read_packet_do’:
../../lib/async_req/async_sock.c:563:12: error: ‘nread’ may be used uninitialized [-Werror=maybe-uninitialized]
  563 |         if ((nread == -1) && (errno == EINTR)) {
      |            ^
../../lib/async_req/async_sock.c:531:17: note: ‘nread’ was declared here
  531 |         ssize_t nread, more;
      |                 ^~~~~
cc1: all warnings being treated as errors

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos3:lib: Initialize pointer to NULL
Jennifer Sutton [Thu, 20 Feb 2025 02:05:42 +0000 (15:05 +1300)] 
s3:lib: Initialize pointer to NULL

../../source3/lib/netapi/tests/netdisplay.c: In function ‘test_netquerydisplayinformation’:
../../source3/lib/netapi/tests/netdisplay.c:87:45: error: ‘current_name’ may be used uninitialized [-Werror=maybe-uninitialized]
   87 |                                 if (name && strcasecmp(current_name, name) == 0) {
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../source3/lib/netapi/tests/netdisplay.c:37:21: note: ‘current_name’ was declared here
   37 |         const char *current_name;
      |                     ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agolibcli: Fix maybe-uninitialized warning
Jennifer Sutton [Thu, 20 Feb 2025 00:51:24 +0000 (13:51 +1300)] 
libcli: Fix maybe-uninitialized warning

../../libcli/wsp/wsp_aqs.c: In function ‘create_size_range_shortcut’:
../../libcli/wsp/wsp_aqs.c:872:37: error: ‘upper_size’ may be used uninitialized [-Werror=maybe-uninitialized]
  872 |                 right->value.number = upper_size;
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../../libcli/wsp/wsp_aqs.c:835:18: note: ‘upper_size’ was declared here
  835 |         uint32_t upper_size;
      |                  ^~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agoldb: Fix maybe-uninitialized warning
Jennifer Sutton [Thu, 20 Feb 2025 00:41:48 +0000 (13:41 +1300)] 
ldb: Fix maybe-uninitialized warning

In file included from ../../lib/ldb/include/ldb.h:50,
                 from ../../lib/ldb/include/ldb_private.h:43,
                 from ../../lib/ldb/common/ldb_pack.c:34:
../../lib/ldb/common/ldb_pack.c: In function ‘ldb_filter_attrs’:
../../lib/talloc/talloc.h:1173:48: error: ‘i’ may be used uninitialized [-Werror=maybe-uninitialized]
 1173 | #define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/ldb/common/ldb_pack.c:1178:34: note: in expansion of macro ‘talloc_array’
 1178 |         filtered_msg->elements = talloc_array(filtered_msg,
      |                                  ^~~~~~~~~~~~
../../lib/ldb/common/ldb_pack.c:1134:22: note: ‘i’ was declared here
 1134 |         unsigned int i;
      |                      ^
cc1: all warnings being treated as errors

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agoCID 1509059 winbind: Fixing print statement for time_t
Rabinarayan Panigrahi [Tue, 26 Aug 2025 06:32:25 +0000 (12:02 +0530)] 
CID 1509059 winbind: Fixing print statement for time_t

Fixing DEBUG output for time_t to uintmax_t

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Aug 27 02:17:29 UTC 2025 on atb-devel-224

5 weeks agopython:tarfile: notes about extraction_filter
Douglas Bagnall [Fri, 22 Aug 2025 04:23:16 +0000 (16:23 +1200)] 
python:tarfile: notes about extraction_filter

a reminder to delete.

Signed-off-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): Tue Aug 26 23:43:08 UTC 2025 on atb-devel-224

5 weeks agopytest: safe_tarfile: accept NotADirectoryError as bad path rejection
Douglas Bagnall [Fri, 22 Aug 2025 03:24:34 +0000 (15:24 +1200)] 
pytest: safe_tarfile: accept NotADirectoryError as bad path rejection

After recent upstream Python fixes for various path escape and symlink
CVEs in tarfile, in particular this commit:

  commit 3612d8f51741b11f36f8fb0494d79086bac9390a
  Author: Łukasz Langa <lukasz@langa.pl>
  Date:   Tue Jun 3 12:42:11 2025 +0200

  gh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_missing')` (#135037)

  Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
our ../../ test that looks for a tarfile.OutsideDestinationError now
meets a NotADirectoryError in recent Python versions (this from 3.13,
Fedora 42):

UNEXPECTED(error): samba.tests.safe_tarfile.samba.tests.safe_tarfile.SafeTarFileTestCase.test_dots(none)
REASON: Exception: Exception: Traceback (most recent call last):
  File "/tmp/samba-testbase/b1/samba-o3/bin/python/samba/tests/safe_tarfile.py", line 48, in test_dots
    self.assertRaises(tarfile.OutsideDestinationError,
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      stf.extractall,
                      ^^^^^^^^^^^^^^^
                      tarname)
                      ^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 795, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 238, in handle
    callable_obj(*args, **kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2343, in extractall
    tarinfo, unfiltered = self._get_extract_tarinfo(
                          ~~~~~~~~~~~~~~~~~~~~~~~~~^
        member, filter_function, path)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2432, in _get_extract_tarinfo
    self._handle_fatal_error(e)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2430, in _get_extract_tarinfo
    filtered = filter_function(unfiltered, path)
  File "/usr/lib64/python3.13/tarfile.py", line 842, in tar_filter
    new_attrs = _get_filtered_attrs(member, dest_path, False)
  File "/usr/lib64/python3.13/tarfile.py", line 783, in _get_filtered_attrs
    target_path = os.path.realpath(os.path.join(dest_path, name),
                                   strict=os.path.ALLOW_MISSING)
  File "<frozen posixpath>", line 457, in realpath
NotADirectoryError: [Errno 20] Not a directory: '/tmp/samba-testbase/b1/samba-o3/bin/ab/tmp/tmpbn6e69ci/tar.tar'

In this commit, we say that a NotADirectoryError is OK.

When we started safe_tarfile we were acting in advance of upstream
Python, but now they are well ahead of us. If we trust their work in
recent versions and accept the error conditions they choose, we can
more easily get rid of our safe_tarfile when the time is right.

For the moment we still support as far back as Python 3.6 for some old
enterprise distros, and it is for those that we continue to maintain
safe_tarfile. In versions before 3.11 we will see
tarfile.ExtractError, and the test for that is unaffected by this
change.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 weeks agos4:libsocket: better diagnostics for no interfaces
Douglas Bagnall [Fri, 7 Feb 2025 00:37:37 +0000 (13:37 +1300)] 
s4:libsocket: better diagnostics for no interfaces

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agos3:smbd: slightly improve no sockets panic message
Douglas Bagnall [Fri, 7 Feb 2025 00:36:24 +0000 (13:36 +1300)] 
s3:smbd: slightly improve no sockets panic message

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agowinbindd:migrate_secrets_tdb_to_ldb() handles no client password
Douglas Bagnall [Wed, 5 Feb 2025 03:50:28 +0000 (16:50 +1300)] 
winbindd:migrate_secrets_tdb_to_ldb() handles no client password

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agos4:smb_composite: session_setup_old() handles no password
Douglas Bagnall [Wed, 5 Feb 2025 03:49:21 +0000 (16:49 +1300)] 
s4:smb_composite: session_setup_old() handles no password

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agos4:smb_composite: session_setup_nt1() handles no password
Douglas Bagnall [Wed, 5 Feb 2025 03:49:01 +0000 (16:49 +1300)] 
s4:smb_composite: session_setup_nt1() handles no password

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agoutils/smbtree: do not crash with no password (-N)
Douglas Bagnall [Wed, 5 Feb 2025 03:47:39 +0000 (16:47 +1300)] 
utils/smbtree: do not crash with no password (-N)

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agoauth: avoid strcmp(x, NULL)
Douglas Bagnall [Wed, 5 Feb 2025 03:45:06 +0000 (16:45 +1300)] 
auth: avoid strcmp(x, NULL)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agoauth: fix docs for cli_credentials_get_password_and_obtained()
Douglas Bagnall [Wed, 5 Feb 2025 03:40:47 +0000 (16:40 +1300)] 
auth: fix docs for cli_credentials_get_password_and_obtained()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agodomsid: be less alarmed by non-SID
Douglas Bagnall [Sat, 4 May 2024 01:07:26 +0000 (13:07 +1200)] 
domsid: be less alarmed by non-SID

This has been causing log noise when something is trying to parse an
identifier using a sequence of parsers, to see if it is a SID, a DN,
an account name, etc.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agodsdb:password_hash.c: restrict crypt hash to proper forms
Douglas Bagnall [Thu, 30 Jan 2025 20:24:53 +0000 (09:24 +1300)] 
dsdb:password_hash.c: restrict crypt hash to proper forms

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agopython:build: do not allow sizeof(int) != 4
Douglas Bagnall [Thu, 29 May 2025 00:58:48 +0000 (12:58 +1200)] 
python:build: do not allow sizeof(int) != 4

A non-32 bit int will (if the compiler allows it) result in code
where we write into memory adjacent to a target uint32_t value in
many python bindings using the python arg-parsing API. The more
correct thing to do would be to always parse into an unsigned long
long and error if it is greater than UINT32_MAX, but we do this in
so many places that there is reason to believe we'll just keep
adding more.

Note, we already check in lib/replace/wscript that int is at least
32 bits; here we are effectively just checking that it is not more.

There was apparently a version of 64 bit Solaris in the 1990s that
had 64 bit ints.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
5 weeks agos4:lib/tls: add additional dns hostnames as GNUTLS_SAN_DNSNAME for self-signed certif...
Stefan Metzmacher [Tue, 26 Aug 2025 13:22:10 +0000 (15:22 +0200)] 
s4:lib/tls: add additional dns hostnames as GNUTLS_SAN_DNSNAME for self-signed certificates

It's better to include X509v3 Subject Alternative Name with
DNS names also for additional dns hostnames.

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

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): Tue Aug 26 22:00:26 UTC 2025 on atb-devel-224