]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agos3:winbind: Improve logging in wb_lookupsid.c
Pavel Filipenský [Tue, 7 Jun 2022 17:36:16 +0000 (19:36 +0200)] 
s3:winbind: Improve logging in wb_lookupsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_lookupname.c
Pavel Filipenský [Wed, 22 Jun 2022 21:39:52 +0000 (23:39 +0200)] 
s3:winbind: Improve logging in wb_lookupname.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_group_members.c
Pavel Filipenský [Thu, 23 Jun 2022 08:40:53 +0000 (10:40 +0200)] 
s3:winbind: Improve logging in wb_group_members.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_gettoken.c
Pavel Filipenský [Tue, 7 Jun 2022 17:33:57 +0000 (19:33 +0200)] 
s3:winbind: Improve logging in wb_gettoken.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_getpwsid.c
Pavel Filipenský [Mon, 20 Jun 2022 13:05:21 +0000 (15:05 +0200)] 
s3:winbind: Improve logging in wb_getpwsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_getgrsid.c
Pavel Filipenský [Fri, 24 Jun 2022 13:04:46 +0000 (15:04 +0200)] 
s3:winbind: Improve logging in wb_getgrsid.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_dsgetdcname.c
Pavel Filipenský [Fri, 24 Jun 2022 13:05:09 +0000 (15:05 +0200)] 
s3:winbind: Improve logging in wb_dsgetdcname.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in samlogon_cache.c
Pavel Filipenský [Sat, 11 Jun 2022 15:44:30 +0000 (17:44 +0200)] 
s3:winbind: Improve logging in samlogon_cache.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_xids_to_sids.c
Pavel Filipenský [Fri, 24 Jun 2022 10:12:30 +0000 (12:12 +0200)] 
s3:winbind: Improve logging in winbindd_xids_to_sids.c

Test scenario in ad_dc:local test environment:
bin/wbinfo --unix-ids-to-sids=u100000

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_wins_byname.c
Pavel Filipenský [Fri, 24 Jun 2022 11:01:23 +0000 (13:01 +0200)] 
s3:winbind: Improve logging in winbindd_wins_byname.c

Test scenario:
$  bin/wbinfo --WINS-by-name=ADDC

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_wins_byip.c
Pavel Filipenský [Fri, 24 Jun 2022 11:07:42 +0000 (13:07 +0200)] 
s3:winbind: Improve logging in winbindd_wins_byip.c

Test scenario:
$ bin/wbinfo --WINS-by-ip=10.53.57.30

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_sids_to_xids.c
Pavel Filipenský [Fri, 24 Jun 2022 11:14:27 +0000 (13:14 +0200)] 
s3:winbind: Improve logging in winbindd_sids_to_xids.c

Test scenario:
bin/wbinfo --sid-to-uid=S-1-5-21-1961314572-195468382-2567644205-1107

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_setpwent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:44:54 +0000 (10:44 +0200)] 
s3:winbind: Improve logging in winbindd_setpwent.c

Test scenario:
$ getent passwd

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_setgrent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:43:33 +0000 (10:43 +0200)] 
s3:winbind: Improve logging in winbindd_setgrent.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_pam_logoff.c
Pavel Filipenský [Fri, 24 Jun 2022 12:51:07 +0000 (14:51 +0200)] 
s3:winbind: Improve logging in winbindd_pam_logoff.c

Test scenario:
$ bin/wbinfo --logoff

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_pam_auth.c
Pavel Filipenský [Fri, 24 Jun 2022 12:29:35 +0000 (14:29 +0200)] 
s3:winbind: Improve logging in winbindd_pam_auth.c

Test scenario:
$ bin/wbinfo --pam-logon=ADDOMAIN/alice%Secret007

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_lookupname.c
Pavel Filipenský [Fri, 24 Jun 2022 11:32:52 +0000 (13:32 +0200)] 
s3:winbind: Improve logging in winbindd_lookupname.c

Test scenario:
bin/wbinfo --name-to-sid=ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_list_users.c
Pavel Filipenský [Fri, 24 Jun 2022 09:10:24 +0000 (11:10 +0200)] 
s3:winbind: Improve logging in winbindd_list_users.c

Test scenario:
$ bin/wbinfo -u

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_list_groups.c
Pavel Filipenský [Fri, 24 Jun 2022 10:25:16 +0000 (12:25 +0200)] 
s3:winbind: Improve logging in winbindd_list_groups.c

Test scenario:
$ bin/wbinfo -g

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getuserdomgroups.c
Pavel Filipenský [Thu, 5 Aug 2021 13:06:04 +0000 (15:06 +0200)] 
s3:winbind: Improve logging in winbindd_getuserdomgroups.c

Test scenario:
$ bin/wbinfo --user-domgroups `bin/wbinfo -n ADDOMAIN/alice | awk '{print $1}'`
S-1-5-21-2260029349-2102976898-3003119-1107
S-1-5-21-2260029349-2102976898-3003119-513

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getsidaliases.c
Pavel Filipenský [Thu, 5 Aug 2021 12:51:02 +0000 (14:51 +0200)] 
s3:winbind: Improve logging in winbindd_getsidaliases.c

Test scenario:
$ bin/wbinfo --sid-aliases S-1-5-21-4248687961-4152985382-2800071106-1107

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getpwuid.c
Pavel Filipenský [Thu, 5 Aug 2021 12:38:37 +0000 (14:38 +0200)] 
s3:winbind: Improve logging in winbindd_getpwuid.c

Test scenario:
$ bin/wbinfo --uid-info 2001107
or
$ bin/wbinfo --uid-info 100000

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getpwsid.c
Pavel Filipenský [Thu, 5 Aug 2021 12:21:23 +0000 (14:21 +0200)] 
s3:winbind: Improve logging in winbindd_getpwsid.c

Test scenario:

$ bin/wbinfo --name-to-sid ADDOMAIN/alice
S-1-5-21-4248687961-4152985382-2800071106-1107 SID_USER (1)

$ bin/wbinfo --user-sidinfo S-1-5-21-4248687961-4152985382-2800071106-1107
ADDOMAIN/alice:*:2001107:2000513::/home/ADDOMAIN/alice:/bin/false

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getpwnam.c
Pavel Filipenský [Wed, 4 Aug 2021 16:12:03 +0000 (18:12 +0200)] 
s3:winbind: Improve logging in winbindd_getpwnam.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getpwent.c
Pavel Filipenský [Thu, 5 Aug 2021 09:02:53 +0000 (11:02 +0200)] 
s3:winbind: Improve logging in winbindd_getpwent.c

Test scenario:
$ getent passwd

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getgroups.c
Pavel Filipenský [Thu, 5 Aug 2021 08:44:27 +0000 (10:44 +0200)] 
s3:winbind: Improve logging in winbindd_getgroups.c

Test scenario:
bin/wbinfo --user-groups 'ADDOMAIN/alice'

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getgrnam.c
Pavel Filipenský [Wed, 4 Aug 2021 16:41:21 +0000 (18:41 +0200)] 
s3:winbind: Improve logging in winbindd_getgrnam.c

Test scenario:
bin/wbinfo --group-info 'ADDOMAIN/domain users'

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getgrgid.c
Pavel Filipenský [Wed, 4 Aug 2021 16:36:51 +0000 (18:36 +0200)] 
s3:winbind: Improve logging in winbindd_getgrgid.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getgrent.c
Pavel Filipenský [Wed, 4 Aug 2021 16:29:11 +0000 (18:29 +0200)] 
s3:winbind: Improve logging in winbindd_getgrent.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getdcname.c
Pavel Filipenský [Wed, 4 Aug 2021 16:16:47 +0000 (18:16 +0200)] 
s3:winbind: Improve logging in winbindd_getdcname.c

Test scenario:
bin/wbinfo --getdcname=ADDOMAIN

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_endpwent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:47:10 +0000 (10:47 +0200)] 
s3:winbind: Improve logging in winbindd_endpwent.c

Test scenario:
$ getent passwd

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_endgrent.c
Pavel Filipenský [Fri, 24 Jun 2022 08:40:11 +0000 (10:40 +0200)] 
s3:winbind: Improve logging in winbindd_endgrent.c

Test scenario:
id ADDOMAIN/alice

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_dsgetdcname.c
Pavel Filipenský [Fri, 24 Jun 2022 10:35:59 +0000 (12:35 +0200)] 
s3:winbind: Improve logging in winbindd_dsgetdcname.c

Test scenario:
$ bin/wbinfo --dsgetdcname=ADDOMAIN

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_getusersids.c
Pavel Filipenský [Thu, 5 Aug 2021 13:17:57 +0000 (15:17 +0200)] 
s3:winbind: Improve logging in winbindd_getusersids.c

Test scenario:

$ bin/wbinfo --user-sids `bin/wbinfo -n ADDOMAIN/alice | awk '{print $1}'`
S-1-5-21-2018381343-4210792308-1157936888-1107
S-1-5-21-2018381343-4210792308-1157936888-513
S-1-5-32-545

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Move up some code in winbindd_getusersids.c
Pavel Filipenský [Thu, 5 Aug 2021 13:17:57 +0000 (15:17 +0200)] 
s3:winbind: Move up some code in winbindd_getusersids.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd_group.c
Pavel Filipenský [Thu, 23 Jun 2022 10:42:51 +0000 (12:42 +0200)] 
s3:winbind: Improve logging in winbindd_group.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in wb_xids2sids.c
Pavel Filipenský [Fri, 24 Jun 2022 13:27:29 +0000 (15:27 +0200)] 
s3:winbind: Improve logging in wb_xids2sids.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve logging in winbindd.c
Pavel Filipenský [Fri, 24 Jun 2022 10:45:33 +0000 (12:45 +0200)] 
s3:winbind: Improve logging in winbindd.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespaces in winbindd_group.c
Pavel Filipenský [Thu, 23 Jun 2022 10:42:09 +0000 (12:42 +0200)] 
s3:winbind: Fix trailing whitespaces in winbindd_group.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc:ndr: Update ndr_print_debug() to the new ndr ABI
Pavel Filipenský [Fri, 8 Jul 2022 14:48:09 +0000 (16:48 +0200)] 
librpc:ndr: Update ndr_print_debug() to the new ndr ABI

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4:lib: Fix trailing whitespaces in tools/regshell.c
Pavel Filipenský [Fri, 8 Jul 2022 14:52:21 +0000 (16:52 +0200)] 
s4:lib: Fix trailing whitespaces in tools/regshell.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:passdb: Fix trailing whitespaces in machine_account_secrets.c
Pavel Filipenský [Fri, 8 Jul 2022 14:50:38 +0000 (16:50 +0200)] 
s3:passdb: Fix trailing whitespaces in machine_account_secrets.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc:ndr: Update ndr_print_debug() and add macro NDR_PRINT_DEBUG_LEVEL
Pavel Filipenský [Wed, 22 Jun 2022 09:13:34 +0000 (11:13 +0200)] 
librpc:ndr: Update ndr_print_debug() and add macro NDR_PRINT_DEBUG_LEVEL

Bumping the ABI to 3.0.0

This is enhancement of NDR_PRINT_DEBUG macro with following new features:

* debug level can be specified (NDR_PRINT_DEBUG always uses level 1)
* the trace header shows the location and function of the caller
  instead of function 'ndr_print_debug', which is not really useful.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agodebug: Add DEBUGLF macro with explicit location and function parameters.
Pavel Filipenský [Sun, 19 Jun 2022 13:40:37 +0000 (15:40 +0200)] 
debug: Add DEBUGLF macro with explicit location and function parameters.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agodebug: Fix whitespace and a typo in debug.h
Pavel Filipenský [Tue, 12 Jul 2022 08:36:30 +0000 (10:36 +0200)] 
debug: Fix whitespace and a typo in debug.h

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: Do not skip working tests
Andreas Schneider [Fri, 15 Jul 2022 08:33:55 +0000 (10:33 +0200)] 
selftest: Do not skip working tests

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Jul 15 14:24:49 UTC 2022 on sn-devel-184

3 years agos4:torture: Rename rpc.samr.passwords tests
Andreas Schneider [Fri, 15 Jul 2022 08:09:02 +0000 (10:09 +0200)] 
s4:torture: Rename rpc.samr.passwords tests

This way it is easier to select them with 'make test'.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:selftest: Reformat rpc.samr.passwords plansmbtorture4testsuite
Andreas Schneider [Fri, 15 Jul 2022 08:08:09 +0000 (10:08 +0200)] 
s4:selftest: Reformat rpc.samr.passwords plansmbtorture4testsuite

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:selftest: Reformat slow_ncacn_np_tests list
Andreas Schneider [Fri, 15 Jul 2022 08:06:36 +0000 (10:06 +0200)] 
s4:selftest: Reformat slow_ncacn_np_tests list

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos3:selftest: Reformat rpc array
Andreas Schneider [Fri, 15 Jul 2022 08:05:44 +0000 (10:05 +0200)] 
s3:selftest: Reformat rpc array

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat bogus.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat bogus.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/bogus.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Jul 15 13:00:30 UTC 2022 on sn-devel-184

3 years agos4:setup: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:03:50 +0000 (12:03 +0100)] 
s4:setup: Reformat shell scripts

shfmt -f source4/setup/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:selftest: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:02:44 +0000 (12:02 +0100)] 
s4:selftest: Reformat shell scripts

shfmt -f source4/selftest/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agonfs4_acls: Correctly skip chown when gid did not change
Christof Schmitt [Tue, 12 Jul 2022 12:12:21 +0000 (05:12 -0700)] 
nfs4_acls: Correctly skip chown when gid did not change

Commit 86f7af84 introduced a problem that a chown is always attempted,
even when the owning gid did not change. Then the ACL is set in the file
system as root. Fix the check by correctly comparing with gid, not uid.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Wed Jul 13 17:30:30 UTC 2022 on sn-devel-184

3 years agomdssvc: return all-zero policy handle if spotlight is disabled
Ralph Boehme [Wed, 25 May 2022 15:37:22 +0000 (17:37 +0200)] 
mdssvc: return all-zero policy handle if spotlight is disabled

A Mac SMB server returns an all zero handle and an empty path if Spotlight is
disabled on a share. We must return the exact same error return in order to
trigger client-side searching.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086
pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jul 12 15:42:52 UTC 2022 on sn-devel-184

3 years agoCI: fix check for correct mdsvc resonse when connecting to a share with Spotlight...
Ralph Boehme [Tue, 7 Jun 2022 07:52:53 +0000 (09:52 +0200)] 
CI: fix check for correct mdsvc resonse when connecting to a share with Spotlight disabled

A Mac SMB server returns an all zero handle and an empty path if Spotlight is
disabled on a share. We must return the exact same error return in order to
trigger client-side searching.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086
pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: convert mds_init_ctx() to return NTSTATUS
Ralph Boehme [Wed, 25 May 2022 15:26:29 +0000 (17:26 +0200)] 
mdssvc: convert mds_init_ctx() to return NTSTATUS

No change in behavour. In preperation for returning a special error to signal
the caller that spotlight is disabled for a share.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: fix indentation
Ralph Boehme [Wed, 25 May 2022 15:23:53 +0000 (17:23 +0200)] 
mdssvc: fix indentation

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agorpc_server3: Initialize mangle_fns in classic and spoolss
Volker Lendecke [Fri, 8 Jul 2022 12:14:22 +0000 (14:14 +0200)] 
rpc_server3: Initialize mangle_fns in classic and spoolss

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15118
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Tue Jul 12 13:33:14 UTC 2022 on sn-devel-184

3 years agos3:winbind: Use the canonical realm name to renew the credentials
Samuel Cabrero [Thu, 7 Jul 2022 09:32:39 +0000 (11:32 +0200)] 
s3:winbind: Use the canonical realm name to renew the credentials

Consider the following AD topology where all trusts are parent-child
trusts:

                   ADOM.AFOREST.AD
    |
            ACHILD.ADOM.AFOREST.AD
|
AGRANDCHILD.ACHILD.ADOM.AFOREST.AD <-- Samba joined

When logging into the Samba machine using pam_winbind with kerberos enabled
with user ACHILD\user1, the ccache content is:

Default principal: user1@ACHILD.ADOM.AFOREST.AD

Valid starting       Expires              Service principal
07/06/2022 16:09:23  07/06/2022 16:14:23  krbtgt/ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD
        renew until 07/13/2022 16:09:23
--> 07/06/2022 16:09:23  07/06/2022 16:14:23  krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD <-- NOTE this TGT ticket
        renew until 07/13/2022 16:09:23
07/06/2022 16:09:23  07/06/2022 16:14:23  SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
        renew until 07/13/2022 16:09:23

But when logging in with user ADOM\user1, the ccache content is:

Default principal: user1@ADOM.AFOREST.AD

Valid starting       Expires              Service principal
07/06/2022 16:04:37  07/06/2022 16:09:37  krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD
        renew until 07/13/2022 16:04:37
07/06/2022 16:04:37  07/06/2022 16:09:37  SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
        renew until 07/13/2022 16:04:37

MIT does not store the intermediate TGTs when there is more than one hop:

ads_krb5_cli_get_ticket: Getting ticket for service [SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD] using creds from [FILE:/tmp/krb5cc_11105] and impersonating [(null)]

Getting credentials user1@ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD using ccache FILE:/tmp/krb5cc_11105
Starting with TGT for client realm: user1@ADOM.AFOREST.AD -> krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD

Requesting TGT krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ADOM.AFOREST.AD using TGT krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD
Sending request to ADOM.AFOREST.AD
Received answer from stream 192.168.101.32:88
TGS reply is for user1@ADOM.AFOREST.AD -> krbtgt/ACHILD.ADOM.AFOREST.AD@ADOM.AFOREST.AD with session key rc4-hmac/D88B
--> Received TGT for offpath realm ACHILD.ADOM.AFOREST.AD <-- NOTE this TGT ticket is not stored

Requesting TGT krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD using TGT krbtgt/ACHILD.ADOM.AFOREST.AD@ADOM.AFOREST.AD
Sending request (1748 bytes) to ACHILD.ADOM.AFOREST.AD
Received answer (1628 bytes) from stream 192.168.101.33:88
TGS reply is for user1@ADOM.AFOREST.AD -> krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD with session key rc4-hmac/D015
--> Received TGT for service realm: krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD <-- NOTE this TGT is not stored

Requesting tickets for SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD, referrals on
Sending request (1721 bytes) to AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
Received answer (1647 bytes) from stream 192.168.101.34:88
TGS reply is for user1@ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD with session key aes256-cts/345A
Received creds for desired service SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
Storing user1@ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD in FILE:/tmp/krb5cc_11105

In the case of ACHILD\user1:

ads_krb5_cli_get_ticket: Getting ticket for service [SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD] using creds from [FILE:/tmp/krb5cc_2000] and impersonating [(null)]

Getting credentials user1@ACHILD.ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD using ccache FILE:/tmp/krb5cc_2000
Starting with TGT for client realm: user1@ACHILD.ADOM.AFOREST.AD -> krbtgt/ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD

Requesting TGT krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD using TGT krbtgt/ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD
Sending request to ACHILD.ADOM.AFOREST.AD
Received answer from stream 192.168.101.33:88
TGS reply is for user1@ACHILD.ADOM.AFOREST.AD -> krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD with session key rc4-hmac/0F60
--> Storing user1@ACHILD.ADOM.AFOREST.AD -> krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD in FILE:/tmp/krb5cc_2000 <-- NOTE this TGT is stored
Received TGT for service realm: krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ACHILD.ADOM.AFOREST.AD

Requesting tickets for SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD, referrals on
Sending request (1745 bytes) to AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
Received answer (1675 bytes) from stream 192.168.101.34:88
TGS reply is for user1@ACHILD.ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD with session key aes256-cts/3576
Received creds for desired service SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD
Storing user1@ACHILD.ADOM.AFOREST.AD -> SAMBA$@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD in FILE:/tmp/krb5cc_2000

The result is that winbindd can't refresh the tickets for ADOM\user1
because the local realm is used to build the TGT service name.

smb_krb5_renew_ticket: Using FILE:/tmp/krb5cc_11105 as ccache for client 'user1@ADOM.AFOREST.AD' and service 'krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@AGRANDCHILD.ACHILD.ADOM.AFOREST.AD'

Retrieving user1@ADOM.AFOREST.AD -> krbtgt/AGRANDCHILD.ACHILD.ADOM.AFOREST.AD@ADOM.AFOREST.AD from FILE:/tmp/krb5cc_11105 with result: -1765328243/Matching credential not found (filename: /tmp/krb5cc_11105)

The canonical realm name must be used instead:

smb_krb5_renew_ticket: Using FILE:/tmp/krb5cc_11105 as ccache for client 'user1@ADOM.AFOREST.AD' and service 'krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD'

Retrieving user1@ADOM.AFOREST.AD -> krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD from FILE:/tmp/krb5cc_11105 with result: 0/Success
Get cred via TGT krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD after requesting krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD (canonicalize off)
Sending request to ADOM.AFOREST.AD
Received answer from stream 192.168.101.32:88
TGS reply is for user1@ADOM.AFOREST.AD -> krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD with session key aes256-cts/8C7B
Storing user1@ADOM.AFOREST.AD -> krbtgt/ADOM.AFOREST.AD@ADOM.AFOREST.AD in FILE:/tmp/krb5cc_11105

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 12 12:38:55 UTC 2022 on sn-devel-184

3 years agos3:winbind: Create service principal inside add_ccache_to_list()
Samuel Cabrero [Thu, 7 Jul 2022 09:22:05 +0000 (11:22 +0200)] 
s3:winbind: Create service principal inside add_ccache_to_list()

The function can build the service principal itself, there is no
need to do it in the caller. This removes code duplication.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib:krb5_wrap: Add debug to ads_krb5_cli_get_ticket()
Samuel Cabrero [Thu, 7 Jul 2022 10:33:15 +0000 (12:33 +0200)] 
lib:krb5_wrap: Add debug to ads_krb5_cli_get_ticket()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve debug message to print service in smb_krb5_renew_ticket()
Samuel Cabrero [Thu, 7 Jul 2022 12:13:02 +0000 (14:13 +0200)] 
s3:winbind: Improve debug message to print service in smb_krb5_renew_ticket()

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Improve debug message to print the service in add_ccache_to_list()
Samuel Cabrero [Thu, 7 Jul 2022 09:28:03 +0000 (11:28 +0200)] 
s3:winbind: Improve debug message to print the service in add_ccache_to_list()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespaces in winbindd_proto.h
Samuel Cabrero [Thu, 7 Jul 2022 09:19:47 +0000 (11:19 +0200)] 
s3:winbind: Fix trailing whitespaces in winbindd_proto.h

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbind: Fix trailing whitespaces and spaces before tabs in winbindd_cred_cache.c
Samuel Cabrero [Thu, 7 Jul 2022 09:18:42 +0000 (11:18 +0200)] 
s3:winbind: Fix trailing whitespaces and spaces before tabs in winbindd_cred_cache.c

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbd: follow-up fix for "if close fails just log it, don't crash"
Ralph Boehme [Fri, 8 Jul 2022 15:08:05 +0000 (17:08 +0200)] 
smbd: follow-up fix for "if close fails just log it, don't crash"

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jul  9 09:04:46 UTC 2022 on sn-devel-184

3 years agos4:utils: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:04:57 +0000 (12:04 +0100)] 
s4:utils: Reformat shell scripts

shfmt -f source4/utils/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Jul  8 09:59:19 UTC 2022 on sn-devel-184

3 years agos4:torture: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:04:28 +0000 (12:04 +0100)] 
s4:torture: Reformat shell scripts

shfmt -f source4/torture/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:scripting: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:01:51 +0000 (12:01 +0100)] 
s4:scripting: Reformat shell scripts

shfmt -f source4/scripting/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:script: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:01:32 +0000 (12:01 +0100)] 
s4:script: Reformat shell scripts

shfmt -f source4/script/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:librpc: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 11:01:11 +0000 (12:01 +0100)] 
s4:librpc: Reformat shell scripts

shfmt -f source4/librpc/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agos4:client: Reformat shell scripts
Andreas Schneider [Wed, 23 Feb 2022 10:59:24 +0000 (11:59 +0100)] 
s4:client: Reformat shell scripts

shfmt -f source4/client/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agosmbd: if close fails just log it, don't crash
Ralph Boehme [Thu, 7 Jul 2022 12:40:28 +0000 (14:40 +0200)] 
smbd: if close fails just log it, don't crash

Originally I added the assert here as we can't return the error being in a
talloc destructor. But OEMs prefer error log messages over crashes.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul  8 09:04:28 UTC 2022 on sn-devel-184

3 years agodocs-xml:manpages: update vfs_fileid.8.xml for the recent changes
Stefan Metzmacher [Tue, 28 Jun 2022 16:25:46 +0000 (16:25 +0000)] 
docs-xml:manpages: update vfs_fileid.8.xml for the recent changes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul  5 16:01:10 UTC 2022 on sn-devel-184

3 years agos3:vfs_fileid: add 'fileid:nolock_all_inodes = BOOL'
Stefan Metzmacher [Wed, 29 Jun 2022 15:50:08 +0000 (17:50 +0200)] 
s3:vfs_fileid: add 'fileid:nolock_all_inodes = BOOL'

This adds the feature of the 'hostname' algorithm,
but provides it for all algorithms, including 'next_module'.

This can be used to deliberately break lock coherency, but
keep the devid/inode pair untouched, as this will only
alter file_id.extid:

  vfs objects = fileid
  fileid:algorithm = next_module
  fileid:nolock_all_inodes = yes

This should be preferred unless someone is already using the
'hostname' algorithm.

Note this is only for testing (or read only shares if at all...)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: add 'fileid:nolock_all_dirs = BOOL'
Stefan Metzmacher [Wed, 29 Jun 2022 15:50:08 +0000 (17:50 +0200)] 
s3:vfs_fileid: add 'fileid:nolock_all_dirs = BOOL'

This adds the feature of the 'fsname_nodirs' algorithm,
but provides it for all algorithms, including 'next_module'.

This can be used to deliberately break lock coherency, but
keep the devid/inode pair untouched, e.g.

  vfs objects = fileid
  fileid:algorithm = next_module
  fileid:nolock_all_dirs = yes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: introduce 'fileid:nolock_paths'
Stefan Metzmacher [Wed, 29 Jun 2022 15:14:22 +0000 (17:14 +0200)] 
s3:vfs_fileid: introduce 'fileid:nolock_paths'

This brings much more flexibility compared to:
- 'fsname_norootdir', 'fsname_norootdir_ext',
  which only allow the nolock behavior for the share root
- 'fileid:nolockinode', which only gets a single inode number,
  and ignores the devide id completely.

You can specify path names, which are relative to the shareroot
or absolute.

These names are only evaluated at SMB_VFS_CONNECT() time,
where they are converted into devide and inode pairs.
It means they are completely ignored if the path doesn't
exist yet, or is replaced by a new inode later.

This allows:

- 'fileid:algorithm = fsname_norootdir'
  to be replaced by:
  'fileid:algorithm = fsname' (the default)
  'fileid:nolock_paths = .'

- 'fileid:algorithm = fsname_norootdir_ext'
  to be replaced by:
  'fileid:algorithm = fsname' (the default)
  'fileid:nolock_paths = .'
  'fileid:nolock_max_slots = 18446744073709551615'

And 'fileid:nolockinode = 1234567' and be replaced by
'fileid:nolock_paths = Very/Contended/Path' or
'fileid:nolock_paths = . Very/Contended/Path1 /data/conteded.dir',
if the share root and two additional inodes should be handled
by the 'nolock' behavior.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: introduce 'fileid:nolock_max_slots'
Stefan Metzmacher [Wed, 29 Jun 2022 15:09:51 +0000 (17:09 +0200)] 
s3:vfs_fileid: introduce 'fileid:nolock_max_slots'

This controlls the maximum number of concurrent locking slots
on each host. It specifies the maximal number of locking.tdb
records for a single inode.

It can be used to deliberately break lock coherency not
only between cluster nodes, but also between processes on
each node.

This allows administrators to control the behavior that's
currently only available by 'fsname_norootdir_ext' to
other cases as well.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: also imply the generic nolock logic to the legacy 'hostname' algorithm
Stefan Metzmacher [Wed, 29 Jun 2022 15:06:12 +0000 (17:06 +0200)] 
s3:vfs_fileid: also imply the generic nolock logic to the legacy 'hostname' algorithm

That way the file_id.extid is consistenly filled for all cases
where we deliberately break lock coherency.

This will simplify further changes and give administrators more
flexibility.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: also handle 'fsname_nodirs' via fileid_is_nolock_inode()
Stefan Metzmacher [Wed, 29 Jun 2022 15:02:32 +0000 (17:02 +0200)] 
s3:vfs_fileid: also handle 'fsname_nodirs' via fileid_is_nolock_inode()

This means we'll be able to provide the 'nolock' feature for all
directories also with other algorithms than 'fsname' in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: always add the 'nolock' behavior via file_id.extid
Stefan Metzmacher [Wed, 29 Jun 2022 14:47:50 +0000 (16:47 +0200)] 
s3:vfs_fileid: always add the 'nolock' behavior via file_id.extid

file_id.extid was filled with getpid() by 'fsname_norootdir_ext'.

However instead of forcing the existing 'hostname' algorithm for the 'nolock'
case, we'll now generate file_id.extid also based the hostname, vnn
and for 'fsname_norootdir_ext' also the pid.

This simplifies further changes and gives us the ability to generate stable
results for file_id.{devid,inode} based on the main algorithm. This is important
as we have a push_file_id_16() helper function used in places to generate a
stable identifier of the file that is also client visible and might be stored on
stable storage (acl_tdb, xattr_tdb). While the file_id.extid is only used
internally in volatile databases.

Review with: git show --patience

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: introduce algorithm 'next_module'
Stefan Metzmacher [Wed, 29 Jun 2022 14:35:47 +0000 (16:35 +0200)] 
s3:vfs_fileid: introduce algorithm 'next_module'

This can be use to get just bypass the fileid module for the
common case. But it allows 'fileid:nolockinode' (and in future
other things) to work in order to avoid lock contention
for all 'nolock' inodes.

If we would have started from scratch all the nolock
logic would have been in its own vfs module, just
altering file_id.extid

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: maintain an array of nolock inodes
Stefan Metzmacher [Wed, 29 Jun 2022 14:31:22 +0000 (16:31 +0200)] 
s3:vfs_fileid: maintain an array of nolock inodes

This way 'fsname_norootdir[_ext]' is not overwritten by
'fileid:nolockinode' and both can work independently.

It will also allow us to add more nolock inodes under
other conditions in the following changes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:vfs_fileid: move to a single mapping_fn() returning struct file_id
Stefan Metzmacher [Wed, 22 Jun 2022 15:33:49 +0000 (17:33 +0200)] 
s3:vfs_fileid: move to a single mapping_fn() returning struct file_id

This makes the code much less magic (at least for me) and
it will allow further changes to be made easier.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4:torture/smb2: add smb2.bench.path-contention-shared
Stefan Metzmacher [Thu, 23 Jun 2022 10:23:53 +0000 (12:23 +0200)] 
s4:torture/smb2: add smb2.bench.path-contention-shared

This test tortures contention on a single path where
all opens are shared stat opens without any oplock/lease
interaction.

It opens 'nproc' connections to the share and runs
for 'timelimit' seconds, while it opens and closes
the 'bench_path' on each connection as fast as possible.

The number of concurrent connections can be specified
with:

  --option="torture:nprocs=256"

while the default is 4.

The runtime can be specified by

  --option='torture:timelimit=30'

the default being 10.

By default the test operates on the share root directory, but
the path can be changed with:

  --option='torture:bench_path=Apps\1\2\3\4\5\6\7\8\9\10'

pointing to an existing file or directory.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4:torture/smb2: rename 'smb2.bench-oplock' to 'smb2.bench.oplock'
Stefan Metzmacher [Tue, 28 Jun 2022 14:44:51 +0000 (14:44 +0000)] 
s4:torture/smb2: rename 'smb2.bench-oplock' to 'smb2.bench.oplock'

We should have a toplevel 'smb2.bench' suite for all benchmark tests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: libads: Fix coverity false positive.
Jeremy Allison [Fri, 1 Jul 2022 15:49:42 +0000 (08:49 -0700)] 
s3: libads: Fix coverity false positive.

dn is always returned as NULL on error in ads_build_path(),
but coverity can't see that. Easy change to quieten it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Jul  4 16:42:28 UTC 2022 on sn-devel-184

3 years agos4:mitkdc: Always set SDB_F_FOR_{TGS,AS}_REQ flag for DAL >= 9
Samuel Cabrero [Mon, 27 Jun 2022 14:04:56 +0000 (16:04 +0200)] 
s4:mitkdc: Always set SDB_F_FOR_{TGS,AS}_REQ flag for DAL >= 9

The KRB5_KDB_FLAG_REFERRAL_OK is to indicate wether a realm referral is
allowed. In AD this is always allowed. Also there is no way to pass that
indication to the SamDB layer.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Mon Jul  4 12:22:16 UTC 2022 on sn-devel-184

3 years agos3:dbwrap_ctdb: improve the error handling in ctdb_async_ctx_init_internal()
Stefan Metzmacher [Mon, 13 Jun 2022 09:35:31 +0000 (11:35 +0200)] 
s3:dbwrap_ctdb: improve the error handling in ctdb_async_ctx_init_internal()

We should not map any error from ctdbd_init_async_connection() to EIO.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul  1 18:34:17 UTC 2022 on sn-devel-184

3 years agos3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn...
Stefan Metzmacher [Mon, 13 Jun 2022 09:32:30 +0000 (11:32 +0200)] 
s3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn = NULL

This should not happen anywhere, but it clears the expectation of the
caller and simplifies the error handling there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestparm: clarify "Weak crypto is allowed" message
Michael Tokarev [Fri, 20 May 2022 06:48:32 +0000 (09:48 +0300)] 
testparm: clarify "Weak crypto is allowed" message

The message testparm prints about weak crypto is really
misleading: "Weak crypto is allowed" is often interpreted
in a way that smb.conf settings are bad by allowing weak
crypto.  While the actual meaning is about the ability to
fall back to weaker crypto for (backwards) compatibility,
and this has nothing to do with samba settings, it is the
gnutls settings. Clarify both of these, and eliminate an
if() and a local variable.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul  1 14:35:09 UTC 2022 on sn-devel-184

3 years agos4:torture: check return of ndr_pull_init_blob() via torture_assert()
Pavel Filipenský [Tue, 28 Jun 2022 08:52:13 +0000 (10:52 +0200)] 
s4:torture: check return of ndr_pull_init_blob() via torture_assert()

Reported by covscan.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul  1 08:12:49 UTC 2022 on sn-devel-184

3 years agos3:printing: Do not clear the printer-list.tdb
Andreas Schneider [Wed, 22 Jun 2022 16:56:26 +0000 (18:56 +0200)] 
s3:printing: Do not clear the printer-list.tdb

With the new dcerpc architecture we need to keep printer-list.tdb
around. A spoolss dcerpc call will start rpc-spoolssd which will then
start the background queue process. However in order to enum the
printers we need have a printer-list.tdb. Depending on the number of
printers this task can take several seconds. It is unlinkly that
the printer-list will change all the time, so we might provide outdated
data till it gets refreshed, but this is better than providing no
printer list at all.

If there are a lot of printers, the idle_seconds for the rpc-spoolssd
should be increased so that the background task can finish.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 30 22:08:39 UTC 2022 on sn-devel-184

3 years agos3: libads: Fix return from malloc check.
Jeremy Allison [Wed, 29 Jun 2022 15:29:28 +0000 (08:29 -0700)] 
s3: libads: Fix return from malloc check.

We shouldn't be checking *realm != '\0' here, just
the return from malloc.

Coverity CID: 1506719.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 30 16:28:30 UTC 2022 on sn-devel-184

3 years agos3: winbind: Add missing NULL check for returned talloc'ed ADS struct.
Jeremy Allison [Wed, 29 Jun 2022 15:20:21 +0000 (08:20 -0700)] 
s3: winbind: Add missing NULL check for returned talloc'ed ADS struct.

Coverity CID: 1506720.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoctdb-tests: Add new tool unit tests to cover UNKNOWN state
Martin Schwenke [Thu, 26 May 2022 22:38:11 +0000 (08:38 +1000)] 
ctdb-tests: Add new tool unit tests to cover UNKNOWN state

Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jun 28 10:16:59 UTC 2022 on sn-devel-184

3 years agoctdb-tool: Add UNKNOWN pseudo state
Vinit Agnihotri [Tue, 26 Apr 2022 07:20:21 +0000 (17:20 +1000)] 
ctdb-tool: Add UNKNOWN pseudo state

When a node is starting, CTDB reports remote nodes as unhealthy by
default.  This can be misleading.

To hide this, report an "UNKNOWN" pseudo state when a remote node is
not disconnected and the runstate is less than or equal to
"FIRST_RECOVERY".

Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-tests: Add runstate handling to fake ctdbd
Vinit Agnihotri [Tue, 26 Apr 2022 07:20:21 +0000 (17:20 +1000)] 
ctdb-tests: Add runstate handling to fake ctdbd

Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-tests: Return error on empty fake ctdbd configuration blocks
Martin Schwenke [Mon, 27 Jun 2022 00:34:13 +0000 (10:34 +1000)] 
ctdb-tests: Return error on empty fake ctdbd configuration blocks

These would be unintended errors.  The block should be omitted to keep
the default value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>