asn/samba.git
4 years agos3:auth_sam: replace confusing FALL_THROUGH; with break;
Stefan Metzmacher [Thu, 23 Jan 2020 14:48:39 +0000 (15:48 +0100)]
s3:auth_sam: replace confusing FALL_THROUGH; with break;

There's no real logic change here, but is makes it easier to
understand.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agobootstrap: Remove un-used dependency python3-crypto
Andrew Bartlett [Fri, 13 Dec 2019 17:59:45 +0000 (06:59 +1300)]
bootstrap: Remove un-used dependency python3-crypto

This became unused in bbeef554f2c15e739f6095fcb57d9ef6646b411c
(except for repl_cleartext_pwd.py, a development script) and we now use
GnuTLS via a Samba wrapper.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:param: make sure secrets_db_connect() no longer creates on empty secrets.ldb
Stefan Metzmacher [Tue, 4 Feb 2020 15:16:48 +0000 (16:16 +0100)]
s4:param: make sure secrets_db_connect() no longer creates on empty secrets.ldb

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb  5 10:13:02 UTC 2020 on sn-devel-184

4 years agos4:param: make use of secrets_db_create() in provision_store_self_join()
Stefan Metzmacher [Tue, 4 Feb 2020 15:15:53 +0000 (16:15 +0100)]
s4:param: make use of secrets_db_create() in provision_store_self_join()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:param: add secrets_db_create() helper function
Stefan Metzmacher [Tue, 4 Feb 2020 15:14:55 +0000 (16:14 +0100)]
s4:param: add secrets_db_create() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli/nbt: avoid talloc_reference() in nbt_name_*_send()
Stefan Metzmacher [Thu, 8 Aug 2013 16:11:23 +0000 (18:11 +0200)]
libcli/nbt: avoid talloc_reference() in nbt_name_*_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server/lsa: remove some useless talloc_reference() calls
Stefan Metzmacher [Tue, 4 Feb 2020 15:09:46 +0000 (16:09 +0100)]
s4:rpc_server/lsa: remove some useless talloc_reference() calls

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli:smb: Improve check for gnutls_aead_cipher_(en|de)cryptv2
Andreas Schneider [Fri, 24 Jan 2020 15:34:42 +0000 (16:34 +0100)]
libcli:smb: Improve check for gnutls_aead_cipher_(en|de)cryptv2

This is available since version 3.6.10, but 3.6.10 has a bug which got fixed
in 3.6.11, see:

    https://gitlab.com/gnutls/gnutls/-/merge_requests/1085

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

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): Tue Feb  4 06:44:00 UTC 2020 on sn-devel-184

4 years agoselftest: simplify logic in setup_env
Douglas Bagnall [Sat, 7 Dec 2019 10:22:45 +0000 (23:22 +1300)]
selftest: simplify logic in setup_env

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: avoid comparison against undefined value
Douglas Bagnall [Sun, 2 Feb 2020 07:57:17 +0000 (20:57 +1300)]
selftest: avoid comparison against undefined value

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/target/samba: do not look for undef environment
Douglas Bagnall [Sat, 7 Dec 2019 10:20:29 +0000 (23:20 +1300)]
selftest/target/samba: do not look for undef environment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/target/samba: add missing methods
Douglas Bagnall [Sat, 7 Dec 2019 10:17:26 +0000 (23:17 +1300)]
selftest/target/samba: add missing methods

These methods are being called but have not been provided.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/s3: prefer empty string over undef to add nothing to config
Douglas Bagnall [Sat, 7 Dec 2019 10:08:48 +0000 (23:08 +1300)]
selftest/s3: prefer empty string over undef to add nothing to config

To fix a warning.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/s3: actually close parent copy of smbd's STDIN
Douglas Bagnall [Sat, 7 Dec 2019 10:05:03 +0000 (23:05 +1300)]
selftest/s3: actually close parent copy of smbd's STDIN

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/s4: remove illegal function signature
Douglas Bagnall [Sat, 7 Dec 2019 09:56:00 +0000 (22:56 +1300)]
selftest/s4: remove illegal function signature

The character ':' has no meaning in function signatures. Perhaps ';' was
intended, which would have marked the later arguments as optional --
which is the default with no signature. All callers always provide all
the arguments anyway.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/s4: don't put pcap file in / by default
Douglas Bagnall [Sat, 7 Dec 2019 09:48:42 +0000 (22:48 +1300)]
selftest/s4: don't put pcap file in / by default

If the SOCKET_WRAPPER_PCAP_DIR is not defined, let's assume it wasn't
wanted rather than choosing /.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/s4: properly initialise an empty hash
Douglas Bagnall [Sat, 7 Dec 2019 09:45:47 +0000 (22:45 +1300)]
selftest/s4: properly initialise an empty hash

The '%ret = {}' construction was bad because '{}' is a hash-ref, which
counts as a single scalar value, but a true hash like '%ret' must be
initialised with an even number of scalar values (usually in pairs, like
'($a => $b, $c => $d)').

I think this meant %ret was initialised as something harmless like
'(<HASH(0x55ce39781278)> => undef)'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: avoid redeclaring perl variables
Douglas Bagnall [Sat, 7 Dec 2019 09:38:30 +0000 (22:38 +1300)]
selftest: avoid redeclaring perl variables

None of these ones are doing any harm, we just want to silence these
warnings.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest/target/samba: avoid overwriting $pkinitdir
Douglas Bagnall [Sat, 7 Dec 2019 10:15:00 +0000 (23:15 +1300)]
selftest/target/samba: avoid overwriting $pkinitdir

We were declaring the same variable twice with two different paths,
"$cadir/Users/$pkinitprincipalname" here and
"$ctx->{prefix_abs}/pkinit" about 5 lines down.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: enable perl warnings
Douglas Bagnall [Sat, 7 Dec 2019 09:37:00 +0000 (22:37 +1300)]
selftest: enable perl warnings

After this we will see more noise with each test run, and these
warnings will be addressed in following commits.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agobuild: Do not check if system perl modules should be bundled
Andrew Bartlett [Sun, 2 Feb 2020 20:51:12 +0000 (09:51 +1300)]
build: Do not check if system perl modules should be bundled

We do not ship any perl modules in third_party at this time, so
this check is pointless and breaks the build for --bundled-libraries=ALL.

As reported by aaptel on https://gitlab.com/samba-team/samba/-/merge_requests/1104#note_281050331

This changes our autobuild script to cover this case in the
samba-static job.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agovfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls
Ralph Wuerthner [Tue, 28 Jan 2020 14:42:03 +0000 (15:42 +0100)]
vfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Mon Feb  3 21:53:05 UTC 2020 on sn-devel-184

4 years agovfs_gpfs: Remove discard_const_p() from gpfs_putacl() calls
Ralph Wuerthner [Tue, 28 Jan 2020 14:40:46 +0000 (15:40 +0100)]
vfs_gpfs: Remove discard_const_p() from gpfs_putacl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agovfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls
Ralph Wuerthner [Tue, 28 Jan 2020 14:33:47 +0000 (15:33 +0100)]
vfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_quotactl()
Ralph Wuerthner [Tue, 28 Jan 2020 13:50:19 +0000 (14:50 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_quotactl()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_get_winattrs_path()
Ralph Wuerthner [Tue, 28 Jan 2020 13:46:43 +0000 (14:46 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_get_winattrs_path()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_set_winattrs_path()
Ralph Wuerthner [Tue, 28 Jan 2020 13:44:24 +0000 (14:44 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_set_winattrs_path()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_get_realfilename_path()
Ralph Wuerthner [Tue, 28 Jan 2020 13:42:01 +0000 (14:42 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_get_realfilename_path()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_putacl()
Ralph Wuerthner [Tue, 28 Jan 2020 13:39:51 +0000 (14:39 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_putacl()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Make pathname "const char *" in gpfswrap_getacl()
Ralph Wuerthner [Tue, 28 Jan 2020 13:34:55 +0000 (14:34 +0100)]
gpfswrap: Make pathname "const char *" in gpfswrap_getacl()

Update wrapper function to match the definition in gpfs.h.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agogpfswrap: Remove unused wrapper gpfswrap_getfilesetid()
Ralph Wuerthner [Fri, 31 Jan 2020 08:51:27 +0000 (09:51 +0100)]
gpfswrap: Remove unused wrapper gpfswrap_getfilesetid()

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoscript/release.sh: Don't use quotations any longer.
Karolin Seeger [Tue, 28 Jan 2020 10:48:53 +0000 (11:48 +0100)]
script/release.sh: Don't use quotations any longer.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Feb  3 12:45:39 UTC 2020 on sn-devel-184

4 years agopidl/wscript: configure should insist on Parse::Yapp::Driver
Douglas Bagnall [Sun, 2 Feb 2020 03:05:38 +0000 (16:05 +1300)]
pidl/wscript: configure should insist on Parse::Yapp::Driver

following 83ffe6752d589180eac96d7b8e7d1a54e3476bfd, you get a build
error if you lack a system perl Parse::Yapp. Let's make it a configure
failure instead.

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): Sun Feb  2 10:09:11 UTC 2020 on sn-devel-184

4 years agos3: VFS: Implement create_dfs_pathat() in catia.
Jeremy Allison [Tue, 28 Jan 2020 22:59:46 +0000 (14:59 -0800)]
s3: VFS: Implement create_dfs_pathat() in catia.

Now we use this instead of symlinks to create
DFS links, it's needed in cap.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jan 30 18:21:47 UTC 2020 on sn-devel-184

4 years agos3: VFS: Implement create_dfs_pathat() in catia.
Jeremy Allison [Tue, 28 Jan 2020 22:42:49 +0000 (14:42 -0800)]
s3: VFS: Implement create_dfs_pathat() in catia.

Now we use this instead of symlinks to create
DFS links, it's needed in catia.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4:torture: Skip the deltest20 as user root
Andreas Schneider [Thu, 30 Jan 2020 15:18:25 +0000 (16:18 +0100)]
s4:torture: Skip the deltest20 as user root

The test is meant to be run as a user and not root.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 30 16:54:33 UTC 2020 on sn-devel-184

4 years agoctdb-test: Fix a typo
Volker Lendecke [Tue, 28 Jan 2020 16:42:13 +0000 (17:42 +0100)]
ctdb-test: Fix a typo

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): Thu Jan 30 13:53:22 UTC 2020 on sn-devel-184

4 years agolibsmb: Fix a typo
Volker Lendecke [Thu, 23 Jan 2020 20:23:03 +0000 (21:23 +0100)]
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoauth3: Fix a typo
Volker Lendecke [Mon, 27 Jan 2020 15:43:24 +0000 (16:43 +0100)]
auth3: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolib: Align integer types
Volker Lendecke [Fri, 24 Jan 2020 10:49:58 +0000 (11:49 +0100)]
lib: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli: Align integer types
Volker Lendecke [Tue, 28 Jan 2020 14:39:29 +0000 (15:39 +0100)]
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agopassdb: Use struct allocation
Volker Lendecke [Mon, 27 Jan 2020 16:00:59 +0000 (17:00 +0100)]
passdb: Use struct allocation

Give the compiler more info

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:torture: Convert samba4.base.charset test to smb2
David Mulder [Tue, 10 Dec 2019 19:06:13 +0000 (12:06 -0700)]
s4:torture: Convert samba4.base.charset test to smb2

The partial surrogate test is known to fail (in
both smb1 and smb2).

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Jan 30 12:05:13 UTC 2020 on sn-devel-184

4 years agoselftest: Exit skipped daemons on close(STDIN)
Volker Lendecke [Tue, 28 Jan 2020 13:46:09 +0000 (14:46 +0100)]
selftest: Exit skipped daemons on close(STDIN)

Without this, teardown_env() will take ages for environments with
skipped daemons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan 29 11:06:53 UTC 2020 on sn-devel-184

4 years agoselftest: Close STDIN_PIPE's write end for skipped daemons
Volker Lendecke [Tue, 28 Jan 2020 13:41:11 +0000 (14:41 +0100)]
selftest: Close STDIN_PIPE's write end for skipped daemons

Without this, any environment that skips any daemon will not shut down
properly. If a copy of a pipe's write end remains, closing one of them
won't cause the read end to be readable, i.e. the daemons waiting for
that won't exit properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolib: asn1.c: Prevent ASN1_ENUMERATED from wrapping.
Jeremy Allison [Thu, 23 Jan 2020 21:59:18 +0000 (13:59 -0800)]
lib: asn1.c: Prevent ASN1_ENUMERATED from wrapping.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 29 01:02:04 UTC 2020 on sn-devel-184

4 years agolib/util: use better linux os detection in gpfs configure
Günther Deschner [Mon, 27 Jan 2020 20:39:20 +0000 (21:39 +0100)]
lib/util: use better linux os detection in gpfs configure

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Christof Schmitt cs@samba.org
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 28 18:05:34 UTC 2020 on sn-devel-184

4 years agoctdb-tests: Enable job control when keeping stdin open
Martin Schwenke [Mon, 13 Jan 2020 23:58:15 +0000 (10:58 +1100)]
ctdb-tests: Enable job control when keeping stdin open

POSIX says:

  If job control is disabled (see set, -m), the standard input for an
  asynchronous list, before any explicit redirections are performed,
  shall be considered to be assigned to a file that has the same
  properties as /dev/null. This shall not happen if job control is
  enabled. In all cases, explicit redirection of standard input shall
  override this activity.

ctdbd is backgrounded at startup, so the above causes stdin to be
redirected from /dev/null.  Enable job control to work around this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jan 28 11:24:35 UTC 2020 on sn-devel-184

4 years agoctdb-tests: Don't close stdin when starting local daemons
Martin Schwenke [Mon, 13 Jan 2020 10:04:24 +0000 (21:04 +1100)]
ctdb-tests: Don't close stdin when starting local daemons

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-daemon: Shut down if interactive and stdin is closed
Martin Schwenke [Mon, 13 Jan 2020 10:04:54 +0000 (21:04 +1100)]
ctdb-daemon: Shut down if interactive and stdin is closed

This allows a test environment to simply close its end of a pipe to
cleanly shutdown ctdbd.  Like in smbd, this is only done if stdin is a
pipe or a socket.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-daemon: Only stop monitoring if it has been initialised
Martin Schwenke [Mon, 13 Jan 2020 10:13:32 +0000 (21:13 +1100)]
ctdb-daemon: Only stop monitoring if it has been initialised

This avoids a crash if ctdb_shutdown_sequence() is called before
monitoring is initialised.

Switch to using TALLOC_FREE() while touching this function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agolib:util: Log mkdir error on correct debug levels
Andreas Schneider [Mon, 27 Jan 2020 13:58:10 +0000 (14:58 +0100)]
lib:util: Log mkdir error on correct debug levels

For smbd we want an error and for smbclient we only want it in NOTICE
debug level.
The default log level of smbclient is log level 1 so we need notice to
not spam the user.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Jan 27 15:55:24 UTC 2020 on sn-devel-184

4 years agoselftest: Convert Samba3::provision() to named parameters
Volker Lendecke [Fri, 24 Jan 2020 09:45:52 +0000 (10:45 +0100)]
selftest: Convert Samba3::provision() to named parameters

9 positional parameters is a bit too much for easy overview

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agoselftest: Factor out create_file_chmod()
Volker Lendecke [Thu, 23 Jan 2020 15:07:59 +0000 (16:07 +0100)]
selftest: Factor out create_file_chmod()

24 lines less perl :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agokrb5-wrap: deal with different krb5_trace_info struct flavors (earlier MIT krb5 releases)
Günther Deschner [Thu, 23 Jan 2020 14:31:27 +0000 (15:31 +0100)]
krb5-wrap: deal with different krb5_trace_info struct flavors (earlier MIT krb5 releases)

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 24 20:38:53 UTC 2020 on sn-devel-184

4 years agonsswitch:tests: Add test to check correct group lookup with samlogon cache
Andreas Schneider [Wed, 15 Jan 2020 15:29:24 +0000 (16:29 +0100)]
nsswitch:tests: Add test to check correct group lookup with samlogon cache

TEST FOR: https://bugzilla.samba.org/show_bug.cgi?id=14124

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 24 17:18:38 UTC 2020 on sn-devel-184

4 years agoselftest: Make 'Samba Users' the primary group of joe
Andreas Schneider [Wed, 15 Jan 2020 13:41:37 +0000 (14:41 +0100)]
selftest: Make 'Samba Users' the primary group of joe

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
4 years agoselftest: Add a group 'Samba Users'
Andreas Schneider [Wed, 15 Jan 2020 13:41:13 +0000 (14:41 +0100)]
selftest: Add a group 'Samba Users'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
4 years agoselftest: Add user joe
Andreas Schneider [Wed, 15 Jan 2020 13:39:56 +0000 (14:39 +0100)]
selftest: Add user joe

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
4 years agonsswitch: Fix username in wbinfo -K output
Andreas Schneider [Wed, 15 Jan 2020 14:30:24 +0000 (15:30 +0100)]
nsswitch: Fix username in wbinfo -K output

We should not print the password if specified via the command line.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
4 years agotdb: Align integer types
Volker Lendecke [Wed, 22 Jan 2020 10:47:55 +0000 (11:47 +0100)]
tdb: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 23 20:41:46 UTC 2020 on sn-devel-184

4 years agodbwrap: Do direct struct initalization in db_ctdb_store_db_seqnum()
Volker Lendecke [Mon, 20 Jan 2020 13:06:11 +0000 (14:06 +0100)]
dbwrap: Do direct struct initalization in db_ctdb_store_db_seqnum()

Save a few lines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc: Use PRIu32 printf specifiers
Volker Lendecke [Wed, 22 Jan 2020 09:21:17 +0000 (10:21 +0100)]
librpc: Use PRIu32 printf specifiers

Both values printed are uint32_t's

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbclient: Fix a typo
Volker Lendecke [Wed, 15 Jan 2020 12:11:20 +0000 (13:11 +0100)]
smbclient: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc: Use the MAX() macro where appropriate
Volker Lendecke [Tue, 21 Jan 2020 12:20:07 +0000 (13:20 +0100)]
librpc: Use the MAX() macro where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc: Fix a gcc warning
Volker Lendecke [Tue, 21 Jan 2020 12:17:13 +0000 (13:17 +0100)]
librpc: Fix a gcc warning

gcc does not like const before static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Call string_term_tdb_data() once instead of 6 times
Volker Lendecke [Wed, 22 Jan 2020 15:14:01 +0000 (16:14 +0100)]
smbd: Call string_term_tdb_data() once instead of 6 times

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: lib: nmblib. Clean up and harden nmb packet processing.
Jeremy Allison [Fri, 17 Jan 2020 21:49:48 +0000 (13:49 -0800)]
s3: lib: nmblib. Clean up and harden nmb packet processing.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14239
OSS-FUZZ: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20156
OSS-FUZZ: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20157

Credit to oss-fuzz.
No security implications.

Signed-off-by: Jeremy Allison <jra@samba.org>
Pair programmed with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 21 23:33:41 UTC 2020 on sn-devel-184

4 years agovfs_gpfs: Preserve errno across unbecome_root call
Christof Schmitt [Thu, 16 Jan 2020 21:15:15 +0000 (14:15 -0700)]
vfs_gpfs: Preserve errno across unbecome_root call

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Remove unused define
Christof Schmitt [Thu, 16 Jan 2020 20:50:03 +0000 (13:50 -0700)]
smbd: Remove unused define

CAP_LEASE is not used in the file oplock_linux.c, so remove it there.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Remove unused function linux_set_lease_capability
Christof Schmitt [Thu, 16 Jan 2020 20:45:54 +0000 (13:45 -0700)]
smbd: Remove unused function linux_set_lease_capability

This function is no longer used. In case this capability would be
required, set_effective_capability(LEASE_CAPABILITY) could also be
called directly.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: Cleanup lease mapping function
Christof Schmitt [Thu, 16 Jan 2020 19:18:46 +0000 (12:18 -0700)]
vfs_gpfs: Cleanup lease mapping function

Shorten the function a bit by directly returning the mapped value.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: Change lease helper function to only provide mapping
Christof Schmitt [Thu, 16 Jan 2020 19:17:46 +0000 (12:17 -0700)]
vfs_gpfs: Change lease helper function to only provide mapping

The set_gpfs_lease function first maps the lease argument to the GPFS
version and then issues the API call. Change this to only do the mapping
in the helper function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: Remove function call from "if" statement
Christof Schmitt [Thu, 16 Jan 2020 19:15:29 +0000 (12:15 -0700)]
vfs_gpfs: Remove function call from "if" statement

Follow the current coding guidelines to first issue the function call
and then check the return code.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: Reformat function definition of vfs_gpfs_setlease
Christof Schmitt [Thu, 16 Jan 2020 19:13:46 +0000 (12:13 -0700)]
vfs_gpfs: Reformat function definition of vfs_gpfs_setlease

Remove trailing whitespace and put each argument on a seperate line.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: Remove call to linux_set_lease_capability
Christof Schmitt [Thu, 16 Jan 2020 19:12:53 +0000 (12:12 -0700)]
vfs_gpfs: Remove call to linux_set_lease_capability

The API call is already done as root user (become_root), so that the
lease contains the root user. The lease capability is already implied by
the root user, so the explicit call to linux_set_lease_capability is not
required.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoscript/release.sh: make it possible to run from a git worktree
Stefan Metzmacher [Tue, 21 Jan 2020 18:25:00 +0000 (19:25 +0100)]
script/release.sh: make it possible to run from a git worktree

.git is a regular file in that case.

Also check that script/release.sh is present as a relative path
to ensure we're called from the expected location.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoWHATSNEW: Start release notes for Samba 4.13.0pre1.
Stefan Metzmacher [Tue, 21 Jan 2020 13:51:34 +0000 (14:51 +0100)]
WHATSNEW: Start release notes for Samba 4.13.0pre1.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 21 16:04:29 UTC 2020 on sn-devel-184

4 years agoVERSION: Bump version up to 4.13.0pre1...
Stefan Metzmacher [Tue, 21 Jan 2020 13:23:45 +0000 (14:23 +0100)]
VERSION: Bump version up to 4.13.0pre1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoVERSION: Disable GIT_SNAPSHOT for the 4.12.0rc1 release...
Stefan Metzmacher [Tue, 21 Jan 2020 13:21:50 +0000 (14:21 +0100)]
VERSION: Disable GIT_SNAPSHOT for the 4.12.0rc1 release...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agoWHATSNEW: Add release note for Samba 4.12.0rc1.
Stefan Metzmacher [Tue, 21 Jan 2020 13:20:22 +0000 (14:20 +0100)]
WHATSNEW: Add release note for Samba 4.12.0rc1.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agosamba-tool group addmembers: avoid python traceback on member add failure
Björn Baumbach [Tue, 21 Jan 2020 12:56:29 +0000 (13:56 +0100)]
samba-tool group addmembers: avoid python traceback on member add failure

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoselftest: add test for samba-tool groupmember --member-base-dn option
Björn Baumbach [Mon, 30 Dec 2019 15:14:52 +0000 (16:14 +0100)]
selftest: add test for samba-tool groupmember --member-base-dn option

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoselftest: add tests for samba-tool group addmembers --object-types option
Björn Baumbach [Wed, 18 Dec 2019 14:09:16 +0000 (15:09 +0100)]
selftest: add tests for samba-tool group addmembers --object-types option

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoselftest: add test for new samba-tool group addmembers --member-dn option
Björn Baumbach [Wed, 18 Dec 2019 09:43:22 +0000 (10:43 +0100)]
selftest: add test for new samba-tool group addmembers --member-dn option

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool group addmembers: add --member-base-dn option for group member search
Björn Baumbach [Mon, 30 Dec 2019 13:54:32 +0000 (14:54 +0100)]
samba-tool group addmembers: add --member-base-dn option for group member search

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool group {add,remove}members: allow to use --member-dn in combination with...
Björn Baumbach [Wed, 18 Dec 2019 12:35:16 +0000 (13:35 +0100)]
samba-tool group {add,remove}members: allow to use --member-dn in combination with listofmembers

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool group removemembers: adapt functionality to addmembers command
Björn Baumbach [Tue, 17 Dec 2019 15:27:32 +0000 (16:27 +0100)]
samba-tool group removemembers: adapt functionality to addmembers command

Adds --member-dn and --object-types options.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool group addmembers: add --member-dn option
Björn Baumbach [Tue, 17 Dec 2019 15:26:23 +0000 (16:26 +0100)]
samba-tool group addmembers: add --member-dn option

The --member-dn option allows to specify an object by it's DN.

This is required to select a specific object if there are more than one
with the same name. Multiple contacts can exist with the same name in
different OUs.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool group addmembers: add new option --object-types
Björn Baumbach [Fri, 9 Aug 2019 15:07:07 +0000 (17:07 +0200)]
samba-tool group addmembers: add new option --object-types

With this option the admin can specify the object types of the group
members which will be added to the group. The search filter for the objects
will be created according to the types.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: validation of group member types for group member filter
Björn Baumbach [Mon, 30 Dec 2019 12:57:26 +0000 (13:57 +0100)]
python/samdb: validation of group member types for group member filter

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: add type "all" to search for all common types of group members
Björn Baumbach [Mon, 30 Dec 2019 12:57:11 +0000 (13:57 +0100)]
python/samdb: add type "all" to search for all common types of group members

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: adapt search filter for group object type
Björn Baumbach [Fri, 9 Aug 2019 14:45:51 +0000 (16:45 +0200)]
python/samdb: adapt search filter for group object type

Use a group search filter which is similar to the filter which is used
by the basic MS Windows group membership management.

The filter excludes the group type GROUP_TYPE_BUILTIN_LOCAL_GROUP.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: adapt search filter for user object type
Björn Baumbach [Mon, 30 Dec 2019 15:27:59 +0000 (16:27 +0100)]
python/samdb: adapt search filter for user object type

Use a user search filter which is similar to the filter which is used
by the basic MS Windows group membership management.

The filter filters for objects with the sAMAccountType ATYPE_NORMAL_ACCOUNT.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: add 'computer' to the default group member types for group member filters
Björn Baumbach [Mon, 30 Dec 2019 15:24:23 +0000 (16:24 +0100)]
python/samdb: add 'computer' to the default group member types for group member filters

Add the 'computer' type to the default member types, so that the next
commit does not change the default behavior.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: fetch specific error if there are more than one search results
Björn Baumbach [Wed, 18 Dec 2019 16:15:13 +0000 (17:15 +0100)]
python/samdb: fetch specific error if there are more than one search results

There can be more than one contact with the same name.

Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: add more object types for adding/remove group members
Björn Baumbach [Fri, 9 Aug 2019 14:26:58 +0000 (16:26 +0200)]
python/samdb: add more object types for adding/remove group members

The filters are based on the MS Windows filter, which are used by the
basic group member management dialog.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agopython/samdb: add option to specify types of group members
Björn Baumbach [Fri, 9 Aug 2019 14:19:52 +0000 (16:19 +0200)]
python/samdb: add option to specify types of group members

The option can be used to specify the type of the object which have to
be added to (or removed) from a group. The search filter for the objects
will be created according to the types.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool tests: add test-case for 'ou list --base-dn'
Jule Anger [Tue, 27 Aug 2019 10:21:29 +0000 (12:21 +0200)]
samba-tool tests: add test-case for 'ou list --base-dn'

Check if the ou list --base-dn / -b command uses a specific base dn.

Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosamba-tool: add -b/--base-dn option to OUs list command
Jule Anger [Mon, 26 Aug 2019 08:25:18 +0000 (10:25 +0200)]
samba-tool: add -b/--base-dn option to OUs list command

With this option it's e.g. possible to list the OUs which are
located under a different specific place in the AD.

Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>