bbaumbach/samba-autobuild/.git
2 weeks agosamba-tool group listmembers: always list objects which can not expire master
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>
2 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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>
2 weeks agosamba-tool: add dns zoneoptions for aging control
Douglas Bagnall [Mon, 19 Apr 2021 12:07:50 +0000 (00:07 +1200)]
samba-tool: add dns zoneoptions for aging control

This adds a subcommand for altering zone parameters.

At the moment the only options are related to record aging (a.k.a
scavenging). The code is structured to make it easy to add more
integer or boolean options, but it is not clear that this would be
useful; many other parameters are not used or would only have
deleterious effects.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr 21 10:04:14 UTC 2021 on sn-devel-184

2 weeks agodocs: Expand the "log level" docs on audit logging
Andrew Bartlett [Thu, 15 Apr 2021 22:43:07 +0000 (10:43 +1200)]
docs: Expand the "log level" docs on audit logging

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agodocs: underline special words in the audit logging part of "log level" in man smb...
Andrew Bartlett [Thu, 15 Apr 2021 02:40:30 +0000 (14:40 +1200)]
docs: underline special words in the audit logging part of "log level" in man smb.conf

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agodocs: Further discourage the use of the "event notification" options
Andrew Bartlett [Thu, 15 Apr 2021 02:45:07 +0000 (14:45 +1200)]
docs: Further discourage the use of the "event notification" options

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agodocs: Add proper explination on why transactions need to be audited.
Andrew Bartlett [Thu, 15 Apr 2021 02:44:22 +0000 (14:44 +1200)]
docs: Add proper explination on why transactions need to be audited.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agodocs: Add missing documentation on dsdb_group_audit and dsdb_group_audit_json
Andrew Bartlett [Thu, 15 Apr 2021 02:39:49 +0000 (14:39 +1200)]
docs: Add missing documentation on dsdb_group_audit and dsdb_group_audit_json

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agodebug: Synchronise "log level" in smb.conf with the code
Andrew Bartlett [Thu, 15 Apr 2021 01:52:38 +0000 (13:52 +1200)]
debug: Synchronise "log level" in smb.conf with the code

This is done by pasting in the contents of default_classname_table[]
in lib/util/debug.c into
cut -f 2 -d \"| xargs -i sh -c 'echo "\t<listitem><para><parameter moreinfo=\"none\">{}</parameter></para></listitem>"'

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 weeks agolibcli: Fix parsing access flags from multiple tables
Volker Lendecke [Mon, 19 Apr 2021 14:00:27 +0000 (16:00 +0200)]
libcli: Fix parsing access flags from multiple tables

We have to look at all available mappings for parsing sddl for each
special flag set. "GW" and "FX" come from two different tables, but
the previous code settled on one table and then expected both "GW" and
"FX" to come from that same table. Change the code to look at all
tables per special flag set.

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): Wed Apr 21 00:04:36 UTC 2021 on sn-devel-184

2 weeks agotorture: Show sddl_decode() failure for "GWFX" access mask
Volker Lendecke [Mon, 19 Apr 2021 14:04:00 +0000 (16:04 +0200)]
torture: Show sddl_decode() failure for "GWFX" access mask

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 weeks agolibcli: Factor out sddl_map_flag()
Volker Lendecke [Mon, 19 Apr 2021 12:46:21 +0000 (14:46 +0200)]
libcli: Factor out sddl_map_flag()

We have to look at more than one map, "FRSD" is not correctly handled
right now for example. This factors out walking a map to make walking
multiple maps easier.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoutil: Ensure debugger is not started until it is allowed to attach
Joseph Sutton [Sun, 11 Apr 2021 22:23:20 +0000 (10:23 +1200)]
util: Ensure debugger is not started until it is allowed to attach

Use a pipe to ensure that the debugger is not started until after the
prctl() call allowing it to attach to the parent, avoiding a potential
race condition.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 20 12:33:40 UTC 2021 on sn-devel-184

3 weeks agoutil: Ensure debugger can be attached to process
Joseph Sutton [Mon, 29 Mar 2021 02:04:53 +0000 (15:04 +1300)]
util: Ensure debugger can be attached to process

samba_start_debugger() attempts to start a debugger attached to the
calling process by calling system() to start a background process.
However, if the spawned shell exits before the debugger has had a chance
to attach, the debugger process will no longer be a child of the parent
process (as it will have been reparented).

If the system does not allow tracing by non-child processes, attachment
may fail as a result.

This commit replaces the system() call and the implicit shell around
xterm with an explicit fork()/exec() so that the debugger remains a
child of the calling process, ensuring the attachment succeeds unless
tracing is disabled completely.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agoheimdal_build: avoid cflags='-DSOCKET_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_'
Stefan Metzmacher [Fri, 3 Apr 2020 10:06:50 +0000 (12:06 +0200)]
heimdal_build: avoid cflags='-DSOCKET_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_'

SOCKET_WRAPPER_DISABLE is unused for a long time already
and _SAMBA_HOSTCC_ is implied by use_hostcc=True now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
[abartlet@samba.org: Adapted to current master from Metze's wip.git/master/heimdal
 branch]
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agolib/replace: don't set -D_SAMBA_HOSTCC_ explicitly
Stefan Metzmacher [Fri, 3 Apr 2020 09:50:53 +0000 (11:50 +0200)]
lib/replace: don't set -D_SAMBA_HOSTCC_ explicitly

use_hostcc=True already triggers this.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agowafsamba: let 'use_hostcc=True' result in -D_SAMBA_HOSTCC_
Stefan Metzmacher [Fri, 3 Apr 2020 09:49:44 +0000 (11:49 +0200)]
wafsamba: let 'use_hostcc=True' result in -D_SAMBA_HOSTCC_

That's easier for the callers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agoselftest: Improve test names in kinit test for improved debugging
Andrew Bartlett [Wed, 20 May 2015 11:40:13 +0000 (13:40 +0200)]
selftest: Improve test names in kinit test for improved debugging

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agoheimdal_build: Do not use LMDB in Heimdal even if we have it in Samba
Andrew Bartlett [Thu, 6 Sep 2018 02:54:50 +0000 (14:54 +1200)]
heimdal_build: Do not use LMDB in Heimdal even if we have it in Samba

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agoheimdal_build: use TO_LIST from wafsamba.samba_utils
Stefan Metzmacher [Fri, 3 Apr 2020 10:01:15 +0000 (12:01 +0200)]
heimdal_build: use TO_LIST from wafsamba.samba_utils

Signed-off-by: Stefan Metzmacher <metze@samba.org>
[abartlet@samba.org: adapted from patch in Metze's
 wip.git/master-heimdal to current master
 without the other patches]
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agos3: smbd: Prevent fchmod on a symlink.
Jeremy Allison [Mon, 19 Apr 2021 23:38:00 +0000 (16:38 -0700)]
s3: smbd: Prevent fchmod on a symlink.

Remove selftest/knownfail.d/symlink_chmod.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 20 08:23:42 UTC 2021 on sn-devel-184

3 weeks agos3: torture: Add samba3.smbtorture_s3.plain.POSIX-SYMLINK-CHMOD
Jeremy Allison [Mon, 19 Apr 2021 23:25:51 +0000 (16:25 -0700)]
s3: torture: Add samba3.smbtorture_s3.plain.POSIX-SYMLINK-CHMOD

Shows we must protect against a null fsp handle when doing POSIX chmod on a symlink,
whether the symlink points to a real object or is dangling.

Add to knownfail for now. Commit 9722732b1867e359304594ada72ff40cd1341be5
removed the fsp == NULL protection for POSIX, and we need to put it back.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agogpo: Open ssh config to write bytes
David Mulder [Mon, 19 Apr 2021 19:42:35 +0000 (13:42 -0600)]
gpo: Open ssh config to write bytes

Reopening the existing config file fails because
we fail to open to write bytes.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agos3:passdb: Fix 'return 1' in secrets_store_creds()
pavel.filipensky [Fri, 16 Apr 2021 12:24:15 +0000 (14:24 +0200)]
s3:passdb: Fix 'return 1' in secrets_store_creds()

The recently introduced function secrets_store_creds() should always
use 'return false' in case of a failure. It is not only spelling issue
since 'return 1' actually means 'return true'.

Signed-off-by: Pavel Filipensky <pavel.filipensky@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr 20 06:42:50 UTC 2021 on sn-devel-184

3 weeks agolib: Fix a typo
Volker Lendecke [Mon, 12 Apr 2021 09:43:06 +0000 (09:43 +0000)]
lib: Fix a typo

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 Apr 19 19:07:01 UTC 2021 on sn-devel-184

3 weeks agoauth3: Make auth3_session_info_create() static
Volker Lendecke [Fri, 16 Apr 2021 20:18:29 +0000 (22:18 +0200)]
auth3: Make auth3_session_info_create() static

Only used in the static artifical session creation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agotorture: Move sddl tests to python
Volker Lendecke [Fri, 16 Apr 2021 15:32:27 +0000 (17:32 +0200)]
torture: Move sddl tests to python

This kind of test is better hosted in python than in C. More lines,
but the ones in source4/libcli/security/tests/sddl.c were preeetty
long...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolibrpc: Add py_descriptor_richcmp() equality function
Volker Lendecke [Fri, 16 Apr 2021 15:22:12 +0000 (17:22 +0200)]
librpc: Add py_descriptor_richcmp() equality function

Only a python3 version. Do we still need the python2 flavor?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolibrpc: Use GUID_buf_string() in python wrappers
Volker Lendecke [Fri, 16 Apr 2021 07:15:43 +0000 (09:15 +0200)]
librpc: Use GUID_buf_string() in python wrappers

No need for the talloc'ed strings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agopy_security: Avoid casts in py_random_sid()
Volker Lendecke [Thu, 15 Apr 2021 10:05:34 +0000 (12:05 +0200)]
py_security: Avoid casts in py_random_sid()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolibcli: Simplify sddl_encode_ace()
Volker Lendecke [Wed, 14 Apr 2021 15:44:54 +0000 (17:44 +0200)]
libcli: Simplify sddl_encode_ace()

Use GUID_buf_string() instead of GUID_string() for encoding objects,
no need to check for NULL anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Add an error check to auth_generic_prepare()
Volker Lendecke [Wed, 14 Apr 2021 18:42:27 +0000 (20:42 +0200)]
auth3: Add an error check to auth_generic_prepare()

gensec_set_credentials() can fail

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Remove unnecessary talloc_unlink() calls
Volker Lendecke [Wed, 14 Apr 2021 18:37:39 +0000 (20:37 +0200)]
auth3: Remove unnecessary talloc_unlink() calls

The structures we unlinked have been talloc_reference()ed in gensec
and thus don't need the second talloc parent anymore. But this
talloc_unlink isn't necessary because tmp_ctx is free()ed a few lines
down.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agodsdb: Slightly tune get_new_descriptor()
Volker Lendecke [Wed, 14 Apr 2021 14:30:16 +0000 (16:30 +0200)]
dsdb: Slightly tune get_new_descriptor()

DBG_DEBUG only calls its arguments if required according to the debug
level. A simple talloc_new/TALLOC_FREE in the normal case should be
much cheaper than the full sddl_encode().

I just stumbled across this code, this is has not shown up in any
profiles. I just think it's cleaner this way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Make load_auth_module() static
Volker Lendecke [Wed, 14 Apr 2021 10:33:09 +0000 (12:33 +0200)]
auth3: Make load_auth_module() static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Remove auth_skel.c
Volker Lendecke [Wed, 14 Apr 2021 10:31:27 +0000 (12:31 +0200)]
auth3: Remove auth_skel.c

Authentication is a very complex topic, and someone who is able to
write a custom auth module turning a struct auth_usersupplied_info
into a struct auth_serversupplied_info should be able to live without
this skeleton module.

This module also gave an example to load a secondary authentication
module via a module parameter (the call to load_module()). We have
abandoned this practice, and since the "auth methods" parameter has
gone we don't use this anymore internally.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agocreate_local_token: Add error checks
Volker Lendecke [Wed, 14 Apr 2021 08:48:04 +0000 (10:48 +0200)]
create_local_token: Add error checks

add_sid_to_array_unique() only fails for ENOMEM, and other parts of
the auth stack would probably crash under ENOMEM anyway. But this is
authorization-related code that should be as clean as possible.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Fix a few error path memleaks in create_local_token()
Volker Lendecke [Wed, 14 Apr 2021 08:43:44 +0000 (10:43 +0200)]
auth3: Fix a few error path memleaks in create_local_token()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Fix a typo
Volker Lendecke [Wed, 14 Apr 2021 08:28:21 +0000 (10:28 +0200)]
auth3: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Simplify check_samba4_security()
Volker Lendecke [Wed, 14 Apr 2021 08:05:59 +0000 (10:05 +0200)]
auth3: Simplify check_samba4_security()

First set up "server_info" in a local variable and once it's fully set
up, assign it to the out parameter "pserver_info".

Pointer dereferencing obfuscates the code for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agosmbd: Fix a typo
Volker Lendecke [Tue, 13 Apr 2021 15:48:44 +0000 (15:48 +0000)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth: Simplify DEBUG statements in make_auth3_context_for_ntlm()
Volker Lendecke [Tue, 13 Apr 2021 15:14:01 +0000 (15:14 +0000)]
auth: Simplify DEBUG statements in make_auth3_context_for_ntlm()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Remove two unused historic macros
Volker Lendecke [Tue, 13 Apr 2021 15:00:39 +0000 (15:00 +0000)]
lib: Remove two unused historic macros

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agovfs: Remove a call to TALLOC_ZERO()
Volker Lendecke [Tue, 13 Apr 2021 14:59:14 +0000 (14:59 +0000)]
vfs: Remove a call to TALLOC_ZERO()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agovfs: Replace a call to TALLOC_ZERO()
Volker Lendecke [Tue, 13 Apr 2021 14:57:26 +0000 (14:57 +0000)]
vfs: Replace a call to TALLOC_ZERO()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Replace a call to TALLOC_ZERO()
Volker Lendecke [Tue, 13 Apr 2021 14:55:47 +0000 (14:55 +0000)]
lib: Replace a call to TALLOC_ZERO()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Fix a error path memleak
Volker Lendecke [Tue, 13 Apr 2021 14:50:16 +0000 (14:50 +0000)]
auth3: Fix a error path memleak

(find the missing TALLOC_FREE() in the - part of the patch...)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoauth3: Use talloc_move() instead of talloc_steal()
Volker Lendecke [Tue, 13 Apr 2021 14:45:54 +0000 (14:45 +0000)]
auth3: Use talloc_move() instead of talloc_steal()

More recent coding style, avoid ambiguities about ownership

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agowinbindd: Fix a typo
Volker Lendecke [Tue, 13 Apr 2021 13:42:37 +0000 (13:42 +0000)]
winbindd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoregistry: Fix a typo
Volker Lendecke [Tue, 6 Apr 2021 19:29:06 +0000 (19:29 +0000)]
registry: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agorpc_client: talloc_stackframe() aborts on failure
Volker Lendecke [Wed, 7 Apr 2021 15:45:18 +0000 (15:45 +0000)]
rpc_client: talloc_stackframe() aborts on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agorpc_client: Direct struct initialization in dcerpc_winreg_enumvals()
Volker Lendecke [Wed, 7 Apr 2021 15:44:35 +0000 (15:44 +0000)]
rpc_client: Direct struct initialization in dcerpc_winreg_enumvals()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoprinting: talloc_stackframe() aborts on failure
Volker Lendecke [Wed, 7 Apr 2021 15:42:46 +0000 (15:42 +0000)]
printing: talloc_stackframe() aborts on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoprinting: Straighten winreg_get_printer() slightly
Volker Lendecke [Wed, 7 Apr 2021 15:41:11 +0000 (15:41 +0000)]
printing: Straighten winreg_get_printer() slightly

Use the common done: exit for everything. This involves initializing
the handles on the stack, but this is good practice anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoprinting: Make winreg_get_printer() a bit easier to understand
Volker Lendecke [Wed, 7 Apr 2021 15:37:35 +0000 (15:37 +0000)]
printing: Make winreg_get_printer() a bit easier to understand

This is more lines, but the FILL_STRING macro did not really gain much
in clarity for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agoprinting: Make winreg_get_printer() a bit easier to read
Volker Lendecke [Wed, 7 Apr 2021 15:25:09 +0000 (15:25 +0000)]
printing: Make winreg_get_printer() a bit easier to read

EMPTY_STRING does not gain clarity over "" for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Simplify tdb_fetch_int32()
Volker Lendecke [Mon, 12 Apr 2021 08:37:11 +0000 (08:37 +0000)]
lib: Simplify tdb_fetch_int32()

With tdb_parse_record we don't need malloc/SAFE_FREE.

The semantics are a bit different from tdb_parse_uint32: We just return
-1 on error, but this could be overloaded with a valid -1 record value.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Simplify tdb_fetch_uint32_t()
Volker Lendecke [Mon, 12 Apr 2021 08:29:02 +0000 (08:29 +0000)]
lib: Simplify tdb_fetch_uint32_t()

With tdb_parse_record() we don't need malloc/SAFE_FREE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Remove unused tdb_traverse_delete_fn()
Volker Lendecke [Mon, 12 Apr 2021 08:06:18 +0000 (08:06 +0000)]
lib: Remove unused tdb_traverse_delete_fn()

We have tdb_wipe_all() for that now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Fix nonempty line endings
Volker Lendecke [Sun, 11 Apr 2021 19:43:51 +0000 (21:43 +0200)]
lib: Fix nonempty line endings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Fix includes in util_tdb.h
Volker Lendecke [Fri, 9 Apr 2021 07:59:48 +0000 (07:59 +0000)]
lib: Fix includes in util_tdb.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agolib: Fix includes in strv.h
Volker Lendecke [Fri, 9 Apr 2021 07:59:26 +0000 (07:59 +0000)]
lib: Fix includes in strv.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 weeks agos3:script: Remove findsmb from default installation
Andreas Schneider [Mon, 19 Apr 2021 07:12:24 +0000 (09:12 +0200)]
s3:script: Remove findsmb from default installation

This tool is the only client tool which requires perl. Distributions are
removing perl from the default installation now.

Also this is a wrapper around nmblookup which is obsolete in the AD
world. However it might still be used by someone so move it just to
examples/scripts/nmb/

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Apr 19 14:37:04 UTC 2021 on sn-devel-184

3 weeks agos3: VFS: Remove SMB_VFS_NTIMES(), no longer used
Samuel Cabrero [Tue, 13 Apr 2021 16:00:29 +0000 (18:00 +0200)]
s3: VFS: Remove SMB_VFS_NTIMES(), no longer used

                         ---------------
                        /               \
                       /      REST       \
                      /        IN         \
                     /        PEACE        \
                    /                       \
                    |                       |
                    |     SMB_VFS_NTIMES    |
                    |                       |
                    |                       |
                    |       13 April        |
                    |         2021          |
                    |                       |
                    |                       |
                   *|     *  *  *           | *
          _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Mon Apr 19 13:19:35 UTC 2021 on sn-devel-184

3 weeks agos3: VFS: default: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:18:20 +0000 (17:18 +0200)]
s3: VFS: default: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: unityed_media: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:45:51 +0000 (17:45 +0200)]
s3: VFS: unityed_media: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: time_audit: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:45:12 +0000 (17:45 +0200)]
s3: VFS: time_audit: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: snapper: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:42:56 +0000 (17:42 +0200)]
s3: VFS: snapper: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: shadow_copy2: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:27:41 +0000 (17:27 +0200)]
s3: VFS: shadow_copy2: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: not_implemented: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:27:08 +0000 (17:27 +0200)]
s3: VFS: not_implemented: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: media_harmony: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:26:29 +0000 (17:26 +0200)]
s3: VFS: media_harmony: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agogpfswrap: Remove wrapper for gpfs_set_times_path()
Samuel Cabrero [Tue, 13 Apr 2021 15:25:39 +0000 (17:25 +0200)]
gpfswrap: Remove wrapper for gpfs_set_times_path()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: gpfs: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:23:49 +0000 (17:23 +0200)]
s3: VFS: gpfs: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: glusterfs: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:21:15 +0000 (17:21 +0200)]
s3: VFS: glusterfs: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: full_audit: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:20:35 +0000 (17:20 +0200)]
s3: VFS: full_audit: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: fruit: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:19:50 +0000 (17:19 +0200)]
s3: VFS: fruit: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: delay_inject: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:19:01 +0000 (17:19 +0200)]
s3: VFS: delay_inject: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: ceph_snapshots: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:17:35 +0000 (17:17 +0200)]
s3: VFS: ceph_snapshots: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: ceph: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:17:00 +0000 (17:17 +0200)]
s3: VFS: ceph: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: catia: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:16:02 +0000 (17:16 +0200)]
s3: VFS: catia: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3: VFS: cap: Remove SMB_VFS_NTIMES()
Samuel Cabrero [Tue, 13 Apr 2021 15:15:12 +0000 (17:15 +0200)]
s3: VFS: cap: Remove SMB_VFS_NTIMES()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>