kseeger/samba-autobuild/.git
2 years agoCVE-2021-20254 passdb: Simplify sids_to_unixids() master
Volker Lendecke [Sat, 20 Feb 2021 14:50:12 +0000 (15:50 +0100)]
CVE-2021-20254 passdb: Simplify sids_to_unixids()

Best reviewed with "git show -b", there's a "continue" statement that
changes subsequent indentation.

Decouple lookup status of ids from ID_TYPE_NOT_SPECIFIED

Add comments to explain the use of the three lookup
loops.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: For 'security = ADS' require realm/workgroup to be set
Andreas Schneider [Wed, 28 Apr 2021 10:25:42 +0000 (12:25 +0200)]
s3:winbind: For 'security = ADS' require realm/workgroup to be set

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 29 04:48:37 UTC 2021 on sn-devel-184

2 years agos3:utils: Tell users that workgroup/realm is required for ADS mode
Andreas Schneider [Wed, 28 Apr 2021 10:09:21 +0000 (12:09 +0200)]
s3:utils: Tell users that workgroup/realm is required for ADS mode

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Update samba.8 manpage for new cmdline opition parser
Andreas Schneider [Thu, 11 Feb 2021 13:31:26 +0000 (14:31 +0100)]
docs-xml: Update samba.8 manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:samba: Migrate samba daemon to new cmdline option parser
Andreas Schneider [Thu, 14 Jan 2021 08:50:10 +0000 (09:50 +0100)]
s4:samba: Migrate samba daemon to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:samba: Pass a talloc memory context to binary_smbd_main()
Andreas Schneider [Thu, 14 Jan 2021 08:36:47 +0000 (09:36 +0100)]
s4:samba: Pass a talloc memory context to binary_smbd_main()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Update winbindd manpage for new cmdline opition parser
Andreas Schneider [Fri, 15 Jan 2021 14:14:39 +0000 (15:14 +0100)]
docs-xml: Update winbindd manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Update smbd manpage for new cmdline opition parser
Andreas Schneider [Fri, 15 Jan 2021 13:41:51 +0000 (14:41 +0100)]
docs-xml: Update smbd manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Update nmbd manpage for new cmdline opition parser
Andreas Schneider [Fri, 15 Jan 2021 14:10:46 +0000 (15:10 +0100)]
docs-xml: Update nmbd manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3: Remove --log-stdout from daemons
Andreas Schneider [Mon, 11 Jan 2021 08:52:36 +0000 (09:52 +0100)]
s3: Remove --log-stdout from daemons

The common cmdline parser provides --debug-stdout.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:util: Add debug_get_log_type() function
Andreas Schneider [Fri, 8 Jan 2021 07:31:24 +0000 (08:31 +0100)]
lib:util: Add debug_get_log_type() function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:winbind: Migrate winbindd to new cmdline option parser
Andreas Schneider [Mon, 11 Jan 2021 09:20:41 +0000 (10:20 +0100)]
s3:winbind: Migrate winbindd to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: Migrate smbd to new cmdline option parser
Andreas Schneider [Tue, 5 Jan 2021 13:35:39 +0000 (14:35 +0100)]
s3:smbd: Migrate smbd to new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:nmbd: Migrate nmbd to new cmdline option parser
Andreas Schneider [Tue, 5 Jan 2021 13:28:53 +0000 (14:28 +0100)]
s3:nmbd: Migrate nmbd to new cmdline option parser

This removes --log-stdout as we already have --debug-stdout in the
common options!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoWHATSNEW: Document removal of NIS support
Andreas Schneider [Tue, 27 Apr 2021 12:58:20 +0000 (14:58 +0200)]
WHATSNEW: Document removal of NIS support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Wed Apr 28 08:47:21 UTC 2021 on sn-devel-184

2 years agodocs-xml: Add doc entities for the options of the new cmdline parser
Andreas Schneider [Fri, 21 Aug 2020 11:33:09 +0000 (13:33 +0200)]
docs-xml: Add doc entities for the options of the new cmdline parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr 28 04:32:47 UTC 2021 on sn-devel-184

2 years agolib:cmdline: Add sanity check for options
Andreas Schneider [Wed, 2 Sep 2020 15:19:00 +0000 (17:19 +0200)]
lib:cmdline: Add sanity check for options

Make sure we don't have duplicate options!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Add samba_cmdline_burn()
Andreas Schneider [Wed, 19 Aug 2020 07:07:47 +0000 (09:07 +0200)]
lib:cmdline: Add samba_cmdline_burn()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Set kerberos=required for --use-krb5-ccache=CCACHE
Andreas Schneider [Thu, 12 Nov 2020 10:45:05 +0000 (11:45 +0100)]
lib:cmdline: Set kerberos=required for --use-krb5-ccache=CCACHE

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Implement legacy kerberos options
Andreas Schneider [Mon, 31 Aug 2020 15:42:57 +0000 (17:42 +0200)]
lib:cmdline: Implement legacy kerberos options

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Parse cmdline options with popt
Andreas Schneider [Tue, 11 Aug 2020 14:37:16 +0000 (16:37 +0200)]
lib:cmdline: Parse cmdline options with popt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Add callback for loading the config file
Andreas Schneider [Mon, 10 Aug 2020 13:09:54 +0000 (15:09 +0200)]
lib:cmdline: Add callback for loading the config file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Add client credentials
Andreas Schneider [Mon, 27 Jul 2020 14:13:53 +0000 (16:13 +0200)]
lib:cmdline: Add client credentials

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:cmdline: Add initial code for new cmdline option parser
Andreas Schneider [Thu, 16 Jul 2020 13:15:07 +0000 (15:15 +0200)]
lib:cmdline: Add initial code for new cmdline option parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds:tests: Add test for cli_credentials_get_password_and_obtained()
Andreas Schneider [Tue, 1 Sep 2020 13:36:20 +0000 (15:36 +0200)]
auth:creds:tests: Add test for cli_credentials_get_password_and_obtained()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds: Add cli_credentials_get_password_and_obtained()
Andreas Schneider [Tue, 1 Sep 2020 13:33:18 +0000 (15:33 +0200)]
auth:creds: Add cli_credentials_get_password_and_obtained()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds:tests: Add test for cli_credentials_get_username_and_obtained()
Andreas Schneider [Tue, 1 Sep 2020 11:33:19 +0000 (13:33 +0200)]
auth:creds:tests: Add test for cli_credentials_get_username_and_obtained()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds: Add cli_credentials_get_username_and_obtained()
Andreas Schneider [Mon, 31 Aug 2020 16:52:44 +0000 (18:52 +0200)]
auth:creds: Add cli_credentials_get_username_and_obtained()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds:tests: Add test for cli_credentials_set_gensec_features()
Andreas Schneider [Tue, 1 Sep 2020 11:28:12 +0000 (13:28 +0200)]
auth:creds:tests: Add test for cli_credentials_set_gensec_features()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds: Add obtained arg to cli_credentials_set_gensec_features()
Andreas Schneider [Thu, 20 Aug 2020 08:50:30 +0000 (10:50 +0200)]
auth:creds: Add obtained arg to cli_credentials_set_gensec_features()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds: Use 'client protection' option for smb sign and encrypt defaults
Andreas Schneider [Thu, 20 Aug 2020 14:44:32 +0000 (16:44 +0200)]
auth:creds: Use 'client protection' option for smb sign and encrypt defaults

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:param: Add 'client protection' config option
Andreas Schneider [Thu, 20 Aug 2020 08:18:08 +0000 (10:18 +0200)]
lib:param: Add 'client protection' config option

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds:tests: Add test for cli_credentials_set_kerberos_state()
Andreas Schneider [Tue, 1 Sep 2020 11:01:56 +0000 (13:01 +0200)]
auth:creds:tests: Add test for cli_credentials_set_kerberos_state()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoauth:creds: Add obtained arg to cli_credentials_set_kerberos_state()
Andreas Schneider [Wed, 19 Aug 2020 13:46:11 +0000 (15:46 +0200)]
auth:creds: Add obtained arg to cli_credentials_set_kerberos_state()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:rpc_server: Set Kerberos to desired
Andreas Schneider [Thu, 8 Apr 2021 13:45:42 +0000 (15:45 +0200)]
s4:rpc_server: Set Kerberos to desired

This is required for ncalrpc_as_system to work. In FIPS enabled mode,
'client use kerberos' is forced to required. We need to allow
non-kerberos use for ncalrpc_as_system here.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Check the return code of setup_namespaces()
Andreas Schneider [Thu, 8 Apr 2021 13:54:18 +0000 (15:54 +0200)]
selftest: Check the return code of setup_namespaces()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:param: Add 'client use kerberos' config parameter
Andreas Schneider [Wed, 19 Aug 2020 09:34:02 +0000 (11:34 +0200)]
lib:param: Add 'client use kerberos' config parameter

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:tests: Check for 'Client started' in the log
Andreas Schneider [Wed, 26 Aug 2020 09:27:59 +0000 (11:27 +0200)]
s3:tests: Check for 'Client started' in the log

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests: Use --configfile instead of -s
Andreas Schneider [Wed, 14 Apr 2021 09:44:51 +0000 (11:44 +0200)]
tests: Use --configfile instead of -s

We should use long options in tests to make clear what we are trying to
do.

Also the -s short option will be removed for --configfile later.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotestprogs: Use --suppress-prompt instead of -s for testparm
Andreas Schneider [Fri, 9 Apr 2021 12:33:09 +0000 (14:33 +0200)]
testprogs: Use --suppress-prompt instead of -s for testparm

We should use long options in tests to make clear what we are trying to
do.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests: Use ldbsearch '--scope instead of '-s'
Andreas Schneider [Thu, 17 Dec 2020 11:25:15 +0000 (12:25 +0100)]
tests: Use ldbsearch '--scope instead of '-s'

We should use long options in tests to make clear what we are trying to
do.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Use 'desired' and 'required' for option 'client ipc signing'
Andreas Schneider [Thu, 3 Dec 2020 14:29:28 +0000 (15:29 +0100)]
docs-xml: Use 'desired' and 'required' for option 'client ipc signing'

For a better user experience we use disabled, desired, required
everywhere now. The arguments auto and mandatory are still working and
synonyms.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Use 'desired' and 'required' for option 'client signing'
Andreas Schneider [Thu, 3 Dec 2020 14:25:59 +0000 (15:25 +0100)]
docs-xml: Use 'desired' and 'required' for option 'client signing'

For a better user experience we use disabled, desired, required
everywhere now. The arguments auto and mandatory are still working and
synonyms.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Specify /dev/null as the smbd config file
Andreas Schneider [Tue, 12 Jan 2021 09:07:56 +0000 (10:07 +0100)]
selftest: Specify /dev/null as the smbd config file

smbd will require a smb.conf later.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:winbind: Pass the 'samba' daemon config file to winbindd
Andreas Schneider [Mon, 11 Jan 2021 15:30:44 +0000 (16:30 +0100)]
s3:winbind: Pass the 'samba' daemon config file to winbindd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:winbind: Add a missing no memory check
Andreas Schneider [Mon, 11 Jan 2021 15:27:48 +0000 (16:27 +0100)]
s4:winbind: Add a missing no memory check

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agofile_server: Pass the 'samba' daemon config file to smbd
Andreas Schneider [Mon, 11 Jan 2021 15:24:23 +0000 (16:24 +0100)]
file_server: Pass the 'samba' daemon config file to smbd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agofile_server: Add a missing no memory check
Andreas Schneider [Mon, 11 Jan 2021 15:24:00 +0000 (16:24 +0100)]
file_server: Add a missing no memory check

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:utils: Link py_net only against needed cmdline_contexts library
Andreas Schneider [Mon, 26 Apr 2021 06:15:00 +0000 (08:15 +0200)]
s3:utils: Link py_net only against needed cmdline_contexts library

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agobuild: Use bison at build time rather than lexyacc.sh to build the embedded heimdal
Andrew Bartlett [Mon, 29 Mar 2021 20:39:00 +0000 (09:39 +1300)]
build: Use bison at build time rather than lexyacc.sh to build the embedded heimdal

Because the filenames are changed to the *.tab.{h,c} format
a transitional header is added.

While the built compilers differ, the output of the compilers
and the resulting .o files have been verified not to have changed
on Ubuntu 20.04.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoheimdal: use correct prototype of yyparse()
Andrew Bartlett [Sun, 18 Apr 2021 19:03:47 +0000 (07:03 +1200)]
heimdal: use correct prototype of yyparse()

As noted in 92c6891c368cae5c2402727c1f66f1c60778199d in upstream
Heimdal yyparse() returns an int.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoheimdal_build: Make HEIMDAL_BINARY be based on HEIMDAL_SUBSYSTEM
Andrew Bartlett [Mon, 19 Apr 2021 00:57:38 +0000 (12:57 +1200)]
heimdal_build: Make HEIMDAL_BINARY be based on HEIMDAL_SUBSYSTEM

This is imporatant as it ensures that the warning -> error
logic and overrides are done for source files directly
listed in a HEIMDAL_BINARY and a HEIMDAL_SUBSYSTEM.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoHEIMDAL: Avoid yydebug compiler warning
Viktor Dukhovni [Sun, 13 Nov 2016 19:51:17 +0000 (06:51 +1100)]
HEIMDAL: Avoid yydebug compiler warning

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry-picked from Heimdal commit 17d6d0ac1e8597e91d723399cbe9af9ea2e13f42)

2 years agopython: remove 'from __future__ import unicode_literals'
Douglas Bagnall [Wed, 28 Apr 2021 01:07:51 +0000 (01:07 +0000)]
python: remove 'from __future__ import unicode_literals'

as well as a comment about Python 2 strings, which we don't want to be
reminded of.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython/hostconfig: remove 'from __future__ import absolute_import'
Douglas Bagnall [Wed, 28 Apr 2021 01:06:06 +0000 (01:06 +0000)]
python/hostconfig: remove 'from __future__ import absolute_import'

obsolete in Python 3.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython: remove all 'from __future__ import division'
Douglas Bagnall [Wed, 28 Apr 2021 01:04:57 +0000 (01:04 +0000)]
python: remove all 'from __future__ import division'

This made '//' and '/' in Python 2 behave as in Python 3.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython: remove all 'from __future__ import print_function'
Douglas Bagnall [Wed, 28 Apr 2021 01:02:37 +0000 (01:02 +0000)]
python: remove all 'from __future__ import print_function'

This made Python 2's print behave like Python 3's print().

In some cases, where we had:

   from __future__ import print_function
   """Intended module documentation..."""

this will have the side effect of making the intended module documentation
work as the actual module documentation (i.e. becoming __doc__), because
it is once again the first statement in the module.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years ago.gitlab-ci.yml: Always build the ubuntu1804-samba-o3 with --enable-coverage
Andrew Bartlett [Mon, 19 Apr 2021 19:45:31 +0000 (07:45 +1200)]
.gitlab-ci.yml: Always build the ubuntu1804-samba-o3 with --enable-coverage

This ensures that the coverage build always works, as it can trigger different warnings.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years ago.gitlab-ci.yml: Return code coverage reporting for "none" tasks
Andrew Bartlett [Mon, 19 Apr 2021 09:09:03 +0000 (21:09 +1200)]
.gitlab-ci.yml: Return code coverage reporting for "none" tasks

This was lost early on with 54f26cfcf2587a2b1d97f466a886fa89a116eea1
which did not take into account code coverage, which stopped running
for these tasks very early on with
71595201bea9b3fa28357065fa137806f9220f38.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agos3-modules: Fix "-Werror=maybe-uninitialized" errors only seen with -O3 and --enable...
Andrew Bartlett [Tue, 20 Apr 2021 02:39:40 +0000 (14:39 +1200)]
s3-modules: Fix "-Werror=maybe-uninitialized" errors only seen with -O3 and --enable-coverage

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agotests: Fix "-Werror=maybe-uninitialized" errors only seen with -O3 and --enable-coverage
Andrew Bartlett [Tue, 20 Apr 2021 02:38:37 +0000 (14:38 +1200)]
tests: Fix "-Werror=maybe-uninitialized" errors only seen with -O3 and --enable-coverage

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agotorture: Avoid -Werror=strict-overflow in -O3 coverage build
Andrew Bartlett [Mon, 19 Apr 2021 19:34:12 +0000 (07:34 +1200)]
torture: Avoid -Werror=strict-overflow in -O3 coverage build

The test_getinfo() function only needs to return if this happens
not how many times.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years ago.gitlab-ci.yml and autobuild: Publish the current HTML docs with the code coverage
Andrew Bartlett [Thu, 15 Apr 2021 23:16:17 +0000 (11:16 +1200)]
.gitlab-ci.yml and autobuild: Publish the current HTML docs with the code coverage

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agolib:replace: Fix a posible double free
Andreas Schneider [Tue, 27 Apr 2021 13:33:04 +0000 (15:33 +0200)]
lib:replace: Fix a posible double free

CID 1477397

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): Tue Apr 27 17:51:36 UTC 2021 on sn-devel-184

2 years agoauth3: talloc_strackframe() panics on failure
Volker Lendecke [Thu, 22 Apr 2021 08:29:24 +0000 (10:29 +0200)]
auth3: talloc_strackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 27 14:14:22 UTC 2021 on sn-devel-184

2 years agoauth: Fix a typo
Volker Lendecke [Thu, 22 Apr 2021 08:29:14 +0000 (10:29 +0200)]
auth: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agopassdb: Add error checks in samu_set_unix_internal()
Volker Lendecke [Wed, 21 Apr 2021 19:51:44 +0000 (21:51 +0200)]
passdb: Add error checks in samu_set_unix_internal()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoauth3: if (ret==False) just looks weird
Volker Lendecke [Wed, 21 Apr 2021 19:30:30 +0000 (21:30 +0200)]
auth3: if (ret==False) just looks weird

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoauth3: Fix a typo
Volker Lendecke [Wed, 21 Apr 2021 10:56:04 +0000 (12:56 +0200)]
auth3: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoauth3: Use auth3_context_set_challenge() in auth3_set_challenge()
Volker Lendecke [Wed, 21 Apr 2021 10:29:16 +0000 (12:29 +0200)]
auth3: Use auth3_context_set_challenge() in auth3_set_challenge()

Don't duplicate what's already there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoauth3: Apply some const to auth3_context_set_challenge()
Volker Lendecke [Wed, 21 Apr 2021 10:28:12 +0000 (12:28 +0200)]
auth3: Apply some const to auth3_context_set_challenge()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agogensec: Slightly simplify gensec_generate_session_info_pac()
Volker Lendecke [Wed, 21 Apr 2021 09:30:20 +0000 (11:30 +0200)]
gensec: Slightly simplify gensec_generate_session_info_pac()

Reduce indentation by an early error return and by introducing a
helper variable.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agolib: Remove close_low_fds()
Volker Lendecke [Fri, 23 Apr 2021 14:37:31 +0000 (16:37 +0200)]
lib: Remove close_low_fds()

There were only two callers, it did not do proper error handling, and
it was confusing to call.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agolib: Directly call close_low_fd() in become_daemon()
Volker Lendecke [Fri, 23 Apr 2021 14:35:02 +0000 (16:35 +0200)]
lib: Directly call close_low_fd() in become_daemon()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agosmbd: Replace call to close_low_fds() with direct calls
Volker Lendecke [Fri, 23 Apr 2021 14:31:08 +0000 (16:31 +0200)]
smbd: Replace call to close_low_fds() with direct calls

Check the errors from close_low_fd(). Also, close_low_fds() does not
really add a lot of value, for example there's no caller that closes
stderr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoprinting: Avoid zombies in the background daemon
Volker Lendecke [Fri, 23 Apr 2021 09:17:33 +0000 (11:17 +0200)]
printing: Avoid zombies in the background daemon

Whatever you read about waitpid() tells you should should run it in a
loop.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoprinting: Reduce indentation in start_background_queue()
Volker Lendecke [Fri, 23 Apr 2021 14:09:43 +0000 (16:09 +0200)]
printing: Reduce indentation in start_background_queue()

We don't need the "if(pid==0)" here, we've covered "if(pid!=0)" a few
lines above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoprinting: Remove dead code
Volker Lendecke [Fri, 23 Apr 2021 14:07:38 +0000 (16:07 +0200)]
printing: Remove dead code

This was already covered a few lines above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoprinting: Remove the pause_pipe[] from queue_process.c
Volker Lendecke [Fri, 23 Apr 2021 14:03:57 +0000 (16:03 +0200)]
printing: Remove the pause_pipe[] from queue_process.c

Since c80f70390c37 we don't need this explicit pipe anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agosamba-tool group listmembers: always list objects which can not expire
Björn Baumbach [Fri, 23 Apr 2021 16:03:53 +0000 (18:03 +0200)]
samba-tool group listmembers: always list objects which can not expire

Otherwise for example contacts wouldn't be listed when the
--hide-expired option is used. Contacts typically do not have the
accountExpires attribute.

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Rowland penny <rpenny@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Mon Apr 26 13:21:43 UTC 2021 on sn-devel-184

2 years agotest samba-tool group listmembers: test listing contacts as group members
Björn Baumbach [Fri, 23 Apr 2021 16:01:33 +0000 (18:01 +0200)]
test samba-tool group listmembers: test listing contacts as group members

Make sure that contacts are listed as group members, even if the
--hide-expired option is used.

Expect failure. Fix follows up.

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Rowland penny <rpenny@samba.org>
2 years agopyldb: fix a typo
Björn Baumbach [Mon, 18 Jan 2021 15:48:21 +0000 (16:48 +0100)]
pyldb: fix a typo

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Rowland penny <rpenny@samba.org>
2 years agolib:replace: Fix possible resource leaks in test_closefrom()
Andreas Schneider [Thu, 22 Apr 2021 13:25:57 +0000 (15:25 +0200)]
lib:replace: Fix possible resource leaks in test_closefrom()

Found by covscan

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): Sun Apr 25 22:02:20 UTC 2021 on sn-devel-184

2 years agolib:replace: Fix memory leak in test_asprintf()
Andreas Schneider [Thu, 22 Apr 2021 13:20:27 +0000 (15:20 +0200)]
lib:replace: Fix memory leak in test_asprintf()

Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:replace: Fix a memleak in test_strndup()
Andreas Schneider [Thu, 22 Apr 2021 13:05:07 +0000 (15:05 +0200)]
lib:replace: Fix a memleak in test_strndup()

Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:replace: Fix a memleak in test_strdup()
Andreas Schneider [Thu, 22 Apr 2021 13:03:25 +0000 (15:03 +0200)]
lib:replace: Fix a memleak in test_strdup()

Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:replace: Fix resource leak in os2_delete test
Andreas Schneider [Thu, 22 Apr 2021 13:01:39 +0000 (15:01 +0200)]
lib:replace: Fix resource leak in os2_delete test

Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:ldb: Change page size of guidindexpackv1.ldb
Andreas Schneider [Thu, 22 Apr 2021 09:09:03 +0000 (11:09 +0200)]
lib:ldb: Change page size of guidindexpackv1.ldb

As this is a TDB file, the file has been backed up using tdbbackup to
get a different page size. This fixes running the repack.py test on
aarch64.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 23 08:26:00 UTC 2021 on sn-devel-184

2 years agolib:ldb: Use a 1MiB lmdb so the test also passes on aarch64 CentOS stream
Gary Lockyer [Thu, 22 Apr 2021 08:03:53 +0000 (10:03 +0200)]
lib:ldb: Use a 1MiB lmdb so the test also passes on aarch64 CentOS stream

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoFix sigsegv in check_stream in smbtorture smb2.streams.io
Gordon Ross [Mon, 19 Apr 2021 22:31:13 +0000 (18:31 -0400)]
Fix sigsegv in check_stream in smbtorture smb2.streams.io

torture_comment calls need a struct torture_context arg,
not its mem_ctx child.  Use talloc_parent().  Also
need to call torture_result somewhere on failure.

Signed-off-by: Gordon Ross <gordon.ross@tintri.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 22 18:48:30 UTC 2021 on sn-devel-184

2 years agodocs-xml: Update documentation for removal of NIS support
Andreas Schneider [Wed, 21 Apr 2021 08:30:56 +0000 (10:30 +0200)]
docs-xml: Update documentation for removal of NIS support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:replace: Remove NIS support
Andreas Schneider [Tue, 20 Apr 2021 16:01:02 +0000 (18:01 +0200)]
lib:replace: Remove NIS support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: Remove NIS support
Andreas Schneider [Tue, 20 Apr 2021 15:59:34 +0000 (17:59 +0200)]
s3:smbd: Remove NIS support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:lib: Remove NIS support from substitute
Andreas Schneider [Wed, 21 Apr 2021 08:22:29 +0000 (10:22 +0200)]
s3:lib: Remove NIS support from substitute

%N is often used to get the netbios name (local machine name). So we
need to keep it.

This is covered by samba.tests.s3passdb.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:util: Remove NIS support from string_match()
Andreas Schneider [Tue, 20 Apr 2021 15:53:49 +0000 (17:53 +0200)]
lib:util: Remove NIS support from string_match()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib:texpect: Do not link against nsl
Andreas Schneider [Tue, 20 Apr 2021 16:00:11 +0000 (18:00 +0200)]
lib:texpect: Do not link against nsl

I do not see what would use that in texpect.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba-tool: Use s3 net join for member join
David Mulder [Tue, 27 Oct 2020 14:28:06 +0000 (08:28 -0600)]
samba-tool: Use s3 net join for member join

The s4 member join code has been broken for some
time. Modify samba-tool to instead use the
working s3 member join code.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Apr 21 21:40:13 UTC 2021 on sn-devel-184

2 years agopython: glue function for detecting if selftest is enabled
David Mulder [Fri, 19 Mar 2021 18:31:42 +0000 (12:31 -0600)]
python: glue function for detecting if selftest is enabled

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython: Test s3 net join and leave
David Mulder [Mon, 26 Oct 2020 21:13:50 +0000 (15:13 -0600)]
python: Test s3 net join and leave

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3: Add s3 net python bindings
David Mulder [Wed, 21 Oct 2020 15:40:32 +0000 (09:40 -0600)]
s3: Add s3 net python bindings

This adds python bindings for the s3 net ads
join and leave commands.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>