]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agos3:selftest: Add environ parameter to plansmbtorture4testsuite
Pavel Filipenský [Tue, 11 Apr 2023 10:08:14 +0000 (12:08 +0200)] 
s3:selftest: Add environ parameter to plansmbtorture4testsuite

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotests: Fix idmap.rid.getgrnam for ad_member_idmap_rid with 'winbind expand groups...
Pavel Filipenský [Sun, 23 Apr 2023 22:11:34 +0000 (00:11 +0200)] 
tests: Fix idmap.rid.getgrnam for ad_member_idmap_rid with 'winbind expand groups = 10'

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: set 'winbind expand groups = 10' for ad_member_idmap_rid
Pavel Filipenský [Mon, 27 Feb 2023 16:03:31 +0000 (17:03 +0100)] 
selftest: set 'winbind expand groups = 10' for ad_member_idmap_rid

This is for alias members tests.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:torture: Skip test_membership_user for users that get incorrectly assigned group sid
Pavel Filipenský [Mon, 27 Mar 2023 18:00:05 +0000 (20:00 +0200)] 
s4:torture: Skip test_membership_user for users that get incorrectly assigned group sid

This commit should be removed once wb_queryuser() is fixed.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix the default group for the 'Guest' user
Pavel Filipenský [Fri, 24 Mar 2023 14:03:21 +0000 (15:03 +0100)] 
s3:winbind: Fix the default group for the 'Guest' user

If samlogon cache has no entry for the 'Guest' user, the group sid
should default to 'Guests' group.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Include local groups in _wbint_QueryGroupList
Pavel Filipenský [Mon, 27 Feb 2023 16:03:32 +0000 (17:03 +0100)] 
s3:winbind: Include local groups in _wbint_QueryGroupList

This is needed for GETGRENT to show also e.g. BUILTIN/users.
Otherwise the test_membership_user (local.nss.membership) would fail.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Remove SID_NAME_ALIAS code from rpc_lookup_groupmem()
Pavel Filipenský [Thu, 30 Mar 2023 13:32:55 +0000 (15:32 +0200)] 
s3:winbind: Remove SID_NAME_ALIAS code from rpc_lookup_groupmem()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: s/wb_group_members_send/wb_alias_members_send/ for SID_NAME_ALIAS in...
Pavel Filipenský [Tue, 21 Mar 2023 07:33:37 +0000 (08:33 +0100)] 
s3:winbind: s/wb_group_members_send/wb_alias_members_send/ for SID_NAME_ALIAS in wb_getgrsid_sid2gid_done()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib:dbwrap: Add dbwrap_merge_dbs()
Pavel Filipenský [Tue, 28 Mar 2023 09:15:15 +0000 (11:15 +0200)] 
lib:dbwrap: Add dbwrap_merge_dbs()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib:dbwrap: Fix trailing whitespace in lib/dbwrap/dbwrap.h
Pavel Filipenský [Tue, 28 Mar 2023 09:15:50 +0000 (11:15 +0200)] 
lib:dbwrap: Fix trailing whitespace in lib/dbwrap/dbwrap.h

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Convert wb_group_members_send() to resolve array of groups
Pavel Filipenský [Thu, 9 Mar 2023 15:00:20 +0000 (16:00 +0100)] 
s3:winbind: Convert wb_group_members_send() to resolve array of groups

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Add wb_alias_members_{send/recv}
Pavel Filipenský [Wed, 29 Mar 2023 12:57:50 +0000 (14:57 +0200)] 
s3:winbind: Add wb_alias_members_{send/recv}

wb_alias_members.c is very similar to wb_lookupusergroups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Add wbint_LookupAliasMembers to winbind interface
Pavel Filipenský [Wed, 29 Mar 2023 12:53:14 +0000 (14:53 +0200)] 
s3:winbind: Add wbint_LookupAliasMembers to winbind interface

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Add lookup_aliasmem to winbindd_methods and implement it in all backends
Pavel Filipenský [Wed, 8 Mar 2023 07:40:58 +0000 (08:40 +0100)] 
s3:winbind: Add lookup_aliasmem to winbindd_methods and implement it in all backends

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespace in winbindd_cache.c
Pavel Filipenský [Wed, 8 Mar 2023 12:04:40 +0000 (13:04 +0100)] 
s3:winbind: Fix trailing whitespace in winbindd_cache.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespace in winbindd_reconnect.c
Pavel Filipenský [Wed, 29 Mar 2023 11:28:35 +0000 (13:28 +0200)] 
s3:winbind: Fix trailing whitespace in winbindd_reconnect.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespace in winbindd_msrpc.c
Pavel Filipenský [Wed, 29 Mar 2023 11:25:15 +0000 (13:25 +0200)] 
s3:winbind: Fix trailing whitespace in winbindd_msrpc.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agogp: Fix user apply failure when droping privs
David Mulder [Wed, 7 Jun 2023 14:29:31 +0000 (08:29 -0600)] 
gp: Fix user apply failure when droping privs

When dropping privileges, gpupdate errored:
gpclass.py:1167: KeyError: "getpwnam(): name not found: <HOSTNAME>
apply_gp was incorrectly passing the hostname
instead of the username.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 10 10:46:28 UTC 2023 on atb-devel-224

3 years agobootstrap: make sure we have gnutls-cli from gnutls-bin/gnutls-utils
Stefan Metzmacher [Fri, 9 Jun 2023 12:07:06 +0000 (14:07 +0200)] 
bootstrap: make sure we have gnutls-cli from gnutls-bin/gnutls-utils

We'll use it in some upcoming tests...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agobootstrap: force use of LANGUAGE=en_US
Stefan Metzmacher [Fri, 9 Jun 2023 12:02:48 +0000 (14:02 +0200)] 
bootstrap: force use of LANGUAGE=en_US

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: run tests with LANGUAGE=en_US
Stefan Metzmacher [Fri, 9 Jun 2023 11:51:56 +0000 (13:51 +0200)] 
selftest: run tests with LANGUAGE=en_US

This is important in order to run /usr/bin/kpasswd from MIT...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agothird_party/heimdal: Import lorikeet-heimdal-202306091507 (commit 7d8afc9d7e3d309ddcc...
Stefan Metzmacher [Fri, 9 Jun 2023 13:14:50 +0000 (15:14 +0200)] 
third_party/heimdal: Import lorikeet-heimdal-202306091507 (commit 7d8afc9d7e3d309ddccc2aea6405a8ca6280f6de)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosmbd: Remove unused dptr_fill() and dptr_fetch_fsp()
Volker Lendecke [Thu, 8 Jun 2023 10:49:08 +0000 (12:49 +0200)] 
smbd: Remove unused dptr_fill() and dptr_fetch_fsp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  8 18:34:44 UTC 2023 on atb-devel-224

3 years agosmbd: Make reply_search() easier to understand
Volker Lendecke [Thu, 8 Jun 2023 10:37:43 +0000 (12:37 +0200)] 
smbd: Make reply_search() easier to understand

reply_search() is the only place in the code where we have to deal
with [MS-CIFS] 2.2.4.59.1 ResumeKey structures. This concentrates the
formatting of this to pure SMB1 code in reply_search(), moving away
knowledge about the format from smbd/dir.c's dptr_fill() and
dptr_fetch_fsp().

With this code we just count up the FileIndex from behaviour note
110. If the client is sane and sends us the last FileIndex we returned
to it in a subsequent search, we can completely avoid any
telldir/seekdir. If it skips back, with the new code we rewind and
re-readdir the directory. This will be slower for a very special
corner case, but it's a lot simpler to understand (at least to
me). Also, it avoids calling telldir/seekdir for every entry.

Tested both cases (sane and insane clients) manually with a modified
cli_list_old_done(). Not doing automated tests. If this breaks real
users, we'll fix it and write tests then.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Do an early talloc_free() in reply_search()
Volker Lendecke [Thu, 8 Jun 2023 10:20:31 +0000 (12:20 +0200)] 
smbd: Do an early talloc_free() in reply_search()

Don't wait for the main loop to free file names no longer used.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Do an early talloc_free() in fsp_attach_smb_fname()
Volker Lendecke [Thu, 8 Jun 2023 10:19:00 +0000 (12:19 +0200)] 
smbd: Do an early talloc_free() in fsp_attach_smb_fname()

name_str can pile up when reading directories, we don't talloc_free()
our stackframe before we have filled the whole readdir response packet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Add dptr_RewindDir()
Volker Lendecke [Thu, 8 Jun 2023 09:59:35 +0000 (11:59 +0200)] 
smbd: Add dptr_RewindDir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Add dptr_FileNumber()
Volker Lendecke [Wed, 7 Jun 2023 15:10:51 +0000 (17:10 +0200)] 
smbd: Add dptr_FileNumber()

Return how many name entries have been returned from this dptr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Simplify make_dir_struct()
Volker Lendecke [Wed, 7 Jun 2023 13:16:44 +0000 (15:16 +0200)] 
smbd: Simplify make_dir_struct()

We don't need the talloc_strdup and thus we can return void.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Make SeekDir()/TellDir() static to dir.c
Volker Lendecke [Mon, 29 May 2023 10:47:34 +0000 (12:47 +0200)] 
smbd: Make SeekDir()/TellDir() static to dir.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Fix a typo
Volker Lendecke [Wed, 7 Jun 2023 15:18:28 +0000 (17:18 +0200)] 
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbclient: Fix fd leak with "showacls;ls"
Volker Lendecke [Thu, 8 Jun 2023 08:14:18 +0000 (10:14 +0200)] 
smbclient: Fix fd leak with "showacls;ls"

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  8 16:55:14 UTC 2023 on atb-devel-224

3 years agoWHATSNEW.txt: Improved winbind logging and samba-log-parser
Pavel Filipenský [Wed, 7 Jun 2023 12:55:49 +0000 (14:55 +0200)] 
WHATSNEW.txt: Improved winbind logging and samba-log-parser

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  7 15:06:07 UTC 2023 on atb-devel-224

3 years agodocs-xml:manpages: Add man page for samba-log-parser
Pavel Filipenský [Tue, 9 May 2023 12:09:55 +0000 (14:09 +0200)] 
docs-xml:manpages: Add man page for samba-log-parser

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:script: Add samba-log-parser
Pavel Filipenský [Thu, 9 Feb 2023 15:48:49 +0000 (16:48 +0100)] 
s3:script: Add samba-log-parser

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

3 years agosmbcacls/smbcquotas: check for valid UNC path
Björn Jacke [Tue, 10 Jan 2023 11:25:35 +0000 (12:25 +0100)] 
smbcacls/smbcquotas: check for valid UNC path

we used to strip the first two characters of the path and used that.

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jun  6 09:33:47 UTC 2023 on atb-devel-224

3 years agobootstrap: Add a note about cleaning bootstrap/
Łukasz Stelmach [Thu, 11 May 2023 11:33:45 +0000 (13:33 +0200)] 
bootstrap: Add a note about cleaning bootstrap/

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agoConfigure builtin heimdal to use KEYRING ccache
Łukasz Stelmach [Fri, 31 Mar 2023 17:42:13 +0000 (19:42 +0200)] 
Configure builtin heimdal to use KEYRING ccache

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agothird_party: Fix version of socket_wrapper and uid_wrapper
SATOH Fumiyasu [Tue, 23 May 2023 00:38:24 +0000 (09:38 +0900)] 
third_party: Fix version of socket_wrapper and uid_wrapper

Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun  6 08:34:55 UTC 2023 on atb-devel-224

3 years agosmbd: Remove smb1-only perfcount subsystem
Volker Lendecke [Mon, 5 Jun 2023 14:06:50 +0000 (16:06 +0200)] 
smbd: Remove smb1-only perfcount subsystem

This never took off outside of a special OEM setup.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun  5 18:13:05 UTC 2023 on atb-devel-224

3 years agosmbd: Remove unused "pcd" from struct pending_message_list
Volker Lendecke [Mon, 5 Jun 2023 14:03:42 +0000 (16:03 +0200)] 
smbd: Remove unused "pcd" from struct pending_message_list

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "deferred_pcd" from process_smb()
Volker Lendecke [Mon, 5 Jun 2023 14:02:29 +0000 (16:02 +0200)] 
smbd: Remove unused "deferred_pcd" from process_smb()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "deferred_pcd" from process_smb1()
Volker Lendecke [Mon, 5 Jun 2023 14:00:06 +0000 (16:00 +0200)] 
smbd: Remove unused "deferred_pcd" from process_smb1()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "deferred_pcd" from construct_reply()
Volker Lendecke [Mon, 5 Jun 2023 13:58:08 +0000 (15:58 +0200)] 
smbd: Remove unused "deferred_pcd" from construct_reply()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "pcd" from struct smb_request
Volker Lendecke [Mon, 5 Jun 2023 13:55:10 +0000 (15:55 +0200)] 
smbd: Remove unused "pcd" from struct smb_request

After the macros went away, nobody read this anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "deferred_pcd" from construct_reply_chain()
Volker Lendecke [Mon, 5 Jun 2023 13:52:57 +0000 (15:52 +0200)] 
smbd: Remove unused "deferred_pcd" from construct_reply_chain()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "deferred_pcd" from process_smb2()
Volker Lendecke [Mon, 5 Jun 2023 13:47:50 +0000 (15:47 +0200)] 
smbd: Remove unused "deferred_pcd" from process_smb2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused "pcd" arg from smb1_srv_send()
Volker Lendecke [Mon, 5 Jun 2023 13:45:35 +0000 (15:45 +0200)] 
smbd: Remove unused "pcd" arg from smb1_srv_send()

Looks larger than it is, "git clang-format" added a few lines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agomodules: Remove perfcount_test module
Volker Lendecke [Mon, 5 Jun 2023 13:36:55 +0000 (15:36 +0200)] 
modules: Remove perfcount_test module

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove SMB_PERFCOUNT_ macros
Volker Lendecke [Mon, 5 Jun 2023 13:35:07 +0000 (15:35 +0200)] 
smbd: Remove SMB_PERFCOUNT_ macros

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Remove unused smb2_srv_send()
Volker Lendecke [Mon, 5 Jun 2023 13:31:57 +0000 (15:31 +0200)] 
smbd: Remove unused smb2_srv_send()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/utils: avoid erronous NO MEMORY detection
Noel Power [Fri, 2 Jun 2023 13:27:55 +0000 (14:27 +0100)] 
s3/utils: avoid erronous NO MEMORY detection

since 5cc3c1b5f6b0289f91c01b20989558badc28fd61 if we don't have
a realm specified either on cmdline or in conf file we try to
copy (talloc_strdup) a NULL variable which triggers a NO_MEMORY
error when we check the result of the copy

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jun  4 12:42:16 UTC 2023 on atb-devel-224

3 years agosmbd: remove comments about deprecated 'write cache size'
Jones Syue [Fri, 2 Jun 2023 06:40:09 +0000 (14:40 +0800)] 
smbd: remove comments about deprecated 'write cache size'

The option 'write cache size' was removed since samba-4.12 version:
https://wiki.samba.org/index.php/Samba_4.12_Features_added/changed
https://git.samba.org/?p=samba.git;a=commit;h=3fea05e0
https://git.samba.org/?p=samba.git;a=commit;h=728fabea

It is supposed to remove comments about deprecated 'write cache size',
in order to avoid confusion when reading source code and documents.

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

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun  2 09:48:17 UTC 2023 on atb-devel-224

3 years agolibsmb: Fix directory listing against old servers
Volker Lendecke [Thu, 1 Jun 2023 13:57:26 +0000 (15:57 +0200)] 
libsmb: Fix directory listing against old servers

cli_list_trans_recv() can be called multiple times. When it's done, it
return NT_STATUS_OK and set *finfo to NULL. cli_list_old_recv() did
not do the NULL part, so smbclient would endlessly loop.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  1 21:54:42 UTC 2023 on atb-devel-224

3 years agotests: Show that we 100% loop in cli_list_old_recv()
Volker Lendecke [Thu, 1 Jun 2023 14:41:37 +0000 (16:41 +0200)] 
tests: Show that we 100% loop in cli_list_old_recv()

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Make timelimit available to test scripts
Volker Lendecke [Thu, 1 Jun 2023 14:39:21 +0000 (16:39 +0200)] 
tests: Make timelimit available to test scripts

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodocs: fix a typo in history file
Björn Baumbach [Thu, 1 Jun 2023 09:28:00 +0000 (11:28 +0200)] 
docs: fix a typo in history file

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Thu Jun  1 12:46:04 UTC 2023 on atb-devel-224

3 years agos4:torture/smb2: add smb2.bench.read test
Stefan Metzmacher [Thu, 22 Sep 2022 13:49:41 +0000 (15:49 +0200)] 
s4:torture/smb2: add smb2.bench.read test

This test opens one file for each loop (for nprocs * qdepth loops)
and for each file it loops in read requests for the first
io_size bytes.

time smbtorture //127.0.0.1/m -Uroot%test smb2.bench.read \
        --option="torture:timelimit=600" \
        --option="torture:nprocs=1" \
        --option="torture:qdepth=4" \
        --option="torture:io_size=4096"

In order to generate constant load for profiles
--option="torture:looplimit=150000" can be used to stop
after the given number of loops before the timelimit hits.

Sometimes the bottleneck is the smbtorture process.
In order to bring the smbd process to 100% cpu, you can use
'--option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4"'
and run multiple instances of the test at the same time,
which both talk to the same smbd process.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun  1 08:14:23 UTC 2023 on atb-devel-224

3 years agos4:torture/smb2: add --option="torture:looplimit=150000" to smb2.bench.echo
Stefan Metzmacher [Fri, 28 Apr 2023 08:02:39 +0000 (08:02 +0000)] 
s4:torture/smb2: add --option="torture:looplimit=150000" to smb2.bench.echo

Also see the commit message of 23988f19e7cc2823d6c0c0f40af0195d0a3b81bf
for other examples...

This test calls SMB2_Echo in a loop per connection.

time smbtorture //127.0.0.1/m -Uroot%test smb2.bench.echo \
        --option="torture:timelimit=600" \
        --option="torture:looplimit=150000" \
        --option="torture:nprocs=1" \
        --option="torture:qdepth=1"

This is a very useful test to show how many requests are possible
at the raw SMB2 layer.

In order to do profiling and being able to compare the
profiles between runs, it is important to produce the
exact same load in each run, which is not possible
with the typical --option="torture:timelimit=600".

E.g. when the server runs under 'valgrind --tool=callgrind bin/smbd'
I typically run without "torture:looplimit" first in order to
see, which rate is possible per second, then I'll add a
"torture:looplimit" in order to run about half of the timelimit.
Then the looplimit should run for some time, but finish
before the timelimit.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4:torture/smb2: move benchmarking tests to bench.c
Stefan Metzmacher [Thu, 22 Sep 2022 13:02:04 +0000 (15:02 +0200)] 
s4:torture/smb2: move benchmarking tests to bench.c

I'll add more tests there soon

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmb2_negprot: add CALLGRIND_START_INSTRUMENTATION after SMB2 negprot
Stefan Metzmacher [Tue, 25 Apr 2023 15:38:30 +0000 (15:38 +0000)] 
smb2_negprot: add CALLGRIND_START_INSTRUMENTATION after SMB2 negprot

This allows us to support starting smbd under callgrind and only start
the overhead and instrumentation after the SMB2 negprot, this allows us
to profile only useful stuff and not all the smbd startup, forking and
multichannel handling.

This will do the trick:

  valgrind --tool=callgrind --instr-atstart=no smbd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolib/replace: check for valgrind/callgrind.h
Stefan Metzmacher [Wed, 31 May 2023 10:59:47 +0000 (12:59 +0200)] 
lib/replace: check for valgrind/callgrind.h

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolib/util: use RUNNING_ON_VALGRIND to check if valgrind is used
Stefan Metzmacher [Wed, 31 May 2023 10:09:09 +0000 (12:09 +0200)] 
lib/util: use RUNNING_ON_VALGRIND to check if valgrind is used

We should not skip all of close_low_fd() just because we
detected valgrind headers at build time.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmb2_server: use MSG_DONTWAIT to get non-blocking send/recvmsg
Stefan Metzmacher [Wed, 30 Sep 2020 21:43:37 +0000 (23:43 +0200)] 
smb2_server: use MSG_DONTWAIT to get non-blocking send/recvmsg

It means we can make the fd blocking, which will help
with io_uring support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:smbd: only do profiling overhead in smbd_tevent_trace_callback() when needed
Stefan Metzmacher [Wed, 26 Apr 2023 15:22:01 +0000 (17:22 +0200)] 
s3:smbd: only do profiling overhead in smbd_tevent_trace_callback() when needed

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbprofile: add smbprofile_active() helper
Stefan Metzmacher [Wed, 26 Apr 2023 15:21:38 +0000 (17:21 +0200)] 
smbprofile: add smbprofile_active() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo)
Stefan Metzmacher [Tue, 14 Feb 2023 13:45:26 +0000 (13:45 +0000)] 
smb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo)

This is not strictly needed, but it helps profiling
the core smb2_server.c code with the 'smb2.bench.echo'
test.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4-rpc_server: Filter via dsdb_dc_functional_level() before we are returning a lookup...
Andrew Bartlett [Tue, 30 May 2023 06:03:13 +0000 (18:03 +1200)] 
s4-rpc_server: Filter via dsdb_dc_functional_level() before we are returning a lookup directly

Otherwise, punt to winbindd to see if another DC has this capability.

This allows a FL2008-emulating DC to forward a request to a
2012R2-emlating DC, particularly in another domain.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May 31 04:59:01 UTC 2023 on atb-devel-224

3 years agos3-libads: Also handle the DS_WEB_SERVICE_REQUIRED flag in check_cldap_reply_required...
Andrew Bartlett [Tue, 30 May 2023 04:38:22 +0000 (16:38 +1200)] 
s3-libads: Also handle the DS_WEB_SERVICE_REQUIRED flag in check_cldap_reply_required_flags()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agos4-libads: Confirm newer functional levels in check_cldap_reply_required_flags()
Andrew Bartlett [Tue, 30 May 2023 02:28:42 +0000 (14:28 +1200)] 
s4-libads: Confirm newer functional levels in check_cldap_reply_required_flags()

This will allow us to require that the target DC has FL 2008,
2012, 2012R2 or 2016.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc: No longer consider the DS_DIRECTORY_SERVICE_{8,9,10}_REQUIRED bits as invalid
Andrew Bartlett [Tue, 30 May 2023 02:08:47 +0000 (14:08 +1200)] 
librpc: No longer consider the DS_DIRECTORY_SERVICE_{8,9,10}_REQUIRED bits as invalid

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agosefltest: Improve getdcname test by confirming the _REQUIRED flag behaviours
Andrew Bartlett [Tue, 30 May 2023 04:06:04 +0000 (16:06 +1200)] 
sefltest: Improve getdcname test by confirming the _REQUIRED flag behaviours

We do this by checking what the underlying CLDAP netlogon call returns.

This also validates that behaviour.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Fix remaining incorrect references to 2012 -> 2012R2 FL in GetDCNameEx...
Andrew Bartlett [Tue, 30 May 2023 03:11:31 +0000 (15:11 +1200)] 
selftest: Fix remaining incorrect references to 2012 -> 2012R2 FL in GetDCNameEx test

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Change self.assertTrue(x is not None) -> self.assertIsNotNone(x)
Andrew Bartlett [Tue, 30 May 2023 21:08:59 +0000 (09:08 +1200)] 
selftest: Change self.assertTrue(x is not None) -> self.assertIsNotNone(x)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Confirm that the flags like DS_DIRECTORY_SERVICE_9_REQUIRED work
Andrew Bartlett [Thu, 25 May 2023 04:59:52 +0000 (16:59 +1200)] 
selftest: Confirm that the flags like DS_DIRECTORY_SERVICE_9_REQUIRED work

We need to confirm this both for forwarded requests, and also for requests
direct to the possible DC.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 29 23:29:50 UTC 2023 on atb-devel-224

3 years agoselftest: Rework samba.tests.getdcname not to use ncalrpc
Andrew Bartlett [Thu, 25 May 2023 04:57:55 +0000 (16:57 +1200)] 
selftest: Rework samba.tests.getdcname not to use ncalrpc

This test is able to operate over the network, which aids testing against
a comparative windows DC.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: Assert that we have a trust in samba.tests.getdcname
Andrew Bartlett [Wed, 24 May 2023 04:28:20 +0000 (16:28 +1200)] 
selftest: Assert that we have a trust in samba.tests.getdcname

We must ensure this test cannot became inoperative because the
environment it was run against has no trust.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolibcli: Don’t call memcpy() with a NULL pointer
Joseph Sutton [Fri, 26 May 2023 04:05:43 +0000 (16:05 +1200)] 
libcli: Don’t call memcpy() with a NULL pointer

Doing so is undefined behaviour.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Ensure that we don’t overwrite tests
Joseph Sutton [Thu, 25 May 2023 05:03:48 +0000 (17:03 +1200)] 
python:tests: Ensure that we don’t overwrite tests

If the file iterator returns two entries with the same name, one may
overwrite the other.

script_iterator() currently ensures this won’t happen, but it pays to be
safe.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Make script executable
Joseph Sutton [Thu, 25 May 2023 04:28:45 +0000 (16:28 +1200)] 
python:tests: Make script executable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Initialize global variable
Joseph Sutton [Thu, 25 May 2023 04:28:29 +0000 (16:28 +1200)] 
python:tests: Initialize global variable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Remove unused imports
Joseph Sutton [Thu, 25 May 2023 04:57:36 +0000 (16:57 +1200)] 
python:tests: Remove unused imports

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Exclude Python test directories
Joseph Sutton [Thu, 25 May 2023 04:58:30 +0000 (16:58 +1200)] 
python:tests: Exclude Python test directories

Practically all of our Kerberos tests are excluded already. Many of our
tests aren’t marked as executable, and so aren’t being checked anyway.
Rather than having a large list of exclusions which one may easily
forget to update, just exclude the test directories.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython:tests: Fix f-strings
Joseph Sutton [Thu, 25 May 2023 02:14:11 +0000 (14:14 +1200)] 
python:tests: Fix f-strings

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:rpc_server/samr: Log correct authentication description for samr_ChangePasswordUser2()
Joseph Sutton [Thu, 25 May 2023 00:58:09 +0000 (12:58 +1200)] 
s4:rpc_server/samr: Log correct authentication description for samr_ChangePasswordUser2()

We would unconditionally log "samr_ChangePasswordUser3", which was
misleading.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:torture: Consistently use NBT_SERVER_* flags
Joseph Sutton [Tue, 23 May 2023 21:55:19 +0000 (09:55 +1200)] 
s4:torture: Consistently use NBT_SERVER_* flags

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:torture: Handle new NBT_SERVER_* flags
Joseph Sutton [Tue, 23 May 2023 21:54:58 +0000 (09:54 +1200)] 
s4:torture: Handle new NBT_SERVER_* flags

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonet_ads: Handle new NBT_SERVER_* flags
Joseph Sutton [Tue, 23 May 2023 21:48:19 +0000 (09:48 +1200)] 
net_ads: Handle new NBT_SERVER_* flags

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool domain: Handle new NBT_SERVER_* flags
Joseph Sutton [Tue, 23 May 2023 21:33:38 +0000 (09:33 +1200)] 
samba-tool domain: Handle new NBT_SERVER_* flags

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibrpc/idl: Fix indentation
Joseph Sutton [Tue, 23 May 2023 21:30:03 +0000 (09:30 +1200)] 
librpc/idl: Fix indentation

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Remove debugging code
Joseph Sutton [Fri, 26 May 2023 03:42:27 +0000 (15:42 +1200)] 
tests/auth_log: Remove debugging code

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Add missing call to tearDownClass()
Joseph Sutton [Thu, 25 May 2023 23:50:35 +0000 (11:50 +1200)] 
tests/auth_log: Add missing call to tearDownClass()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/audit_log: Add missing call to tearDown()
Joseph Sutton [Thu, 25 May 2023 23:50:21 +0000 (11:50 +1200)] 
tests/audit_log: Add missing call to tearDown()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Remove unnecessary check
Joseph Sutton [Thu, 25 May 2023 00:22:11 +0000 (12:22 +1200)] 
tests/auth_log: Remove unnecessary check

This attribute is always truthy.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/audit_log: Remove unnecessary checks
Joseph Sutton [Thu, 25 May 2023 00:20:06 +0000 (12:20 +1200)] 
tests/audit_log: Remove unnecessary checks

These attributes are always truthy.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Call discardMessages() on class
Joseph Sutton [Thu, 25 May 2023 00:16:32 +0000 (12:16 +1200)] 
tests/auth_log: Call discardMessages() on class

This makes it clearer that discardMessages() operates on the class.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Make discardMessages() more reliable
Joseph Sutton [Thu, 25 May 2023 00:15:07 +0000 (12:15 +1200)] 
tests/auth_log: Make discardMessages() more reliable

It can take two or three calls to msg_ctx.loop_once() before a message
comes in. Make sure we get all of the messages.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Expect no messages when changing a non-existent user’s password
Joseph Sutton [Fri, 26 May 2023 04:00:50 +0000 (16:00 +1200)] 
tests/auth_log: Expect no messages when changing a non-existent user’s password

These log messages come from setUp(), and the fact that we are getting
them is merely a side-effect of the unreliability of discardMessages().

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/audit_log: Make discardMessages() more reliable
Joseph Sutton [Thu, 25 May 2023 00:13:28 +0000 (12:13 +1200)] 
tests/audit_log: Make discardMessages() more reliable

It can take two or three calls to msg_ctx.loop_once() before a message
comes in. Make sure we get all of the messages.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/auth_log: Correctly get lp_ctx
Joseph Sutton [Wed, 24 May 2023 02:55:35 +0000 (14:55 +1200)] 
tests/auth_log: Correctly get lp_ctx

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>