]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 months agosmbd: support breaking leases on an object where we don't have an own internal open
Ralph Boehme [Thu, 22 May 2025 14:57:49 +0000 (16:57 +0200)] 
smbd: support breaking leases on an object where we don't have an own internal open

So far, when dealing with the rename destination, we had an internal open on
that which ensured get_existing_share_mode_lock() would always return a
lock.

Subsequently I'll want delay_for_handle_lease_break_send() to be callable on an
object that doesn't have a full internal open including locking.tdb entry, but
merely an open handle from filename_convert_dirfsp().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbd: expand logging in contend_dirleases()
Ralph Boehme [Fri, 23 May 2025 14:35:35 +0000 (16:35 +0200)] 
smbd: expand logging in contend_dirleases()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbtorture: fix test smb2.notify-inotify.inotify-rename
Ralph Boehme [Fri, 23 May 2025 05:26:53 +0000 (07:26 +0200)] 
smbtorture: fix test smb2.notify-inotify.inotify-rename

Need to remove SEC_STD_DELETE from the access mask, otherwise we can't move
files into this directory.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbtorture: add test smb2.dirlease.rename_dst_parent
Ralph Boehme [Thu, 22 May 2025 14:56:45 +0000 (16:56 +0200)] 
smbtorture: add test smb2.dirlease.rename_dst_parent

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbtorture: add support for closing a handle when receiving a lease break
Ralph Boehme [Thu, 22 May 2025 15:50:46 +0000 (17:50 +0200)] 
smbtorture: add support for closing a handle when receiving a lease break

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbtorture: make torture_lease_break_callback() static
Ralph Boehme [Thu, 22 May 2025 15:50:09 +0000 (17:50 +0200)] 
smbtorture: make torture_lease_break_callback() static

It's only used in this compilation unit.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agosmbtorture: remove unused torture_lease_ignore_handler()
Ralph Boehme [Thu, 22 May 2025 15:49:31 +0000 (17:49 +0200)] 
smbtorture: remove unused torture_lease_ignore_handler()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
2 months agothird_party: Update socket_wrapper to version 1.5.1
Stefan Metzmacher [Mon, 19 May 2025 18:37:20 +0000 (20:37 +0200)] 
third_party: Update socket_wrapper to version 1.5.1

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): Wed May 28 11:04:40 UTC 2025 on atb-devel-224

2 months agoselftest: mark samba4.rpc.samr.passwords.lockout on ncacn_np with .samr.lockout as...
Ralph Boehme [Wed, 28 May 2025 09:18:16 +0000 (11:18 +0200)] 
selftest: mark samba4.rpc.samr.passwords.lockout on ncacn_np with .samr.lockout as flapping

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosamba-tool: Fix invalid escape sequences
Jennifer Sutton [Thu, 30 Jan 2025 01:27:10 +0000 (14:27 +1300)] 
samba-tool: Fix invalid escape sequences

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Jo Sutton <jsutton@samba.org>
Autobuild-Date(master): Mon May 26 03:44:44 UTC 2025 on atb-devel-224

2 months agopython: Fix code spelling
Jennifer Sutton [Fri, 14 Feb 2025 03:21:45 +0000 (16:21 +1300)] 
python: Fix code spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Make use of OID comparator constants
Jennifer Sutton [Mon, 13 Jan 2025 23:06:07 +0000 (12:06 +1300)] 
python: Make use of OID comparator constants

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agotests/krb5: Correct comment
Jennifer Sutton [Sat, 23 Nov 2024 00:25:34 +0000 (13:25 +1300)] 
tests/krb5: Correct comment

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Check dsdb_module_search() return value
Jennifer Sutton [Fri, 24 Jan 2025 00:18:00 +0000 (13:18 +1300)] 
s4:dsdb: Check dsdb_module_search() return value

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agosamba-tool: Fix code spelling
Jennifer Sutton [Thu, 29 Aug 2024 22:01:01 +0000 (10:01 +1200)] 
samba-tool: Fix code spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:torture:drs: Pass through unused parameters
Jennifer Sutton [Tue, 13 Aug 2024 00:00:05 +0000 (12:00 +1200)] 
s4:torture:drs: Pass through unused parameters

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:join: Add missing word
Jennifer Sutton [Thu, 15 Aug 2024 02:57:11 +0000 (14:57 +1200)] 
python:join: Add missing word

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Remove trailing whitespace
Jennifer Sutton [Tue, 6 Aug 2024 01:53:13 +0000 (13:53 +1200)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Fix code spelling
Jennifer Sutton [Mon, 5 Aug 2024 23:51:21 +0000 (11:51 +1200)] 
s4:dsdb: Fix code spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos3:smbd: Don’t free the caller’s buffer (CID 1610056)
Jennifer Sutton [Fri, 2 Aug 2024 02:42:10 +0000 (14:42 +1200)] 
s3:smbd: Don’t free the caller’s buffer (CID 1610056)

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos3:winbindd: Allow ‘ptype’ to be NULL (CID 1615194)
Jennifer Sutton [Fri, 2 Aug 2024 02:31:43 +0000 (14:31 +1200)] 
s3:winbindd: Allow ‘ptype’ to be NULL (CID 1615194)

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos3:winbindd: Fix NULL dereference (CID 1615195)
Jennifer Sutton [Fri, 2 Aug 2024 02:29:32 +0000 (14:29 +1200)] 
s3:winbindd: Fix NULL dereference (CID 1615195)

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agolib:compression: Update my name
Jennifer Sutton [Thu, 29 Aug 2024 03:41:53 +0000 (15:41 +1200)] 
lib:compression: Update my name

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agomailmap: Associate my identity with my old email addresses
Jennifer Sutton [Mon, 15 Apr 2024 03:10:37 +0000 (15:10 +1200)] 
mailmap: Associate my identity with my old email addresses

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:tests: Permit expected_count to be zero
Jennifer Sutton [Fri, 2 Aug 2024 03:55:00 +0000 (15:55 +1200)] 
python:tests: Permit expected_count to be zero

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:tests: Decode stdout for greater readability
Jennifer Sutton [Tue, 6 Aug 2024 02:05:38 +0000 (14:05 +1200)] 
python:tests: Decode stdout for greater readability

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:tests: Decode stdout and stderr for greater readability
Jennifer Sutton [Tue, 6 Aug 2024 01:51:00 +0000 (13:51 +1200)] 
python:tests: Decode stdout and stderr for greater readability

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Fix logging call
Jennifer Sutton [Fri, 11 Apr 2025 00:34:14 +0000 (12:34 +1200)] 
python: Fix logging call

ERROR(<class AttributeError>): uncaught exception - RootLogger object has no attribute notice
  File "/samba/bin/python/samba/netcmd/__init__.py", line 387, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/samba/bin/python/samba/netcmd/domain/backup.py", line 698, in run
    logger.notice("back-up has no sysvol data")
    ^^^^^^^^^^^^^

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Remove unused code
Jennifer Sutton [Tue, 4 Feb 2025 06:18:52 +0000 (19:18 +1300)] 
s4:dsdb: Remove unused code

This code has not served a purpose since 2010, when commit
6a2f7fe04c2c658e59fba01f7346303676b121b3 removed
dsdb_class_from_drsuapi().

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Remove trailing whitespace
Jennifer Sutton [Tue, 4 Feb 2025 06:18:28 +0000 (19:18 +1300)] 
s4:dsdb: Remove trailing whitespace

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agosamba-tool: Filter confidential attributes out of backups made with the ‘--no-secrets...
Jennifer Sutton [Tue, 28 Jan 2025 01:15:02 +0000 (14:15 +1300)] 
samba-tool: Filter confidential attributes out of backups made with the ‘--no-secrets’ option

Without this change, ‘lab domains’ and backups intended not to contain
secrets will still contain confidential information, such as BitLocker
recovery data and KDS root keys. Add a new class that filters these
attributes out.

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agodrs_utils: Split process_chunk() out into its own class
Jennifer Sutton [Tue, 23 Jul 2024 05:24:28 +0000 (17:24 +1200)] 
drs_utils: Split process_chunk() out into its own class

This makes it easier to add classes with new functionality without
having to figure out how to slot them into a linear class hierarchy.

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:tests: Test that secret keys and confidential attributes are not included...
Jennifer Sutton [Tue, 14 Jan 2025 01:19:46 +0000 (14:19 +1300)] 
python:tests: Test that secret keys and confidential attributes are not included in a --no-secrets backup

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agodrs_utils: Check for presence of more_flags attribute directly
Jennifer Sutton [Mon, 13 Jan 2025 23:08:26 +0000 (12:08 +1300)] 
drs_utils: Check for presence of more_flags attribute directly

This more directly indicates what we are trying to achieve.

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb: Use PyLong_FromUnsignedLong() for unsigned values
Jennifer Sutton [Wed, 21 May 2025 01:08:56 +0000 (13:08 +1200)] 
s4:dsdb: Use PyLong_FromUnsignedLong() for unsigned values

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:samdb: Add get_searchFlags_from_lDAPDisplayName() method
Jennifer Sutton [Tue, 6 Aug 2024 01:54:56 +0000 (13:54 +1200)] 
python:samdb: Add get_searchFlags_from_lDAPDisplayName() method

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:samdb: Add get_must_contain_from_lDAPDisplayName() method
Jennifer Sutton [Wed, 5 Feb 2025 03:07:49 +0000 (16:07 +1300)] 
python:samdb: Add get_must_contain_from_lDAPDisplayName() method

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:samdb: Add get_lDAPDisplayName_by_governsID_id() method
Jennifer Sutton [Tue, 4 Feb 2025 05:50:32 +0000 (18:50 +1300)] 
python:samdb: Add get_lDAPDisplayName_by_governsID_id() method

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython3: Remove Python 2–only call to decode()
Jennifer Sutton [Tue, 3 Sep 2024 00:32:14 +0000 (12:32 +1200)] 
python3: Remove Python 2–only call to decode()

AttributeError: 'str' object has no attribute 'decode'

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Make set of seen GUIDs a local variable
Jennifer Sutton [Mon, 2 Sep 2024 23:38:44 +0000 (11:38 +1200)] 
python: Make set of seen GUIDs a local variable

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Correct comment
Jennifer Sutton [Mon, 2 Sep 2024 23:38:13 +0000 (11:38 +1200)] 
python: Correct comment

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Simplify GetNCChanges call setup
Jennifer Sutton [Thu, 29 Aug 2024 01:37:05 +0000 (13:37 +1200)] 
python: Simplify GetNCChanges call setup

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Remove unused ‘more_flags’ parameter
Jennifer Sutton [Thu, 29 Aug 2024 01:32:25 +0000 (13:32 +1200)] 
python: Remove unused ‘more_flags’ parameter

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython: Tidy up formatting
Jennifer Sutton [Thu, 29 Aug 2024 01:30:49 +0000 (13:30 +1200)] 
python: Tidy up formatting

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agopython:join: Remove unnecessary local variable
Jennifer Sutton [Tue, 6 Aug 2024 04:18:16 +0000 (16:18 +1200)] 
python:join: Remove unnecessary local variable

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agodrs_utils: Make loop exit condition explicit
Jennifer Sutton [Tue, 6 Aug 2024 03:38:57 +0000 (15:38 +1200)] 
drs_utils: Make loop exit condition explicit

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agodrs_utils: Remove unnecessary qualification
Jennifer Sutton [Tue, 6 Aug 2024 03:07:44 +0000 (15:07 +1200)] 
drs_utils: Remove unnecessary qualification

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

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos3:winbind: Delegate normalize_name_map to the idmap child
Samuel Cabrero [Fri, 25 Apr 2025 14:44:16 +0000 (16:44 +0200)] 
s3:winbind: Delegate normalize_name_map to the idmap child

Delegate mapping to the idmap child to avoid blocking.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Thu May 22 13:41:43 UTC 2025 on atb-devel-224

2 months agowinbind.idl: Add wbint_NormalizeNameUnmap
Samuel Cabrero [Fri, 25 Apr 2025 16:34:42 +0000 (18:34 +0200)] 
winbind.idl: Add wbint_NormalizeNameUnmap

normalize_name_unmap(), depending on the idmap config, can query LDAP
to unmap the username from its alias, e.g., map posix uid to samaccountname.

To avoid blocking this call should be done in the idmap child.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agowinbind.idl: Add wbint_NormalizeNameMap
Samuel Cabrero [Fri, 25 Apr 2025 14:13:10 +0000 (16:13 +0200)] 
winbind.idl: Add wbint_NormalizeNameMap

normalize_name_map(), depending on the idmap config, can query LDAP to map the
username to its alias, e.g., map samaccountname to posix uid.

To avoid blocking this call should be done in the idmap child.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/torture: assert that a test doesn't create new talloc children of context->ev
Stefan Metzmacher [Fri, 9 May 2025 09:28:44 +0000 (11:28 +0200)] 
lib/torture: assert that a test doesn't create new talloc children of context->ev

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 19 10:13:25 UTC 2025 on atb-devel-224

2 months agolib/torture: use temporary memory for each test/suites
Stefan Metzmacher [Fri, 9 May 2025 09:19:47 +0000 (11:19 +0200)] 
lib/torture: use temporary memory for each test/suites

We use torture_context_child() and tevent_re_initialise() in order
to run each test with it's own memory and also a cleared event context.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/torture: give torture_context_child() a dedicated talloc parent and avoid talloc_...
Stefan Metzmacher [Fri, 9 May 2025 09:18:18 +0000 (11:18 +0200)] 
lib/torture: give torture_context_child() a dedicated talloc parent and avoid talloc_reference

The caller should manage the liftimes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/torture: extend torture_context_init()
Stefan Metzmacher [Fri, 9 May 2025 08:41:52 +0000 (10:41 +0200)] 
lib/torture: extend torture_context_init()

Give it a dedicated talloc parent and avoid
talloc_references, the caller needs to take care
that the lifetime of the arguments is longer.

This makes sure any talloc destructors of torture_context
children run before torture->ev is destroyed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos4:rpc_server: don't use event_ctx as talloc parent of dcesrv_sock
Stefan Metzmacher [Fri, 9 May 2025 12:40:38 +0000 (14:40 +0200)] 
s4:rpc_server: don't use event_ctx as talloc parent of dcesrv_sock

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos4:libnet: pass an explicit talloc parent to libnet_context_init()
Stefan Metzmacher [Fri, 9 May 2025 11:30:36 +0000 (13:30 +0200)] 
s4:libnet: pass an explicit talloc parent to libnet_context_init()

We should not implicitly use the tevent_context as talloc parent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos4:messaging/tests: correctly teardown imessage contexts
Stefan Metzmacher [Mon, 12 May 2025 15:45:31 +0000 (17:45 +0200)] 
s4:messaging/tests: correctly teardown imessage contexts

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agocharset/tests: avoid static variables in test_buffer()
Stefan Metzmacher [Mon, 12 May 2025 15:42:45 +0000 (17:42 +0200)] 
charset/tests: avoid static variables in test_buffer()

Add an explicit cache which is destroyed via a talloc
destructor instead, so we don't leak stale pointers
in the static variables.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/util: activate panic on dangling talloc stackframes
Stefan Metzmacher [Tue, 13 May 2025 15:01:22 +0000 (17:01 +0200)] 
lib/util: activate panic on dangling talloc stackframes

We can do that now as pylibsmb.c doesn't trigger it anymore.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos3:pylibsmb: don't use an unbound talloc_stackframe() in libsmb_samba_cwrapper()
Stefan Metzmacher [Mon, 12 May 2025 15:53:45 +0000 (17:53 +0200)] 
s3:pylibsmb: don't use an unbound talloc_stackframe() in libsmb_samba_cwrapper()

Code should use there own explicit stackframes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos3:pylibsmb: add explicit talloc_stackframes to most functions
Stefan Metzmacher [Tue, 13 May 2025 14:58:14 +0000 (16:58 +0200)] 
s3:pylibsmb: add explicit talloc_stackframes to most functions

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos3:pylibsmb: fix a few (potential) memory leaks
Stefan Metzmacher [Tue, 13 May 2025 14:55:02 +0000 (16:55 +0200)] 
s3:pylibsmb: fix a few (potential) memory leaks

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos3:pylibsmb: avoid using PyErr_NTSTATUS_NOT_OK_RAISE()
Stefan Metzmacher [Tue, 13 May 2025 13:36:58 +0000 (15:36 +0200)] 
s3:pylibsmb: avoid using PyErr_NTSTATUS_NOT_OK_RAISE()

Doing explicit if statements will allow us to do
memory cleanup on error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolibcli/smb: create explicit talloc stackframe in reparse_data_buffer_marshall()
Stefan Metzmacher [Wed, 14 May 2025 09:24:36 +0000 (11:24 +0200)] 
libcli/smb: create explicit talloc stackframe in reparse_data_buffer_marshall()

This is needed in order to allow helper functions to use talloc_tos().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/util: add pthread support to talloc_stack.c
Stefan Metzmacher [Mon, 12 May 2025 18:44:46 +0000 (20:44 +0200)] 
lib/util: add pthread support to talloc_stack.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/util: add atexit handling and complain about dangling frames.
Stefan Metzmacher [Mon, 12 May 2025 18:50:10 +0000 (20:50 +0200)] 
lib/util: add atexit handling and complain about dangling frames.

We don't panic yet as pylibsmb.c would trigger that...
This will be fixed in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agolib/util: remove unused SMB_THREAD handling from talloc_stack.c
Stefan Metzmacher [Mon, 12 May 2025 18:43:08 +0000 (20:43 +0200)] 
lib/util: remove unused SMB_THREAD handling from talloc_stack.c

This does not support any threads as smb_thread_set_functions()
is never called anywhere.

We'll add plain pthread handling in the next commit.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 months agos4:torture/smb2: let smb2.bench tests start the loop only when everything is ready
Stefan Metzmacher [Fri, 16 May 2025 11:41:21 +0000 (13:41 +0200)] 
s4:torture/smb2: let smb2.bench tests start the loop only when everything is ready

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 16 13:41:56 UTC 2025 on atb-devel-224

2 months agowafsamba: Adjust 'match' logic to override paths in config.check()
Noel Power [Thu, 8 May 2025 18:16:07 +0000 (19:16 +0100)] 
wafsamba: Adjust 'match' logic to override paths in config.check()

messages that match various parts of the configure check progress e.g.
 'Checking for library iconv'
 'Checking for iconv_open'
 'Checking for header iconv.h'

are intercepted and the some path(s) modified with the associated option
value

    o buildtools/wafsamba/samba_conftests.py: Add arg_list variable
       arg_list contains the argument object returned from
       'argparser.ArgumentParser.add_argument' which is called
       with the content of the 'match' keyword passed to 'add_option'
       stripped out. The content of the 'match' keyword is saved as
       an attribute to the arg object appended to arg_list.
    o buildtools/wafsamba/samba_waf18.py:
       search arg_list (see above) that match and 'msg' argument passed
       to arg_list (allowing the dest variable associated with the argument
       to be accessed and added to some 'path' used during the 'check' phase

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 16 10:31:31 UTC 2025 on atb-devel-224

2 months agodynconfig/wscript: Adjust default cleanup for waf 2.1.5
Andreas Schneider [Thu, 8 May 2025 19:33:52 +0000 (20:33 +0100)] 
dynconfig/wscript: Adjust default cleanup for waf 2.1.5

Using waf 2.1.5 parser.defaults no longer exists (that's part of
the optparse module and waf 2.1.5 uses argparse)
This patch adjusts the default cleanup for argparse.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: Adjust for waf 2.1.5 case of some Options.options attributes
Noel Power [Thu, 8 May 2025 19:28:54 +0000 (20:28 +0100)] 
wafsamba: Adjust for waf 2.1.5 case of some Options.options attributes

Some dynamic attribute names  for some variables have changed
from uppercase to lowercase with waf 2.1.5

e.g.

  Options.options.LIBDIR  -> Options.options.libdir
  Options.options.BINDIR  -> Options.options.bindir
  Options.options.SBINDIR -> Options.options.sbindir

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: Adjust for waf 2.1.5 wafsamba_options_parse_cmd_args return
Noel Power [Thu, 8 May 2025 19:26:33 +0000 (20:26 +0100)] 
wafsamba: Adjust for waf 2.1.5 wafsamba_options_parse_cmd_args return

return 2 item tuple to match waf 2.1.5 version of
Options.OptionsContext.parse_cmd_args

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agothird_party: Update waf to version 2.1.5
Andreas Schneider [Mon, 28 Apr 2025 11:31:20 +0000 (13:31 +0200)] 
third_party: Update waf to version 2.1.5

https://gitlab.com/ita1024/waf/-/blob/waf-2.1.5/ChangeLog

This breaks the build, the following 4 commit will fix it again.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: Set env variables before calling command
Noel Power [Fri, 2 May 2025 09:56:15 +0000 (10:56 +0100)] 
wafsamba: Set env variables before calling command

Old optparse handling in third_party/waf/waflib/Options.py would process
leftover arguments and distinguish between env var overrides and
commands. In waf 2.1.5 Options.py no longer will do this and we can see
this with config command like (from fuzz job)

./configure.developer -C --without-gettext --enable-debug --enable-developer --enable-libfuzzer --address-sanitizer --disable-warnings-as-errors --abi-check-disable --fuzz-target-ldflags=-Wl,--disable-new-dtags  --nonshared-binary=ALL --enable-afl-fuzzer --with-prometheus-exporter LINK_CC=

failing like below

'configure' finished successfully (1m11.100s)

==> /builds/samba-team/devel/samba/samba-fuzz.stderr <==
No function 'LINK_CC=' defined in /builds/samba-testbase/samba-fuzz/wscript
2025-05-02 08:58:21,615 samba-fuzz: [fuzzers-build] failed 'OUT=/builds/samba-testbase/prefix/samba-fuzz LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer --with-prometheus-exporter' with status 1

Now we should just use the needed env directly e.g. for example above you
should call configure as below

LINK_CC= ./configure.developer -C --without-gettext --enable-debug --enable-developer --enable-libfuzzer --address-sanitizer --disable-warnings-as-errors --abi-check-disable --fuzz-target-ldflags=-Wl,--disable-new-dtags  --nonshared-binary=ALL --enable-afl-fuzzer --with-prometheus-exporter

This patch adjusts some documentation and a build script to reflect
this change.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: Adjust for waf 2.1.5, add default for '--with/without-json'
Noel Power [Thu, 8 May 2025 19:19:54 +0000 (20:19 +0100)] 
wafsamba: Adjust for waf 2.1.5, add default for '--with/without-json'

With argparse we need to specify a default for in order to correctly
handle conflicting values for with/without-json

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: Adjust value type from string name(s) to actual
Andreas Schneider [Tue, 29 Apr 2025 14:15:54 +0000 (16:15 +0200)] 
wafsamba: Adjust value type from string name(s) to actual

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agowafsamba: simplify mit kerberos detection
Noel Power [Thu, 8 May 2025 08:43:17 +0000 (09:43 +0100)] 
wafsamba: simplify mit kerberos detection

This patch removes the --with-system-mitkrb5 callback and associated
ability to store both boolean and path (string list) content.
The boolean part is self explanatory, specifying a path list
was a way to alternatively specify where krb5-config was found.
Instead now after this change to influence where krb5-config is found
the PATH variable itself should be modified before running configure.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agothird_party: Update waf to version 2.0.27
Andreas Schneider [Mon, 28 Apr 2025 11:28:56 +0000 (13:28 +0200)] 
third_party: Update waf to version 2.0.27

This is the last 2.0.x version.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 16 08:48:22 UTC 2025 on atb-devel-224

2 months agoutils: Fix CID 1638831 Division or modulo by zero
Shwetha K Acharya [Mon, 5 May 2025 07:47:05 +0000 (13:17 +0530)] 
utils: Fix CID 1638831 Division or modulo by zero

The conditions now == start or pos == start_pos are checked
at the beginning of the function definition to ensure that avg
is non zero.
Also an appropriate print statement is added to indicate
the print status.

Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri May 16 07:10:57 UTC 2025 on atb-devel-224

2 months agoutils: Fix CID 242227 resource leak
Shwetha K Acharya [Fri, 9 May 2025 09:46:19 +0000 (15:16 +0530)] 
utils: Fix CID 242227 resource leak

Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 months agolibsmb: Modernize two DEBUGs
Volker Lendecke [Mon, 7 Apr 2025 08:47:23 +0000 (10:47 +0200)] 
libsmb: Modernize two DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu May 15 15:06:36 UTC 2025 on atb-devel-224

2 months agowinbind: Fix a few Coverity complaints
Volker Lendecke [Wed, 2 Apr 2025 07:34:57 +0000 (09:34 +0200)] 
winbind: Fix a few Coverity complaints

Coverity correctly complains that we pass time_t into a uint32_t.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: Modernize a few DEBUGs
Volker Lendecke [Mon, 7 Apr 2025 13:28:14 +0000 (15:28 +0200)] 
smbd: Modernize a few DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolib: Fix whitespace
Volker Lendecke [Tue, 8 Apr 2025 09:46:38 +0000 (11:46 +0200)] 
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolib: Save lines by avoiding explicit ZERO_STRUCTP calls
Volker Lendecke [Fri, 4 Apr 2025 10:24:59 +0000 (12:24 +0200)] 
lib: Save lines by avoiding explicit ZERO_STRUCTP calls

SMB_CALLOC_ARRAY(..., 1) does this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Put useccache initialization into one place
Volker Lendecke [Thu, 24 Apr 2025 10:04:46 +0000 (12:04 +0200)] 
libsmb: Put useccache initialization into one place

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolsa_server4: Fix comments
Volker Lendecke [Mon, 5 May 2025 08:53:25 +0000 (10:53 +0200)] 
lsa_server4: Fix comments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Avoid an "else"
Volker Lendecke [Thu, 8 May 2025 16:00:34 +0000 (18:00 +0200)] 
libsmb: Avoid an "else"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: Modernize DEBUGs
Volker Lendecke [Thu, 8 May 2025 11:57:25 +0000 (13:57 +0200)] 
smbd: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Avoid a "else" in cli_read_max_bufsize()
Volker Lendecke [Thu, 8 May 2025 11:47:37 +0000 (13:47 +0200)] 
libsmb: Avoid a "else" in cli_read_max_bufsize()

Simpler to read for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolib: Modernize a few DEBUGs
Volker Lendecke [Wed, 7 May 2025 13:45:53 +0000 (15:45 +0200)] 
lib: Modernize a few DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Remove an unused variable
Volker Lendecke [Tue, 6 May 2025 15:06:39 +0000 (17:06 +0200)] 
libsmb: Remove an unused variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Move 192 bytes from R/W .data to R/O (shared) .text
Volker Lendecke [Tue, 6 May 2025 11:52:57 +0000 (13:52 +0200)] 
libsmb: Move 192 bytes from R/W .data to R/O (shared) .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Reduce indentation in SMBC_attr_server()
Volker Lendecke [Tue, 6 May 2025 11:18:30 +0000 (13:18 +0200)] 
libsmb: Reduce indentation in SMBC_attr_server()

Use an early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Reduce indentation in SMBC_find_server()
Volker Lendecke [Mon, 5 May 2025 13:55:13 +0000 (15:55 +0200)] 
libsmb: Reduce indentation in SMBC_find_server()

Use an early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Simplify cli_smb2_list_send()
Volker Lendecke [Mon, 5 May 2025 12:05:03 +0000 (14:05 +0200)] 
libsmb: Simplify cli_smb2_list_send()

Use make_smb2_posix_create_ctx()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Remove a redundant tevent_req_nterror()
Volker Lendecke [Mon, 5 May 2025 12:02:39 +0000 (14:02 +0200)] 
libsmb: Remove a redundant tevent_req_nterror()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Reduce indentation in SMBC_check_server() with a "goto done"
Volker Lendecke [Mon, 5 May 2025 10:47:07 +0000 (12:47 +0200)] 
libsmb: Reduce indentation in SMBC_check_server() with a "goto done"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Reduce indentation in SMBC_check_server() with an early return
Volker Lendecke [Mon, 5 May 2025 10:43:58 +0000 (12:43 +0200)] 
libsmb: Reduce indentation in SMBC_check_server() with an early return

Best reviewed with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibsmb: Introduce a helper var in SMBC_check_server()
Volker Lendecke [Mon, 5 May 2025 10:41:51 +0000 (12:41 +0200)] 
libsmb: Introduce a helper var in SMBC_check_server()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>