]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 months agosmbd: Simplify inotify_handler()
Volker Lendecke [Fri, 23 May 2025 13:22:39 +0000 (15:22 +0200)] 
smbd: Simplify inotify_handler()

[sizeof(struct inotify_event) + NAME_MAX + 1] is the recommended
buffer size in "man 7 inotify". Pulling everything out of the inotify
buffer makes sense if we would reliably get the two rename events in
the same read-call. Unfortunately this is not the case, even with a
buffer size of 64k I've seen MOVED_FROM and MOVED_to in separate reads
from the socket. We'll have to take care of this situation next. Until
then, we don't have to FIONREAD and then read everything that's
there. Rather go through another event loop, replacing the ioctl with
a epoll_wait syscall.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agosmbd: Modernize a DEBUG
Volker Lendecke [Mon, 26 May 2025 10:54:45 +0000 (12:54 +0200)] 
smbd: Modernize a DEBUG

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agosmbd: Initialize all members of struct inotify_watch_context
Volker Lendecke [Mon, 26 May 2025 09:53:31 +0000 (11:53 +0200)] 
smbd: Initialize all members of struct inotify_watch_context

We don't have talloc_zero()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agosmbd: Fix a typo
Volker Lendecke [Wed, 28 May 2025 10:32:29 +0000 (12:32 +0200)] 
smbd: Fix a typo

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agosmbd: Fix some whitespace
Volker Lendecke [Fri, 23 May 2025 12:50:15 +0000 (14:50 +0200)] 
smbd: Fix some whitespace

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agoCVE-2025-0620: smbd: smbd doesn't pick up group membership changes when re-authentica...
Ralph Boehme [Fri, 23 May 2025 06:47:06 +0000 (08:47 +0200)] 
CVE-2025-0620: smbd: smbd doesn't pick up group membership changes when re-authenticating an expired SMB session

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jule Anger <janger@samba.org>
Autobuild-Date(master): Mon Jun  2 15:10:30 UTC 2025 on atb-devel-224

2 months agoctdb-daemon: Modernise some DEBUGs
Martin Schwenke [Mon, 19 May 2025 00:06:21 +0000 (10:06 +1000)] 
ctdb-daemon: Modernise some DEBUGs

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu May 29 10:57:35 UTC 2025 on atb-devel-224

2 months agoctdb-daemon: Add configuration option shutdown extra timeout
Martin Schwenke [Sun, 18 May 2025 23:06:38 +0000 (09:06 +1000)] 
ctdb-daemon: Add configuration option shutdown extra timeout

See documentation change for details.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoctdb-daemon: Run "startipreallocate" event in SHUTDOWN runstate
Martin Schwenke [Thu, 15 May 2025 04:01:16 +0000 (14:01 +1000)] 
ctdb-daemon: Run "startipreallocate" event in SHUTDOWN runstate

Even though all nodes may be shutting down there is still a very small
window for a race when multiple nodes are shut down.  For simplicity,
assume 2 nodes.  Assume the shutdowns of nodes are staggered, which is
usual because they're usually initiated by a loop (e.g. onnode -p all
ctdb shutdown).  Although commands can continue in parallel, some
commands are started later than others.

Consider this sequence:

1.  Node 0 reaches ctdb_shutdown_takeover() in
    ctdb_shutdown_sequence() and a takeover run starts

2.  Node 1 has not yet set its runlevel to SHUTDOWN in
    ctdb_shutdown_sequence()

3.  The leader node asks node 1 which IPs it can host

4.  Node 1 replies "all of them"

5.  Node 1 now sets its runlevel to SHUTDOWN in
    ctdb_shutdown_sequence()

6.  The leader node continues with the takeover run, first asking all
    nodes to run "startipreallocate"

7.  Node 0 runs "startipreallocate", so its NFS server starts grace

8.  Node 1 does not run "startipreallocate" because it is not in
    RUNNING runstate, so its NFS server does not start grace

9.  The leader node continues with the takeover run, first asking all
    nodes to run "releaseip" for IPs they can no longer hold

10. Node 0 releases all IPs, since it is SHUTDOWN runstate (so can't
    host IPs)

11. As part of this, the NFS server on node 0 releases locks held
    against IPs it is releasing

12. A client connected to node 1, where the NFS server is not in
    grace, takes ("steals") one of those locks

This client is then permitted to reclaim the lock when nodes are
restarted.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoctdb-daemon: Add configuration option shutdown failover timeout
Martin Schwenke [Mon, 12 May 2025 02:00:28 +0000 (12:00 +1000)] 
ctdb-daemon: Add configuration option shutdown failover timeout

Allows the timeout for failover during shutdown to be modified.
Defaults to 10s.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
SQ

Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoctdb-daemon: Add failover on shutdown
Martin Schwenke [Mon, 12 May 2025 01:33:19 +0000 (11:33 +1000)] 
ctdb-daemon: Add failover on shutdown

Without this, NFS servers on other nodes will not go into grace before
this node releases locks.  This should also support improved behaviour
for SMB durable file handles.

The timeout is currently a constant 10s.  However, it will
subsequently be switched to an option.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoctdb-protocol: Add CTDB server SRVID range
Martin Schwenke [Wed, 14 May 2025 06:55:51 +0000 (16:55 +1000)] 
ctdb-protocol: Add CTDB server SRVID range

Normally, communication from other components to ctdbd is done via
controls.  However, there are contexts where receiving SRVID messages
in ctdbd makes sense, such as replies to outgoing SRVID messages.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoctdb-daemon: Avoid aborting during early shutdown
Martin Schwenke [Wed, 21 May 2025 12:17:42 +0000 (22:17 +1000)] 
ctdb-daemon: Avoid aborting during early shutdown

An early shutdown can put ctdbd into SHUTDOWN runstate before ctdbd
has completed all early initialisation.  Some of the start-time
transitions then attempt to set the runstate to FIRST_RECOVERY or
RUNNING, which would make the runstate go backwards, so ctdbd aborts.

Upcoming changes cause ctdbd shutdown to take longer, so the problem
will become more likely.  With those changes, this can be
unreliably (50% of the time?)  triggered by:

  ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh

since it does an early shutdown due to a version mismatch.

Avoid this by noticing when the runstate is SHUTDOWN and refusing to
continue with subsequent early initialisation steps, which aren't
needed when shutting down.

Earlier runstate transitions do not seems likely to cause an abort
during early shutdown.  The following:

  ./tests/local_daemons.sh foo start 0; ./tests/local_daemons.sh foo stop 0

sees ctdbd already into FIRST_RECOVERY before the shutdown is
processed.

The change to ctdb_run_startup() probably isn't strictly necessary.
There will be no abort in this case.  ctdb_shutdown_sequence() will
always run the "shutdown" event and then stop the event daemon, so it
doesn't seem possible that services could be left running.  However,
we might as well avoid running the "startup" event when shutting down,
even if only to avoid confusing logs.

Ultimately, it seems like some redesign would be needed to avoid this
in a more predictable manner, rather than responding when an early
initialisation step inconveniently completes during shutdown.  For
example, hanging a lot of the start-time event handling off a common
talloc context, could allow it to be cancelled with a single
TALLOC_FREE().  However, a change like that would involve a lot of
analysis to ensure that the talloc hierarchy is correct and there is
no change of free'd pointers being dereferenced.  So, we're probably
better off just keeping this issue in mind during a broader redesign.

This workaround appears to be sufficient.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoheimdal build clang 20: compile lex generated code
Gary Lockyer [Tue, 20 May 2025 21:21:17 +0000 (09:21 +1200)] 
heimdal build clang 20: compile lex generated code

The lex/flex generated code in the heimdal build triggers:
   strict-prototype and implicit-fallthrough errors

Rather that blanket disabling the warnings, try to disable them only
when compiling lex/flex generated code

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu May 29 00:19:50 UTC 2025 on atb-devel-224

2 months agoheimdal build: pass c flags in HEIMDAL_BINARY
Gary Lockyer [Tue, 20 May 2025 21:13:48 +0000 (09:13 +1200)] 
heimdal build: pass c flags in HEIMDAL_BINARY

HEIMDAL_CFLAGS clears the cflags variable,
so we need to pass cflags_end to HEIMDAL_SUBSYSTEM to ensure the
subsystem files get built with the intended flags

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 format-nonliteral warnings
Gary Lockyer [Tue, 20 May 2025 21:10:28 +0000 (09:10 +1200)] 
Fix clang 20 format-nonliteral warnings

Fix:
  /source3/utils/smbcacls.c:1619:35 error:
    format string is not a string literal
    [-Werror -Wformat-non-literal]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 format-truncation warnings
Gary Lockyer [Mon, 19 May 2025 22:00:26 +0000 (10:00 +1200)] 
Fix clang 20 format-truncation warnings

Fix:
  lib/replace/tests/testsuite.c:387:6: error:
    'snprintf' will always be truncated; specified size is 3,
    but format string expands to at least 5 [-Werror,-Wformat-truncation]
  387 |         if (snprintf(tmp, 3, "foo%d", 9) != 4) {
      |             ^

As this is an explicit test of snprintf's truncation behaviour
the warning can be safely suppressed.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 unused-function warnings
Gary Lockyer [Mon, 19 May 2025 04:32:22 +0000 (16:32 +1200)] 
Fix clang 20 unused-function warnings

Remove unused function:
  static inline struct ldb_val talloc_steal_ldb_val(TALLOC_CTX *mem_ctx, struct ldb_val val)
From source4/kdc/ad_claims.c
1 error generated.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 unused-but-set-variables warnings
Gary Lockyer [Mon, 19 May 2025 04:15:27 +0000 (16:15 +1200)] 
Fix clang 20 unused-but-set-variables warnings

Suppress error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
                for the code generated from the yacc files.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 sometimes-uninitialized warnings
Gary Lockyer [Wed, 21 May 2025 22:34:23 +0000 (10:34 +1200)] 
Fix clang 20 sometimes-uninitialized warnings

Fix clang 20:
  variable '' is uninitialized where 'if' condition is true

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agonsswitch wbinfo: fix uninitialised return value on error
Gary Lockyer [Wed, 21 May 2025 22:32:50 +0000 (10:32 +1200)] 
nsswitch wbinfo: fix uninitialised return value on error

In wbinfo_lookup_sids ret was not initialised and was not set in
the error return paths. Returning an uninitialised value in the
event of an error, and in all probability something that evaluated to
true, so would not have signalled the error to the caller.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoFix clang 20 shadows variable in global scope warning
Gary Lockyer [Mon, 19 May 2025 02:35:43 +0000 (14:35 +1200)] 
Fix clang 20 shadows variable in global scope warning

Fixes:

 [4822/4916] Compiling source3/torture/torture.c
 ../../source3/torture/torture.c:685:6: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
  685 |         int timezone = smb1cli_conn_server_time_zone(cli->conn);
      |             ^
 /usr/include/time.h:234:17: note: previous declaration is here
  234 | extern long int timezone;
      |                 ^
 1 error generated.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agobuild: Allow developer builds with clang 20
Gary Lockyer [Mon, 19 May 2025 01:56:10 +0000 (13:56 +1200)] 
build: Allow developer builds with clang 20

Disable clang warnings to allow samba to be compiled with clang 20.

Subsequent commits will fix the offending code and re-enable the
warnings.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: use fsp->name_hash in check_parent_access_fsp()
Ralph Boehme [Sat, 24 May 2025 09:47:37 +0000 (11:47 +0200)] 
smbd: use fsp->name_hash in check_parent_access_fsp()

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>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 28 16:03:59 UTC 2025 on atb-devel-224

2 months agosmbd: remove parent_dirname_compatible_open()
Ralph Boehme [Thu, 22 May 2025 15:52:28 +0000 (17:52 +0200)] 
smbd: remove parent_dirname_compatible_open()

This is now handled correctly smbd_smb2_setinfo_rename_dst_parent_check().

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 agoselftest: stop running smb2.streams against the ad_dc_ntvfs
Ralph Boehme [Mon, 26 May 2025 10:32:16 +0000 (12:32 +0200)] 
selftest: stop running smb2.streams against the ad_dc_ntvfs

This will soon start failing with

UNEXPECTED(failure): samba4.smb2.streams.rename2(ad_dc_ntvfs)
REASON: Exception: Exception: ../../source4/torture/smb2/streams.c:1533: status was NT_STATUS_OBJECT_NAME_COLLISION, expected NT_STATUS_OK: CHECK_STATUS

and I don't see the point in tracking this down for a dead product.

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 agoselftest: stop running smb2.streams against "ad_dc" environment
Ralph Boehme [Mon, 26 May 2025 09:18:57 +0000 (11:18 +0200)] 
selftest: stop running smb2.streams against "ad_dc" environment

Drop running smb2.streams tests against the "ad_dc" environment, to simplify
test failure handling with the knownfail file.

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: implement H-lease breaks on parent directory of rename target
Ralph Boehme [Thu, 22 May 2025 09:42:13 +0000 (11:42 +0200)] 
smbd: implement H-lease breaks on parent directory of rename target

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: add access_mask to delay_for_handle_lease_break_send()
Ralph Boehme [Fri, 23 May 2025 15:06:50 +0000 (17:06 +0200)] 
smbd: add access_mask to delay_for_handle_lease_break_send()

No change in behaviour, existing caller all pass SEC_RIGHTS_DIR_ALL. Prepares
for selectively breaking only H-leases if the access_mask of the corresponding
open contains DELETE_ACCESS.

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: add has_delete_access_opens()
Ralph Boehme [Wed, 21 May 2025 17:17:54 +0000 (19:17 +0200)] 
smbd: add has_delete_access_opens()

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