[Pkg-samba-maint] [Git][samba-team/samba][master] 2187 commits: VERSION: Bump version up to 4.13.0pre1...

Mathieu Parent gitlab at salsa.debian.org
Thu Nov 12 10:26:30 GMT 2020



Mathieu Parent pushed to branch master at Debian Samba Team / samba


Commits:
423ca5e3 by Stefan Metzmacher at 2020-01-21T14:38:47+00:00
VERSION: Bump version up to 4.13.0pre1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
71b57a0a by Stefan Metzmacher at 2020-01-21T16:04:29+00:00
WHATSNEW: Start release notes for Samba 4.13.0pre1.

Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

- - - - -
648f94d2 by Stefan Metzmacher at 2020-01-21T19:29:38+01:00
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 at samba.org>

- - - - -
22cd011b by Christof Schmitt at 2020-01-21T22:08:40+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d9c992a7 by Christof Schmitt at 2020-01-21T22:08:40+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
96252a0e by Christof Schmitt at 2020-01-21T22:08:41+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
49584782 by Christof Schmitt at 2020-01-21T22:08:41+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fed2c3ed by Christof Schmitt at 2020-01-21T22:08:41+00:00
vfs_gpfs: Cleanup lease mapping function

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

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6a19404e by Christof Schmitt at 2020-01-21T22:08:41+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
01e563be by Christof Schmitt at 2020-01-21T22:08:41+00:00
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 at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a39c4d9b by Christof Schmitt at 2020-01-21T22:08:41+00:00
vfs_gpfs: Preserve errno across unbecome_root call

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ad236bb7 by Jeremy Allison at 2020-01-21T23:33:41+00:00
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 at samba.org>
Pair programmed with: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jan 21 23:33:41 UTC 2020 on sn-devel-184

- - - - -
1393011b by Volker Lendecke at 2020-01-23T19:11:34+00:00
smbd: Call string_term_tdb_data() once instead of 6 times

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7b5edaeb by Volker Lendecke at 2020-01-23T19:11:34+00:00
librpc: Fix a gcc warning

gcc does not like const before static

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4864a4bb by Volker Lendecke at 2020-01-23T19:11:34+00:00
librpc: Use the MAX() macro where appropriate

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3c224ee2 by Volker Lendecke at 2020-01-23T19:11:34+00:00
smbclient: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a0b967ec by Volker Lendecke at 2020-01-23T19:11:34+00:00
librpc: Use PRIu32 printf specifiers

Both values printed are uint32_t's

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2d3cbc53 by Volker Lendecke at 2020-01-23T19:11:34+00:00
dbwrap: Do direct struct initalization in db_ctdb_store_db_seqnum()

Save a few lines

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4fca8d7a by Volker Lendecke at 2020-01-23T20:41:46+00:00
tdb: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Jan 23 20:41:46 UTC 2020 on sn-devel-184

- - - - -
96f319e0 by Andreas Schneider at 2020-01-24T15:46:42+00:00
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 at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>
- - - - -
b4a4adeb by Andreas Schneider at 2020-01-24T15:46:42+00:00
selftest: Add user joe

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>
- - - - -
227a8a11 by Andreas Schneider at 2020-01-24T15:46:42+00:00
selftest: Add a group 'Samba Users'

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>
- - - - -
6a10ab3f by Andreas Schneider at 2020-01-24T15:46:42+00:00
selftest: Make 'Samba Users' the primary group of joe

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>
- - - - -
91b68ac0 by Andreas Schneider at 2020-01-24T17:18:38+00:00
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 at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Jan 24 17:18:38 UTC 2020 on sn-devel-184

- - - - -
b2c13d9a by Günther Deschner at 2020-01-24T20:38:53+00:00
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 at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Jan 24 20:38:53 UTC 2020 on sn-devel-184

- - - - -
26da6f56 by Volker Lendecke at 2020-01-27T14:27:33+00:00
selftest: Factor out create_file_chmod()

24 lines less perl :-)

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
f9173c18 by Volker Lendecke at 2020-01-27T14:27:33+00:00
selftest: Convert Samba3::provision() to named parameters

9 positional parameters is a bit too much for easy overview

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
0ad6a243 by Andreas Schneider at 2020-01-27T15:55:24+00:00
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 at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Mon Jan 27 15:55:24 UTC 2020 on sn-devel-184

- - - - -
d79e2dcf by Martin Schwenke at 2020-01-28T09:57:32+00:00
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

- - - - -
cf460bd9 by Martin Schwenke at 2020-01-28T09:57:32+00:00
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

- - - - -
2380b13b by Martin Schwenke at 2020-01-28T09:57:33+00:00
ctdb-tests: Don't close stdin when starting local daemons

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

- - - - -
ea754bfd by Martin Schwenke at 2020-01-28T11:24:35+00:00
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Tue Jan 28 11:24:35 UTC 2020 on sn-devel-184

- - - - -
62098744 by Günther Deschner at 2020-01-28T18:05:34+00:00
lib/util: use better linux os detection in gpfs configure

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Christof Schmitt cs at samba.org

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Tue Jan 28 18:05:34 UTC 2020 on sn-devel-184

- - - - -
2d5b7c9a by Jeremy Allison at 2020-01-29T01:02:03+00:00
lib: asn1.c: Prevent ASN1_ENUMERATED from wrapping.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Douglas Bagnall <dbagnall at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jan 29 01:02:04 UTC 2020 on sn-devel-184

- - - - -
5bc5b681 by Volker Lendecke at 2020-01-29T09:36:27+00:00
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 at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3f0e0ee2 by Volker Lendecke at 2020-01-29T11:06:53+00:00
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 at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Jan 29 11:06:53 UTC 2020 on sn-devel-184

- - - - -
1bb16ff4 by David Mulder at 2020-01-30T12:05:13+00:00
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 at suse.com>
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Böhme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Thu Jan 30 12:05:13 UTC 2020 on sn-devel-184

- - - - -
21359f4f by Volker Lendecke at 2020-01-30T12:27:40+00:00
passdb: Use struct allocation

Give the compiler more info

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
bf531c24 by Volker Lendecke at 2020-01-30T12:27:40+00:00
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
30940e72 by Volker Lendecke at 2020-01-30T12:27:40+00:00
lib: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
9f2b131c by Volker Lendecke at 2020-01-30T12:27:40+00:00
auth3: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
168c6d9b by Volker Lendecke at 2020-01-30T12:27:40+00:00
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
3d40efae by Volker Lendecke at 2020-01-30T13:53:22+00:00
ctdb-test: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Jan 30 13:53:22 UTC 2020 on sn-devel-184

- - - - -
677bc1b1 by Andreas Schneider at 2020-01-30T16:54:33+00:00
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 at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Jan 30 16:54:33 UTC 2020 on sn-devel-184

- - - - -
fa2f83e1 by Jeremy Allison at 2020-01-30T16:55:45+00:00
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 at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
042249d9 by Jeremy Allison at 2020-01-30T18:21:47+00:00
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 at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu Jan 30 18:21:47 UTC 2020 on sn-devel-184

- - - - -
af47a776 by Douglas Bagnall at 2020-02-02T10:09:11+00:00
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 at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Sun Feb  2 10:09:11 UTC 2020 on sn-devel-184

- - - - -
f699df32 by Karolin Seeger at 2020-02-03T12:45:39+00:00
script/release.sh: Don't use quotations any longer.

Signed-off-by: Karolin Seeger <kseeger at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(master): Mon Feb  3 12:45:39 UTC 2020 on sn-devel-184

- - - - -
18c26641 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
gpfswrap: Remove unused wrapper gpfswrap_getfilesetid()

Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
3630ae22 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
4833f173 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
91be03a7 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
27a725f4 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
5d4ec2d7 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
bb0b3171 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
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 at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
508ae8ee by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
vfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
ea45cba9 by Ralph Wuerthner at 2020-02-03T20:27:37+00:00
vfs_gpfs: Remove discard_const_p() from gpfs_putacl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
6be818b4 by Ralph Wuerthner at 2020-02-03T21:53:05+00:00
vfs_gpfs: Remove discard_const_p() from gpfswrap_quotactl() calls

Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Reviewed-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Christof Schmitt <cs at samba.org>
Autobuild-Date(master): Mon Feb  3 21:53:05 UTC 2020 on sn-devel-184

- - - - -
cf498494 by Andrew Bartlett at 2020-02-04T05:13:39+00:00
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 at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
8f17d481 by Douglas Bagnall at 2020-02-04T05:13:39+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
467abee4 by Douglas Bagnall at 2020-02-04T05:13:39+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
6c4ee528 by Douglas Bagnall at 2020-02-04T05:13:39+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7a65a26a by Douglas Bagnall at 2020-02-04T05:13:39+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
18efb47a by Douglas Bagnall at 2020-02-04T05:13:40+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
314b59fb by Douglas Bagnall at 2020-02-04T05:13:40+00:00
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 at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
e50c5b80 by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest/s3: actually close parent copy of smbd's STDIN

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
213e237e by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest/s3: prefer empty string over undef to add nothing to config

To fix a warning.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d087f74d by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest/target/samba: add missing methods

These methods are being called but have not been provided.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7334d575 by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest/target/samba: do not look for undef environment

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
131bfc8c by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest: avoid comparison against undefined value

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
4258f805 by Douglas Bagnall at 2020-02-04T05:13:40+00:00
selftest: simplify logic in setup_env

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d459ca04 by Andreas Schneider at 2020-02-04T06:43:59+00:00
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 at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Feb  4 06:44:00 UTC 2020 on sn-devel-184

- - - - -
87ae154e by Stefan Metzmacher at 2020-02-05T08:46:38+00:00
s4:rpc_server/lsa: remove some useless talloc_reference() calls

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c80a51c6 by Stefan Metzmacher at 2020-02-05T08:46:39+00:00
libcli/nbt: avoid talloc_reference() in nbt_name_*_send()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
32f75621 by Stefan Metzmacher at 2020-02-05T08:46:39+00:00
s4:param: add secrets_db_create() helper function

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0344b92b by Stefan Metzmacher at 2020-02-05T08:46:39+00:00
s4:param: make use of secrets_db_create() in provision_store_self_join()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
6cbd7d1a by Stefan Metzmacher at 2020-02-05T10:13:02+00:00
s4:param: make sure secrets_db_connect() no longer creates on empty secrets.ldb

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Feb  5 10:13:02 UTC 2020 on sn-devel-184

- - - - -
446c9201 by Andrew Bartlett at 2020-02-05T16:30:42+00:00
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 at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
85b168c6 by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
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 at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
72ef8d3a by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
s3:auth_sam: unify the debug messages of all auth_sam*_auth() functions

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
01b8374e by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
s3:auth_sam: make sure we never handle empty usernames

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
a63e2a31 by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
s3:auth_sam: introduce effective_domain helper variables

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
a9eeea6e by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
s3:selftest: test authentication with an empty userdomain and upn names

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
590df382 by Stefan Metzmacher at 2020-02-05T16:30:42+00:00
s3:auth_sam: map an empty domain or '.' to the local SAM name

When a domain member gets an empty domain name or '.', it should
not forward the authentication to domain controllers of
the primary domain.

But we need to keep passing UPN account names with
an empty domain to the DCs as a domain member.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4d0bda94 by Stefan Metzmacher at 2020-02-05T17:56:58+00:00
winbindd: handling missing idmap in getgrgid()

A similar hunk was added via commit
89f753c1fc824fef29aebb7d783ab7e09cd1f04e ("winbind: Use xids2sids in getpwuid"),
but it was missing in commit
e2dda192e7f8b65a5f02120be56cf0f07d03679f ("winbind: Use xids2sids in getgrgid")

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Feb  5 17:56:58 UTC 2020 on sn-devel-184

- - - - -
52722746 by Andreas Schneider at 2020-02-06T07:30:13+00:00
wafsamba: Do not use 'rU' as the 'U' is deprecated in Python 3.9

See https://docs.python.org/3.9/whatsnew/3.9.html#changes-in-the-python-api

"open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U'
(“universal newline”) in the file mode. This flag was deprecated since Python
3.3. In Python 3, the “universal newline” is used by default when a file is
open in text mode. The newline parameter of open() controls how universal
newlines works."

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Feb  6 07:30:13 UTC 2020 on sn-devel-184

- - - - -
e6e722ab by Ralph Boehme at 2020-02-06T10:17:42+00:00
smbd: setting current_user stuff here is redundant

This is already handled by set_sec_ctx() below, we just have to pass in the
values instead of setting it here in this function before calling set_sec_ctx().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
276d280d by Ralph Boehme at 2020-02-06T10:17:42+00:00
lib/util: add talloc_alpha_strcpy()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
5e35d30b by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/auth: use talloc_alpha_strcpy() in create_local_token()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2b230321 by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3:auth: use talloc_alpha_strcpy() in auth3_session_info_create()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
1a8e6271 by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/lib: use talloc_alpha_strcpy() in set_local_machine_name()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
e3cd8e46 by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/lib: use talloc_alpha_strcpy() in set_remote_machine_name()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f8e218ac by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/lib: use talloc_alpha_strcpy() in sub_set_smb_name()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
a6054e2b by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/rpc_server: use talloc_alpha_strcpy() in _winreg_InitiateSystemShutdownEx()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
d1b2254f by Ralph Boehme at 2020-02-06T10:17:43+00:00
s4/auth: use talloc_alpha_strcpy() in auth_session_info_fill_unix()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
dbe7d139 by Ralph Boehme at 2020-02-06T10:17:43+00:00
smbd: remove sub_set_smb_name()/reload_services()

This means switching auth backend based on %U include, ie

  passdb backend = tdbsam
  include = smb.conf.%U

and smb.conf.SOMEUSER contains

  passdb backend = smbpasswd

won't work anymore.

We're still calling set_current_user_info() and reload_services() later on
in this function, so everything else still works as before.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
1484fb0c by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/rpc_server/netlogon: use set_current_user_info() in _netr_LogonSamLogon_base()

Note that we're now sanitizing the username we got from the client, as we do
everywhere else.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
dc4b1e39 by Ralph Boehme at 2020-02-06T10:17:43+00:00
s3/auth: use set_current_user_info() in auth3_generate_session_info_pac()

This delays reloading config slightly, but I don't see how could affect
observable behaviour other then log messages coming from the functions in
between the different locations for lp_load_with_shares() like
make_session_info_krb5() are sent to a different logfile if "log file" uses %U.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
92499287 by Ralph Boehme at 2020-02-06T10:17:44+00:00
s3/auth: use set_current_user_info() in auth3_check_password_send()

This delays reloading config slightly, but I don't see how could affect
observable behaviour other then log messages coming from the functions in
between the different locations for lp_load_with_shares() like
make_user_info_map() are sent to a different logfile if "log file" uses %U.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
8bfa0d58 by Ralph Boehme at 2020-02-06T10:17:44+00:00
s3/lib: RIP smb_user_name

This has been replaced in previous commits by consistently using
current_user_info.smb_name.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f705629a by Ralph Boehme at 2020-02-06T11:44:07+00:00
smbd: avoid double chdir() in chdir_current_service()

Since 8e81090789e4cc3ba9e5aa792d4e52971909c894 we're doing chdir() twice, first
into conn->connectpath, then into conn->origpath.

Before commit 8e81090789e4cc3ba9e5aa792d4e52971909c894 if
chdir(conn->connectpath) succeeded, we wouldn't do the second chdir().

While at it, simplify the logging logic: if chdir() fails in this core function,
just always log is as error including the unix token.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14256
RN: smbd does a chdir() twice per request

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Feb  6 11:44:07 UTC 2020 on sn-devel-184

- - - - -
8b80145a by Stefan Metzmacher at 2020-02-06T14:57:41+00:00
s4:torture: make rpc.handles.random-assoc test even more robust

This improves commit bebee47e6386476e9948089484f89d213fcc2660 a bit
further.

I just got this:

  connect samr pipe1
  use assoc_group_id[0x00000001] for new connections
  connect lsa pipe2
  got assoc_group_id[0x00000001] for p2
  samr_Connect to open a policy handle on samr p1
  use policy handle on lsa p2 - should fail
  closing policy handle on samr p1
  connect samr pipe3 - should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL
  connect lsa pipe4 - should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ab for ncacn_np:localdc[\pipe\lsarpc,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ab/0x00000000] NT_STATUS_UNSUCCESSFUL
  connect samr pipe5 with assoc_group_id[0xFFFFFFFF]- should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0xffffffff,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL
  connect lsa pipe6 with assoc_group_id[0x00000000]- should fail
  UNEXPECTED(failure): samba4.rpc.handles on ncacn_np with validate.mixed-shared(ad_dc_ntvfs)
  REASON: Exception: Exception: ../../source4/torture/rpc/handles.c:500: status was NT_STATUS_OK, expected NT_STATUS_UNSUCCESSFUL: opening lsa pipe6
  FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)
  A summary with detailed information can be found in:

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
cc7b909b by Stefan Metzmacher at 2020-02-06T14:57:41+00:00
s3:rpclient: simplify rpc_tstream_next_vector()

We always now how many bytes our caller requires,
so there's no need to use tstream_pending_bytes().

This makes it possible to read socket_wrapper generated
captures again, as wireshark requires the fixed (16 bytes) DCERPC
header to be in one TCP packet.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
c48ae9cf by Stefan Metzmacher at 2020-02-06T14:57:41+00:00
selftest: force LC_ALL=en_US.utf8 LANG=en_US.utf8

That makes sure we have the same as on gitlab runners
(see bootstrap/config.py).

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
4effc558 by Stefan Metzmacher at 2020-02-06T14:57:42+00:00
selftest: move {setup,cleanup}_pcap() to selftest/target/Samba.pm

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
f182c9a3 by Stefan Metzmacher at 2020-02-06T14:57:42+00:00
selftest: create pcap files for invidual env services

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
7d1b5608 by Stefan Metzmacher at 2020-02-06T14:57:42+00:00
selftest: create a pcap file for the environment setup

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
76e12067 by Stefan Metzmacher at 2020-02-06T14:57:42+00:00
smb2_server: use sendmsg/recvmsg instead of writev/readv

This avoids a few function calls inside the kernel
in order to reach sock_sendmsg() quicker:

    entry_SYSCALL_64_after_hwframe
       do_syscall_64
          __x64_sys_writev
             do_writev
                vfs_writev
                   do_iter_write
                      do_iter_readv_writev
                         sock_write_iter
                            sock_sendmsg

    entry_SYSCALL_64_after_hwframe
       do_syscall_64
          __x64_sys_sendmsg
             __sys_sendmsg
                ___sys_sendmsg
                   sock_sendmsg

As a side effect it will be useful for SMB-Direct invalidation
messages via msg->msg_control and CMSG_*.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
d3b385d5 by Andrew Bartlett at 2020-02-06T14:57:42+00:00
source4/scripting/bin: Swap machine account password scripts

I regularly get requests for my simple script to print the
password from the secrets.tdb (or secrets.ldb on the AD DC).

This removes the old script that only reads the secrets.ldb.

Neither new nor old script has tests, however it seems
better to have it in the tree where it can be found rather
that me digging it out of my outbound e-mail.

Originally posted here:
 https://lists.samba.org/archive/samba/2017-November/212362.html

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
3657bbc2 by Andrew Bartlett at 2020-02-06T14:57:42+00:00
dsdb: Correctly handle memory in objectclass_attrs

el->values is caller-provided memory that should be thought of as constant,
it should not be assumed to be a talloc context.

Otherwise, if the caller gives constant memory or a stack
pointer we will get an abort() in talloc when it expects
a talloc magic in the memory preceeding the el->values.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
c8e3c78d by Andrew Bartlett at 2020-02-06T16:24:25+00:00
selftest: Test behaviour of DNS scavenge with an existing dNSTombstoned value

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu Feb  6 16:24:25 UTC 2020 on sn-devel-184

- - - - -
ae6927e4 by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr: Heap-buffer-overflow in lzxpress_decompress

Reproducer for oss-fuzz Issue 20083

Project: samba
Fuzzing Engine: libFuzzer
Fuzz Target: fuzz_ndr_drsuapi_TYPE_OUT
Job Type: libfuzzer_asan_samba
Platform Id: linux

Crash Type: Heap-buffer-overflow READ 1
Crash Address: 0x6040000002fd
Crash State:
  lzxpress_decompress
    ndr_pull_compression_xpress_chunk
      ndr_pull_compression_start

Sanitizer: address (ASAN)

Recommended Security Severity: Medium

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
46edde86 by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr tests: uint32 overflow in NDR_PULL_ALIGN

Check that uint32 overflow is handled correctly by NDR_NEED_BYTES.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
6d05fb3e by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr: NDR_PULL_ALIGN check for unsigned overflow

Handle uint32 overflow in NDR_PULL_ALIGN

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d1277f4d by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr tests: Unsigned overflow in ndr_pull_advance

Check that uint32 overflow is handled correctly by ndr_pull_advance.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
14182350 by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr: ndr_pull_advance check for unsigned overflow.

Handle uint32 overflow in ndr_pull_advance

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
490bbb96 by Gary Lockyer at 2020-02-07T08:53:40+00:00
libprc ndr tests: Fix ndrdump test ntlmssp_CHALLENGE_MESSAGE

Fix the expected data in fuzzed_ntlmssp-CHALLENGE_MESSAGE.txt, as it
contained source code line numbers.

Andrew this test needs to be altered to us a regular expression and
remove the dependency on source line numbers.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
91d4e79c by Gary Lockyer at 2020-02-07T08:53:40+00:00
librpc ndr: Change loop index to size_t

Change the loop index in ndr_check_padding to size_t.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3bc7acc6 by Douglas Bagnall at 2020-02-07T10:19:39+00:00
nmblib: avoid undefined behaviour in handle_name_ptrs()

If *offset is length - 1, we would read ubuf[(*offset)+1] as the lower
bits of the new *offset. This value is undefined, but because it is
checked against the valid range, there is no way to read further
beyond that one byte.

Credit to oss-fuzz.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14242
OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20193

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Feb  7 10:19:39 UTC 2020 on sn-devel-184

- - - - -
c247afbd by Douglas Bagnall at 2020-02-07T10:37:37+00:00
pytests: heed assertEquals deprecation warning en-masse

TestCase.assertEquals() is an alias for TestCase.assertEqual() and
has been deprecated since Python 2.7.

When we run our tests with in python developer mode (`PYTHONDEVMODE=1
make test`) we get 580 DeprecationWarnings about this.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
07fa6678 by Douglas Bagnall at 2020-02-07T10:37:37+00:00
python: use raw string for regex with escape

Python regards 'GPT\.INI$' as a string containing an invalid escape
sequence '\.', which is ignored (i.e. treated as the literal sequence
of those 2 characters), but only after Python has grumbled to itself,
and to you if you enabled DeprecationWarnings.

The proper thing to do here is use r-strings, like r'GPT\.INI$', which
tell Python that all backslashes are literal. Alternatively (as we do
once in this patch), the backslash can itself be escaped ('\\').

There are more problems of this nature in the build scripts.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
beb829d0 by Douglas Bagnall at 2020-02-07T12:03:34+00:00
samba-tool gpo: tighter matching for ini names

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Noel Power <npower at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Fri Feb  7 12:03:34 UTC 2020 on sn-devel-184

- - - - -
3894f878 by Stefan Metzmacher at 2020-02-07T13:48:27+00:00
libcli:smb: Don't use forward declartions for GnuTLS typedefs

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Feb  7 13:48:27 UTC 2020 on sn-devel-184

- - - - -
daaf550e by Andreas Schneider at 2020-02-07T17:00:42+00:00
s3:lib: Use a static buffer for (local|remote)_machine

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7a7b597b by Andreas Schneider at 2020-02-07T17:00:42+00:00
s3:lib: Remove unneded call to set_local_machine_name()

We return the netbios name by default if not set.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
859a86b3 by Jeremy Allison at 2020-02-07T18:26:15+00:00
s3: lib: Now remote_machine is static, we can depend on it being non-NULL..

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Feb  7 18:26:15 UTC 2020 on sn-devel-184

- - - - -
149217ce by Volker Lendecke at 2020-02-07T21:01:30+00:00
libsmb: Remove "const" from smb_create_blob->tag

I want to TALLOC_FREE that soon, and we do a talloc_strdup into this anyway.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
298dbc53 by Volker Lendecke at 2020-02-07T21:01:30+00:00
libsmb: Add required includes to smb2_create_blob.h

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
76803ecc by Volker Lendecke at 2020-02-07T21:01:30+00:00
libsmb: Add required #includes to smb_util.h

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d33d43f3 by Volker Lendecke at 2020-02-07T21:01:30+00:00
libsmb: Add posix create context definition

Pair programmed with: Jeremy Allison <jra at samba.org>
Signed-off-by: Volker Lendecke <vl at samba.org>

- - - - -
23db7315 by Volker Lendecke at 2020-02-07T21:01:30+00:00
libsmb: Allow passing in NULL to smb2_create_blob_find()

Will simplify callers a bit, and it does not change semantics
significantly. Zero create blobs won't find anything anyway.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f6fe7c39 by Volker Lendecke at 2020-02-07T21:01:31+00:00
libsmb: Add smb2_create_blob_remove()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
54bd2716 by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Ignore incoming POSIX create context

We will use this internally and can only expose this once SMB3.11 unix
extensions are activated for the client.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8047876f by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Add make_smb2_posix_create_ctx()

Will be used internally to pass an artificial posix create context
into VFS_CREATE_FILE from the SMB1 unix extension calls

Pair programmed with: Jeremy Allison <jra at samba.org>
Signed-off-by: Volker Lendecke <vl at samba.org>

- - - - -
4776456c by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Make unix_perms_from_wire() public

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3b92cbdf by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Add a "done:" exit for get_posix_fsp()

We'll have another exit with the next commit

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5bdad0fb by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Add posix create ctx to CREATE_FILE for posix operations

This will replace overloading file attributes

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e0814dc5 by Volker Lendecke at 2020-02-07T21:01:31+00:00
smbd: Allow a Posix create context to override the unix mode

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2d9841c9 by Volker Lendecke at 2020-02-07T22:27:48+00:00
smbd: Remove overriding file_attributes with unix_mode in the VFS

Internally to open.c this is still used, but that can go away next.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Feb  7 22:27:48 UTC 2020 on sn-devel-184

- - - - -
0737849b by Martin Schwenke at 2020-02-10T04:07:38+00:00
Revert "ctdb-tests: Enable job control when keeping stdin open"

This doesn't work when stdin is not a tty.

This reverts commit ea754bfdec9d537c500036d4d521bd41d34c0835.

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

- - - - -
8de1bb75 by Martin Schwenke at 2020-02-10T04:07:38+00:00
ctdb-tests: Redirect stdin from /dev/null when running a test

Otherwise, if the test is run via ssh it will "unexpectedly" find
itself at the other end of a pipe.

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

- - - - -
3509aa28 by Martin Schwenke at 2020-02-10T04:07:38+00:00
ctdb-tests: Don't actually close stdin in fake ssh

A subsequent file descriptor allocation may return 0 and unexpected
things may then happen.

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

- - - - -
cefb3327 by Martin Schwenke at 2020-02-10T04:07:38+00:00
ctdb-daemon: Pass more information to ctdb_start_daemon()

No functional changes.

This is staging for a change that makes ctdbd fork when test mode is
enabled but interactive is not set.

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

- - - - -
a220e945 by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-daemon: Make some conditions more explicit

These don't need to depend on do_fork.  Child logging should be set up
whenever the daemon is not interactive.  The stdin handler should be
setup whenever test mode is enabled.

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

- - - - -
1a0e1f89 by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-daemon: Fork when not interactive and test mode is enabled

There is no sane way of keeping stdin open when using the shell to
background ctdbd in local_daemons.sh.  Instead, have ctdbd fork when
not interactive and when test mode is enabled.  become_daemon() can't
be used for this: if it forks then it also closes stdin.

For the interactive case, become_daemon() wasn't doing anything
special, so do nothing instead.

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

- - - - -
b0b14e4e by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-tests: Make $ctdb_dir absolute

This is used to set several variables so it might as well be cd-proof.

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

- - - - -
3b0b830e by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-tests: Use $PWD/bin/ if it exists when running in-tree

When running tests from a top-level build, a stale build in ctdb/bin/
will be preferred and may cause confusing results.

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

- - - - -
39206fd3 by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-tools: When in test mode set process group in top-level ctdb tool

If ctdbd hangs when shutting down in post-test clean-up then killing
the process group can kill the test.  When in test mode, create a
process group but only in the top-level ctdb tool - the natgw and lvs
helpers also run the ctdb tool.

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

- - - - -
0e59cd25 by Martin Schwenke at 2020-02-10T04:07:39+00:00
ctdb-tools: Allow shorter runtime limit to be specified

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

- - - - -
0b3db29b by Martin Schwenke at 2020-02-10T05:34:08+00:00
ctdb-tests: Add some tool unit tests to ensure that timeouts work

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Mon Feb 10 05:34:08 UTC 2020 on sn-devel-184

- - - - -
f8e7c3d3 by Stefan Metzmacher at 2020-02-10T16:32:36+00:00
auth/kerberos: add auth4_context_{for,get}_PAC_DATA_CTR() helpers

This adds a generic way to get to the raw (verified) PAC
and will be used in multiple places in future.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
fd2ca9d2 by Stefan Metzmacher at 2020-02-10T16:32:36+00:00
s3:libads: make use auth4_context_{for,get}_PAC_DATA_CTR() in kerberos_return_pac()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
0be55059 by Stefan Metzmacher at 2020-02-10T16:32:36+00:00
lib/krb5_wrap: prefer new enctyptes in ms_suptypes_to_ietf_enctypes()

This is currently not critical as we only use keytabs
only as acceptor, but in future we'll also use them
for kinit() and there we should prefer the newest type.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
240e5cf3 by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
s3:libads: prefer ENCTYPE_AES256_CTS_HMAC_SHA1_96 in ads_keytab_add_entry()

This is currently not critical as we only use keytabs
only as acceptor, but in future we'll also use them
for kinit() and there we should prefer the newest type.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
a8ba35fa by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
s4:gensec_krb5: make use of struct samba_sockaddr

This avoids some strict-aliasing warnings.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
8ec0e319 by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
s4:gensec_krb5: make use of talloc_zero() in gensec_krb5_start()

This is simpler and safter in case the structure gets new elements.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
15d2130b by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
s4:gensec_krb5: remove unused argument of gensec_krb5_common_client_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
a0c6ae24 by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
smbspool: use one element per line for the auth_errors array

This makes it more obvious if the later change the array.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
d032569f by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
smbspool: add more error codes to the auth_errors array

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
62ee0d93 by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
winbindd_cm: fallback to anonymous for INVALID_COMPUTER_NAME and NO_SUCH_DOMAIN too

These error codes are soon propagated in addition to
INVALID_ACOUNT_NAME through the gensec/spnego layers.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
28d9493d by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
gensec/spnego: fallback on INVALID_{ACCOUNT,COMPUTER}_NAME and NO_SUCH_DOMAIN

I think it's better to handle them in spnego.c, instead of squashing
them already in the gssapi/gse modules. This is related to
KRB5KDC_ERR_{C,S}_PRINCIPAL_UNKNOWN and KRB5_REALM_UNKNOWN.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
98d2d5a4 by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
auth/gensec: map NT_STATUS_{INVALID_ACCOUNT_NAME,NO_SUCH_DOMAIN} to NT_STATUS_NO_SUCH_USER

This means nt_status_squash() will map NT_STATUS_NO_SUCH_USER to
LOGON_FAILURE later.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
c403fa1a by Stefan Metzmacher at 2020-02-10T16:32:37+00:00
krb5_wrap: move source3/libads/krb5_errs.c to lib/krb5_wrap/krb5_errs.c

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
765b0eac by Stefan Metzmacher at 2020-02-10T16:32:38+00:00
krb5_wrap: map KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN to NT_STATUS_INVALID_COMPUTER_NAME

KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN is already mapped to
NT_STATUS_INVALID_ACCOUNT_NAME and we need a way to
distinguish between client and server principal
at the NTSTATUS layer too.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
c90824a2 by Stefan Metzmacher at 2020-02-10T17:59:34+00:00
krb5_wrap: map KRB5_REALM_UNKNOWN to NT_STATUS_NO_SUCH_DOMAIN

This is much better than mapping it to NT_STATUS_UNSUCCESSFUL.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Mon Feb 10 17:59:34 UTC 2020 on sn-devel-184

- - - - -
e033dafd by Volker Lendecke at 2020-02-10T18:00:43+00:00
dbwrap: Improve an error message

Include the path where db_open() tried to find the ctdb socket

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e9c1c822 by Volker Lendecke at 2020-02-10T18:00:43+00:00
smbclient: Don't cli_posix_stat() twice

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f5d33040 by Volker Lendecke at 2020-02-10T19:26:37+00:00
smbclient4: Remove unused code

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Feb 10 19:26:37 UTC 2020 on sn-devel-184

- - - - -
ad784966 by Gary Lockyer at 2020-02-11T17:41:32+00:00
samba-tool domain join: remove sub domain join code

Remove the unused sub domain join code, the option was removed by commit
5583208aed0e4647269e48aa1d3c5c48a73001ac. This commit completely removes
the now unused code.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue Feb 11 17:41:32 UTC 2020 on sn-devel-184

- - - - -
a40fc709 by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tcp: Make error handling for outbound connection consistent

If we can't bind the local end of an outgoing connection then
something has gone wrong.  Retrying is better than failing into a
zombie state.  The interface might come back up and/or the address my
be reconfigured.

While here, do the same thing for the other (potentially transient)
failures.

The unknown address family failure is special but just handle it via a
retry.  Technically it can't happen because the node address parsing
can only return values with address family AF_INET or AF_INET6.

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

Reported-by: 耿纪超 <gengjichao at jd.com>
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

- - - - -
5a702b01 by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tests: Fix return value of DB test tool delete command

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

- - - - -
0162fd87 by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tests: Increase to dumping up to 500 lines of logs on error

100 lines are not enough to debug a current issue.

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

- - - - -
b9f23f5b by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tests: Use select_test_node()

select_test_node_and_ips() is not required in these cases.

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

- - - - -
a6d464aa by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tests: Use a here document to improve readability

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

- - - - -
224e8978 by Martin Schwenke at 2020-02-12T03:11:39+00:00
ctdb-tests: Fix handling of --no-event-scripts option

Shellcheck noticed that pnn was never referenced.  Not sure this ever
worked or whether it got broken somewhere along the way.

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

- - - - -
bd279d3f by Martin Schwenke at 2020-02-12T04:38:47+00:00
ctdb-tests: Fix getdbmap test so that it actually works sanely

* Typo in variable name db_map_pattern
* Variable num_db_init used before set
* dbmap_pattern does not cover database flags

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed Feb 12 04:38:47 UTC 2020 on sn-devel-184

- - - - -
503fc8f2 by Volker Lendecke at 2020-02-14T12:15:32+00:00
auth: Fix CID 1458420 Null pointer dereferences (REVERSE_INULL)

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ef035022 by Volker Lendecke at 2020-02-14T12:15:32+00:00
auth: Fix CID 1458418 Null pointer dereferences (REVERSE_INULL)

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
43c808f2 by Volker Lendecke at 2020-02-14T12:15:32+00:00
gensec: Fix CID 1458421 OVERRUN

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
7e78d275 by Volker Lendecke at 2020-02-14T13:42:26+00:00
gensec: Fix CID 1458419 Control flow issues (NO_EFFECT)

socklen_t can be unsigned

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Fri Feb 14 13:42:26 UTC 2020 on sn-devel-184

- - - - -
8fbdff5c by Andrew Bartlett at 2020-02-14T15:47:41+00:00
auth/credentials: Test connecting to LDAP with a "virtual user" style account

This type of account is often used by e-mail hosting platforms
that do not wish to create an AD domain for each DNS domain that
they host mail for.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
f231a072 by Andrew Bartlett at 2020-02-14T17:13:33+00:00
s4-auth: Allow simple bind login of a user with an @ in the samAccountName

LDAP Simple BIND authentications have already been mapped to a
DOMAIN\username pair and should not be mapped twice.

This appears to be a regression in 09e24ce40f89ac2f03d0c5fefa8b59f0d113fa6b
included in Samba 4.7.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Fri Feb 14 17:13:33 UTC 2020 on sn-devel-184

- - - - -
b9ab8bf7 by Andreas Schneider at 2020-02-14T20:16:04+00:00
s3:tests: Add smbclient test for 'force create mode = 0664'

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Feb 14 20:16:04 UTC 2020 on sn-devel-184

- - - - -
c1b9bf99 by Stefan Metzmacher at 2020-02-15T10:11:28+00:00
lib/replace: remove unused check for aio.h

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fb5a99fa by Stefan Metzmacher at 2020-02-15T10:11:28+00:00
bootstrap: replace libaio-dev/libaio-devel with liburing-dev/liburing-devel

We'll never use libaio, but will soon add a io_uring vfs module.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
195e88ce by Stefan Metzmacher at 2020-02-15T11:37:45+00:00
s3:modules: add vfs_io_uring module

The module makes use of the new io_uring infrastructure
(intruduced in linux 5.1), see https://lwn.net/Articles/778411/ and
http://git.kernel.dk/cgit/liburing/

Currently this only implements SMB_VFS_{PREAD,PWRITE,FSYNC}_SEND/RECV
and avoids the overhead of our userspace threadpool.

In future we'll hopefully make more use of more advanced io_uring
features.

For now we don't have automated tests as our test infrastructure
doesn't use a recent kernel. At least we're able to do compile tests
on fedora31.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Sat Feb 15 11:37:45 UTC 2020 on sn-devel-184

- - - - -
c16da0e8 by Amitay Isaacs at 2020-02-18T02:56:38+00:00
ctdb-common: Remove signed/unsigned comparisons

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

- - - - -
c9405aec by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-daemon: Check for lock count underflow

This is a programming error.

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

- - - - -
a20403ad by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-daemon: Fix signed/unsigned comparison

csbuild says:

  ctdb/server/ctdb_lock.c: scope_hint: In function ‘ctdb_find_lock_context’
  ctdb/server/ctdb_lock.c:671:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]

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

- - - - -
dc076b83 by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-tests: Rationalise node stop/start/restart

Separate functions are not needed for stopping/starting/restarting
individual nodes.  The stop and start functions essentially just use
onnode, though for local daemons this is embedded in local_daemons.sh.
So, just provide one stop and one start function that takes an
optional nodespec, defaulting to all nodes.

Restarting becomes common.

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

- - - - -
03403aac by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-tests: Avoid shutdown error when daemon already cleanly shut down

This depends on a small amount of internal knowledge but is the
cleanest way of avoiding errors for nodes that have already been shut
down.

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

- - - - -
455d931a by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-tests: Dump logs on shutdown failure

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

- - - - -
3d5de9b2 by Martin Schwenke at 2020-02-18T02:56:38+00:00
ctdb-tests: Flag setup, startup, shutdown failures as test errors

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

- - - - -
4de1e320 by Martin Schwenke at 2020-02-18T04:22:56+00:00
ctdb-docs: Provide example commands for "ctdb event ..."

The example output doesn't tell a user what command generated it.
Adding the command makes the examples much more useful.

Reported-by: Stefan Kania <stefan at kania-online.de>
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Feb 18 04:22:56 UTC 2020 on sn-devel-184

- - - - -
8a23031b by Volker Lendecke at 2020-02-18T11:38:40+00:00
lib: Simplify register_msg_pool_usage()

We can do as much as we want in the filter. This gives us automatic
retry, we don't have to do the messaging_filtered_read_send() over and
over again

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
dab982d8 by Volker Lendecke at 2020-02-18T11:38:40+00:00
lib: Add a TALLOC_CTX to base register_msg_pool_usage() on

Add a simple way to deactivate the registration

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
7209357f by Volker Lendecke at 2020-02-18T11:38:40+00:00
lib: Introduce messaging_context->per_process_talloc_ctx

Consolidate "msg_dgm_ref" and "msg_ctdb_ref": The only purpose of
those pointers was to TALLOC_FREE() them in messaging_reinit(). We'll
have a third entity to talloc_free() in the next commit, make that
simpler.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
f1577c2b by Volker Lendecke at 2020-02-18T13:05:52+00:00
lib: Fix a shutdown crash with "clustering = yes"

This is a bit confusing now, sorry for that:

register_msg_pool_usage() in the ctdb case uses
messaging_ctdb_register_tevent_context(), which talloc_reference()s
the central struct messaging_ctdb_fde_ev of the
messaging_ctdb_context. In messaging_reinit(), we talloc_free only one
of those references and allocate a new messaging_ctdb_fde_ev. The
remaining messaging_ctdb_fde_ev should have been deleted as well, but
due to the second reference this does not happen. When doing the
shutdown messaging_ctdb_fde_ev_destructor() is called twice, once on
the properly reinitialized fde_ev, and once much later on the leftover
one which references invalid data structures.

By the way, this is not a problem with talloc_reference(), this would
have happened with explicit refcounting too.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Björn Baumbach <bb at sernet.de>
Autobuild-Date(master): Tue Feb 18 13:05:53 UTC 2020 on sn-devel-184

- - - - -
e2ea059e by Andreas Schneider at 2020-02-18T21:07:44+00:00
s3:tests: Add test for a dropbox with dir mode 0733

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Feb 18 21:07:44 UTC 2020 on sn-devel-184

- - - - -
b4195cd4 by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: DFS: Don't allow link creation on a read-only share.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0450593e by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: DFS: Don't allow link deletion on a read-only share.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d22b0d90 by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: smbd: dfs: Cleanup, reformat calls to parse_msdfs_symlink()

Make parameter easier to change.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
028c33e0 by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: smbd: dfs: Move lp_msdfs_shuffle_referrals() call out of parse_msdfs_symlink().

Removes dependency on snum for what is text parsing code.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
012b8121 by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: smbd: dfs: Make parse_msdfs_symlink() external.

So it can be called by a future new VFS call.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a211c640 by Jeremy Allison at 2020-02-18T21:08:32+00:00
s3: smbd: dfs: Apply some README.Coding to parse_msdfs_symlink().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4e4afc52 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: smbd: dfs: Allow parse_msdfs_symlink() to be called with NULL pointers.

In case we don't want all the data.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ed527dc1 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: smbd: dfs: Make parameter names consistent.

Initialize reflist to NULL.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
74b47bf5 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: smbd: dfs: Clean up exits / talloc heirarchy in parse_msdfs_symlink()..

Ensure on error or clean return we don't leave memory on mem_ctx.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
96bc3298 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: Add SMB_VFS_READ_DFS_PATHAT().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e52e2135 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: ceph: Add vfswrap_ceph_read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
018af49b by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: gluster: Add vfs_gluster_read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9e92d46b by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: shadow_copy2: Add shadow_copy2_read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9f6c01b2 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: cap: Add cap_read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
16acdc34 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: catia: Add read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
263df988 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: vfs_full_audit: Add read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
05285844 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: VFS: vfs_time_audit: Add read_dfs_pathat().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
07a3cd56 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: DFS: Change simple is_msdfs_link() call to use SMB_VFS_READ_DFS_PATHAT().

This will need an extra dirfsp parameter in future, but this
is the easiest change for now.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1ffc52ab by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: DFS: Parse the returned target path in dfs_path_lookup().

Currently unused, but this will ease the transition to
using SMB_VFS_READ_DFS_PATHAT().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1668c9ee by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: DFS: Change dfs_path_lookup() to return struct referral list and count directly.

Remove external parse of returned link targetpath, expose
the parsing previously added to dfs_path_lookup().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3c77a9e7 by Jeremy Allison at 2020-02-18T21:08:33+00:00
s3: DFS: Replace calls to is_msdfs_link_internal() inside dfs_path_lookup() with SMB_VFS_READ_DFS_PATHAT().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
94068b54 by Jeremy Allison at 2020-02-18T21:08:34+00:00
s3: DFS: Change the last use of is_msdfs_link_internal() -> SMB_VFS_READ_DFS_PATHAT() inside form_junctions().

is_msdfs_link_internal() is no longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9ee13200 by Jeremy Allison at 2020-02-18T22:34:16+00:00
s3: DFS: Remove is_msdfs_link_internal() - no longer used.

All DFS links are now read through the VFS and not via
symlink calls.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Feb 18 22:34:16 UTC 2020 on sn-devel-184

- - - - -
2a5002d9 by Volker Lendecke at 2020-02-19T09:38:39+00:00
lib: Fix rotating nonstandard debug class log files

Looking at the same pointer in the loop does not really make sense to
me

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
c9c0e69d by Volker Lendecke at 2020-02-19T09:38:39+00:00
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
b058c6d3 by Volker Lendecke at 2020-02-19T09:38:39+00:00
torture4: Use strlcpy() with size check instead of snprintf()

It's just test code, but we should give good examples where possible

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
158bf58c by Volker Lendecke at 2020-02-19T09:38:39+00:00
torture4: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
b36376fc by Volker Lendecke at 2020-02-19T09:38:39+00:00
lib: Remove unneded #include malloc.h

We do the mallinfo() call in talloc_report_printf.c now

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
7598b906 by Volker Lendecke at 2020-02-19T09:38:39+00:00
selftest: Allow "netbios name" to be overriden in Samba3::provision()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
2a54c03a by Volker Lendecke at 2020-02-19T09:38:39+00:00
selftest: Add "share_dir" as an argument to Samba3::provision()

Default to the previous value

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
4cd28d73 by Volker Lendecke at 2020-02-19T09:38:39+00:00
selftest: Fix a warning message

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
586189ab by Martin Schwenke at 2020-02-19T09:38:40+00:00
selftest: Fix an uninitialised variable warning.

If $nmbd is not "yes" then this can result in a warning.

Introduced in commit 676261fa08273114b888bb46f65de3de091b615b.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
ff5dd4bb by Volker Lendecke at 2020-02-19T09:38:40+00:00
selftest: Parameterize clean up in the child process

Default to closing the write end of the parent->child pipe.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
154d7c8e by Volker Lendecke at 2020-02-19T09:38:40+00:00
selftest: Convert Samba3::check_or_start() to named parameters

Another parameter will be added soon.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
c779dfe7 by Volker Lendecke at 2020-02-19T09:38:40+00:00
selftest: Allow passing fork_and_exec()'s child_cleanup

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
822604a1 by Martin Schwenke at 2020-02-19T09:38:40+00:00
selftest: net command needs to think it is root in clustered case

So just run it "as root" all the time.

Something similar is already done for other things in
Samba3::provision(), such as running smbpasswd in
Samba3::createuser().

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
bb85a710 by Volker Lendecke at 2020-02-19T09:38:40+00:00
selftest: Split up a long line

We'll add another argument soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
5ff7e2f2 by Michael Adam at 2020-02-19T09:38:40+00:00
selftest:Samba3: add a clusteredmember environment

Allow running tests against a CTDB setup, thereby covering the
dbrwap_ctdb->ctdb stack in real SMB tests.

Sets up a 3 node cluster.

Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Volker Lendecke <vl at samba.org>
Signed-off-by: Martin Schwenke <martin at meltin.net>

- - - - -
602f27d6 by Volker Lendecke at 2020-02-19T09:38:40+00:00
autobuild: Avoid clusteredmember in normal environments

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
ebf67b6d by Volker Lendecke at 2020-02-19T09:38:40+00:00
autobuild: Run a simple test for clustered samba

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
dc015080 by Martin Schwenke at 2020-02-19T09:38:40+00:00
selftest:clusteredmember: Build a unclist for every share

This is fairly cheap and it is simple to do.  This allows the Python
code to be able to specify a unclist quite simply.  The level of
coupling doesn't seem worse than anything else in the
selftest/autobuild code.

There may be cleverer ways of doing this (e.g. a wrapper in
testprogs/blackbox/clusteredmember_smbtorture or similar) but cleverer
code isn't necessarily better code... and they'll probably involve
code duplication.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
d4af16a1 by Martin Schwenke at 2020-02-19T09:38:40+00:00
selftest: Run a clustered test

Signed-off-by: Volker Lendecke <vl at samba.org>
Signed-off-by: Martin Schwenke <martin at meltin.net>

- - - - -
cfb8e4de by Volker Lendecke at 2020-02-19T09:38:40+00:00
autobuild: Split a long line

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
8441471d by Volker Lendecke at 2020-02-19T11:28:56+00:00
autobuild: samba-ctdb does not need an AD DC

Speed up the build a bit

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Wed Feb 19 11:28:56 UTC 2020 on sn-devel-184

- - - - -
305204a2 by Volker Lendecke at 2020-02-20T20:48:29+00:00
test: Intercept open in vfs_error_inject

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7bbba73b by Volker Lendecke at 2020-02-20T20:48:29+00:00
test: Show that smbd does not handle EINTR from open() correctly

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4a943d84 by Volker Lendecke at 2020-02-20T20:48:29+00:00
lib: Map EINPROGRESS->NT_STATUS_MORE_PROCESSING_REQUIRED

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aebe427b by Volker Lendecke at 2020-02-20T22:14:25+00:00
smbd: Separate aio_pthread indicator from normal EINTR

According to Posix and the Linux open(2) manpage, the open-syscall can
return EINTR. If that happens, core smbd saw this as an indication
that aio_pthread's open function was doing its job. With a real EINTR
without aio_pthread this meant we ended up in a server_exit after 20
seconds, because there was nobody to do the retry.

EINTR is mapped to NT_STATUS_RETRY. Handle this by just retrying after
a second.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Feb 20 22:14:25 UTC 2020 on sn-devel-184

- - - - -
3d8680e6 by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Add bytearray.h

This is an implementation which doesn't have undefined behavior
problems. It casts correctly that calculations are don in the correct
integer space. Also the naming is less confusing than what we have in
byteorder.h.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
8a87fdb4 by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Add test to verify old and new macros are the same

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
841e2436 by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Use _DATA_BYTE(_CONST) from bytearray.h

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b8804416 by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Use PULL_LE_(U16|U32) for SVAL and IVAL

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
656d293a by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Use PUSH_LE_(U16|U32) for S(S|I)VAL

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
c3b627f4 by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Use PUSH_LE_(U16|U32) for S(I|S)VALS

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
83cb44db by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Use (PULL|PUSH)_BE_(U16|U32|U64) for R*VAL*

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
fc4064ea by Andreas Schneider at 2020-02-21T02:09:33+00:00
lib:util: Add comments to use bytearray.h to byteorder.h

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
5268c83a by Andreas Schneider at 2020-02-21T02:09:33+00:00
librpc:ndr: Use bytearray.h in ndr_basic.c

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7ab1156b by Andreas Schneider at 2020-02-21T02:09:33+00:00
librpc:ndr: Remove byteorder.h from libndr.h

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a84c24e7 by Andreas Schneider at 2020-02-21T02:09:34+00:00
lib:util: Do not expose internal header files

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a2692b64 by Andreas Schneider at 2020-02-21T03:35:58+00:00
lib:util: Add (PULL|PUSH)_(BE|LE)_I(8|16|32|64) byterarray macros

The only difference is that the pull macros do the correct casting of
the integer in the end.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Feb 21 03:35:58 UTC 2020 on sn-devel-184

- - - - -
17bd63db by Andrew Bartlett at 2020-02-25T10:38:34+00:00
ldb: Add tests for one-level indexes in conjunction with other indexes

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
16767697 by Andrew Bartlett at 2020-02-25T10:38:34+00:00
ldb: Add tests aimed at the SCOPE_ONELEVEL particular

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ec34a709 by Andrew Bartlett at 2020-02-25T10:38:34+00:00
ldb: Ensure @IDXONE modes is tested in ldb.python (apy.py) tests

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
3c7261c4 by Andrew Bartlett at 2020-02-25T10:38:34+00:00
ldb: Fix search with scope ONE and small result sets

This changes the LDB behaviour in the combination of a SCOPE_ONE search and
an index returning less than 10 results.

After b6b5b5fe355fee2a4096e9214831cb88c7a2a4c6 the list->strict flag
became set to false in all cases, rather than being left to the
value set by the caller.

This changes the ldb_kv_index_dn_one() code to force strict
mode on success instead.

Thanks to Marcus Granér, ICEYE Oy for reporting.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
0b8ab020 by Andrew Bartlett at 2020-02-25T10:38:34+00:00
ldb: Add tests aimed at the SCOPE_ONELEVEL bug in particular

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
0ca46a37 by Stefan Metzmacher at 2020-02-25T12:59:02+00:00
ldb: version 2.1.1

* Bug 14270:
  Samba 4.11 and later give incorrect results for SCOPE_ONE searches

Signed-off-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(master): Tue Feb 25 12:59:02 UTC 2020 on sn-devel-184

- - - - -
d4c69d82 by Ralph Boehme at 2020-02-25T17:44:44+00:00
VFS: default: let vfswrap_is_offline() take conn, not handle

vfswrap_is_offline() has been converted to a "helper" function some time ago, it
had been a VFS interface function before. To make this change more obvious let
it take a struct connection_struct instead of a struct vfs_handle_struct which
is the canonical first parameter to VFS functions.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
99873724 by Ralph Boehme at 2020-02-25T17:44:44+00:00
VFS: default: remove unused arg from vfswrap_is_offline()

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cbca8112 by Ralph Boehme at 2020-02-25T17:44:44+00:00
VFS: default: avoid a crash in vfswrap_getxattrat_do_sync()

Must use tevent_req_data() to get our tevent_req state, talloc_get_type_abort()
will just crash as struct tevent_req != struct vfswrap_getxattrat_state..

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ace296b9 by Ralph Boehme at 2020-02-25T17:44:44+00:00
VFS: default: use correct type for pathlen in vfswrap_getxattrat_do_sync()

full_path_tos() returns a ssize_t.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a23f8d91 by Ralph Boehme at 2020-02-25T17:44:44+00:00
VFS: default: add support for FILE_ATTRIBUTE_OFFLINE to async dosmode

This had been missing in the initial async dosmode implementation. It's the
responsibility of the sync and async dosmode functions to call
vfswrap_is_offline() since the offline functionality has been converted from a
first class VFS function to be a part of the DOS attributes VFS functions..

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a4a96a90 by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Add a NULL check

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c3a2cc9b by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Align calls to SMBC_dlist_contains()

Everywhere else it's called as !SMBC_dlist_contains()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
427e10e8 by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Make SMBC_dlist_contains return bool

It returned True/False, and is used as boolean only. Modernize
formatting a bit.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d7281e32 by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Simplify callers of SMBC_dlist_contains()

This function already does the NULL check on the file pointer

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
78eae77e by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Remove a pointless ZERO_STRUCT()

"c" is a pointer that was initialized to NULL above

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
42f744d8 by Volker Lendecke at 2020-02-25T17:44:44+00:00
libsmb: Use IS[DOT]DOT

strequal is not necessary here

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6d282d61 by Volker Lendecke at 2020-02-25T17:44:45+00:00
libsmb: Avoid casts

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
15769f11 by Volker Lendecke at 2020-02-25T17:44:45+00:00
libsmb: Don't pass "sbuf" to cli_posix_stat_send()

Don't pass in the result buffer upon _send(), let the _recv() function
fill this in. Internal API only, adapt to current conventions.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b7b7fbf9 by Volker Lendecke at 2020-02-25T17:44:45+00:00
torture4: Use torture_assert_not_null where appropriate

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8f50e4fa by Volker Lendecke at 2020-02-25T17:44:45+00:00
torture4: Use higher-level torture macros

Makes an easier read of torture_libsmbclient_readdirplus_seek()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ae76d218 by Volker Lendecke at 2020-02-25T17:44:45+00:00
selftest: Consolidate planning libsmbclient tests to source4

We don't need to plan those tests both in source3 and source4's
tests.py. The source4 version seems more "advanced", it uses
smbtorture4_testsuites() to list all tests, making it less
error-prone, and it also does the tests for all SMB1 and SMB3

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9df3ed7e by Volker Lendecke at 2020-02-25T17:44:45+00:00
selftest: We don't need an AD DC for libsmbclient tests

In case we would start to actually test kerberos auth via the libsmbclient API
(which we right now don't), this will change again. Until then,

make test TESTS=libsmbclient

is a lot faster this way.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5076e28a by Volker Lendecke at 2020-02-25T19:30:27+00:00
selftest: Slightly simplify setting up libsmbclient tests

We'll add per-test arguments soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Feb 25 19:30:27 UTC 2020 on sn-devel-184

- - - - -
51551e0d by Volker Lendecke at 2020-02-25T23:23:39+00:00
libsmb: Pass the correct path to cli_posix_stat()

This fixes doing strlen() on talloc_tos(), about which valgrind is pretty
unhappy. Without this patch we survive the tests because we have fallbacks to
the non-posix flavors of stat(). With this patch in place cli_posix_stat()
becomes functional in this code path. This creates conflicts with the readdir
libsmbclient tests, which need fixing separately.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c3242b4d by Volker Lendecke at 2020-02-26T00:50:32+00:00
libsmb: Fill in device which we don't get from cli_posix_stat

SMB1 unix extensions don't carry st_dev for stat

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Feb 26 00:50:32 UTC 2020 on sn-devel-184

- - - - -
e0c50272 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:libsmb: pass dest_ss to cli_cm_connect() down to cli_connect_nb()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
08a7f5c4 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:libsmb: pass dest_ss to cli_cm_open()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
03562cf1 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:libsmb: use only a timeout of 250ms in name_resolve_bcast_send()

We use the same value for broadcasts in name_query().

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b1ebfec3 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:libsmb: move cli_set_message() to source3/libsmb/nmblib.c

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f99d8ffc by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:wscript: move libsmb/clidgram.c to LIBNMB

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aab5c847 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:wscript: split out dsgetdcname subsystem

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6d63fa02 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
lib/tsocket: add a comment regarding TEVENT_FD_READ in tstream_bsd_connect_send()

This is different compared to the raw usage of [e]poll
where [E]POLLOUT is enough to see errors via POLLERR/POLLHUP.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
048a4230 by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
lib/async_req: make sure we return errors early from async_connect_send/recv

While it is true that [e]poll() only needs POLLOUT
and POLLERR/POLLHUP are added implicitly.
For tevent we need TEVENT_FD_READ in order to see POLLERR/POLLHUP.

The socket becomes only readable when we hit an error.
Waiting for TEVENT_FD_WRITE is needed for getting success,
while TEVENT_FD_READ is required to get failures.

This matches what we have in tstream_bsd_connect_send().

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ce1a3f2c by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:lib: s/result/req in open_socket_out_send()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d48fba7c by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:lib: avoid goto's in open_socket_out_send()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a26be7ee by Stefan Metzmacher at 2020-02-26T19:45:36+00:00
s3:lib: avoid calling async_connect_send() again and again in open_socket_out*()

There's really no need to do that!

Once connect() is called and returned EINPROGRESS, the kernel
knowns what to do and reports any state change via
TEVENT_FD_READ or TEVENT_FD_WRITE.
The actual success or failure is available via
getsockopt(.., SOL_SOCKET, SO_ERROR, ...).

Before this commit we called connect() (via async_connect_send()) again
and again until we reached the final caller provided timeout,
even if the kernel already found out that the destination is
unreachable.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
09ea7248 by Stefan Metzmacher at 2020-02-26T19:45:37+00:00
lib/async_req: remove useless "reentrant" support from async_connect_send()

Now that open_socket_out*() doesn't do the strange reentrant calls,
we can remove support for this in async_connect_send(), so that we'll
never get any new users of this.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3a7480d6 by Volker Lendecke at 2020-02-26T19:45:37+00:00
s3:lib: Allow open_socket_out without a timeout

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4edece5e by Stefan Metzmacher at 2020-02-26T21:11:59+00:00
s3:smb2_tcon: pass down in_flags to smbd_smb2_tree_connect_send()

SMB 3.1.1 converted the reserved field to a flags field.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Feb 26 21:11:59 UTC 2020 on sn-devel-184

- - - - -
340cd2b8 by Stefan Metzmacher at 2020-02-26T23:11:39+00:00
ldb: change the version to 2.2.0 for Samba 4.13

Signed-off-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Feb 26 23:11:39 UTC 2020 on sn-devel-184

- - - - -
3e072b3f by Gary Lockyer at 2020-02-27T01:02:32+00:00
build: fix the coverage build

"make lcov" was failing with:
   Processing file bin/default/<stdout>
   genhtml: ERROR: cannot read ... <stdout>

Flex adds "#line nnn <stdout>" to the generated source, which then causes
issues with lcov. This commit adds a SAMBA_GENERATOR for es_lexer.l and
sparql_lexer.l that strips out the offending lines.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
23d285d3 by Gary Lockyer at 2020-02-27T01:02:32+00:00
librpc ndr: Stack-overflow in ndr_pull_drsuapi_DsaAddressListItem_V1

Reproducer for oss-fuzz Issue 19280

Project: samba
Fuzzing Engine: libFuzzer
Fuzz Target: fuzz_ndr_drsuapi_TYPE_OUT
Job Type: libfuzzer_asan_samba
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffcb4cc2ff8
Crash State:
  ndr_pull_drsuapi_DsaAddressListItem_V1

Sanitizer: address (ASAN)

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19280
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ba518a1d by Gary Lockyer at 2020-02-27T01:02:32+00:00
librpc ndr: add recursion check macros

Add macros to check the recursion depth.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19280
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
5d323f2a by Gary Lockyer at 2020-02-27T01:02:32+00:00
pidl: Add recursive depth checks.

Add new parameter to elements "max_recursion" and modify pidl to call
NDR_RECURSION_CHECK and NDR_RECURSION_UNWIND for element tagged with
that attribute.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2f8c3b62 by Gary Lockyer at 2020-02-27T01:02:32+00:00
idl: drsuapi_DsaAddressListItem_V1 limit recursion

Limit number of drsuapi_DsaAddressListItem_V1 elements to 1024

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2ba2ce40 by Gary Lockyer at 2020-02-27T01:02:32+00:00
fuzzing: ndr set global_max_recursion.

Set global_max_recursion to 128, to ensure the fuzzer does not trip the
ASAN maximum stack depth which seems to be about 256?

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
575d3904 by Gary Lockyer at 2020-02-27T02:29:20+00:00
idl: limit recurion on recursive elements

Limit the max_recursion on self recursive definitions in the idl to
20,000. This value is hopefully large eneough to not impact normal
operation, but small eneough to prevent stack over flow issues.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Feb 27 02:29:21 UTC 2020 on sn-devel-184

- - - - -
efb3aa95 by Andrew Bartlett at 2020-02-27T03:42:35+00:00
lib/util: Make prctl_set_comment take a printf format string

This makes it easier to pass a small amount of variable information
into the buffer, to distinguish processes in the AD DC.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
3136d2fd by Andrew Bartlett at 2020-02-27T03:42:35+00:00
s4-smbd: Make use of prctl_set_comment()

This makes it possible to tell different child tasks apart on linux systems
that have not compiled against libsetproctitle or libbsd-setproctitle.

Use "ps -ef -o pid,comm" to see the tree with these titles.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
f50bd0d0 by Andrew Bartlett at 2020-02-27T03:42:35+00:00
lib/tfork: Improve process titles for the tfork waiter process

This makes it easier to understand the process graph as there is
not a duplicate (eg) ldap[master] process for each tfork waiter.
when useing "ps -ef -o pid,comm"

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
4ee326f3 by Andrew Bartlett at 2020-02-27T03:42:35+00:00
Move INTERNAL ERROR... printout into smb_panic() and improve "why" string

The "why" string is now eg "Signal 11: Segmentation fault" and
so more descriptive, and hopefully this will encourage the
Samba version to be included in more error reports.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
f7fe6fa5 by Andrew Bartlett at 2020-02-27T05:09:44+00:00
lib/util/fault.c: Unify printing of the stack trace with the INTERNAL ERROR string

We can diverged into the s3 and lib/fault panic action stuff once
we have printed the backtrace.

Our tests require we use the word PANIC, and some administrative scripts
might look for similar things, so keep those words.

The use of DEBUG(0, ... is deliberate to keep the output
of the PANIC line as consistent as possible with the historical smbd output.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Feb 27 05:09:44 UTC 2020 on sn-devel-184

- - - - -
26e15568 by Günther Deschner at 2020-02-27T06:07:41+00:00
ctdb-scripts: add new 48.netbios script for starting nmbd

This change basically moves out nmbd references from 50.samba script to
a new 48.netbios script. Accordingly ctdb test scripts are tweaked to
cope with newly added script.

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
512fa29c by Anoop C S at 2020-02-27T06:07:41+00:00
ctdb-scripts: Change CTDB_SERVICE_NMB default value to 'nmb'

Till now 50.samba script was based on RHEL versions <=6 where we didn't
have separate start up script for nmb and smbd used to start nmbd when
required. Now that nmbd has its own start up script named "nmb" it is
reasonable to have "nmb" as default value for CTDB_SERVICE_NMB inside
new 48.netbios ctdb script.

Signed-off-by: Anoop C S <anoopcs at redhat.com>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
959235ff by Anoop C S at 2020-02-27T07:34:53+00:00
ctdb-docs: Move CTDB_SERVICE_NMB to new 48.netbios section

Signed-off-by: Anoop C S <anoopcs at redhat.com>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Thu Feb 27 07:34:53 UTC 2020 on sn-devel-184

- - - - -
ce3b594a by Volker Lendecke at 2020-02-27T18:07:29+00:00
selftest: Remove an obsolete knownfail entry

Since ae76d218346 this is not run anymore

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
536694d4 by Volker Lendecke at 2020-02-27T18:07:29+00:00
selftest: Remove an unnecessary space character

The pattern "//%s/%s %s" already provides the space. Why this patch? It makes
checking the next patch trivial.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e4f39912 by Volker Lendecke at 2020-02-27T18:07:29+00:00
selftest: Assemble smbtorture arguments as a list

I'm planning to mess with libsmbclient tests calling into
smbtorture4. For this it will be much more convenient to have the
arguments available as a higher-level data structure than just a
string.

Checked by "diff" on the testlist before and after -- no change..

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ac65874e by Volker Lendecke at 2020-02-27T18:07:29+00:00
selftest: Factor out smbtorture4testsuite_cmdarray()

This will be used in the libsmbclient tests soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bb5cf674 by Volker Lendecke at 2020-02-27T18:07:29+00:00
selftest: Introduce planlibsmbclienttest()

Small refactoring

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cb37caaa by Volker Lendecke at 2020-02-27T19:34:36+00:00
selftest: Run libsmbclient with and without unix extensions

The libsmbclient readdir tests are broken just for the unix extension
case. For example they assume our "map archive" behaviour. This will
have to be parameterized once unix extensions become better
implemented in libsmbclient

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Feb 27 19:34:36 UTC 2020 on sn-devel-184

- - - - -
76780322 by Peter Eriksson at 2020-02-27T21:43:29+00:00
Undef ARRAY_SIZE, if defined, before define to avoid compilation warnings

Signed-off-by: Peter Eriksson <pen at lysator.liu.se>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Gary Lockyer <<gary at catalyst.net.nz>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Feb 27 21:43:29 UTC 2020 on sn-devel-184

- - - - -
789d84c0 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group listmembers: hide python backtracke on command error

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
40e498e7 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group listmembers: handle group-does-not-exist error

Return a error with a proper message instead of just do nothing when
the target group does not exist.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
1d2e9f27 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group listmembers: find group members by groups SID

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d0f8e833 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group listmembers: use binary encoded group names

Allows to find groups with names like e.g. 'group1 (xy)'.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
626209be by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group move: use binary encoded group name

Allows to move groups with names like e.g. 'group1 (xy)'.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
104582b7 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group delete: use binary encoded group name

Allows to delete groups with names like e.g. 'group1 (xy)'.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f3e7ea04 by Björn Baumbach at 2020-02-28T03:08:45+00:00
samba-tool group edit: use binary encoded group name

Allows to edit groups with names like e.g. 'group1 (xy)'.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
534809a0 by Björn Baumbach at 2020-02-28T03:08:45+00:00
selftest: test samba-tool group commands with groupnames with brackets and spaces

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b29e6480 by Peter Eriksson at 2020-02-28T03:08:45+00:00
Rename macro argument s_addr due to it already being defined

Signed-off-by: Peter Eriksson <pen at lysator.liu.se>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0a87f59a by Andrew Bartlett at 2020-02-28T03:08:45+00:00
ldb: Fix memory leak in ldb_kv_index_dn_ordered()

We need to ensure we TALLOC_FREE(tmp_ctx) in every error exit.

Reported by Alex Kolesnik, ABISoft Ltd., www.abisoft.biz.  Thanks!

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
48cfb845 by Andrew Bartlett at 2020-02-28T03:08:46+00:00
ldb: Improve coding style in ldb_kv_index_dn_simple()

We avoid bare if conditions in Samba.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
535debb3 by Andrew Bartlett at 2020-02-28T03:08:46+00:00
ldb: Add mem_ctx argument to ldb_kv_index_key()

This avoids using "ldb" as the memory context in most cases, and may avoid
a long-term memory leak if future changes cause dn_key not to be freed.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
3b951251 by Swen Schillig at 2020-02-28T03:08:46+00:00
prevent NULL reference from being used as '%s' argument.

The two string arguments to torture_comment() can be NULL
as the succeeding checks suggest. This is not wanted because a compile
with --enable-developer throws an error of [-Werror=format-overflow=]
in those situations.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f2a2b469 by Andrew Bartlett at 2020-02-28T03:08:46+00:00
selftest: Confirm we can delete a user with a dangling backlink

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
7ad56d41 by Andrew Bartlett at 2020-02-28T03:08:46+00:00
dsdb: Simplifiy VANISH_LINKS handling: The variable "parent" is always non-NULL

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
47b6c4b8 by Andrew Bartlett at 2020-02-28T03:08:46+00:00
dsdb: Improve clarity by adding a comment in replmd_delete_internals()

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
01a3cf8e by Andrew Bartlett at 2020-02-28T03:08:46+00:00
dsdb: Do not use ldb_save_controls() in partitions module for domain_scope

The LDAP backend is long-removed so we do not need this workaround
for a confused server any longer.

This avoids references to old (but valid) memory after a new ldb_control array is
allocated in ldb_save_controls() and keeps the controls pointer as
constant as possible given the multiple ldb_request structures it
will appear in.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
dc308d1c by Andrew Bartlett at 2020-02-28T03:08:46+00:00
dsdb: Remove dead code in partition_prep_request()

The partition variable is never NULL.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
a3fc18f6 by Andrew Bartlett at 2020-02-28T04:42:23+00:00
dsdb: Rewrite comment to remove refernece to LDAP backends

This is required despire the demise of the LDAP backend.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Feb 28 04:42:23 UTC 2020 on sn-devel-184

- - - - -
c2dba1f5 by Ralph Boehme at 2020-02-29T08:02:50+00:00
ctdb: add tail logs option to local_daemons.sh

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Sat Feb 29 08:02:50 UTC 2020 on sn-devel-184

- - - - -
1e72fbdd by Martin Schwenke at 2020-02-29T11:53:42+00:00
ctdb-tests: Silence a ShellCheck warning

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Sat Feb 29 11:53:42 UTC 2020 on sn-devel-184

- - - - -
b8aa0552 by Andrew Bartlett at 2020-03-02T02:47:30+00:00
ldb: ensure that ldbedit operates like ldbmodify: set DONT_CREATE_DB

ldb* tools, when passed a raw filename assume tdb://

By default, ldb_tdb will call tdb with O_CREAT.

TDB, when passed O_CREAT and a not-tdb file, will wipe the file.

This means that if you run ldbedit <path to mdb-format-ldb file> the file
will be wiped, which is unexpected.  I noticed this while trying to
corrupt a sam.ldb backend file (for testing), but instead I wiped it!

Ideally tdb would not do that, but the behaviour has been this way for
decades.  Ideally ldb would have had a "create db" command, but this
has been the job of ldbadd for over a decade.

So this just blunts the knife for ldbedit.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
1a0d43bb by Andrew Bartlett at 2020-03-02T02:47:30+00:00
dsdb: Add very verbose debugging if a delete fails in repl_meta_data

The modification into a tombstone should be a pretty reliable operation
so if it fails print lots of info for debugging.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
84172ae7 by Andrew Bartlett at 2020-03-02T04:14:21+00:00
dsdb: Add debugging for a contrived situation where a non-schema attribute is on the record

I had to modify the backend DB to produce this error, but
I would like a clear error anyway.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Mon Mar  2 04:14:22 UTC 2020 on sn-devel-184

- - - - -
7cff3ed1 by Martin Schwenke at 2020-03-02T10:39:28+00:00
ctdb-tests: Use a local "ctdb shutdown" command to avoid a race

When "ctdb shutdown" is run with -n <N> it does not wait for the node
<N>'s ctdbd to go down but exits immediately.  This means that the
local_daemons.sh shutdown command can find the PID file still present
and then attempt the shutdown, but the daemon can have exited between
the check and the shutdown.  Although the test waits until the node is
disconnected, the transport is taken down just before the exit, so
this does not guarantee the daemon has exited.

A local shutdown command (no -n <N>) waits until the socket
disconnects and this happens *after* the PID file is gone, so this is
safe to use with the local_daemons.sh shutdown command.

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Mon Mar  2 10:39:28 UTC 2020 on sn-devel-184

- - - - -
8c06f193 by Volker Lendecke at 2020-03-03T17:48:37+00:00
test: Fix a copy&paste error

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bf07b16e by Volker Lendecke at 2020-03-03T17:48:37+00:00
winbindd: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
edfc19f1 by Volker Lendecke at 2020-03-03T17:48:37+00:00
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b08643f0 by Volker Lendecke at 2020-03-03T17:48:37+00:00
selftest: Fix usage check of test_smbtorture_s3.sh

This needs at least 5 args

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7c1abd7e by Volker Lendecke at 2020-03-03T17:48:37+00:00
selftest: Run smbtorture3 SHORTNAME-TEST without unix extensions

Soon cli_list() will change to SMB_FIND_FILE_UNIX_INFO2 which does not
provide a shortname. For now we lose that as an encrypted test, as for
now it's a SMB1 test which requires unix extensions for
encryption. Hopefully we don't forget to reenable this once the test
is converted to SMB2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

nonunix

- - - - -
9cc54695 by Volker Lendecke at 2020-03-03T17:48:37+00:00
libsmb: Factor out fetch_file_unix_basic_info()

Will be used in clilist.c for SMB_FIND_FILE_UNIX_INFO2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
128545ba by Volker Lendecke at 2020-03-03T17:48:37+00:00
libsmb: Introduce fetch_file_unix_basic_info2()

Will be used in clilist.c for SMB_FIND_FILE_UNIX_INFO2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
890c94d5 by Volker Lendecke at 2020-03-03T17:48:37+00:00
libsmb: Implement SMB_FIND_FILE_UNIX_INFO2 dir listing

This keeps the original SMB_STRUCT_STAT coming from posix as part of
struct file_info. It is a slight waste of space, as the timestamps are
kept twice, but having a full SMB_STRUCT_STAT with the nlink!=0
validity check makes thinking about which mode/size/etc is the correct
one a no-brainer. We can save space later by referencing only one set
of time stamps for example.

This for the time fixes readdirplus2, but for the wrong reason: We don't yet
create files the "proper" way using posix create.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c2e012fe by Volker Lendecke at 2020-03-03T17:48:37+00:00
libsmb: Use posix result in SMBC_readdirplus2_ctx

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a1856f07 by Volker Lendecke at 2020-03-03T17:48:38+00:00
libsmb: Use posix open in SMBC_open_ctx

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
dfa01af7 by Volker Lendecke at 2020-03-03T17:48:38+00:00
selftest: run libsmbclient unix ext tests against "posix_share"

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a7bdb293 by Volker Lendecke at 2020-03-03T17:48:38+00:00
selftest: Inform smbtorture about running with unix extensions

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c2387f13 by Volker Lendecke at 2020-03-03T17:48:38+00:00
selftest: Adapt libsmbclient.readdirplus2 to unix extensions

A few lines above the mode check we created a file with mode
0666. With unix exensions we expect this back 1:1, without them the
server changes them on the fly.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f89c7ad8 by Ralph Boehme at 2020-03-03T19:15:10+00:00
smbd: ignore set NTACL requests which contain S-1-5-88 NFS ACEs

We apply the same "ignore" logic already in the POSIX ACL code and in the
vfs_acl_xattr|tdb VFS modules to smb_set_nt_acl_nfs4() in the nfs4_acl helper
subsystem which is common to a bunch of VFS modules: GPFS, ZFS, NFS4_xattr and
aixacl2.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Mar  3 19:15:10 UTC 2020 on sn-devel-184

- - - - -
4d784590 by Swen Schillig at 2020-03-04T10:43:54+00:00
[s4] possible memleak in torture vfs-fruit

The allocated memory for "full_name" must be free'd
before returning to caller.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Mar  4 10:43:54 UTC 2020 on sn-devel-184

- - - - -
e45e0912 by Björn Baumbach at 2020-03-05T12:29:26+00:00
s3-libads: use dns name to open a ldap session

Required for working certificate verification.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13124
Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Bjoern Jacke <bjacke at samba.org>

Autobuild-User(master): Björn Baumbach <bb at sernet.de>
Autobuild-Date(master): Thu Mar  5 12:29:26 UTC 2020 on sn-devel-184

- - - - -
0dd2a273 by Jonathon Reinhart at 2020-03-05T16:27:50+00:00
python: Fix userPrincipalName in GetPasswordCommand.get_account_attributes()

Signed-off-by: Jonathon Reinhart <Jonathon.Reinhart at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Mar  5 16:27:50 UTC 2020 on sn-devel-184

- - - - -
a4ed6ada by Jonathon Reinhart at 2020-03-05T18:40:16+00:00
Remove unnecessary/incorrect talloc_steal() calls

The talloc_steal() in dsdb_enum_group_mem() is unnecessary, because
members was already allocated from the same mem_ctx.

The talloc_steal() in pdb_samba_dsdb_enum_aliasmem() is also unnecessary
for the same reason, but also incorrect, because it should be
dereferencing pmembers:

    talloc_steal(mem_ctx, *pmembers);

Furthermore, we should only assign to *pnum_members on success; otherwise
num_members is used uninitialized.

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

Signed-off-by: Jonathon Reinhart <Jonathon.Reinhart at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Mar  5 18:40:16 UTC 2020 on sn-devel-184

- - - - -
b0ba7cd4 by Art M. Gallagher at 2020-03-07T01:37:31+00:00
vfs_fruit: tmsize prevent overflow Force the type during arithmetic in order to prevent overflow when summing the Time Machine folder size. Increase the precision to off_t (used for file sizes), leave the overflow error traps but with more precise wording.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13622
Signed-off-by: Art M. Gallagher <smblock at artmg.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat Mar  7 01:37:31 UTC 2020 on sn-devel-184

- - - - -
56e466b4 by Gary Lockyer at 2020-03-07T05:09:34+00:00
ndrdump tests: Make the tests less fragile

Remove the C source file and line number from the expected output to
make the tests less likely to break if ndr.c changes.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d2d2329b by Gary Lockyer at 2020-03-07T06:37:09+00:00
audit_logging tests: Fix timezone validation

test_audit_get_timestamp used the "%Z" format specifier in strptime,
this is non-portable.  Updated tests now explicitly set the time zone to
"UTC".

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Sat Mar  7 06:37:09 UTC 2020 on sn-devel-184

- - - - -
594a435b by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pread_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e102908f by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Pass in struct vfswrap_pread_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfswrap_pread_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_pread_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
b9ad0607 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Protect vfs_pread_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_pread_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
86cc7439 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pwrite_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
13e25d68 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Pass in struct vfswrap_pwrite_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfswrap_pwrite_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_pwrite_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
c8cd93dd by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Protect vfs_pwrite_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_pwrite_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
4adde71b by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_fsync_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
d6237799 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Pass in struct vfswrap_fsync_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfswrap_fsync_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_fsync_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
18671534 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_fsync_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
0e3dc007 by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pread_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
c6c4e2de by Jeremy Allison at 2020-03-08T18:07:43+00:00
s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pread_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfs_gluster_pread_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_pread_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
99283871 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_pread_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
058a7eff by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pwrite_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
3357a77d by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pwrite_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfs_gluster_pwrite_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_pwrite_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
67910c75 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_pwrite_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
c0c088b1 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_fsync_state.

We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
cdde55a6 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_fsync_state as the callback data to the subreq.

Find the req we're finishing off by looking inside vfs_gluster_fsync_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_fsync_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
9ecbda26 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_glusterfs. Protect vfs_gluster_fsync_done() from accessing a freed req pointer.

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_fsync_done(), just throw away the result if
state->req == NULL.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
410e7599 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: smbd: Make sure we correctly reply to outstanding aio requests with an error on SHUTDOWN_CLOSE.

SHUTDOWN_CLOSE can be called when smbcontrol close-share
is used to terminate active connections.

Previously we just called talloc_free()
on the outstanding request, but this
caused crashes (before the async callback
functions were fixed not to reference req
directly) and also leaves the SMB2 request
outstanding on the processing queue.

Using tevent_req_error() instead
causes the outstanding SMB1/2/3 request to
return with NT_STATUS_INVALID_HANDLE
and removes it from the processing queue.

The callback function called from this
calls talloc_free(req). The destructor will remove
itself from the fsp and the aio_requests array.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
a1e247c3 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_aio_pthread. Fix leak of state struct on error.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
8db831a3 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_aio_pthread: Replace state destructor with explicitly called teardown function.

This will allow repurposing a real destructor to allow
connections structs to be freed whilst the aio open
request is in flight.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
ddb9038f by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_aio_pthread. Move xconn into state struct (opd).

We will need this in future to cause a pending open to
be rescheduled after the connection struct we're using
has been shut down with an aio open in flight. This will
allow a correct error reply to an awaiting client.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e5660666 by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_aio_pthread: Add a talloc context parameter to create_private_open_data().

Pass in NULL for now so no behavior change.
We will be changing this from NULL to fsp->conn in a later commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
6b567e0c by Jeremy Allison at 2020-03-08T18:07:44+00:00
s3: VFS: vfs_aio_pthread: Make aio opens safe against connection teardown..

Allocate state off fsp->conn, not NULL, and add a destructor
that catches deallocation of conn which happens
on connection shutdown or force close.

Note - We don't allocate off fsp as the passed in
fsp will get freed once we return EINPROGRESS/NT_STATUS_MORE_PROCESSING_REQUIRED.
A new fsp pointer gets allocated on every re-run of the
open code path.

The destructor allows us to NULL out the saved conn struct pointer
when conn is deallocated so we know not to access deallocated memory.
This matches the async teardown code changes for bug #14301
in pread/pwrite/fsync vfs_default.c and vfs_glusterfs.c

state is still correctly deallocated in all code
paths so no memory leaks.

This allows us to safely complete when the openat()
returns and then return the error NT_STATUS_NETWORK_NAME_DELETED
to the client open request.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
bb22be08 by Jeremy Allison at 2020-03-08T19:34:14+00:00
s3: tests: Add samba3.blackbox.force-close-share

Checks server stays up whilst writing to a force closed share.
Uses existing aio_delay_inject share to delay writes while
we force close the share.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sun Mar  8 19:34:14 UTC 2020 on sn-devel-184

- - - - -
be90ab01 by Martin Schwenke at 2020-03-09T02:27:18+00:00
ctdb-docs: Improve recovery lock documentation

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Christof Schmitt <cs at samba.org>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Mon Mar  9 02:27:18 UTC 2020 on sn-devel-184

- - - - -
f92af661 by Ralph Boehme at 2020-03-09T14:15:06+00:00
vfs_recycle: prevent flooding the log if we're called on non-existant paths

vfs_recycle is assuming that any path passed to unlink must exist, otherwise it
logs this error. Turn this into a DEBUG level message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14316
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1780802

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Mon Mar  9 14:15:06 UTC 2020 on sn-devel-184

- - - - -
0825324b by Günther Deschner at 2020-03-09T15:00:31+00:00
s4-torture: add rpc test for ChangeServiceConfigW

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c3fa0b2d by Günther Deschner at 2020-03-09T15:00:31+00:00
s4-torture: add ndr svcctl testsuite

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ebda529b by Günther Deschner at 2020-03-09T15:00:31+00:00
librpc: fix IDL for svcctl_ChangeServiceConfigW

Found while trying to run winexe against Windows Server 2019.

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
54c21a99 by Günther Deschner at 2020-03-09T16:27:21+00:00
winexe: add configure option to control whether to build it (default: auto)

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Mar  9 16:27:21 UTC 2020 on sn-devel-184

- - - - -
0e894f3e by Ralph Boehme at 2020-03-09T18:07:34+00:00
vfs_default: pass in state as the callback data to the subreq

Find the req we're finishing off by looking inside the state.  In a shutdown
close the caller calls talloc_free(req), so we can't access it directly as
callback data.

The next commit will NULL out the state->req pointer when a caller calls
talloc_free(req), and the request is still in flight.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
95cfcda1 by Ralph Boehme at 2020-03-09T18:07:34+00:00
vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer

If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the request is in
flight (share forced closed by smbcontrol), then we set state->req = NULL in the
state destructor.

The existing state destructor prevents the state memory from being freed, so
when the thread completes and calls vfs_getxattrat_done(), just throw away the result
if state->req == NULL.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
acb0b017 by Ralph Boehme at 2020-03-09T18:07:34+00:00
smbd: move pending aio cleanup to a helper function

We'll be reusing this from close_directory() in the next commit.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f94cd10a by Ralph Boehme at 2020-03-09T18:07:34+00:00
smbd: call tevent_req_nterror() for directories when cleaning up pending aio

smbd_smb2_query_directory_recv() calls tevent_req_is_nterror() which requires a
NTSTATUS error code.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0ae4f368 by Ralph Boehme at 2020-03-09T19:34:27+00:00
smbd: reuse close_free_pending_aio() in close_directory()

A directory fsp can have outstanding aio requests as well.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Mar  9 19:34:27 UTC 2020 on sn-devel-184

- - - - -
d048d7e1 by Andrew Bartlett at 2020-03-09T22:03:26+00:00
bootstrap: Remove long-unsupported OS versions

Samba has not built on these versions for quite some time due to
the need for Python 3.5 and GnuTLS 3.4.7

These were always marked as broken, but given the requirements
these are never likely to come back.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
e9ce0f13 by Andrew Bartlett at 2020-03-09T22:03:26+00:00
.gitlab-ci.yml: Do not build Samba for Ubuntu 16.04 or Debian 9 any longer

These only have Python 3.5 and we want to increase the minimum to Python 3.6.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
609c9903 by Andrew Bartlett at 2020-03-09T22:03:26+00:00
Require Python 3.6 for Samba 4.13

This allows Samba to use formatted string literals, which
are quite handy.

REF: https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep498

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
54f26cfc by Andreas Schneider at 2020-03-09T23:42:26+00:00
autobuild: Run the none env in the samba-o3 build

This includes tests which should make sure that certain code is not
optimized away, like memset_s().

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Mon Mar  9 23:42:26 UTC 2020 on sn-devel-184

- - - - -
77f69771 by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Skipped tests should not cause failure

Skipped tests return a status that indicates failure.  In combination
with the -e option this results in an exit with failure on the first
skipped test.

Convert skipped test status to success.  The skip has already been
counted.

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

- - - - -
30180ef6 by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Use ctdb_test_skip() when shellcheck is not installed

When the tests are run interactively this will make it more noticeable
that shellcheck is not installed because the test summary will
indicate missing tests.

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

- - - - -
8402dabf by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Use ctdb_test_skip() when initscript can not be found

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

- - - - -
c5dd4767 by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Add function ctdb_test_check_supported_OS

Skips test if not on one of the supported OSes.

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

- - - - -
b10e79f2 by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Skip "ctdb process-exists" tests when not on Linux

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

- - - - -
60269452 by Martin Schwenke at 2020-03-10T07:37:34+00:00
ctdb-tests: Split system socket test

One test for each of types, TCP, ARP.

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

- - - - -
9f9dcfb6 by Martin Schwenke at 2020-03-10T09:17:12+00:00
ctdb-tests: Use built-in hexdump() in system socket tests

Better compatibility, since od output isn't consistent on FreeBSD.

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Mar 10 09:17:12 UTC 2020 on sn-devel-184

- - - - -
bebad45b by Isaac Boukris at 2020-03-10T13:02:27+00:00
Adapt sign_authdata in our KDB module for krb5 v1.18

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
5d73cc40 by Isaac Boukris at 2020-03-10T13:02:27+00:00
Fix uxsuccess test with new MIT krb5 library 1.18

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
34347586 by Isaac Boukris at 2020-03-10T13:02:27+00:00
Sign and verify PAC with ticket principal instead of canon principal

With MIT library 1.18 the KDC no longer set
KRB5_KDB_FLAG_CANONICALIZE for enterprise principals which allows
us to not canonicalize them (like in Windows / Heimdal).

However, it now breaks the PAC signature verification as it was
wrongly done using canonical client rather than ticket client name.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
8b0c796f by Andreas Schneider at 2020-03-10T13:02:27+00:00
selftest: Set KRB5RCACHETYPE to none for selftest

This is required that out tests work with MIT KRB5 1.18.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
0982980d by Isaac Boukris at 2020-03-10T14:46:04+00:00
mit-kdc: Explicitly reject S4U requests

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Tue Mar 10 14:46:04 UTC 2020 on sn-devel-184

- - - - -
9653a107 by Volker Lendecke at 2020-03-10T21:25:33+00:00
libsmbclient: Put it back to a known, well-working state

For adapting unix extensions in our client libraries, we need a fresh start
with additional APIs. We can't change existing application behaviour.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c8d51953 by Volker Lendecke at 2020-03-10T21:25:33+00:00
smbd: Fix a comment, "flags" expanded to 2 bytes

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
52b5bcb6 by Volker Lendecke at 2020-03-10T21:25:33+00:00
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
12596a3a by Volker Lendecke at 2020-03-10T23:08:19+00:00
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Mar 10 23:08:20 UTC 2020 on sn-devel-184

- - - - -
00ab6349 by Christof Schmitt at 2020-03-11T08:09:32+00:00
rpcclient: Ask for minimal permissions for SID and name lookups

The RPC calls to lookup SIDS and names only require the
POLICY_LOOKUP_NAMES permission. Only ask for that instead of the
MAXIMUM_ALLOWED flag. This allows these calls to work against a NetApp
that does not accept MAXIMUM_ALLOWED (see bugzilla 11105).

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
808d6c0c by Christof Schmitt at 2020-03-11T09:52:44+00:00
selftest: Add test for rpcclient LSA lookup calls

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Mar 11 09:52:44 UTC 2020 on sn-devel-184

- - - - -
6a4fa078 by Ralph Boehme at 2020-03-12T03:47:30+00:00
ctdb-daemon: ensure restart() callback is called in half-connected state

If NODE_FLAGS_DISCONNECTED is set the node can be in half-connected state. With
this change we ensure to restart the transport for this case.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
15762a34 by Martin Schwenke at 2020-03-12T03:47:30+00:00
ctdb-daemon: more logical whitespace, debug modernisation

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

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0ff1b78f by Noel Power at 2020-03-12T03:47:30+00:00
ctdb-tcp: move free of inbound queue to TCP restart

Since commit 77deaadca8e8dbc3c92ea16893099c72f6dc874e, a nodeA which
had previously accepted a connection from nodeB (where nodeB dies
e.g. as as result of fencing) when nodeB attempts to connect again
after restarting is always rejected with

 ctdb_listen_event: Incoming queue active, rejecting connection from w.x.y.z

messages.

Consolidate dead node handling in the TCP restart handling.

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

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
b83ef98c by Ralph Boehme at 2020-03-12T03:47:30+00:00
ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb()

ctdb_tcp_tnode_cb() is called when we receive data on the outgoing connection.

This can happen when we get an EOF on the connection because the other side as
closed. In this case data will be NULL.

It would also be called if we received data from the peer. In this case data
will not be NULL.

The latter case is a fatal error though and we already call
ctdb_tcp_stop_connection() for this case as well, which means even though the
node is not fully connected anymore, by not calling the node_dead() upcall
NODE_FLAGS_DISCONNECTED will not be set.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
ea37ecdc by Ralph Boehme at 2020-03-12T03:47:30+00:00
ctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb()

The node dead upcall has already restarted the outgoing connection.
There's no need to repeat it.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Martin Schwenke <martin at meltin.net>

- - - - -
1e2a967f by Ralph Boehme at 2020-03-12T03:47:30+00:00
ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing()

No change in behaviour.  This makes the code self-documenting.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
2c73dbaf by Ralph Boehme at 2020-03-12T03:47:30+00:00
ctdb-tcp: add ctdb_tcp_stop_incoming()

No change in behaviour.  This makes the code self-documenting.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Martin Schwenke <martin at meltin.net>

- - - - -
3c8747fe by Martin Schwenke at 2020-03-12T03:47:30+00:00
ctdb-tcp: Factor out function ctdb_tcp_start_outgoing()

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

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

- - - - -
319c93f0 by Martin Schwenke at 2020-03-12T05:29:20+00:00
ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect()

The only place the outgoing connection needs to be stopped is when
there is a timeout when waiting for the connection to become writable.
Add a new function ctdb_tcp_node_connect_timeout() to handle this
case.

All of the other cases are attempts to establish a new outgoing
connection (initial attempt, retry after an error or disconnect, ...)
so drop stopping the connection in those cases.

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

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

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Thu Mar 12 05:29:20 UTC 2020 on sn-devel-184

- - - - -
566658d9 by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: tests: Slight tweak to the force-close share test.

Turns out on a fast desktop machine 10MB is too small,
and by the time we've done the 'sleep 1' to make sure
the smbclient got scheduled and started processing
the 'put' command, it's already done.

Tweak the file size to be 20MB from 10MB. 10MB
seems to work reliably on gitlab-ci and on
sn-devel, but making the put size 20MB makes
sure it's still in flight when we force-close
the share, even on a fast desktop box. 20MB
shouldn't be too burdonsome even on ci VM's.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0c952bba by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: smbd: In aio_del_req_from_fsp() talloc_free(fsp->aio_requests[]) when fsp->num_aio_requests reaches zero.

The add code in aio_add_req_to_fsp() re-tallocs
this array on demand, and talloc freeing it here
allows it to be used as the parent for a tevent
wait queue, so callers can get notified when
all outstanding aio on an fsp is finished.

We'll deal with any performance issues in
the next commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b90bc0f2 by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: smbd: Now we free fsp->aio_requests when it gets zero entries, talloc in chunks of 10 instead of 1.

Prevents incremental +1 tallocs, and the original
idea of this array was that it wasn't freed for
io efficiency reasons. Add paranoia integer wrap
protection also.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b7d09b30 by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: smbd: In async SMB1 reply_close() set fsp->closing = true, as we already do in SMB2 async close.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4287ea13 by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: smbd: Every place we check fsp->deferred_close, also check for fsp->closing.

Eventually this will allow us to remove fsp->deferred_close
from the fsp struct (and also source3/lib/tevent_wait.[ch]).

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ac800ca6 by Jeremy Allison at 2020-03-18T18:03:28+00:00
s3: smbd: Don't allow force disconnect of a connection already being disconnected.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4f9e0459 by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Add async internals of conn_force_tdis().

Commented out so it can be seen complete as
a diff. The next commit will replace the old
synchronous conn_force_tdis() code with the
new async code.

Uses a wait_queue to cause the force close
requests to stay pending until all outstanding
aio is finished on all file handles opened
on the connection.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7891302a by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Replace synchronous conn_force_tdis() with the async version.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
86cc67d5 by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Add async internals of reply_tdis().

Waits until all aio requests on all fsp's under this
conn struct are finished before returning to the client.

Charges the profile time in the done function. Not strictly
correct but better than the other SMB1 async code that
double-charges profiling in both send and done at the
moment.

Done this way (commented out) so it is a clean
diff and it's clear what is being added.

A later commit will remove the old synchronous version.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ca4521f1 by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: In reply_tdis(), replace req -> smb1req.

Minimises the diff in the next commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
71725f1c by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: reply_tdis() Update to modern coding standards.

Minimizes the diff in the next commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7613998e by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Remove old synchronous SMB1 reply_tdis().

SMB1 tree disconnect is now fully async.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4dd3012c by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Add async internals of reply_ulogoffX.

Waits until all aio requests on all fsp's owned by this
vuid are finished before returning to the client.

Charges the profile time in the done function. Not strictly
correct but better than the other SMB1 async code that
double-charges profiling in both send and done at the
moment.

Done this way (commented out) so it is a clean
diff and it's clear what is being added.

A later commit will remove the old synchronous version.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5c073aa0 by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: In reply_ulogoffX(), replace req -> smb1req.

Minimises the diff in later commits.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9cda76ad by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: reply_ulogoffX() Update to modern coding standards.

Minimizes the diff in the later commits.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
446b64ca by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Remove old synchronous SMB1 reply_ulogoffX().

SMB1 user logoff is now fully async.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8f58feab by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Add async internals of reply_exit().

Waits until all aio requests on all fsp's owned by this
vuid are finished before returning to the client.

Charges the profile time in the done function. Not strictly
correct but better than the other SMB1 async code that
double-charges profiling in both send and done at the
moment.

Done this way (commented out) so it is a clean
diff and it's clear what is being added.

A later commit will remove the old synchronous version.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1de0daa7 by Jeremy Allison at 2020-03-18T18:03:29+00:00
s3: smbd: Remove old synchronous SMB1 reply_exit().

SMB1 exit is now fully async.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
58493343 by Jeremy Allison at 2020-03-18T18:03:30+00:00
s3: smbd: Remove file_close_pid().

The old synchronous reply_exit() was the only user.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1a52e635 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer"

This reverts commit 95cfcda13fe9a70b9955a7c44173d619eacb34c1.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
626b2b0e by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "vfs_default: pass in state as the callback data to the subreq"

This reverts commit 0e894f3e48285415f72cf7a68e26f1802fe8045d.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3616d399 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_fsync_done() from accessing a freed req pointer."

This reverts commit 9ecbda263f102a24257fd47142b7c24d1f429d8d.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a4e51f26 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_fsync_state as the callback data to the subreq."

This reverts commit cdde55a69d0dacd2f9939c2f00cd356c0186f791.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
aac29930 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_fsync_state."

This reverts commit c0c088b1b786f0ba248960114191277e91bbba2f.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f2d5e1a8 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_done() from accessing a freed req pointer."

This reverts commit 67910c751c9f5ce8cdd1e57b34e51e5b7163838b.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e8c0bdb4 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pwrite_state as the callback data to the subreq."

This reverts commit 3357a77d0823eddc1b0db68cfa251a0d54058c88.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d9b00159 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pwrite_state."

This reverts commit 058a7effd00b47e4778f7d680cc9c2a7d40d5fa8.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e189d707 by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_done() from accessing a freed req pointer."

This reverts commit 99283871c5230e640a8102943ebed685459ed9af.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
097e48fa by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pread_state as the callback data to the subreq."

This reverts commit c6c4e2de22cd3d84f45f5c21e6b09b09274f7f7b.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7acec67a by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pread_state."

This reverts commit 0e3dc0078ebd6aa79553bf2afa8e72945e23dfb0.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
27e1bfce by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req pointer."

This reverts commit 18671534e42f66b904e51c3fbe887e998ff79493.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
22ebf32f by Jeremy Allison at 2020-03-18T18:03:30+00:00
Revert "s3: VFS: vfs_default. Pass in struct vfswrap_fsync_state as the callback data to the subreq."

This reverts commit d623779913e0d4a46d7e299dc41b5c83cb127872.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ddd14d36 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_fsync_state."

This reverts commit 4adde71b99d4ab09914072458329d5f1008b77e3.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
106f83e6 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default. Protect vfs_pwrite_done() from accessing a freed req pointer."

This reverts commit c8cd93dd54cb9f78665928d4bc8fcc3baf084b6f.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a6c186b6 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default. Pass in struct vfswrap_pwrite_state as the callback data to the subreq."

This reverts commit 13e25d68385aa951115e0e063ec6a9a281fea4a4.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6041a936 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pwrite_state."

This reverts commit 86cc7439501ab9b9eb018a18dbbef9567eb9b6f9.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ce0235be by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default. Protect vfs_pread_done() from accessing a freed req pointer."

This reverts commit b9ad06079fe362385cc4c77f8e8d54f5f74d6db6.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
43d5d9b0 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default. Pass in struct vfswrap_pread_state as the callback data to the subreq."

This reverts commit e102908f112866d657b8c0cd6a5b217d070210c8.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9a5b79c6 by Jeremy Allison at 2020-03-18T18:03:31+00:00
Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pread_state."

This reverts commit 594a435b33e8447625ca83b50daec2d08cf66d64.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
86dd5a08 by Ralph Boehme at 2020-03-18T19:40:00+00:00
smbd: enforce AIO requests draining

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Mar 18 19:40:00 UTC 2020 on sn-devel-184

- - - - -
73fedf01 by Ralph Boehme at 2020-03-19T01:20:34+00:00
s4/torture: fix a timestamps test to work on ext filesystem

ext filesystem has a time_t limit of 15032385535 (0x0x37fffffff). From
Documentation/filesystems/ext4/inodes.rst:

  If the inode structure size ``sb->s_inode_size`` is larger than 128 bytes and
  the ``i_inode_extra`` field is large enough to encompass the respective
  ``i_[cma]time_extra`` field, the ctime, atime, and mtime inode fields are
  widened to 64 bits. Within this “extra” 32-bit field, the lower two bits are
  used to extend the 32-bit seconds field to be 34 bit wide; the upper 30 bits
  are used to provide nanosecond timestamp accuracy. Therefore, timestamps
  should not overflow until May 2446. ...

Changing the test to use the value 0x37fffffff instead of 100000000000 allows
running the test locally on ext filesytems.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
47508c5e by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: mtime update logic with 2 handles: write io on handle 1, then set mtime on handle 2

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c63d6c9e by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: add a test verifying a flush flushes a pending writetime update

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4e3c2afb by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: add a test verifying a setinfo(basicinfo) flushes a pending writetime update

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
79d7d6b9 by Ralph Boehme at 2020-03-19T01:20:34+00:00
smbd: always flush pending write time update when setting filesize

We need to flush a pending write time update even when we're setting the
filesize to current filesize.

Note that we're already doing it this way in the relevant places listed my
dochelp at MS in

https://lists.samba.org/archive/cifs-protocol/2019-December/003364.html

  Cleanup (= Close)
  SetBasicInfo
  SetAllocationInfo
  SetEndOfFileInfo
  SetValidDataLengthInfo
  Flush
  FSCTL_SET_ENCRYPTION
  FSCTL_OFFLOAD_WRITE

Cleanup (= Close):

  Already implemented by update_write_time_on_close() and friends.

SetBasicInfo:

  Currently doesn't flush pending updates. Fixed by a subsequent commit.

SetAllocationInfo:

  smb_set_file_allocation_info() when setting a file's allocation size.

SetEndOfFileInfo:

  Currently doesn't flush pending updates. Fixed by a subsequent commit.

SetValidDataLengthInfo:

  Not implemented, returns NT_STATUS_NOT_SUPPORTED which seems wrong btw, as
  SetValidDataLengthInfo IS listed in MS-SMB2 2.2.39.

Flush:

  Currently doesn't flush pending updates. Fixed by subsequent commit..

FSCTL_SET_ENCRYPTION:

  Windows 2016 doesn't flush a pending writetime update, verified with a
  smbtorture test.

FSCTL_OFFLOAD_WRITE:

  NT_STATUS_NOT_IMPLEMENTED

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d99d5bf2 by Ralph Boehme at 2020-03-19T01:20:34+00:00
smbd: flush pending writetime update when flushing file

Cf the explanations in the previous commit.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7b90fe69 by Ralph Boehme at 2020-03-19T01:20:34+00:00
smbd: flush pending writetime update when setting timestamps file

Cf the explanations in the previous commits.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6f7d1d8a by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: Windows 2019 15 ms timestamp resolution

This test demonstrates that Windows has a timestamp resolution of ~15ms.

When a smaller amount of time than that has passed between modifying operations
on a file, it's not necessarily detectable on a Windows 2019 server that
implements immediate timestamp updates (no delayed magic).

Note that this test relies on a low latency SMB connection. Even with a low
latency connection of eg 1m there's a chance of 1/15 that the first part of the
test expecting no timestamp change fails as the writetime is updated.

Due to this timing dependency this test is skipped in Samba CI, but it is
preserved here for future SMB2 timestamps behaviour archealogists.

See also: https://lists.samba.org/archive/cifs-protocol/2019-December/003358.html

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2c19d271 by Ralph Boehme at 2020-03-19T01:20:34+00:00
smbd: remove stat call from mark_file_modified()

This stat dates back to d03453864ab1bc5fd3b4a3abaf96176a006c102b where the call
to trigger_write_time_update() had been to the file IO codepath. It was present
there for other reasons: to setup the write-cache based on the file's size.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
58fa7b4f by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: delayed timestamp update test: single write

Verify close only updates write-time when a delayed update is actually pending.

This scenario is not covered by basic.delaywrite.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
60aecca9 by Ralph Boehme at 2020-03-19T01:20:34+00:00
torture/smb2: delayed timestamp updates test: more then one write

Verify a close updates the write-time for subsequent writes after an initial
write started the delayed update logic.

This covers a scenario that will become relevant with the two subsequent
commits. The next commit:

  smbd: let mark_file_modified() always call trigger_write_time_update()

ensures that trigger_write_time_update() is not only called for the first write
on a file. Without that preaparatory change, the second commit:

  smbd: let delayed update handler also update on-disk timestamps

alone would cause this test to fail.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
53de2da7 by Ralph Boehme at 2020-03-19T01:20:34+00:00
smbd: let mark_file_modified() always call trigger_write_time_update()

Preperatory change: the next commit will reset fsp->update_write_time_on_close
in the event handler, so this change ensures it gets set again for any
subsequent write.

This will NOT always result in a write-time update because
trigger_write_time_update() has its own only-once logic using the internal
variable fsp->update_write_time_triggered.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
81c1a14e by Ralph Boehme at 2020-03-19T03:05:40+00:00
smbd: let delayed update handler also update on-disk timestamps

Let delayed update handler also update on-disk timestamps by calling
trigger_write_time_update_immediate().

trigger_write_time_update_immediate() sets fsp->update_write_time_on_close to
false which prevents updating the write-time on close if there was ever only one
write to the file.

Besides resetting fsp->update_write_time_on_close and setting the on-disk timestamps
trigger_write_time_update_immediate() takes the same steps as the removed code.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Mar 19 03:05:40 UTC 2020 on sn-devel-184

- - - - -
cb034a9f by Andreas Schneider at 2020-03-19T20:46:41+00:00
lib:crypto: Add samba_gnutls_weak_crypto()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3d1ecef1 by Andreas Schneider at 2020-03-19T20:46:41+00:00
s3:utils: Add weak crypto information to testparm

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7d09c1cc by Andreas Schneider at 2020-03-19T20:46:41+00:00
lib:param: Add lp(cfg)_weak_crypto()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
6ada071d by Andreas Schneider at 2020-03-19T20:46:41+00:00
gensec: Add a check if a gensec module implements weak crypto

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
32f83be8 by Andreas Schneider at 2020-03-19T20:46:41+00:00
auth:ntlmssp: Mark as weak_crypto

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0b84bc03 by Andreas Schneider at 2020-03-19T20:46:41+00:00
waf: Check if GnuTLS has support for crypto policies

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ff70d7cc by Andreas Schneider at 2020-03-19T20:46:42+00:00
tests: Add test for weak crypto

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
54062053 by Noel Power at 2020-03-19T20:46:42+00:00
python/samba/gp_parse: Fix test errors with python3.8

UNEXPECTED(failure): samba.tests.samba_tool.gpo.samba.tests.samba_tool.gpo.GpoCmdTestCase.test_backup_restore_generalize(ad_dc:local)
REASON: Exception: Exception: Traceback (most recent call last):
  File "/tmp/samba-testbase/b28/samba-ad-dc-1/bin/python/samba/tests/samba_tool/gpo.py", line 434, in test_backup_restore_generalize
    self.assertIsNone(has_difference(os.path.join(new_path, 'policy',

This caused because prior to 3.8 minodom.toprettyxml() was sorting the
attribute order, now it preserves the attribute order specified by the user
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ee5c07cb by Andrew Bartlett at 2020-03-19T20:46:42+00:00
build: Allow a fuzzing build with Python 3.5

The Python 3.6 changes are only in actual .py files, not in the build system
nor the C side of things, so relax this so we can still build on oss-fuzz
which is based on Ubuntu 16.04 for now.

REF: https://github.com/google/oss-fuzz/issues/3505
REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21189

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
e10910f8 by Andrew Bartlett at 2020-03-19T20:46:42+00:00
bootstrap: Bring back a Ubuntu 16.04 build but just for the samba-fuzz task

This is needed to restore oss-fuzz support, as this uses the Ubuntu 16.04 package list
because all the docker images provided start with a Ubuntu 16.04 base.

REF: https://github.com/google/oss-fuzz/issues/3505
REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21189

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
32d56271 by Noel Power at 2020-03-19T20:46:42+00:00
s4/param: don't decref object we don't own

provision_fn is a borrowed reference we should not
call Py_CLEAR on it

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9e84f1e5 by Noel Power at 2020-03-19T20:46:42+00:00
s4/param: treat NULL value passed to dict_insert as error

insert_dict is used as a convenience to decrement the values to
prevent leaks with orpahaned PyObjects and avoid excessive creation of
temp variables.

        if (!dict_insert(parameters,
                         "rootdn",
                         PyUnicode_FromString(settings->root_dn_str))) {
                status = NT_STATUS_UNSUCCESSFUL;
                goto out;
        }

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2321b11f by Noel Power at 2020-03-19T22:23:52+00:00
s4/param: py_sid shouldn't be decref'ed after insertion into dict

This was causing samba.tests.net_join_no_spnego(ad_dc) to
core dumps sometimes on tumbleweed with python3.8

with...

===============================================================
INTERNAL ERROR: Signal 11 in pid 1781 (4.12.0)
If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
===============================================================
smb_panic_default: PANIC (pid 1781): internal error
BACKTRACE: 64 stack frames:

7128  #0 bin/shared/libsamba-util.so.0(log_stack_trace+0x1f) [0x7fa541c5b220]
7129  #1 bin/shared/libsamba-util.so.0(+0x1efc8) [0x7fa541c5afc8]
7130  #2 bin/shared/libsamba-util.so.0(log_stack_trace+0) [0x7fa541c5b201]
7131  #3 bin/shared/libsamba-util.so.0(+0x1eed9) [0x7fa541c5aed9]
7132  #4 bin/shared/libsamba-util.so.0(+0x1eeee) [0x7fa541c5aeee]
7133  #5 /lib64/libc.so.6(+0x3bf20) [0x7fa542631f20]
7134  #6 /usr/lib64/libpython3.8.so.1.0(PyObject_GC_UnTrack+0xd) [0x7fa542386c1d]
7135  #7 /usr/lib64/libpython3.8.so.1.0(+0x12d599) [0x7fa542387599]
7136  #8 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4d6d) [0x7fa5424269ed]
7137  #9 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x30c) [0x7fa5423eaf5c]
7138  #10 /usr/lib64/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x18e) [0x7fa5423ebcbe]
7139  #11 /usr/lib64/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4a3a) [0x7fa5424266ba]
etc....

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Mar 19 22:23:52 UTC 2020 on sn-devel-184

- - - - -
39c910fd by Volker Lendecke at 2020-03-20T05:06:07+00:00
libsmb: Don't try to find posix stat info in SMBC_getatr()

This wrongly used "frame" instead of "fname", which can never have
worked. A first attempt to fix in 51551e0d53fa6 caused a few followup
patches in an attempt to clean up the test failures 51551e0d53fa6
introduced. They were reverted after a few discussions. So rather than
changing behaviour, just remove the code that introduced the valgrind
error again.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Mar 20 05:06:07 UTC 2020 on sn-devel-184

- - - - -
272b43d3 by Andreas Schneider at 2020-03-20T11:04:30+00:00
bootstrap: Add podman command to readme

Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
639e64d3 by Andreas Schneider at 2020-03-20T12:41:36+00:00
third_party: Update nss_wrapper to version 1.1.10

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Mar 20 12:41:36 UTC 2020 on sn-devel-184

- - - - -
08756664 by Andreas Schneider at 2020-03-20T13:41:27+00:00
gitlab-ci: Remove Fedora 29 which is already EOL

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
- - - - -
ef08b303 by Andreas Schneider at 2020-03-20T13:41:27+00:00
gitlab-ci: Remove Fedora 30

It is pretty similar to Fedora 31, so remove it safe some CI resources.
We will add Fedora 32 next.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
- - - - -
bce99f59 by Andreas Schneider at 2020-03-20T15:19:50+00:00
gitlab-ci: Add Fedora 32 (Beta)

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Mar 20 15:19:50 UTC 2020 on sn-devel-184

- - - - -
d809da3a by Samuel Cabrero at 2020-03-20T15:36:31+00:00
selftest: Run python.samba.tests.dcerpc.raw_protocol against S3 ad_member

The goal is to pass the raw protocol testsuite against s3 RPC server.
To do so we need to enable epmd and lsasd daemons, as the testsuite
connects to the endpoint mapper and lsa endpoints using NCACN_IP_TCP
and NCACN_NP transports.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
19034670 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
pidl:NDR/ServerCompat: Compat server PIDL parser

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
dc1d34d3 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Include generated boilerplate code

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3bcbad0c by Samuel Cabrero at 2020-03-20T15:36:31+00:00
selftests: Test lsa over netlogon in nt4 dc environment

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9331772e by Samuel Cabrero at 2020-03-20T15:36:31+00:00
selftests: Tests only appropiate RPC interfaces are available in smb pipes

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
06f1bad0 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Provide LSA ncacn_np secondary endpoint and LSA over Netlogon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d77a4e55 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers for embedded services

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
da5aabde by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers in external epmd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
909cf570 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers in external lsasd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
612c7fa3 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers in external fssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3692290e by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers in external spoolssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
eea1c425 by Samuel Cabrero at 2020-03-20T15:36:31+00:00
s3:rpc_server: Register endpoint servers in external mdssd daemon

The parent calls the setup function to register the endpoint server, as
it has to be registered to initialize the endpoints (create the sockets).

Delete the setup call from forker childs as it is already registered by
the parent.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ed02614e by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:winbindd: Register endpoint servers in winbindd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
20542bcf by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Add global dcesrv_context init and shutdown functions

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3719de01 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Initialize global dcesrv_context for embedded services

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
1f87794d by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Shutdown registered enpoint servers on server exit

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f1eec15c by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Reinitialize dcesrv_context in external epmd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
eeb6888f by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Reinitialize dcesrv_context in external fssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
80c57f23 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Reinitialize dcesrv_context in external mdssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3b52f154 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Reinitialize dcesrv_context in external lsasd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f89ae363 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Reinitialize dcesrv_context in external spoolssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7eab9f88 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
pidl:NDR/ServerCompat: Register and unregister legacy api_struct cmds

Next commits will initialize the registered enpoint servers in S3 RPC
server, removing the rpc_{interface}_init calls. The legacy api_struct
registration will be registered by the enpoint server initialization
code generated by PIDL.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
36c2abbc by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Init registered endpoint servers for embedded services

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0e2839f9 by Samuel Cabrero at 2020-03-20T15:36:32+00:00
s3:rpc_server: Init registered ep servers in external epmd daemon

Initialize and shutdown the endpoint servers registed by the endpoint
mapper daemon. The pidl-generated init function will register the
api_struct for backward compatibility until completely removed.

The common server exit routine will shutdown all registered endpoint
servers, and the pidl-generated shutdown function will unregister the
api_struct.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
887a8b37 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Init registered ep servers in external spoolssd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a450f103 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Init registered ep servers in external lsasd daemon

Initialize and shutdown the endpoint servers registed by the lsasd
daemon. The pidl-generated init function will register the
api_struct for backward compatibility until completely removed.

The common server exit routine will shutdown all registered endpoint
servers, and the pidl-generated shutdown function will unregister the
api_struct.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
99b5b9a9 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Init registered ep servers in external fssd daemon

Initialize and shutdown the endpoint servers registed by the fssd
daemon. The pidl-generated init function will register the
api_struct for backward compatibility until completely removed.

The common server exit routine will shutdown all registered endpoint
servers, and the pidl-generated shutdown function will unregister the
api_struct.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
5174e469 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Init registered ep servers in external mdssd daemon

Initialize and shutdown the endpoint servers registed by the mdssd
daemon. The pidl-generated init function will register the
api_struct for backward compatibility until completely removed.

The common server exit routine will shutdown all registered endpoint
servers, and the pidl-generated shutdown function will unregister the
api_struct.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
eeacac2e by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:winbindd: Initialize dcesrv_context and ep servers in winbindd daemon

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b9e5740a by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Setup dcesrv_context callbacks

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
4e7670ed by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Implement association group find callback

Keep the s3 server behaviour for now and return always the same
association group ID, 0x53F0.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
c97a7729 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Add a function to setup the endpoints

The pidl-generated initialization function for each endpoint server will
register the RPC interface in all endpoints defined in the idl file.

The interface registration code will create the endpoint if it does not
exists (as an endpoint can serve multiple interfaces) and will add it to
the endpoint list exiting in the dcesrv_context.

This commit adds a generic dcesrv_setup_endpoint_sockets function which
will be used by embedded services and non-preforking external daemons to
setup the sockets regardless the transport.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
228f8b2c by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Add a function to create the endpoints sockets

The pidl-generated initialization function for each endpoint server will
register the RPC interface in all endpoints defined in the idl file.

The interface registration code will create the endpoint if it does not
exists (as an endpoint can serve multiple interfaces) and will add it to
the endpoint list exiting in the dcesrv_context.

This commit adds a generic dcesrv_create_endpoint_sockets function which
will be preforking external daemons to create the sockets regardless the
endpoint transport. This function will only create the sockets, the
external preforking daemon is who will start listening.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2d2c4881 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Initialize the embedded services endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0e6d138c by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Initialize epmd connection endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d0a2b0c7 by Samuel Cabrero at 2020-03-20T15:36:33+00:00
s3:rpc_server: Initialize lsasd connection endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
04d30536 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Initialize fssd connection endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
fd099ae1 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Initialize mdssd connection endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
5e7dc9fb by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Initialize spoolssd connection endpoints

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a18163a1 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Setup ncacn_ip_tcp sockets through endpoint init

The listener is created in the endpoint memory context. If the endpoint
is freed, the listener will be freed too and the socket closed.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a6b718b6 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Create ncacn_ip_tcp sockets through enpoint init

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
1d970fa8 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Setup ncalrpc sockets through endpoint initialization

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f8eb0e35 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Create ncalrpc socket through endpoint initialization

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
c0ff6da2 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Listen in different socket for ncalrpc when role is AD DC

If smbd and samba processes use DEFAULT as socket name they will race to
accept the NCALRPC connections.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
64a70a96 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Setup ncacn_np sockets through endpoint initialization

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9a6a5a50 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Create ncacn_np sockets through endpoint initialization

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
53ca9ad2 by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Remove unused members from dcerpc_ncacn_listen_state

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
82020a3f by Samuel Cabrero at 2020-03-20T15:36:34+00:00
s3:rpc_server: Drop dcerpc_binding_vector usage in the server side

The endpoint mapper entry is built using the dcesrv_endpoint and the
interfaces registered into it instead of using the
dcerpc_binding_vector.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7fef249d by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Retrieve the dcesrv_endpoint from prefork listen data

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0d37a00b by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Set a dcerpc_ncacn_conn termination function

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
06a913a2 by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Retrieve dcesrv_context from parent context to open NP

Get the dcesrv_context from parent context and use it to search the
endpoint serving the named pipe. Once we have the endpoint pass it to
the make_internal_rpc_pipe_socketpair function.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d4e6764b by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Store dcesrv context and endpoint in ncacn_conn

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d1afa40c by Samuel Cabrero at 2020-03-20T15:36:35+00:00
pidl:NDR/ServerCompat: Retrieve and setup pipes struct before dispatch

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
bebd5578 by Samuel Cabrero at 2020-03-20T15:36:35+00:00
pidl:NDR/ServerCompat: Add dispatch, reply, pull and push functions to header

Will be used by winspool to forward selected opnums to spoolss.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
73e32f5f by Samuel Cabrero at 2020-03-20T15:36:35+00:00
pidl:NDR/ServerCompat: Initialize and allocate out vars

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
42a7e7bc by Samuel Cabrero at 2020-03-20T15:36:35+00:00
pidl:NDR/ServerCompat: Generate local dispatching function

To be used in rpcint_binding_handle, prepare to remove legacy api_struct
and S3 pidl generated code.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
60fa8e25 by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Dispatch local calls through interfaces local handler

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
97ee59fd by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:winbindd: Dispatch RPC calls through interface local handler

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0c326e96 by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Update winspool generated server stub

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9bdf3ccd by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Switch to core dcerpc server loop

This commit finally switches the RPC server implementation.

At the same we have to do other related changes to keep code compiling
and test environments running.

First avoid moving the session_info into the allocated pipes_struct memory
context as it is owned now by the core RPC server, and the s3compat pidl
compiler will update the pipes_struct session_info before dispatching
the call with dcesrv_call->auth_state->session_info.

Also, fix a segfault in the endpoint mapper daemon when it tries to delete
the endpoints previously registered over a NCALRPC connection.

If we have:

rpc_server : epmapper = external
rpc_server : lsarpc = external
rpc_daemon : epmd = fork
rpc_daemon : lsasd = fork

The sequence is:

* The endpoint mapper starts (start_epmd in source3/smbd/server.c)
* The lsarpc daemon starts (start_lsasd in source3/smbd/server.c)
  * The lsarpc daemon creates the sockets and registers its endpoints
    (rpc_ep_register in source3/rpc_server/lsasd.c)
  * The endpoint registration code opens a NCALRPC connection to the
    endpoint mapper daemon (ep_register in source3/librpc/rpc/dcerpc_ep.c)
    and keeps it open to re-register if the endpoint mapper daemon dies
    (rpc_ep_register_loop in source3/rpc_server/rpc_ep_register.c)
* When the endpoint mapper daemon accepts a NCALRPC connection it sets a
  termination function (srv_epmapper_delete_endpoints)
* Suppose the lsarpc daemon exits. The NCALRPC connection termination
  function is called.
* The termination function tries to delete all endpoints registered by that
  connection by calling _epm_Delete
* _epm_Delete calls is_privileged_pipe which access to
  pipes_struct->session_info.

As the call to _epm_Delete occurs outside of the PIDL generated code,
the pipes_stuct->session_info is NULL. This commit also sets
pipes_struct->session_info from the dcerpc_connection before calling
_epm_Delete. As the core rpc server supports security context multiplexing we
need to pass the dcesrv_connection to the termination function and let the
implementation pick a auth context. In the case of the endpoint mapper
the termination function has to pick one of type NCALRPC_AS_SYSTEM to
check if the connection is privileged and delete the endpoints
registered by the connection being closed.

Finally, the samba.tests.dcerpc.raw_protocol testsuite passes against
the ad_member environment.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
c647c13a by Samuel Cabrero at 2020-03-20T15:36:35+00:00
s3:rpc_server: Remove call to s3 rpc services shutdown code

The rpc_<service>_shutdown function unregisters the legacy api_struct
from the local dispatch table, which is not longer used as local
dispatching is done through dcesrv_interface and will be removed in
following commits.

The dcesrv_shutdown_registered_ep_servers will unregister endpoint servers.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
04172e96 by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Remove s3 rpc server loop

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d891c2d3 by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Remove dead code and unused struct members

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f6d41e5b by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Remove api_struct

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
4c09839e by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Do not include s3 autogenerated headers

Prototype is generated by the server compat parser.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
e8e4ecfb by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Do not generate and build s3 RPC server code

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
93224d41 by Samuel Cabrero at 2020-03-20T15:36:36+00:00
s3:rpc_server: Remove unused RPC module init and shutdown callbacks

The setup function registers the endpoint server and RPC core routines
initialize and shutdown it.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9496e052 by Samuel Cabrero at 2020-03-20T17:11:28+00:00
s3:rpc_server: Remove dead code

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Samuel Cabrero <scabrero at samba.org>
Autobuild-Date(master): Fri Mar 20 17:11:28 UTC 2020 on sn-devel-184

- - - - -
fc13304d by Gary Lockyer at 2020-03-22T04:39:36+00:00
ldb tests: Confirm lmdb free list handling

Add cmocka tests to confirm lmdb's handling of the free list.

As a result of lmdb's MVCC (Multiversion Concurrency Control) long
running read transactions or stale readers (read transactions where the
process exited without ending the transaction) can cause the database to
run out of space.

Items in the free list are only reused when they would not be visible in
a read transaction.  So long running read transactions prevent entries
in the free list being reused, and the database can run out of space.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
83ff0527 by Gary Lockyer at 2020-03-22T04:39:36+00:00
ldb build: Remove some PEP8 warnings from wscript

Fix indentation of list members and fix lines > 79 characters to remove
PEP8 warnings.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
1f65f211 by Andrew Bartlett at 2020-03-22T04:39:36+00:00
selftest: Add test for dangling backlinks to objects that do not exist

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
b8ed1525 by Andrew Bartlett at 2020-03-22T04:39:36+00:00
selftest: Add test for dangling backlink to ourself, a missing and a real object

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
ad750ed1 by Andrew Bartlett at 2020-03-22T04:39:36+00:00
dsdb: Add test for the case of a link pointing back at its own object

This type of object was not possible to delete in Samba without first removing
the link.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
a4cdfbd1 by Andrew Bartlett at 2020-03-22T04:39:36+00:00
dsdb: Allow delete (directly and over DRS) of an object with a link to itself

Previously this would fail with Unsupported critical extension 1.3.6.1.4.1.7165.4.3.2

Reported by Alexander Harm.  Many thanks for helping make Samba better
and for your patience with patches and providing debugging information.

REF: https://lists.samba.org/archive/samba/2020-February/228153.html
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14306

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
c680daae by Douglas Bagnall at 2020-03-22T06:19:51+00:00
idl/drsblobs: do not overwrite number of schedules == 1

If the struct has zero or two schedules, that is what it has, and we
should let that be.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Sun Mar 22 06:19:51 UTC 2020 on sn-devel-184

- - - - -
a779f0a5 by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: In SMB1 reply_close() rename all uses of 'struct smb_request' to smb1req.

Will make further changes easier to see, as we now use
req for tevent_req structs.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
91cdfa3d by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: Update reply_close() to modern DBG_ coding style.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
20290d02 by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: In asnyc do_smb1_close() use the utility function meant for async SMB1 replies.

Don't use the raw call.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fef2054d by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: Add async internals of reply_close().

Waits until all aio requests on the closing fsps
before returning to the client.

Slightly modified version of the existing async
reply_close code, updated to use the wait_queue
pattern standardized in reply_tdis, reply_ulogoffX
and reply_exit.

Done this way (commented out) so it is a clean
diff and it's clear what is being added.

The next commit will remove the old version.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
53ee2838 by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: Remove old async versions of SMB1 reply_close().

Use the common pattern to wait for aio.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b686de4e by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: Convert async SMB2 close to use the wait_queue idiom.

Use the same mechanism to wait for aio on a handle used by
SMB1 reply_tdis(), reply_ulogoffX(), reply_exit(), reply_close()
and SMB2 tree disconnect.

This removes the last user of fsp->deferred_close, allowing
us to remove it.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
76b9a359 by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: smbd: Remove all references to fsp->deferred_close.

We are now free to remove it from struct files_struct.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f6efda21 by Jeremy Allison at 2020-03-23T09:40:45+00:00
s3: VFS: Remove deferred_close from struct files_struct.

Bump up the VFS number to 43. Samba 4.13 will ship with that.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4337c144 by Jeremy Allison at 2020-03-23T12:06:45+00:00
s3: Remove tevent_wait code. The last user was fsp->deferred_close.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Mon Mar 23 12:06:45 UTC 2020 on sn-devel-184

- - - - -
607c9ab3 by Andrew Bartlett at 2020-03-23T13:02:31+00:00
build: Require --without-ad-dc for --without-ads

Building an AD DC while setting --without-ads makes no sense and just wastes compile time on our build hosts.

To allow samba-nt4 to build --without-ad-dc we set rpc.spoolss.notify
(which is built on the NTVFS fileserver for the callbacks) to run in
the ad_member environment rather than nt4_dc and ad_dc.

This is also just more realistic in any case.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
fb2918bb by Andrew Bartlett at 2020-03-23T13:02:32+00:00
.gitlab-ci.yml: Move the short samba-xc job into "others"

This job is over in 8mins total and much of that is spent setting up.

It can safely be combined with the others in "others"

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
7a44bd1c by Andrew Bartlett at 2020-03-23T13:02:32+00:00
autobuild: Merge the samba-ktest-heimdal and samba-fileserver jobs

This avoids a full compile of Samba just to test Kerberos with a system Heimdal
while still providing an environment to test other fileserver features.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
88c4305f by Andrew Bartlett at 2020-03-23T13:02:32+00:00
selftest: Run smb2.compound_find against filesrever only, not nt4_dc and ad_dc

This is a slow test of SMB2 protocol features, it needs not to be repeated.  It only
got run against both by accident at the original merge and then extended to
run on the [compount_find] share (with smbd:find async delay usec = 10000)
but really does not need to be run three times.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
9bdc5a67 by Andrew Bartlett at 2020-03-23T14:45:59+00:00
autobuild: Merge samba-simpleserver into samba-nt4

This saves CI resources (20mins build time) at the expense of making
the samba-nt4 job take 45min (5 min longer).

The new maximum job time is 1:15 by samba-o3 on the different hosts.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Mar 23 14:45:59 UTC 2020 on sn-devel-184

- - - - -
3aea3b15 by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define PyInt_Check PyLong_Check

This will allow us to remove some unused code in the PIDL-generated
python bindings.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
79044e96 by Andrew Bartlett at 2020-03-23T19:12:43+00:00
pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses

Since we moved to Python3, these have been dead code, and it is clearer
now that we have removed the compatability define.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
08a76ec0 by Andrew Bartlett at 2020-03-23T19:12:43+00:00
pidl: Remove reference to PyInt_Type from error string when we wanted a sensible Long

PyInt_Type is no longer a thing in Python3, we will remove the compatability
reference shortly.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
cc79726d by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define PyInt_Type PyLong_Type

This allows us to end the use of Python 2/3 compatability macros.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
4764e8b4 by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define PyInt_AsLong PyLong_AsLong

This allows us to end the use of Python 2/3 compatability macros.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
5c1867ba by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define PyInt_FromLong PyLong_FromLong

This allows us to end the use of Python 2/3 compatability macros.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power

- - - - -
675ab9d6 by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define IsPy3Bytes PyBytes_Check

This allows us to end the use of Python 2/3 compatability macros.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
a7633deb by Andrew Bartlett at 2020-03-23T19:12:43+00:00
py3: Remove #define IsPy3BytesOrString(pystr)

This was

  (PyUnicode_Check(pystr) || PyBytes_Check(pystr))

This allows us to end the use of Python 2/3 compatability macros.

The one caller will be simplified in the next commit

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <nopower at samba.org>

- - - - -
4d65e3ad by Andrew Bartlett at 2020-03-23T19:12:43+00:00
s4-librpc: Simplify bytes or unicode input checking in python GUID() bindings

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
1114b02a by Aurelien Aptel at 2020-03-23T20:47:44+00:00
s3: libsmbclient.h: add missing time.h include

A recent change added a struct with timespec members in the public
libsmbclient header. This type is defined in time.h which was not
included thus making users of libsmbclient not build properly.

    /.../libsmbclient.h:158:18: error: field 'btime_ts' has incomplete type
      struct timespec btime_ts;

Fixes: bf13fe0f222 ("s3: libsmbclient: Add internal/external structures needed for readdirplus.")
Signed-off-by: Aurelien Aptel <aaptel at suse.com>
Reviewed-by: Noel Power <npower at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Mon Mar 23 20:47:44 UTC 2020 on sn-devel-184

- - - - -
072ff4d1 by Amitay Isaacs at 2020-03-23T23:45:37+00:00
ctdb-recovery: Fetched vnnmap is never used, so don't fetch it

New vnnmap is constructed using the information from all the connected
nodes.  So there is no need to fetch the vnnmap from recovery master.

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

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

- - - - -
6e2f8756 by Amitay Isaacs at 2020-03-23T23:45:37+00:00
ctdb-recovery: Consolidate node state

This avoids passing multiple arguments to async computation.

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

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

- - - - -
c6a0ff1b by Amitay Isaacs at 2020-03-23T23:45:37+00:00
ctdb-recovery: Don't trust nodemap obtained from local node

It's possible to have a node stopped, but recovery master not yet
updated flags on the local ctdb daemon when recovery is started.  So do
not trust the list of active nodes obtained from the local node.  Query
the connected nodes to calculate the list of active nodes.

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

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

- - - - -
1c56d641 by Amitay Isaacs at 2020-03-23T23:45:37+00:00
ctdb-recovery: Refactor banning a node into separate computation

If a node is marked for banning, confirm that it's not become inactive
during the recovery.  If yes, then don't ban the node.

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

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

- - - - -
c6c89495 by Martin Schwenke at 2020-03-23T23:45:37+00:00
ctdb-daemon: Fix database attach deferral logic

Commit 3cc230b5eeca749ab68d19cfda969f72c269f1f6 says:

  Dont allow clients to connect to databases untile we are well past
  and through the initial recovery phase

It is unclear what this commit was attempting to do.  The commit
message implies that more attaches should be deferred but the code
change adds a conjunction that causes less attaches to be deferred.
In particular, no attaches will be deferred after startup is complete.
This seems wrong.

To implement what seems to be stated in the commit message an "or"
needs to be used so that non-recovery daemon attaches are deferred
either when in recovery or before startup is complete.  Making this
change highlights that attaches need to be allowed during the
"startup" event because this is when smbd is started.

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

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

- - - - -
fc23cd1b by Martin Schwenke at 2020-03-23T23:45:37+00:00
ctdb-daemon: Remove unused old client database functions

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

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

- - - - -
17ed0425 by Martin Schwenke at 2020-03-23T23:45:37+00:00
ctdb-protocol: Add control flag CTDB_CTRL_FLAG_ATTACH_RECOVERY

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

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

- - - - -
98e3d0db by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Use CTDB_CTRL_FLAG_ATTACH_RECOVERY to attach during recovery

ctdb_ctrl_createdb() is only called by the recovery daemon, so this is
a safe, temporary change.  This is temporary because
ctdb_ctrl_createdb(), create_missing_remote_databases() and
create_missing_local_databases() will all go away soon.

Note that this doesn't cause a change in behaviour.  The main daemon
will still only defer attaches from non-recoverd processes during
recovery.

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

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

- - - - -
7e5a8a48 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases

This is currently only set by the recovery daemon when it attaches
missing databases, so there is no obvious behaviour change.  However,
attaching missing databases can now be moved to the recovery helper as
long as it sets this flag.

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

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

- - - - -
4c0b9c36 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Replace use of ctdb_dbid_map with local db_list

This will be used to build a merged list of databases from all nodes,
allowing the recovery helper to create missing databases.

It would be possible to also include the db_name field in this
structure but that would cause a lot of churn.  This field is used
locally in the recovery of each database so can continue to live in
the relevant state structure(s).

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

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

- - - - -
c6f74e59 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: GET_DBMAP from all nodes

This builds a complete list of databases across the cluster so it can
be used to create databases on the nodes where they are missing.

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

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

- - - - -
1bdfeb3f by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Pass db structure for each database recovery

Instead of db_id and db_flags.

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

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

- - - - -
e6e63f8f by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Fetch database name from all nodes where it is attached

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

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

- - - - -
76a81742 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Create database on nodes where it is missing

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

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

- - - - -
3a66d181 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-recovery: Remove old code for creating missing databases

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

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

- - - - -
052f1bdb by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-daemon: Remove more unused old client database functions

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

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

- - - - -
147afe77 by Martin Schwenke at 2020-03-23T23:45:38+00:00
ctdb-daemon: Don't allow attach from recovery if recovery is not active

Neither the recovery daemon nor the recovery helper should attach
databases outside of the recovery process.

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

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

- - - - -
716f52f6 by Martin Schwenke at 2020-03-24T01:22:45+00:00
ctdb-recoverd: Avoid dereferencing NULL rec->nodemap

Inside the nested event loop in ctdb_ctrl_getnodemap(), various
asynchronous handlers may dereference rec->nodemap, which will be
NULL.

One example is lost_reclock_handler(), which causes rec->nodemap to be
unconditionally dereferenced in list_of_nodes() via this call chain:

  list_of_nodes()
  list_of_active_nodes()
  set_recovery_mode()
  force_election()
  lost_reclock_handler()

Instead of attempting to trace all of the cases, just avoid leaving
rec->nodemap set to NULL.  Attempting to use an old value is generally
harmless, especially since it will be the same as the new value in
most cases.

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

Reported-by: Volker Lendecke <vl at samba.org>
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Tue Mar 24 01:22:45 UTC 2020 on sn-devel-184

- - - - -
d61a33ac by Andreas Schneider at 2020-03-24T14:31:25+00:00
selftest: Fix string compare in DnsHandler() of dns_hub.py

dns_hub.py:115: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if forwarder is 'ignore':
dns_hub.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif forwarder is 'fail':

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue Mar 24 14:31:25 UTC 2020 on sn-devel-184

- - - - -
43093743 by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: remove internal directory cleanup logic

Currently fruit does a cleanup run on a directory when it is being removed: it
lists the directory and does an explicit unlink on any found file that is a
genuine AppleDouble file.

This is not realy needed: the ._ AppleDouble sidecar files are either vetoed by
default, so cleanup can be turned on by the built-in "delete veto files"
options. Or, if the user sets "fruit:veto_appledouble", the client will see the
file in a directory list as ordinary files, so the client is responsible for
deleting them first before removing the parent directory.

tl;dr

One caller of SMB_VFS_OPENDIR() less. :)

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
12b1913e by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: move fruit_unlink_internal() back into fruit_unlinkat()

I think this makes fruit_unlinkat() easier to read. No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0a9d8c41 by Ralph Boehme at 2020-03-24T19:48:40+00:00
smbd: use OpenDir() in count_dfs_links()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
70d33236 by Ralph Boehme at 2020-03-24T19:48:40+00:00
smbd: use OpenDir() in form_junctions()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
67b9b52b by Ralph Boehme at 2020-03-24T19:48:40+00:00
smbd: make canonicalize_connect_path() public

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
11f14c2c by Ralph Boehme at 2020-03-24T19:48:40+00:00
smbd: use canonicalize_connect_path() in create_conn_struct_as_root()

This fix ensures create_conn_struct_as_root() works the same way as
make_connection_snum() used in smbd for SMB sessions. Without this any caller of
create_conn_struct_as_root() will fail to use work on shares if the sharepath
contains a symlink.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
afa69567 by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfstest: use OpenDir()

Note that as ReadDirName() returns translated names (in Windows "encoding"), in
cmd_translate_name() test we have to translate back to UNIX "encoding" to check
if the filename matches the user requested path which is also in UNIX
"encoding".

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ec9fcb31 by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_ceph_snapshots: use OpenDir() in ceph_snap_enum_snapdir()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cc07cdaf by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_ceph_snapshots: use OpenDir() in ceph_snap_gmt_convert_dir()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b0dab9d9 by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: use OpenDir() instead of SMB_VFS_OPENDIR() in fruit_get_num_bands()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
232d7481 by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: let fruit_get_num_bands() take bundle as const

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a5e4f70d by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: pass e->d_name directly to fruit_tmsize_do_dirent()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7217694c by Ralph Boehme at 2020-03-24T19:48:40+00:00
vfs_fruit: use OpenDir() in fruit_disk_free()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8339b485 by Ralph Boehme at 2020-03-24T19:48:41+00:00
vfs_streams_depot: use OpenDir() in walk_streams()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4d28b614 by Ralph Boehme at 2020-03-24T19:48:41+00:00
vfs_shadow_copy: use OpenDir() in shadow_copy_get_shadow_copy_data()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
974ea2ce by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: add create_internal_dirfsp_at()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
38cce1bc by Ralph Boehme at 2020-03-24T19:48:41+00:00
vfs_shadow_copy2: use create_internal_dirfsp_at() and SMB_VFS_FDOPENDIR()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d961608c by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: simplify non_widelink_open()

As fsp->is_directory is already correctly populated by our callers, we can drop
the complicated and possibly broken logic that relies on O_DIRECTORY being
defined.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6dccfd63 by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: remove fdopendir() fallback

In order to get rid of SMB_VFS_OPENDIR, we have to require
fdopendir(). Everybody but macOS seems to have it, so RIP opendir() fallback.

This also prepares for a subsequent commit where we're going to start calling
OpenDir_fsp() from inside OpenDir(). Without removing the fallback this would
result in a recursion.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b6bcc4bd by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: update smb_Dir_destructor() to cope with fsp->dptr not being set

Currently the only caller of OpenDir_fsp() is dptr_create() which means
fsp->dptr will always be set by dptr_create().

A subsequent commit will add another caller so that fsp->dptr will end up being
NULL.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
af622683 by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: reformat OpenDir() function definition

Gives a nicer diff in the next commit. No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
45f62cec by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: add open_internal_dirfsp_at()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
54e0f250 by Ralph Boehme at 2020-03-24T19:48:41+00:00
smbd: use open_internal_dirfsp_at() and OpenDir_fsp() in OpenDir()

This allows consolidating symlink safe processing of pathnames to the low-level
function non_widelink_open() used in the file open codepath via fd_open() and
the new utility function open_internal_dirfsp_at().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2a5d994b by Ralph Boehme at 2020-03-24T21:23:43+00:00
vfs: remove SMB_VFS_OPENDIR()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Mar 24 21:23:43 UTC 2020 on sn-devel-184

- - - - -
61a6bf82 by Andreas Schneider at 2020-03-25T06:58:38+00:00
third_party: Update pam_wrapper to version 1.1.2

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
e09c2e11 by Stefan Metzmacher at 2020-03-25T06:58:38+00:00
third_party: Update socket_wrapper to version 1.2.4

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
e2d260c7 by Stefan Metzmacher at 2020-03-25T08:33:17+00:00
third_party: Update resolv_wrapper to version 1.1.6

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Mar 25 08:33:17 UTC 2020 on sn-devel-184

- - - - -
051b7c13 by Volker Lendecke at 2020-03-25T09:04:27+00:00
lib: Simplify writev_cancel()

We can only reasonably cancel a writev request that is still
queued. Once writing has started, cancel is pointless. Simplify the
if-conditions.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
f52f5317 by Volker Lendecke at 2020-03-25T09:04:28+00:00
lib: Remove unused SOCKET_FLAG_BLOCK

Nobody in the code set this flag, so remove it

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
0e50ed19 by Volker Lendecke at 2020-03-25T09:04:28+00:00
libsmb: Make sure that the TCP socket is non-blocking

All traffic goes through smbXcli_base.c, and that is prepared to deal
with short writes via the conn->outgoing queue. Instead of making sure
that all callers properly set the socket nonblocking, do it here, so
that we can later optimize sending out data to the server.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
8946531f by Volker Lendecke at 2020-03-25T09:04:28+00:00
winbind: Set the parent->child sock nonblocking

The parent goes through wb_simple_trans_send(), which deals with short
writes fine.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
79f55ba3 by Volker Lendecke at 2020-03-25T09:04:28+00:00
lib: Use optimize_empty in writev_send()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
be394406 by Volker Lendecke at 2020-03-25T10:41:29+00:00
lib: Try nonblocking writes in writev_send()

All callers now use nonblocking sockets, so that we can optimize by
doing early writes

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Mar 25 10:41:29 UTC 2020 on sn-devel-184

- - - - -
94d580c0 by Volker Lendecke at 2020-03-26T14:43:31+00:00
lib: Add macro ARRAY_DEL_ELEMENT()

Every time I have to remove an element from within an array I have to
scratch my head about the memmove arguments. Make this easier to use.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0e14156c by Volker Lendecke at 2020-03-26T14:43:31+00:00
lib: Use ARRAY_DEL_ELEMENT in messaging_dispatch_waiters()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
487ca075 by Volker Lendecke at 2020-03-26T14:43:31+00:00
libsmb: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0f53715a by Volker Lendecke at 2020-03-26T14:43:31+00:00
sharesec: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ac71d6b2 by Volker Lendecke at 2020-03-26T14:43:31+00:00
smbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4ac62408 by Volker Lendecke at 2020-03-26T14:43:31+00:00
smbd: Use ARRAY_DEL_ELEMENT() in brl_unlock_windows_default()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a6de3d20 by Volker Lendecke at 2020-03-26T14:43:31+00:00
smbd: Use ARRAY_DEL_ELEMENT() in smbd_smb1_blocked_locks_cleanup()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
29b591d9 by Volker Lendecke at 2020-03-26T14:43:31+00:00
smbd: Use ARRAY_DEL_ELEMENT() in merge_default_aces()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
eadbaabc by Volker Lendecke at 2020-03-26T14:43:31+00:00
libsmb: Use ARRAY_DEL_ELEMENT() in remove_duplicate_addrs2()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
85cb86d7 by Volker Lendecke at 2020-03-26T14:43:31+00:00
vfs_fruit: Use ARRAY_DEL_ELEMENT() in filter_empty_rsrc_stream()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
356fdb0b by Volker Lendecke at 2020-03-26T14:43:31+00:00
vfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e74e85ee by Volker Lendecke at 2020-03-26T14:43:31+00:00
dsdb: Use ARRAY_DEL_ELEMENT() in dirsync_filter_entry()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3d9d9849 by Volker Lendecke at 2020-03-26T14:43:31+00:00
libcli: Use ARRAY_DEL_ELEMENT() in security_descriptor_acl_del()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d45174a0 by Volker Lendecke at 2020-03-26T14:43:31+00:00
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_msg_delete_element()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
61a28bce by Volker Lendecke at 2020-03-26T14:43:32+00:00
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_index_del_value()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f2a4eecb by Volker Lendecke at 2020-03-26T14:43:32+00:00
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_extended_filter()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
130502af by Volker Lendecke at 2020-03-26T14:43:32+00:00
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f71364bc by Volker Lendecke at 2020-03-26T16:22:00+00:00
tdbtorture: Use ARRAY_DEL_ELEMENT()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu Mar 26 16:22:00 UTC 2020 on sn-devel-184

- - - - -
9565c8f9 by Ralph Boehme at 2020-03-27T01:06:29+00:00
smbd: leave start at NULL, it's not used before being set to smbfname->basename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c4897903 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: initialize end to NULL in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
81857450 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: modernize unix_convert() replacing False with false

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
63cbc330 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: modernize unix_convert() replacing True with true

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c77530a0 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: consolidate comments in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
855a3546 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: turn (*orig_path != '/') assert into a normal if check

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cd8c229d by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: modernize DEBUG in unix_convert()

I'm also consolidating on level 10 instead of 5 for "debug" level messages, as
that what's tend to be the canonical debug level these days.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
41fbfc27 by Ralph Boehme at 2020-03-27T01:06:30+00:00
smbd: use filename_convert() in smb_file_rename_information()

Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fe78216b by Ralph Boehme at 2020-03-27T02:41:39+00:00
smbd: use a helper variable in filename_convert_internal()

Avoids the complicated pointer-to-pointer dereferencing.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Mar 27 02:41:39 UTC 2020 on sn-devel-184

- - - - -
1c0eed6b by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
s3:util_sec: fix the build on non-linux platforms

This fixes a regression introduced by
"util_sec.c: Move __thread variable to global scope"
(5a80f399b51221fb0b8661f30d940ca24e1ce627).

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
bc94d987 by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
s4:torture/ldb: fix the build on FreeBSD

clock_t is 'int' instead' of 'long' there.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
cefa9be9 by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
librpc/tests: make use of replace.h in test_ndr*.c

This fixes the build on FreeBSD 12.1 and maybe other systems.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
23bd1eff by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
python/netcmd/dns: improve exception handling in cmd_delete_record()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
72bbd170 by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
python/netcmd/dns: improve exception handling in cmd_add_record()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
88500f73 by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
samba_dnsupdate: fix --no-credentials handling

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4d6864e0 by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
samba_dnsupdate: fix delete (samba-tool) message

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2d1d67ed by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
selftest: make sure dns_hub.py exits on SIGINT

Otherwise we have a deadlock in the python threading
that prevents out EOF detection on stdin to work
if someone aborts 'make test' with strg+c.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
25ba290d by Stefan Metzmacher at 2020-03-27T09:02:37+00:00
selftest: allow dns_hub.py to listen on more than one address

This makes it possible to serve ipv4 and ipv6 at the same time.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ffa40fa9 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: allow dns_hub.py to do forwarding to ipv6 servers

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f1f43f13 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: handle proc{killdom,limit}.samba.example.com in dns_hub

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
b6af0a26 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: let get_env_for_process() include RESOLV_CONF

This is needed for all environments not just "samba".

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
1e9697c4 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
8133c578 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: split out Samba::mk_resolv_conf() helper

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
678651a7 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: always explicitly use RESOLV_CONF

By default point RESOLV_CONF to a non-existing file and
use the per environment RESOLV_CONF explicitly where needed.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c5e47821 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"

It's important to have the correct $resolv_conf variable within
provision(), because it also sets "RESOLV_WRAPPER_CONF" if needed,
instead of just setting "RESOLV_CONF".

There's also no point in creating an resolv.conf with the ip addresses
for other roles than "active directory domain controller".

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0bc99870 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments

These restore copies of others and better use their own resolv.conf
and use '--use-samba-tool --no-credentials' for samba_dnsupdate in order
to avoid talking to the real environments.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
6b249437 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: let realm_to_ip_mappings() return stable (sorted) results

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
83f6ff90 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: pass ipv4 and ipv6 listener addresses to dns_hub.py

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
05d3a909 by Stefan Metzmacher at 2020-03-27T09:02:38+00:00
selftest: use 10.53.57.0/8 instead of 127.0.0.1/8

This makes our testing much more realistic and allows
the removal of some knowfail entries.

It also means the testing with network namespaces on Linux
can use the same addresses as our socket wrapper testing.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
a85fadae by Stefan Metzmacher at 2020-03-27T10:39:32+00:00
selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD

For now I'll leave it arround for others I haven't tested.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Mar 27 10:39:32 UTC 2020 on sn-devel-184

- - - - -
53402b35 by Stefan Metzmacher at 2020-03-27T18:17:34+00:00
bootstrap: add ubuntu2004 Ubuntu Focal Fossa (development branch)

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
99b64424 by Stefan Metzmacher at 2020-03-27T18:17:34+00:00
bootstrap: add python3-pyasn1/python3-cryptography for kerberos testing

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
0f805db4 by Stefan Metzmacher at 2020-03-27T18:17:34+00:00
python/tests: let usage.py be more verbose on errors

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
679bb52c by Isaac Boukris at 2020-03-27T18:17:35+00:00
python/tests/krb5: add crypto.py from greghudson/pyk5 as kcrypto.py

This is crypto.py of commit f0612aa908062fb239d1c3873595e7204ae1691d
from https://github.com/greghudson/pyk5.git

This will be used in order to do raw protocol testing against
[MS-KILE] KDCs.

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
8bdd3799 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: convert kcrypto.py to python3-cryptography and a few Samba helpers

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
7010a131 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
s4:selftest: run samba.tests.krb5.kcrypto test

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
47385248 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: add support for Cksumtype.MD5

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
a2f75c31 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: add rfc4120.asn1

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
94d06842 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: modify rfc4120.asn1 in order to generate pyasn1 code

The pyasn1 bindings are generated by pyasn1gen.py from
https://github.com/kimgr/asn1ate.git

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
fb7cba50 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: add raw_testcase.py as the base for our Kerberos protocol testing

Pair-Programmed-With: Isaac Boukris <iboukris at samba.org>

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
4f6d2660 by Stefan Metzmacher at 2020-03-27T18:17:35+00:00
python/tests/krb5: add simple_tests.py with the first simple test

This just demonstrates that the infrastructure works:-)

I'm running this as:

  SERVER=172.31.9.188 DOMAIN=W2012R2-L6 REALM=W2012R2-L6.BASE \
  USERNAME=administrator PASSWORD=A1b2C3d4 SERVICE_USERNAME="w2012r2-188" \
  python/samba/tests/krb5/simple_tests.py

Pair-Programmed-With: Isaac Boukris <iboukris at samba.org>

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
c4ccdf4b by Stefan Metzmacher at 2020-03-27T19:54:25+00:00
s4:selftest: run samba.tests.krb5.simple_tests against ad_dc_default

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Fri Mar 27 19:54:25 UTC 2020 on sn-devel-184

- - - - -
047b0d8a by Günther Deschner at 2020-03-30T13:01:20+00:00
nsswitch: fix use-after-free causing segfault in _pam_delete_cred

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Mon Mar 30 13:01:20 UTC 2020 on sn-devel-184

- - - - -
dd015436 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Extract large directory case normalization code into a utility function normalize_filename_case().

It is done before the original_lcomp is extracted
from the client pathname, so the new function that
will allow us to remove original_lcomp also needs
this logic.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f88c36b3 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Add utility function get_original_lcomp().

Gets the last component from a client passed-in
filename. Copes with @GMT snapshot and MS-DFS names.

Preparing to remove original_lcomp from
struct smb_filename.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9d785ae5 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Remove use of smb_fname->original_lcomp from smb2 query directory.

Use get_original_lcomp() call. Removes one use of smb_fname->original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
500037f2 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Remove use of smb_fname->original_lcomp from call_trans2findfirst().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
614b3003 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Reformatting callers of rename_internals_fsp() to make it easer to see changed parameters.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
454ecaf3 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Add a dst_original_lcomp parameter to rename_internals_fsp().

Currently passed in as dst_fname->original_lcomp in all callers
but will eventually be converted to allow original_lcomp to be
removed from struct smb_filename.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6c53372a by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Reformatting caller of rename_internals() to make it easer to see changed parameters.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6c6e5d52 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Add 'const char *dst_original_lcomp' parameter to rename_internals()

Pass through the existing smb_fname_dst->original_lcomp
parameter so no logic change. Preparing to remove the
use of original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d5408193 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Inside rename_internals() wildcard case, re-purpose dst_original_lcomp.

Pass to rename_internals_fsp() instead of using smb_fname_dst->original_lcomp.

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7d2cb521 by Jeremy Allison at 2020-03-30T14:45:30+00:00
s3: smbd: Use get_original_lcomp() inside reply_ntrename().

Pass to rename_internals().

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
aa80e973 by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Use get_original_lcomp() inside reply_mv().

Pass to rename_internals().

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d7f21432 by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Use get_original_lcomp() inside smb2_file_rename_information().

Pass to rename_internals_fsp(). Note this is a logic change,
as the original code only set smb_fname->original_lcomp if
it was doing a stream rename. Inside rename_internals_fsp()
we only look at original_lcomp in the stream rename case, so
this code worked. However, it is much safer to always correctly
create dst_original_lcomp than pass in a NULL here. It won't
hurt if it's not actually looked at.

Removes one more use of the struct member original_lcomp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5104ec8d by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Use get_original_lcomp() inside smb_file_rename_information().

Pass to rename_internals_fsp() and rename_internals().

Removes the last uses of the struct member original_lcomp
outside of the filename and struct util copying code.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
79b945d4 by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathname processing code.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e0d3190b by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Remove all references to original_lcomp from name copying code.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d875f60e by Jeremy Allison at 2020-03-30T14:45:31+00:00
s3: smbd: Remove UCF_SAVE_LCOMP flag. Note it is no longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1cc250b4 by Jeremy Allison at 2020-03-30T16:23:45+00:00
s3: smbd: RIP smb_filename->original_lcomp.

Removed from struct smb_filename. You will not be missed :-).
Note that VFS ABI modified.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Mon Mar 30 16:23:45 UTC 2020 on sn-devel-184

- - - - -
89041a6d by Gary Lockyer at 2020-03-31T01:26:07+00:00
lib ldb: lmdb clear stale readers on write txn start

In use process failures and Bind9 shut downs leave stale entries in the
lmdb reader table.  This can result in lmdb filling it's database file, as
the free list can not be reclaimed due to the stale reader.

In this fix we call mdb_reader_check at the start of each transaction,
to free any stale readers.  As the default maximum number of readers is
127, this should not impact on performance to any great extent.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Mar 31 01:26:07 UTC 2020 on sn-devel-184

- - - - -
9edd7268 by Ralph Boehme at 2020-03-31T19:32:11+00:00
smbd: remove struct privilege_paths

The last user of this had been removed by
d485c43cc74c5550d151fe728ddc53b02ab23df8.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Mar 31 19:32:12 UTC 2020 on sn-devel-184

- - - - -
13bddfca by Andreas Schneider at 2020-04-01T05:46:30+00:00
gitlab-ci: Add ccache and wget

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
- - - - -
963a99f1 by Andreas Schneider at 2020-04-01T07:25:33+00:00
gitlab-ci: Use a shared ccache for the runners

https://docs.gitlab.com/ee/ci/caching/

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Apr  1 07:25:33 UTC 2020 on sn-devel-184

- - - - -
9f9b80c7 by Andrew Bartlett at 2020-04-01T08:51:31+00:00
dlz_bind9: Avoid talloc_new(NULL), use a parent variable

This will help provide a better memory tree if we ever suspect a problem
here.  The tmp_ctx varaible is always freed before the end of this
function.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2558c15b by Samuel Cabrero at 2020-04-01T10:28:43+00:00
s3:rpc_server: Fix talloc_free() with references error on server exit

Fixes talloc_free() with references when smbd exists and talloc_free the
global dcesrv context:

ERROR: talloc_free with references at ../../source3/rpc_server/rpc_config.c:73
	reference at ../../source3/rpc_server/rpc_server.c:193
	reference at ../../source3/rpc_server/rpc_server.c:592
	...

The talloc_reference to make the dcerpc_ncacn_listen_state a parent of
the dcesrv context is not necessary as the listen state is allocated
under the endpoint, which is allocated under the dcesrv context:

full talloc report on 'struct dcesrv_context' (total  12298 bytes in 188 blocks)
    ...
    struct dcesrv_endpoint         contains    691 bytes in  11 blocks (ref 0) 0x55ae964d79a0
        struct dcerpc_ncacn_listen_state contains    160 bytes in   2 blocks (ref 0) 0x55ae964fca60
            struct tevent_fd               contains    104 bytes in   1 blocks (ref 0) 0x55ae964f36f0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8a40
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8ac0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8870
            ../../librpc/rpc/dcesrv_core.c:327 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8970
        struct dcerpc_binding          contains    108 bytes in   2 blocks (ref 0) 0x55ae964e87a0
            \pipe\lsass                    contains     12 bytes in   1 blocks (ref 0) 0x55ae964e88f0
        struct dcerpc_binding          contains    111 bytes in   2 blocks (ref 0) 0x55ae964e86d0
            \pipe\netlogon                 contains     15 bytes in   1 blocks (ref 0) 0x55ae964e8650
    ...
    struct dcesrv_endpoint         contains   1728 bytes in  27 blocks (ref 0) 0x55ae964e0db0
        struct dcerpc_ncacn_listen_state contains    160 bytes in   2 blocks (ref 0) 0x55ae964fd540
            struct tevent_fd               contains    104 bytes in   1 blocks (ref 0) 0x55ae964f3890
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964fbd70
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964f67a0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964fff60
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964f66c0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eb8b0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eba00
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eb200
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eb350
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964eab70
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964eabf0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964ea360
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964ea4b0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e9cb0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e9e00
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e96a0
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e97f0
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e8430
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8580
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e6250
            ../../librpc/rpc/dcesrv_core.c:360 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e8070
        struct dcesrv_if_list          contains    128 bytes in   2 blocks (ref 0) 0x55ae964e7e50
            ../../librpc/rpc/dcesrv_core.c:327 contains    104 bytes in   1 blocks (ref 0) 0x55ae964e7fa0
        struct dcerpc_binding          contains    104 bytes in   2 blocks (ref 0) 0x55ae964e7ed0
            DEFAULT                        contains      8 bytes in   1 blocks (ref 0) 0x55ae964eaa10
    ....

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlet <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Apr  1 10:28:43 UTC 2020 on sn-devel-184

- - - - -
24b03fd2 by Noel Power at 2020-04-01T18:51:43+00:00
s3/utils: Fix double free error with smbtree

==3632==
WORKGROUP
	\\ATP
		\\ATP\IPC$           	IPC Service ()
==3632== Invalid read of size 8
==3632==    at 0x773C926: poptResetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x773E5DD: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A8BC: main (smbtree.c:354)
==3632==  Address 0x16085e00 is 640 bytes inside a block of size 784 free'd
==3632==    at 0x4C2F1AD: free (vg_replace_malloc.c:530)
==3632==    by 0x773E6F7: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A84B: main (smbtree.c:342)
==3632==  Block was alloc'd at
==3632==    at 0x4C2FE45: calloc (vg_replace_malloc.c:711)
==3632==    by 0x773C79A: poptGetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A829: main (smbtree.c:339)
==3632==

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14332
Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Wed Apr  1 18:51:43 UTC 2020 on sn-devel-184

- - - - -
579c27fc by Stefan Metzmacher at 2020-04-02T06:01:38+00:00
.gitlab-ci.yml: actually run ubuntu2004-samba-o3

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f9374d0a by Stefan Metzmacher at 2020-04-02T06:01:38+00:00
script/autobuild.py: add support git worktree

.git is not always a directory, with 'git worktree' it's a file.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0312a10e by Stefan Metzmacher at 2020-04-02T06:01:39+00:00
script/autobuild.py: use more portable 'cp -R -a -l'

On platforms like FreeBSD 12 cp doesn't accept the long options,
using the one letter options works there and keeps working on Linux
as well.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9b1e9619 by Stefan Metzmacher at 2020-04-02T07:36:07+00:00
script/autobuild.py: allow write_system_info commands to fail

These commands are just there as hints to debug possible problems.
In order to support autobuild.py on non-linux platforms we should
just ignore errors here.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu Apr  2 07:36:07 UTC 2020 on sn-devel-184

- - - - -
6e146c85 by Swen Schillig at 2020-04-02T09:51:39+00:00
ctdbd_conn: possible memleak in ctdbd_working

A cstatus != 0 does not guarantee to have no received data
referenced by outdata.dptr.
Therefore, make sure outdata.dptr is free'd.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
- - - - -
95fc8bd4 by Swen Schillig at 2020-04-02T09:51:39+00:00
ctdbd_conn: possible memleak in ctdbd_dbpath

A cstatus != 0 does not guarantee to have no received data
referenced by rdata.dptr.
Therefore, make sure rdata.dptr is free'd.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
- - - - -
2bdb5a75 by Swen Schillig at 2020-04-02T09:51:39+00:00
ctdbd_conn: possible memleak in ctdbd_db_attach

A cstatus != 0 or a data.dsize != sizeof(uint32_t)
does not guarantee to have no received data referenced by data.dptr.
Therefore, make sure data.dptr is free'd.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
- - - - -
f34582af by Swen Schillig at 2020-04-02T09:51:39+00:00
dbwrap: fix comment in code leading to wrong function parameter

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
- - - - -
130c26b4 by Swen Schillig at 2020-04-02T11:26:32+00:00
dbwrap: fix possible memleak and false result check.

A cstatus != 0 or a data.dsize != sizeof(uint32_t)
does not guarantee to have no received data referenced by data.dptr.
Therefore, make sure data.dptr is free'd.
Reusing the same data structure as data input and data output parameter
can lead to wrong results, especially when the output parameters value
is used to detect errors. Create the additional local variable outdata
to prevent this issue.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Thu Apr  2 11:26:32 UTC 2020 on sn-devel-184

- - - - -
84c130a6 by Rowland Penny at 2020-04-02T15:27:53+00:00
samba-tool group show: only shows global security groups, this patch makes it show all groups.

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

Signed-off-by: Rowland Penny <rpenny at samba.org>
Reviewed-by: Björn Baumbach <bb at samba.org>

Autobuild-User(master): Björn Baumbach <bb at sernet.de>
Autobuild-Date(master): Thu Apr  2 15:27:53 UTC 2020 on sn-devel-184

- - - - -
a45e6370 by Ralph Boehme at 2020-04-03T15:08:25+00:00
selftest: allow SMB1 in clusteredmember env

This is a relatively new test environment that only uses very few tests
yet. Skip the env name rename dance for this env, but someone has to convert the
tests later on.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

- - - - -
0f83d915 by Noel Power at 2020-04-03T15:08:26+00:00
s3/selftest: Fix typo in test generator script

Introduced in a64516099936 but only makes a difference when
environments limit protocols for testing.

Reviewed-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Noel Power <noel.power at suse.com>

- - - - -
5898c723 by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Allow ad_dc_ntvfs negotiate smb1 still

The default for most test envs will be changed in a future
commit(s) to be >= SMB2 then we need to still allow  ad_dc_ntvfs to
support SMB1. This will make the number of tests to port easier to
deal with. In addition to test env ad_dc_ntvfs still supporting SMB1
we need to do the same with test other environments that depend on
ad_dc_ntvfs (this will be handled in followup commits).

In addition to the above this change will ensure we don't trigger
failures for ntvfs tests when we switch to default >= SMB2 which will
make the associated skip file (added in a future commit) smaller.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
10c879a9 by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Create a file to exclude tests that fail with SMB1

skip_smb1_fails contains tests that will fail when the min protocol
of the test environments is set to SMB2_02

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7f2cdadf by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Exclude SMB1 tests that would fail when SMB1 is disabled

Exclude the tests specified in the file 'skip_smb1_fails' which
contains the list of tests that would fail if min protocol >= SMB2_02

Note: a subsequent commit will change the default min protocol so
      in order to maintain bisectability we skip the tests before
      we change the default.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
49ba8f21 by Noel Power at 2020-04-03T15:08:26+00:00
selftest: disable SMB1 from testenv(s) make >=SMB2 the default

Change the values of 'min protocol' set for the various test
environments to be SMB2_02.

Servers will only offer protocols starting with the min specified in the
conf files. We don't change the client value here yet (until SMB1 is
truely gone) as we still want to be able to run SMB1 tests.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f64e032a by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Allow rpc_proxy & s4member also negotiate SMB1

Test environments rpc_proxy & s4member depend on ad_dc_ntvfs
so these environments additionally need to also be able to
still support SMB1.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e13e0cf0 by Noel Power at 2020-04-03T15:08:26+00:00
selftest: adjust skip_file (after adjusting s4member and rpc_proxy)

The orig skip file was created with *all* test environments by
default not support SMB1.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fcae8968 by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Add new test environment fileserver_smb1

fileserver_smb1 is a copy of the fileserver test environment but
with the difference that it still supports SMB1, this will allow
use to still run SMB1 tests.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1954972c by Noel Power at 2020-04-03T15:08:26+00:00
script: Add testenv fileserver_smb1 to autobuild jobs

Adjust the existing autobuild jobs that currently include/exclude
test env fileserver to also use fileserver_smb1.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fc0d10d0 by Noel Power at 2020-04-03T15:08:26+00:00
selftest/manage-ca: Add certificiate etc. for DC addcsmb1

Preparatory commit pre adding new addc_smb1 environment.

In order to support new addc_smb1 test environment we need new
certificate(s) in order to satisfy some tests
(e.g. samba4.blackbox.pkinit.*)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b0ea347c by Noel Power at 2020-04-03T15:08:26+00:00
selftest: Create new test env ad_dc_smb1

ad_dc_smb1 is a copy of the ad_dc test environment but
with the difference that it still supports SMB1, this will allow
use to still run SMB1 tests for that env.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
087eb9d7 by Noel Power at 2020-04-03T15:08:26+00:00
script: Add ad_dc_smb1 to autobuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3e5131e0 by Noel Power at 2020-04-03T15:08:26+00:00
selftest/target: Create new nt4_dc_smb1 environment

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
82e4dd50 by Noel Power at 2020-04-03T15:08:26+00:00
autobuild: Add new nt4_dc_smb1 env to jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
34b14c4f by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: Add new alias env ad_dc_default_smb1

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e468b03f by Noel Power at 2020-04-03T15:08:27+00:00
autobuild: Add ad_dc_default_smb1 to autobuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f1139ac5 by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: create return_alias_env function for Samba3.pm

This will allow us easily create lightweight alias environments
like ad_dc_smb1_done etc.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7dbfdd81 by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: Add new alias environment ad_dc_smb1_done

Adding ad_dc_smb1_done, and alias for test env ad_dc_smb1

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
bbce98c2 by Noel Power at 2020-04-03T15:08:27+00:00
autobuild: Add ad_dc_smb1_done to autobuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4948dfc6 by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: Add new alias environment fileserver_smb1_done

setup_fileserver_smb1_done is an alias for setup_fileserver_smb1

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
814a6d43 by Noel Power at 2020-04-03T15:08:27+00:00
autobuild: Add fileserver_smb1_done to autbuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ba3fe03b by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: Create nt4_dc_smb1_done env (alias for nt4_dc_smb1)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ffe856ce by Noel Power at 2020-04-03T15:08:27+00:00
autobuild: Add nt4_dc_smb1_done to autobuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
02a16b31 by Noel Power at 2020-04-03T15:08:27+00:00
selftest/target: Add test environment ad_dc_default_smb1_done

Adding test env ad_dc_default_smb1_done an alias for
test environment ad_dc_default_smb1

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a11c58c5 by Noel Power at 2020-04-03T15:08:27+00:00
autobuild: Add ad_dc_default_smb1 to autobuild jobs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6accac62 by Noel Power at 2020-04-03T15:08:27+00:00
selftest: samba3.blackbox.* so it can run SMB1 & >= SMB2

Move tests that have SMB1 & >=SMB2 versions to fileserver_smb1_done

Additionally this commit removes the entries for fileserver for the same
tests from skip_smb1.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
47ad2551 by Noel Power at 2020-04-03T15:08:27+00:00
selftest: Move samba3.blackbox.shadow_copy2 NT1 to fileserver_smb1

Additionally since we already have a SMB3 version of the test we
can remove it from the skip file

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c86171aa by Noel Power at 2020-04-03T15:08:27+00:00
s3/selftest: Move samba3.blackbox.net.misc to ad_dc

we have an ad_dc_smb1 env and there is not reason why we need
to use nt4_dc for this test. In a later commit we will move the
NT1 test to the ad_dc_smb1 env.

Addionally we change the existing entry in the skip_smb1_fails
skip file.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
df4b8b80 by Noel Power at 2020-04-03T15:08:27+00:00
s3/selftest: Change samba3.blackbox.net.misc desc. to include protocol

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
32506f28 by Noel Power at 2020-04-03T15:08:27+00:00
selftest: Move samba3.blackbox.net.misc NT1 to ad_dc_smb1 env

Additionally remove this test from the skip file as the file doesn't
need to be ported

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2b35d8e0 by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: move samba3.blackbox.smbspool to ad_dc_smb1

and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
87d77b3e by Noel Power at 2020-04-03T15:08:28+00:00
s4/selftest: Add smbclient (s3 version) binary to s4/tests

smbclient4 only negotiates smb1, tests probably should use smbclient
instead (except for tests that intentionally are testing smbclient4
itself)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
35583322 by Noel Power at 2020-04-03T15:08:28+00:00
s4/selftest: Use s3 smbclient for samba4.blackbox.bogusdomain

Additionally remove the test from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1c3f954a by Noel Power at 2020-04-03T15:08:28+00:00
s4/selftest: Use (s3) smbclient for test samba4.blackbox.kinit

Additionally we remove the entry from skip_smb1_fails as it is
no longer relevant

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7e04d84b by Noel Power at 2020-04-03T15:08:28+00:00
s4/selftest: Adjust samba4.blackbox.samba_tool to use (s3) smbclient

(s4) smbclient doesn't negotiate smb2, (s3) smbclient is what
is used and what we really should be testing.

Additionally remove entry from ski_smb1_fails file

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
422e6c5a by Noel Power at 2020-04-03T15:08:28+00:00
s4/selftest: adjust samba.blackbox.pdbtest to use (s3) smbclient

smbclient4 only negotiates smb1, this test should use smbclient(s3)
instead.

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f3ae2dce by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move samba3.smbtorture_s3.plain.* tests to fileserver_smb1

with the exception of tests containing
  "SMB2", "BAD-NBT-SESSION", "DIR1", "LOCK12", "OPLOCK4"

so the following tests have been moved

output below from
   python3 source3/selftest/tests.py | grep samba3.smbtorture_s3.plain |
sort -u

samba3.smbtorture_s3.plain.ATTR
samba3.smbtorture_s3.plain.BROWSE
samba3.smbtorture_s3.plain.CASE-INSENSITIVE-CREATE
samba3.smbtorture_s3.plain.CHAIN1
samba3.smbtorture_s3.plain.CHAIN2(
samba3.smbtorture_s3.plain.CHAIN3
samba3.smbtorture_s3.plain.CHKPATH
samba3.smbtorture_s3.plain.CLEANUP1
samba3.smbtorture_s3.plain.CLEANUP2
samba3.smbtorture_s3.plain.CLEANUP4
samba3.smbtorture_s3.plain.CLI_SPLICE
samba3.smbtorture_s3.plain.DELETE
samba3.smbtorture_s3.plain.DELETE-LN
samba3.smbtorture_s3.plain.DELETE-STREAM
samba3.smbtorture_s3.plain.DIR-CREATETIME
samba3.smbtorture_s3.plain.DIR(
samba3.smbtorture_s3.plain.FDPASS
samba3.smbtorture_s3.plain.FDSESS
samba3.smbtorture_s3.plain.IOCTL
samba3.smbtorture_s3.plain.LARGE_READX
samba3.smbtorture_s3.plain.LOCK10
samba3.smbtorture_s3.plain.LOCK11
samba3.smbtorture_s3.plain.LOCK13
samba3.smbtorture_s3.plain.LOCK1
samba3.smbtorture_s3.plain.LOCK2
samba3.smbtorture_s3.plain.LOCK3
samba3.smbtorture_s3.plain.LOCK4
samba3.smbtorture_s3.plain.LOCK5
samba3.smbtorture_s3.plain.LOCK6
samba3.smbtorture_s3.plain.LOCK7
samba3.smbtorture_s3.plain.LOCK9A
samba3.smbtorture_s3.plain.LOCK9B
samba3.smbtorture_s3.plain.NTTRANS-FSCTL
samba3.smbtorture_s3.plain.OPEN
samba3.smbtorture_s3.plain.OPLOCK1
samba3.smbtorture_s3.plain.OPLOCK2
samba3.smbtorture_s3.plain.OPLOCK5
samba3.smbtorture_s3.plain.OWNER-RIGHTS
samba3.smbtorture_s3.plain.PIDHIGH
samba3.smbtorture_s3.plain.RENAME
samba3.smbtorture_s3.plain.RW1
samba3.smbtorture_s3.plain.RW2
samba3.smbtorture_s3.plain.RW3
samba3.smbtorture_s3.plain.RW-SIGNING
samba3.smbtorture_s3.plain.SHORTNAME-TEST
samba3.smbtorture_s3.plain.STREAMERROR
samba3.smbtorture_s3.plain.TCON2
samba3.smbtorture_s3.plain.TCONDEV
samba3.smbtorture_s3.plain.TCON
samba3.smbtorture_s3.plain.TRANS2
samba3.smbtorture_s3.plain.UID-REGRESSION-TEST
samba3.smbtorture_s3.plain.UNLINK
samba3.smbtorture_s3.plain.W2K
samba3.smbtorture_s3.plain.WILDDELETE
samba3.smbtorture_s3.plain.XCOPY

corrosponding entries removed from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
08171c03 by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: move base.delaywerite, base.deny1 & base.deny2 to _smb1 env

the following tests

samba3.base.delaywrite
samba3.base.deny1
samba3.base.deny2

have been moved to fileserver_smb1 env and removed from skip_file

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e16aba83 by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move various samba3.base.* tests to _smb1 environment(s)

>From list of tests identified as failing with environments that
cannot negotiate SMB2 the following tests have been moved to ad_dc_smb1
& nt4_dc_smb1 (and additionally removed from skip_smb1_fails)

samba3.base.attr
samba3.base.chkpath
samba3.base.defer_open
samba3.base.delete
samba3.base.deny3
samba3.base.denydos
samba3.base.dir1
samba3.base.dir2
samba3.base.disconnect
samba3.base.fdpass
samba3.base.mangle
samba3.base.negnowait
samba3.base.ntdeny1
samba3.base.ntdeny2
samba3.base.open
samba3.base.openattr
samba3.base.properties
samba3.base.rename
samba3.base.samba3error
samba3.base.secleak
samba3.base.tcon
samba3.base.tcondev
samba3.base.trans2
samba3.base.unlink
samba3.base.vuid
samba3.base.xcopy

list of tests verified with

python3 source3/selftest/tests.py  | egrep 'ad_dc_smb1|nt4_dc_smb1' | grep "^samba3.base" | sort -u

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
25efadd5 by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move samba3.rap.basic & samba3.rap.rpc to _smb1 env

Tests:
  samba3.rap.basic
  samba3.rap.rpc

have been moved to ad_dc_smb1, nt4_dc_smb1

verified by
  python3 source3/selftest/tests.py  | grep ad_dc_smb1 | grep "^samba3.rap"

these tests have been removed from skip_smb1_fails
Additionally
samba3.rap.basic.netsessiongetinfo was already marked as knownfail
in ad_dc so in ad_dc_smb1 also true

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
13681247 by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move samba3.unix.info2 to ad_dc_smb1 & nt4_dc_smb1

verified with

  python3 source3/selftest/tests.py  | grep _smb1 | grep "^samba3.unix" | sort -u

Additionally the test entries in skip_smb1_fail also removed

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f7329c0d by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move various samba3.rpc.* tests to ad_dc_smb1

The following tests which fail in environments that cannot negotiate
SMB1 have been moved to ad_dc_smb1 & nt4_dc_smb1

samba3.rpc.authcontext
samba3.rpc.join
samba3.rpc.samba3.bind
samba3.rpc.samba3.getusername
samba3.rpc.samba3.sharesec
samba3.rpc.samba3.smb1-pipe-name
samba3.rpc.samba3.smb-reauth1
samba3.rpc.samba3.smb-reauth2
samba3.rpc.samba3.spoolss
samba3.rpc.samba3.wkssvc

python3 source3/selftest/tests.py  | grep ad_dc_smb1 | grep "^samba3.rpc" | sort -u

test entries have also been removed from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
90a493ac by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move various samba3.raw tests to _smb1 env

The following tests which fail when used in environment that
SMB1 cannot be negotiated in have been moved to ad_dc_smb1
& nt4_dc_smb1

samba3.raw.close(ad_dc_smb1)
samba3.raw.composite(ad_dc_smb1)
samba3.raw.eas(ad_dc_smb1)
samba3.raw.mkdir(ad_dc_smb1)
samba3.raw.open(ad_dc_smb1)
samba3.raw.rename(ad_dc_smb1)
samba3.raw.samba3badnameblob(ad_dc_smb1)
samba3.raw.samba3badpath(ad_dc_smb1)
samba3.raw.samba3caseinsensitive(ad_dc_smb1)
samba3.raw.samba3oplocklogoff(ad_dc_smb1)
samba3.raw.samba3rootdirfid(ad_dc_smb1)
samba3.raw.sfileinfo.bug(ad_dc_smb1)
samba3.raw.sfileinfo.end-of-file(ad_dc_smb1)
samba3.raw.sfileinfo.rename(ad_dc_smb1)
samba3.raw.streams(ad_dc_smb1)
samba3.raw.unlink(ad_dc_smb1)
samba3.raw.write(ad_dc_smb1)

verified with
   python3 source3/selftest/tests.py  | grep ad_dc_smb1 | grep "^samba3.raw" | sort -u

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fbd63bad by Noel Power at 2020-04-03T15:08:28+00:00
s3/selftest: Move samba3.base.createx_access to ad_dc_smb1 env

Test samba3.base.createx_access fails in environments that dont
support SMB1, moving this test to ad_dc_smb1 and removing the entry
in skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8ab2c603 by Noel Power at 2020-04-03T15:08:29+00:00
s3/sefltest: Move samba3.rap.sam to ad_dc_smb1 environment

Test samba3.rap.sam fails in environments that don't support
SMB1 so we move it to enironment ad_dc_smb1 and remove the entry in
skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9f152ae8 by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.unix.whoami* tests to ad_dc_smb1

The following tests which fail in environments that dont support
SMB1 have been moved to ad_dc_smb1

samba3.unix.whoami
samba3.unix.whoami kerberos connection
samba3.unix.whoami anonymous connection
samba3.unix.whoami ntlm user at realm

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
53c3612d by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.raw.chkpath to ad_dc_smb1

Test samba3.raw.chkpath fails in environments that don't support SMB1
so we move it to ad_dc_smb1 and also remove the entry from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e71c2753 by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.raw.session* to ad_dc_smb1

The following tests which fail when used with environments that don't
support SMB1 fail so we move them to ad_dc_smb1 instead and also remove
th entry in skip_smb1_fails

samba3.raw.session ntlm
samba3.raw.session krb5

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8bce1a1b by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.base.rw1 to environment ad_dc_smb1

Test samba3.base.rw1 fails in environments that don't support
SMB1 so we move it to ad_dc_smb1 and also remove the entry in
skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
59eb2724 by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.raw.acls to ad_dc_smb1 env

Test samba3.raw.acls fails in environments that don't support SMB1
so move it to ad_dc_smb1 and remove the entry in skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
543553fe by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.raw.read to ad_dc_smb1

Test samba3.raw.read fails in environments that don't support SMB1
so move it to ad_dc_smb1 and also remove the entry in skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
83f1a9a2 by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.raw.search to ad_dc_smb1 environments

Test samba3.raw.search fails in envrionments that don't support SMB1
so we move it to ad_dc_smb1 and also remove the entry in skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3b4e7dbd by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.rpc.samba3.netlogon to ad_dc_smb1

Move test samba3.rpc.samba3.netlogon which fails in enviroments that
don't support SMB1 to ad_dc_smb1 and remove the test entry from
skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0aa44c88 by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: move samba4.dfs.domain to ad_dc_smb1

Additionally remove the test entry from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1c8974b4 by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: run samba4.libsmbclient.*.NT1.* tests in ad_dc_smb1

additionally remove those related entries from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b0564253 by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: Move failing samba4.rpc.authcontext.* (ad_dc) to ad_dc_smb1

Move
samba4.rpc.authcontext with bigendian(ad_dc)
samba4.rpc.authcontext with seal,padcheck(ad_dc)
samba4.rpc.authcontext with validate(ad_dc)

to ad_dc_smb1 environment and remove the corrosponding entries in
skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ed3b15b3 by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: Move samba4.rpc.join tests from ad_dc to ad_dc_smb1

Move the following tests from ad_dc to ad_dc_smb1

samba4.rpc.join with bigendian(ad_dc)
samba4.rpc.join with seal,padcheck(ad_dc)
samba4.rpc.join with validate(ad_dc)

and additionally remove the corrosponding entries from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a166ddc7 by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: Move samba4.smb.spnego to ad_dc_smb1

Moving

samba4.smb.spnego.krb5.no_optimistic(ad_dc)
samba4.smb.spnego.ntlmssp.no_optimistic(ad_dc)

and additionally removing the entries from skip_smb1_fails

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
53532fed by Noel Power at 2020-04-03T15:08:29+00:00
s3/selftest: Move samba3.blackbox.smbclient_ntlm.plain NT1 to _smb1_done

samba3.blackbox.smbclient_ntlm.plain NT1 fails in environments that
don't support SMB2 so we need to move it to the appropriate _smb1
test env and since this test doesn't need to be ported we can actually
move it directly to the _smb1_done env to indicate that.

Also remove the samba3.blackbox.smbclient_ntlm.plain NT1(ad_dc)
entry from the skip file because we have moved this to the ad_dc_smb1
*and* this test is already ported to >=SMB2

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fc1121bc by Noel Power at 2020-04-03T15:08:29+00:00
s4/selftest: Move samba.tests.auth_log to ad_dc_smb1

Test samba.tests.auth_log will fail when run against environments that
don't support SMB1 so move this test to ad_dc_smb1 and removing
entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6edb4668 by Noel Power at 2020-04-03T15:08:30+00:00
s4/selftest: Move samba.tests.auth_log_pass_change to ad_dc_smb1

Test samba.tests.auth_log_pass_change  will fail when run against
environments that don't support SMB1 so move this test to ad_dc_smb1
and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4c924893 by Noel Power at 2020-04-03T15:08:30+00:00
s4/selftest: Move samba.tests.net_join_no_spnego to ad_dc_smb1

Test samba.tests.net_join_no_spnego when run in environment
doesn't support SMB1 so move it to ad_dc_smb1 and remove
skip_smb1_fail entry

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
572bc3e6 by Noel Power at 2020-04-03T15:08:30+00:00
s4/selftest: Adjust samba4.blackbox.pkinit to use (s3) smbclient

samba4.blackbox.pkinit falls to pass in environments that don't support
SMB2 because of use (s4) smbclient4. Change test to use (s3) smbclient

Additionally a test within the test script test_kinit_trusts_heimdal.sh
explicitly uses smbclient4 which can't negotiate SMB1 in environments
that don't support it. Add knownfail to cater for this & also remove entry
from the skip file

Further reference the smbclient4 specific test is associated with
https://bugzilla.samba.org/show_bug.cgi?id=12554 so maybe we should
keep it for the moment

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b05f3476 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.raw.lock & samba3.base.lock to nt4_dc_smb1

samba3.raw.lock & samba3.raw.lock currently will only work in
environments that negotiate SMB1 so lets move them to new nt4_dc_smb1
and remove those entries form skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
dd721837 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.base.rw1 to nt4_dc_smb1

Test samba3.base.rw1 only works in test environments that support
SMB1 so move test to nt4_dc_smb1 and remove the entry from
skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0c88b2b1 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_auth.plain to _smb1_done

samba3.blackbox.smbclient_auth.plain will fail in test environment
that doesn't support SMB1 so move to directly to test env
nt4_dc_smb1_done as it doesn't require porting.

This test only fails with options that require it to communicate over
SMB1, there are sibling tests that test against >= SMB2 so also we
remove the skip_smb1_fail entry as this test doen't need porting
(for this env)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c8ddcc82 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Remove unnecessary 'for' loop

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
691ef77f by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_s3.NT1.crypt to nt4_dc_smb1

now that a specific SMB1 enabled env is available lets move this
test to nt4_dc_smb1 env. Additionally the entry is removed from
skip_smb1_fails as no porting is required

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
da0dc866 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Remove unnecessary for loop

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f9b1ef8e by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_s3.NT1.plain to nt4_dc_smb1

Test samba3.blackbox.smbclient_s3.NT1.plain as its name suggests
requires a test environment that supports SMB1 so we move it to one.
Additionally the entry from the skip_smb1_fail file is removed (for this
env) as not porting is required.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
18ffea5e by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_large_file*NT1 to nt4_dc_smb1

Test samba3.blackbox.smbclient_large_file*NT1 will only succeed against
test environments that support SMB1 so we move it to nt4_dc_smb1.

Additionally remove the entry from the skip_smb1_faill file

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e848ad12 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.rap.sam to nt4_dc_smb1

This tests fails against nt4_dc because it doesn't support SMB1 so
we move it to nt4_dc_smb1 and remove the corrosponding entry from
skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
227095bb by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_ntlm.plain to nt4_dc_smb1

samba3.blackbox.smbclient_ntlm.plain will fail in test environment
that doesn't support SMB1 so move to nt4_dc_smb1

This test only fails with options that require it to communicate over
SMB1, there are sibling tests that test against >= SMB2 so also we
remove the skip_smb1_fail entry as this test doen't need porting
(for this env)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
bcca2563 by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Remove unnecssary for loop

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
718fea5c by Noel Power at 2020-04-03T15:08:30+00:00
s3/selftest: Move samba3.blackbox.smbclient_s3.NT1.sign to nt4_dc_smb1

samba3.blackbox.smbclient_s3.NT1.sign as the name suggests will fail
in test envs that do not support SMB1 so move it to a _smb1
environment.

Additionally the associated skip_smb1_fails entry is removed as the
test doesn't need to be ported

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c9b13ca0 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.acls* to nt4_dc_smb1

Tests samba3.raw.acls* don't succeed in environments that don't
support SMB1 so move them to nt4_dc_smb1

Also need to adjust knownfail for samba3.raw.acls nfs4acl_xattr*
Additionally remove the entries for test from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f35120b0 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.chkpath to nt4_dc_smb1

Move samba3.raw.chkpath which fails in environments that don't
support SMB1 to nt4_dc_smb1 and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
be21c8b7 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Use variable for test env rather than hardcoding

This change makes it easier and clearer in following commits
to make specific changes based on test name.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e4bdeabf by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.notify & samba3.raw.oplock to nt4_dc_smb1

Move samba3.raw.notify & samba3.raw.oplock which fail when used with
test environments that don't support SMB1 to nt4_dc_smb1 and remove
associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4d9506de by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest Move samba.raw.read to nt4_dc_smb1

Move test samba.raw.read which fails in test environments that
don't support SMB1 to nt4_dc_smb1 and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9fab393a by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move raw.samba3checkfsp, raw.samba3hide & raw.samba3closeerr

Tests samba3.raw.samba3checkfsp, samba3.raw.samba3hide &
samba3.raw.samba3closeerr fail in test environments that don't support
SMB1 so move to nt4_dc_smb1. Additionally samba3.raw.samba3closeer was
a known fail in nt4_dc so this also needs to be adjusted for the new
env.

Remove the remaining entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3fd9c4ac by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Prep commit split handling for raw.samba3posixtimedlock

raw.samba3posixtimedlock & smb2.samba3misc share the same logic block
but in a future commit we will need to split these tests into
'_smb1' & non '_smb1' environments

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fce023d6 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.samba3posixtimedlock to ad_dc_smb1

Test samba3.raw.samba3posixtimedlock will not succeed in test
environments that don't support SMB1 so we move it to ad_dc_smb1
and also remove associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9fa64617 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.samba3posixtimedlock to nt4_dc_smb1

Test samba3.raw.samba3posixtimedlock will not succeed in test
environments that don't support SMB1 so we move it to nt4_dc_smb1
and remove associated entries from skip_smb1_selftest

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3a9e6782 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.search to nt4_dc_smb1

Test samba3.raw.search fails in test environments that don't
support SMB1 so move test to nt4_dc_smb1 and remove entry from
skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
29c340bc by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.raw.session to nt4_dc_smb1

Move test samba3.raw.session which fails in test environments that
don't support SMB1 to nt4_dc_smb1 and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a762e8c6 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.rpc.lsa.lookupsids to nt4_dc_smb1

Test samba3.rpc.lsa.lookupsids when run with protocol options specifying
smb1 will of course fail when run against environments the don't support
SMB1 so move such tests to nt4_dc_smb1

Additionally remove those entries from the skip file as porting is
not needed.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b527816c by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move rpc.samba3.netlogon & rpc.samba3.sessionkey to nt4_dc_smb1

Move test samba3.rpc.samba3.netlogon & ^samba3.rpc.samba3.sessionkey
to nt4_dc_smb1 as these tests will fail when run against an environment
that doesn't support SMB1 and remove the entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a20ad867 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.smbtorture_s3.crypt_client.* to nt4_dc_smb1

Move samba3.smbtorture_s3.crypt_client.* tests which fail against
environments that don't support SMB1.

The following tests have been moved from nt4_dc -> nt4_dc_smb1

samba3.smbtorture_s3.crypt_client.ATTR
samba3.smbtorture_s3.crypt_client.BROWSE
samba3.smbtorture_s3.crypt_client.CASE-INSENSITIVE-CREATE
samba3.smbtorture_s3.crypt_client.CHAIN1
samba3.smbtorture_s3.crypt_client.CHAIN2
samba3.smbtorture_s3.crypt_client.CHAIN3
samba3.smbtorture_s3.crypt_client.CHKPATH
samba3.smbtorture_s3.crypt_client.CLEANUP1
samba3.smbtorture_s3.crypt_client.CLEANUP2
samba3.smbtorture_s3.crypt_client.CLEANUP4
samba3.smbtorture_s3.crypt_client.CLI_SPLICE
samba3.smbtorture_s3.crypt_client.DELETE
samba3.smbtorture_s3.crypt_client.DELETE-LN
samba3.smbtorture_s3.crypt_client.DELETE-STREAM
samba3.smbtorture_s3.crypt_client.DIR
samba3.smbtorture_s3.crypt_client.DIR-CREATETIME
samba3.smbtorture_s3.crypt_client.FDPASS
samba3.smbtorture_s3.crypt_client.FDSESS
samba3.smbtorture_s3.crypt_client.IOCTL
samba3.smbtorture_s3.crypt_client.LARGE_READX
samba3.smbtorture_s3.crypt_client.LOCK1
samba3.smbtorture_s3.crypt_client.LOCK10
samba3.smbtorture_s3.crypt_client.LOCK11
samba3.smbtorture_s3.crypt_client.LOCK13
samba3.smbtorture_s3.crypt_client.LOCK2
samba3.smbtorture_s3.crypt_client.LOCK3
samba3.smbtorture_s3.crypt_client.LOCK4
samba3.smbtorture_s3.crypt_client.LOCK5
samba3.smbtorture_s3.crypt_client.LOCK6
samba3.smbtorture_s3.crypt_client.LOCK7
samba3.smbtorture_s3.crypt_client.LOCK9A
samba3.smbtorture_s3.crypt_client.LOCK9B
samba3.smbtorture_s3.crypt_client.NTTRANS-FSCTL
samba3.smbtorture_s3.crypt_client.OPEN
samba3.smbtorture_s3.crypt_client.OPLOCK1
samba3.smbtorture_s3.crypt_client.OPLOCK2
samba3.smbtorture_s3.crypt_client.OWNER-RIGHTS
samba3.smbtorture_s3.crypt_client.PIDHIGH
samba3.smbtorture_s3.crypt_client.PROPERTIES
samba3.smbtorture_s3.crypt_client.RENAME
samba3.smbtorture_s3.crypt_client.RENAME-ACCESS
samba3.smbtorture_s3.crypt_client.RW1
samba3.smbtorture_s3.crypt_client.RW2
samba3.smbtorture_s3.crypt_client.RW3
samba3.smbtorture_s3.crypt_client.RW-SIGNING
samba3.smbtorture_s3.crypt_client.SHORTNAME-TEST
samba3.smbtorture_s3.crypt_client.STREAMERROR
samba3.smbtorture_s3.crypt_client.TCON
samba3.smbtorture_s3.crypt_client.TCON2
samba3.smbtorture_s3.crypt_client.TCONDEV
samba3.smbtorture_s3.crypt_client.TORTURE
samba3.smbtorture_s3.crypt_client.TRANS2
samba3.smbtorture_s3.crypt_client.UID-REGRESSION-TEST
samba3.smbtorture_s3.crypt_client.UNLINK
samba3.smbtorture_s3.crypt_client.W2K
samba3.smbtorture_s3.crypt_client.WILDDELETE
samba3.smbtorture_s3.crypt_client.XCOPY

and have been removed from skip_smb1_fail

list of tests modified has been verified with

python3 source3/selftest/tests.py | grep "^samba3.smbtorture_s3." | grep nt4_dc_smb1 | cut -f1 -d\( | sort -u

addionally any knownfail entries have been updated as appropriate.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a78f7478 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.smbtorture_s3.crypt_server.TORTURE to nt4_dc_smb1

Test fails to negotiation SMB1 in environments that require SMB1 so
move to nt4_dc_smb1 env.

entry also removed from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
63784fd6 by Noel Power at 2020-04-03T15:08:31+00:00
s3/selftest: Move samba3.smbtorture_s3.crypt.POSIX* to nt4_dc_smb1

The tests menioned below all fail when run against environments that
don't support SMB1 so we move them to nt4_dc_smb1

python3 source3/selftest/tests.py | grep "^samba3.smbtorture_s3.crypt\." | grep nt4_dc_smb1 | cut -f1 -d\( | sort -u

samba3.smbtorture_s3.crypt.POSIX
samba3.smbtorture_s3.crypt.POSIX-ACL-OPLOCK
samba3.smbtorture_s3.crypt.POSIX-ACL-SHAREROOT
samba3.smbtorture_s3.crypt.POSIX-APPEND
samba3.smbtorture_s3.crypt.POSIX-BLOCKING-LOCK
samba3.smbtorture_s3.crypt.POSIX-MKDIR
samba3.smbtorture_s3.crypt.POSIX-OFD-LOCK
samba3.smbtorture_s3.crypt.POSIX-STREAM-DELETE
samba3.smbtorture_s3.crypt.POSIX-SYMLINK-ACL
samba3.smbtorture_s3.crypt.POSIX-SYMLINK-EA
samba3.smbtorture_s3.crypt.WINDOWS-BAD-SYMLINK (this is a posix test)

also remove these entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2668459b by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move samba3.smbtorture_s3.plain.POSIX* to nt4_dc_smb1

    The tests menioned below all fail when run against environments that
    don't support SMB1 so we move them to nt4_dc_smb1

    python3 source3/selftest/tests.py | grep "^samba3.smbtorture_s3.crypt\." | grep nt4_dc_smb1 | cut -f1 -d\( | sort -u

    samba3.smbtorture_s3.plain.POSIX
    samba3.smbtorture_s3.plain.POSIX-ACL-OPLOCK
    samba3.smbtorture_s3.plain.POSIX-ACL-SHAREROOT
    samba3.smbtorture_s3.plain.POSIX-APPEND
    samba3.smbtorture_s3.plain.POSIX-BLOCKING-LOCK
    samba3.smbtorture_s3.plain.POSIX-MKDIR
    samba3.smbtorture_s3.plain.POSIX-OFD-LOCK
    samba3.smbtorture_s3.plain.POSIX-STREAM-DELETE
    samba3.smbtorture_s3.plain.POSIX-SYMLINK-ACL
    samba3.smbtorture_s3.plain.POSIX-SYMLINK-EA
    samba3.smbtorture_s3.plain.WINDOWS-BAD-SYMLINK (this is a posix
test)

Also remove entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6820a8cd by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest Move samba3.smbtorture_s3.plain.MANGLE-ILLEGAL to ad_dc_smb1

Also remove the associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
628ff67b by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move samba3.unix.whoami to nt4_dc_smb1

Also remove the associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
aa688a8d by Noel Power at 2020-04-03T15:08:32+00:00
s4/selftest: Move samba.tests.libsmb to nt4_dc_smb1

Also remove associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
65aa21b8 by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest Move samba3.smbtorture_s3.plain.RENAME-ACCESS to nt4_dc_smb1

Also remove associated entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2b1cca4c by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move tests raw.samba3hide, raw.samba3checkfsp & raw.samba3closeerr

Move tests raw.samba3hide, raw.samba3checkfsp & raw.samba3closeerr from
simpleserver to fileserver. Also need a knownfail for raw.samba3closeerr
which fails in envs that NT ACLs enabled. We will get extra coverage
from ad_dc_smb1 when the same tests are moved there.

Remove the associated entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9161cf74 by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move tests raw.samba3hide, raw.samba3checkfsp & raw.samba3closeerr

Move tests raw.samba3hide, raw.samba3checkfsp & raw.samba3closeerr from
ad_dc to ad_dc_smb1. Also update flapping and knownfail entries to cater
for the new env.

no entries in skip files to be removed as flapping & knownfail negate
the need for this.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f7456c8b by Noel Power at 2020-04-03T15:08:32+00:00
selftest: Add 'hide new files timeout' related data to fileserver_smb1

In order to support samba3.smbtorture_s3.hidenewfiles (and moving
the test to fileserver_smb1) we need to ensure we have some supporting
config

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
07ccb8c7 by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move samba3.smbtorture_s3.hidenewfiles to fileserver_smb1

Test samba3.smbtorture_s3.hidenewfiles fails when run against test
environments that don't support SMB1. Move this test to fileserver_smb1
and remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
58623e53 by Noel Power at 2020-04-03T15:08:32+00:00
selftest: Modify fileserver_smb1 with vfs_aio params

To support running tests samba3.smbtorture_s3.vfs_aio* in
test env fileserver_smb1 we need to add some params to
fileserver_smb1 config files.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
89476fee by Noel Power at 2020-04-03T15:08:32+00:00
s3/selftest: Move samba3.smbtorture_s3.vfs_aio* to fileserver_smb1

move all failing tests to fileserver_smb1 (exception is the SMB2-BASIC
test) doesn't need to move
Additionally remove the associated entries from skip_smb1_file

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c83fafac by Noel Power at 2020-04-03T15:08:32+00:00
s4/selftest: Modify samba4.blackbox.chgdcpass to use smbclient(s3)

Test was using smbclient4 but this fails when used in environments that
don't support SMB1. We use smbclient(s3) instead. There remains one
failure due to behaviour differences between the smbclients.

The behavioural changes are related not to SMB1/SMB2 but
commits d4ea637eb869e0c3540140b7ae04c2b483f7693c &
fce66b22ea312abb252fb9dc748b3adc6fbab49f

Perhaps we need to modify s3 smbclient in a similar way? This is however
something that deserves further discussion.

Move this failing part to a knownfail for the moment.

Also the corrosponding entry in skip_smb1_fail has been removed

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
15536417 by Noel Power at 2020-04-03T15:08:32+00:00
s4/selftest: Move samba4.ldap.nested-search to ad_dc_default_smb1

Test samba4.ldap.nested-search fails when run against test env
that doesn't support SMB1 so move to ad_dc_default_smb1

Also remove entry from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e362ad23 by Noel Power at 2020-04-03T15:08:32+00:00
s4/selftest: Move samba4.ldap.passwordsettings to ad_dc_default_smb1

Test samba4.ldap.passwordsettings fails when run against test env that
doesn't support SMB1 so move to ad_dc_default_smb1

Note: no skip entries to be removed as tests are known failures

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
04639604 by Noel Power at 2020-04-03T15:08:32+00:00
s4/selftest: Move samba4.rpc.join tests to ad_dc_default_smb1

The following tests which fail when run against a test env that
doesn't support SMB1

samba4.rpc.join on ncacn_ip_tcp with bigendian(ad_dc_default)
samba4.rpc.join on ncacn_ip_tcp with seal,padcheck(ad_dc_default)
samba4.rpc.join on ncacn_ip_tcp with validate(ad_dc_default)
samba4.rpc.join on ncacn_np with bigendian(ad_dc_default)
samba4.rpc.join on ncacn_np with seal,padcheck(ad_dc_default)
samba4.rpc.join on ncacn_np with validate(ad_dc_default)
samba4.rpc.join on ncalrpc with bigendian(ad_dc_default:local)
samba4.rpc.join on ncalrpc with seal,padcheck(ad_dc_default:local)
samba4.rpc.join on ncalrpc with validate(ad_dc_default:local)

have been moved to ad_dc_default_smb1

results verified with

VALIDATE="validate" python3 source4/selftest/tests.py | grep "^samba4.rpc.join" | grep ad_dc_default | sort

corrosponding entries have been removed from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6d67a89a by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d Add samba3.blackbox.smbclient_ntlm.plain (NT1)

NT1 flavour of samba3.blackbox.smbclient_ntlm.plain tests will
fail against ad_member, maptoguest, fl2000dc & nt4_member
(because these envs don't support SMB1)

We do however have some coverage with test envs
nt4_dc_smb1_done & ad_dc_ntvfs.

We could maybe just delete these tests for these environments,
creating new envs for such a small amount of strictly SMB1 tests anyway
seem overkill. For the moment just create specific knownfail entries

associated entries from skip_smb1_fail have also been deleted

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ecaaef4f by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d knownfail samba3.blackbox.smbclient_auth.plain

samba3.blackbox.smbclient_auth.plain will fail against
ad_member & nt4_member (because these envs don't
support SMB1) so we don't run these tests where either
'LANMAN2' or 'NT1' are in the options, in these cases
to get coverage so we use nt4_dc_smb1

Creating new envs for such a small amount of strictly SMB1 tests anyway
seems overkill. For the moment just create specific knownfail entries
and remove the associated entries from skip_smb1_fail

Signed-off-by: Noel Power <npower at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0721eed9 by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d: Add samba3.blackbox.smbclient_s3.NT1

samba3.blackbox.smbclient_s3.NT1.plain &
samba3.blackbox.smbclient_s3.NT1.sign tests will fail running against
test envs ad_member & nt4_member (because those envs don't support SMB1)

However we do have some coverage with nt4_dc_smb1_done

We could maybe just delete these tests for those environments for
the moment just create specific knownfail entries and remove associated
entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
eafdbba6 by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d: Add entries for samba3.unix.whoami

samba3.unix.whoami depends of posix extensions which
currently only work with SMB1. These tests fail with
environments nt4_member & ad_member. We currently don't
have plans to provide '_smb1' variants of these environments.

So in addition to adding the knownfail we add some
coverage by running this test with test env ad_dc_smb1.

Also we remove the associated entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
84ba205d by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d: Add samba4.smb.signing disabled

Add know fail for these tests that run against ad_member
which won't succeed because SMB1 isn't supported

However we do have some coverage with s4member (which depends on
ad_dc_ntvfs) which still supports SMB1.

Additionally remove the associated entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e7b4b349 by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d: Add samba4.blackbox.smbclient

This test fails for admember & chgdcpass test envs because they
don't support SMB1

Note: There is some coverage for this test with other test envs e.g.
      s4member, ad_dc_ntvfs & others

Additionally IIUC this test seems to be for testing smbclient4
(if this assumption is incorrect then we could substitute with
smbclient(s3)) However, for the moment it seems best to disable this
test as smbclient4 doesn't support SMB1 and we have sufficient coverage
with other SMB1 supporting envs

Also remove associated entries from skip_smb1_fail

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
adba4165 by Noel Power at 2020-04-03T15:08:33+00:00
selftest/knownfail.d: samba3.blackbox.smbclient_basic.NT1.smbclient

Add known fail for samba3.blackbox.smbclient_basic.NT1.smbclient
which fails against nt4_schannel (because it doesn't support
SMB1)

Additionally since we don't have plans to create a nt4_schannel_smb1
test env provide additional coverage by running this test against
nt4_dc_smb1 (which still support SMB1)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1840e965 by Noel Power at 2020-04-03T15:08:33+00:00
selftest: Create instructions for generating skip file entries

create_smb1_fail_skipfile.txt provides both
  + instructions
  + patch to perform the pre-requisite steps to be able to
    modify the environment and parse test output

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
182635bb by Noel Power at 2020-04-03T15:08:33+00:00
selftest: Don't skip smb1 tests and remove associate skip file

remove the skip file and the code to use it from the build as
all tests now run in either specific smb1 enabled envs or normal
(non smb1) envs

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
23349f9d by Noel Power at 2020-04-03T16:45:48+00:00
selftest: Add list of tests to be ported

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Fri Apr  3 16:45:48 UTC 2020 on sn-devel-184

- - - - -
61e3576a by Ralph Boehme at 2020-04-03T19:05:42+00:00
smbd: CHECK_READ macro reformatting

A subsequent commit will replace can_read with something much longer.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
be6f8e03 by Ralph Boehme at 2020-04-03T19:05:42+00:00
smbd: CHECK_READ_SMB2 macro reformatting

A subsequent commit will replace can_read with something much longer.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2d56412e by Ralph Boehme at 2020-04-03T19:05:42+00:00
smbd: CHECK_READ_IOCTL macro reformatting

A subsequent commit will replace can_read with something much longer.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
574255a7 by Ralph Boehme at 2020-04-03T19:05:42+00:00
smbd: CHECK_WRITE macro reformatting

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5a5bbcd9 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: reformat calling ensure_canon_entry_valid_on_set() in unpack_canon_ace()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
553e576a by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: reformat an if expression in reply_readbraw()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a72208fc by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: reformat a function call in rename_internals_fsp()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ea0f1b3b by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: reformat an if expression in smbd_smb2_close()

No change in behavour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8718dae6 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: fix if expression that checks when to call vfs_fill_sparse()

Noone complained so far, skip bugreport.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fed1bc22 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: reindent if expression in real_write_file()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7c386c08 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: move files_struct.kernel_share_modes_taken to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
adaca959 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: move files_struct.update_write_time_triggered to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9c2809c5 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: move files_struct.update_write_time_on_close to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4d70e92a by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: move files_struct.write_time_forced to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d2209696 by Ralph Boehme at 2020-04-03T19:05:43+00:00
smbd: move files_struct.can_lock to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8b489692 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.can_read to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b95c62bc by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.can_write to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
65a43024 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.modified to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cb996cd5 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.is_directory to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1ccd335a by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.aio_write_behind to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b0824cf3 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.initial_delete_on_close to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
930b7525 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.delete_on_close to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
049488f6 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.is_sparse to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
34b4effc by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.backup_intent to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e940a41c by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.use_ofd_locks to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
16a485d1 by Ralph Boehme at 2020-04-03T19:05:44+00:00
smbd: move files_struct.closing to a bitfield

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
78e1492f by Ralph Boehme at 2020-04-03T20:41:34+00:00
smbd: move files_struct.lock_failure_seen to a bitfield

Updated comment in vfs.h explaining ABI change.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Apr  3 20:41:34 UTC 2020 on sn-devel-184

- - - - -
8cad448a by Noel Power at 2020-04-04T01:12:05+00:00
selftest/flapping: mark samba3.nbt.dgram.netlogon.* as flapping

Post SMB1/SMB2 test env split to help in removing smb1
samba3.nbt.dgram.netlogon* fails randomly. It is unrelated as far
as we can see to the changes but must be a side affect of runtime
order or some such.

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Sat Apr  4 01:12:05 UTC 2020 on sn-devel-184

- - - - -
1a5b0e11 by Andreas Schneider at 2020-04-06T09:08:39+00:00
gitlab-ci: Add coverity scan runner

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
dd083d73 by Ralph Boehme at 2020-04-06T09:08:39+00:00
selftest: remove unnecessary .* from flapping enty

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Noel Power <noel.power at suse.com>

- - - - -
53324c35 by Ralph Boehme at 2020-04-06T10:43:18+00:00
selftest: add two more nbt.dgram flapping tests

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Noel Power <noel.power at suse.com>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Mon Apr  6 10:43:18 UTC 2020 on sn-devel-184

- - - - -
c012f924 by Andreas Schneider at 2020-04-06T17:34:53+00:00
third_party: Update nss_wrapper to version 1.1.11

This fixes strict aliasing which leads to segfaults on certain
architectures, e.g. armv7hl.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Samuel Cabrero <scabrero at samba.org>

Autobuild-User(master): Samuel Cabrero <scabrero at samba.org>
Autobuild-Date(master): Mon Apr  6 17:34:53 UTC 2020 on sn-devel-184

- - - - -
ec69752c by Andreas Schneider at 2020-04-06T17:35:39+00:00
s3:libads: Fix ads_get_upn()

This adds the userPrincipalName to ads_find_machine_acct() which
fetches the data for us.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
c4be195d by Andreas Schneider at 2020-04-06T19:09:53+00:00
testprogs: Add 'net ads join createupn' test also verifying the keytab

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Apr  6 19:09:53 UTC 2020 on sn-devel-184

- - - - -
7ad7c0b9 by Martin Schwenke at 2020-04-07T01:26:41+00:00
ctdb-vacuum: Use vacuum_handle local variables

No behaviour change.  This just makes future changes clearer by
avoiding reformatting (or introducing local variables).

Clean up error handling while touching a relevant line.

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

- - - - -
5d03a3c8 by Martin Schwenke at 2020-04-07T01:26:41+00:00
ctdb-vacuum: Store value of VacuumInterval in ctdb_vacuum_handle

No behaviour change.  This is final staging to make the next change
completely obvious.

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

- - - - -
f8f3d795 by Martin Schwenke at 2020-04-07T03:04:57+00:00
ctdb-vacuum: Reschedule vacuum event if VacuumInterval has increased

The vacuuming integration tests set VacuumInterval to a very high
number to avoid vacuuming collisions.  This is done after the cluster
is healthy, so Samba will have already been started and vacuuming will
already be scheduled *at the default interval* for databases attached
by Samba.  This means that vacuuming controls used by vacuuming tests
can still collide with the scheduled vacuuming events.

Add some logic to reschedule a vacuuming event that has fired but
where VacuumInterval has increased since it was originally scheduled.
The increase in VacuumInterval is used as the time offset for
rescheduling the event.

Although this changes production behaviour for the convenience of
testing, the new behaviour is completely reasonable and obeys the
principle of least surprise.

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Apr  7 03:04:57 UTC 2020 on sn-devel-184

- - - - -
d1f4002b by Gary Lockyer at 2020-04-07T12:29:00+00:00
lib ldb: lmdb init var before calling mdb_reader_check

Initilalise "stale" to zero before passing a pointer to it to
mdb_reader_check.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue Apr  7 12:29:00 UTC 2020 on sn-devel-184

- - - - -
ecdd17c5 by Andreas Schneider at 2020-04-08T13:02:39+00:00
s4:samdb: Do not create WDdigests for HTTP if weak crypto is disabled

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
ab3394f9 by Andreas Schneider at 2020-04-08T13:02:39+00:00
s4:tls: Fix generating TLS RSA certs with FIPS140-2

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
86567061 by Andreas Schneider at 2020-04-08T13:02:39+00:00
selftest: Add an ad_dc_fips environment

This is not FIPS ready yet.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
8c5da549 by Andreas Schneider at 2020-04-08T13:02:39+00:00
selftest: Pass extra_provision_options to provision_raw_prepare()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
aa480d4b by Andreas Schneider at 2020-04-08T13:02:39+00:00
selftest: Pass force_fips_mode to provision_ad_dc()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
dcd99c8d by Andreas Schneider at 2020-04-08T13:02:40+00:00
selftest: Pass force_fips to provision()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
df8831b9 by Andreas Schneider at 2020-04-08T13:02:40+00:00
selftest: Pass force_fips_mode to provision_raw_prepare()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
a78f4819 by Andreas Schneider at 2020-04-08T13:02:40+00:00
selftest: Start ad_dc_fips with forced fips mode

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
ff67642d by Andreas Schneider at 2020-04-08T13:02:40+00:00
tests: Add test to check the server doesn't allow NTLM

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
5ae07ac3 by Andreas Schneider at 2020-04-08T13:02:40+00:00
selftest: Force fips mode for openssl in ad_dc_fips

This allows us to test MIT KRB5 and OpenLDAP in FIPS mode.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
9918abd7 by Andreas Schneider at 2020-04-08T14:45:18+00:00
gitlab-ci: Add runner for fips compliance testing

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Apr  8 14:45:18 UTC 2020 on sn-devel-184

- - - - -
3ab9caae by Volker Lendecke at 2020-04-08T14:46:39+00:00
lib: Fix a signed/unsigned warning

The types are deliberately distinct, but nwritten is >0 or ==-1, so
this should be okay.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fbf55d12 by Volker Lendecke at 2020-04-08T14:46:39+00:00
libsmb: Remove a typedef

No API change, this is not used publically

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
57669562 by Volker Lendecke at 2020-04-08T14:46:39+00:00
lib: Avoid casts in ctdb_packet_dump()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f261d5f7 by Volker Lendecke at 2020-04-08T14:46:39+00:00
torture4: Allow DBG output in libsmbclient tests

smbc_new_context() overwrites the global DEBUGLEVEL to 0.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d3be1d04 by Volker Lendecke at 2020-04-08T14:46:39+00:00
smbclient: Remove some unnecessary declarations

"cmd_ptr" is a global variable in this file anyway

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
268892f7 by Volker Lendecke at 2020-04-08T14:46:39+00:00
smbclient: Remove function set_remote_times()

This was just a wrapper around cli_setpathinfo_ext() with just one
caller

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
bf61a0d7 by Volker Lendecke at 2020-04-08T14:46:39+00:00
libsmb: Add cli_setfileinfo_send/recv()

Encapsulate TRANSACT2_SETFILEINFO like cli_setpathinfo_send() does for
TRANSACT2_SETPATHINFO.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b46b5a64 by Volker Lendecke at 2020-04-08T14:46:39+00:00
libsmb: Use cli_setfilefinfo_send() in cli_nt_delete_on_close_send()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6cb1f20f by Volker Lendecke at 2020-04-08T14:46:39+00:00
libsmb: Use cli_setfileinfo_send() in cli_ftruncate_send()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
aa1f3421 by Volker Lendecke at 2020-04-08T14:46:39+00:00
libsmb: Make cli_setpathinfo_ext() take structs instead of pointers

This simplifies the next commit: With direct (small) structs on the
stack we don't need declared variables in the callers

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b89ab75c by Volker Lendecke at 2020-04-08T14:46:40+00:00
smbtorture3: Call cli_setpathinfo_ext() instead of .._basic()

The timestamps were never looked at

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e4aa9a97 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Pass "struct timespec" to SMBC_setatr()

Prepare to set higher-precision timestamps. No change in behaviour so
far: The {.tv_nsec=SAMBA_UTIME_OMIT} implicitly sets .tv_sec=0, and
SMBC_setatr() only looks at .tv_sec

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7b246696 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Call cli_setpathinfo_ext() instead of .._basic()

Yes, the formatting is not according to README.Coding, but that's a
patch for another day.

Also, this is no functional change: All callers so far either set
.tv_sec only or set .tv_nsec to SAMBA_UTIME_OMIT.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b22b4dae by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Remove unused cli_setpathinfo_basic()

We got beyond 1-sec timestamp resolution a while ago...

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
810397f8 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmbclient: Don't throw away nsec fields in stat()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
833303b8 by Volker Lendecke at 2020-04-08T14:46:40+00:00
torture: Test smbc_utimes()

Prove that smbc_utimes throws away the tv_nsec field

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
cfd0a8a7 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Respect the full timeval for smbc_utimes()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9d8819b3 by Volker Lendecke at 2020-04-08T14:46:40+00:00
smbclient: Simplify browse_host()

We now have the check of the real connection's prootocol, so the
smb.conf's "client min protocol" does not really matter here

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c7022803 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Remove unused cli_NetWkstaUserLogon()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
67b097b8 by Volker Lendecke at 2020-04-08T14:46:40+00:00
libsmb: Move get_ipc_connect_master_ip_bcast() to smbtree.c

... the only user

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
37059e45 by Volker Lendecke at 2020-04-08T16:22:17+00:00
smbtree: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Apr  8 16:22:17 UTC 2020 on sn-devel-184

- - - - -
34240fd4 by Samuel Cabrero at 2020-04-08T20:48:28+00:00
librpc:core: Make find_interface_by_uuid public

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
bce570cf by Samuel Cabrero at 2020-04-08T20:48:28+00:00
spoolss: Add NCALRPC endpoint

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
03f79a3b by Samuel Cabrero at 2020-04-08T22:23:05+00:00
s3:rpc_server: Improve local dispatching

Craft core structures to dispatch local calls in the same way as remote
ones, removing the special handling in the autogenerated code.

This is also necessary to drop s3 rpc handles implementation.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Apr  8 22:23:05 UTC 2020 on sn-devel-184

- - - - -
8197fc07 by Jeremy Allison at 2020-04-09T19:40:34+00:00
VFS: Add vfs_widelinks module.

Hides symlinks from smbd. Will be used to replace
the lp_widelinks() code inside smbd.

Long description of how this module works
with notes is included.

The man page and WHATSNEW.txt update is done
in a later patch in this series.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f7fe3474 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: VFS: Add cmocka tests for pathname parsing in vfs_widelinks.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
886d2c09 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: VFS: Add custom initialization for vfs_widelinks.

As the widelinks logic is now moving into a
vfs_widelinks module, we need to custom load
it after the default module is initialized.
That way no changes to smb.conf files are
needed.

We may revisit this for Samba 5.0 and force
people to change their smb.conf files and
explicitly load this as a vfs module if they
want the insecure widelinks behavior.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
47b7f331 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: VFS: Remove the lp_widelinks() check from check_reduced_name().

Widelinks are now always denied, unless the vfs_widelinks
VFS module is loaded.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d803d66b by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: Remove allowing widelinks in fd_open path.

Widelinks are now always denied, unless the vfs_widelinks
VFS module is loaded.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9eac2320 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: Always call canonicalize_connect_path() for a (synthesized) msdfs-share.

Share path definitions don't need to be aware of symlinks.

This is strictly a change in behavior, but the vfs_widelinks
module (if loaded) copes with symlinks in the share definition.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
78a25320 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: Always call canonicalize_connect_path() for a share.

Share path definitions don't need to be aware of symlinks.

This is strictly a change in behavior, but the vfs_widelinks
module (if loaded) copes with symlinks in the share definition.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8e152494 by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: Reformatting - fix indentation in check_reduced_name().

Now we removed the lp_widelinks() clause we
left an extra {..} level of indirection. Just
reformat to remove it and update to modern
DBG_ macros. No logic changes

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8ec68cdf by Jeremy Allison at 2020-04-09T19:40:35+00:00
s3: smbd: Reformatting - fix indentation in fd_open().

Now we removed the lp_widelinks() clause we
left an extra {..} level of indirection. Just
reformat to remove it. No logic changes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
27d362c6 by Jeremy Allison at 2020-04-09T19:40:35+00:00
docs-xml: Add a vfs_widelinks manpage.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c4176b1c by Jeremy Allison at 2020-04-09T21:21:46+00:00
Update WHATSNEW.txt to explain the vfs_widelinks module addition.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu Apr  9 21:21:46 UTC 2020 on sn-devel-184

- - - - -
eab086c5 by Ralph Boehme at 2020-04-11T12:23:59+00:00
s4/torture: fix timeval wrap in torture_libsmbclient_utimes() test

Fixes the following flapping test:

UNEXPECTED(failure): samba4.libsmbclient.utimes.SMB3.utimes(nt4_dc)
REASON: Exception: Exception: ../../source4/torture/libsmbclient/libsmbclient.c:1249:
    st.st_mtim.tv_nsec / 1000 was 98181 (0x17F85),
    expected 1098181 (0x10C1C5): smbc_utimes did not update msec

https://gitlab.com/samba-team/devel/samba/-/jobs/506361470

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Sat Apr 11 12:24:00 UTC 2020 on sn-devel-184

- - - - -
977d3c7b by Jeremy Allison at 2020-04-14T16:22:28+00:00
s3: VFS: full_audit. Add missing fcntl entry in vfs_op_names[] array.

Found by yannick at in2ip.nl.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
5e987e2f by Jeremy Allison at 2020-04-14T17:58:40+00:00
s3: VFS: Add cmocka test for vfs_full_audit to make sure all arrays are correct.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Apr 14 17:58:40 UTC 2020 on sn-devel-184

- - - - -
34f8ab77 by Noel Power at 2020-04-14T22:55:51+00:00
s3/librpc/crypto: Fix double free with unresolved credential cache

We free gse_ctx->k5ctx but then free it again in the
talloc dtor. This patch just lets the talloc dtor handle
things and removes the extra krb5_free_context

Failed to resolve credential cache 'DIR:/run/user/1000/krb5cc'! (No credentials cache found)
==30762== Invalid read of size 8
==30762==    at 0x108100F4: k5_os_free_context (in /usr/lib64/libkrb5.so.3.3)
==30762==    by 0x107EA661: krb5_free_context (in /usr/lib64/libkrb5.so.3.3)
==30762==    by 0x7945D2E: gse_context_destructor (gse.c:84)
==30762==    by 0x645FB49: _tc_free_internal (talloc.c:1157)
==30762==    by 0x645FEC5: _talloc_free_internal (talloc.c:1247)
==30762==    by 0x646118D: _talloc_free (talloc.c:1789)
==30762==    by 0x79462E4: gse_context_init (gse.c:241)
==30762==    by 0x794636E: gse_init_client (gse.c:268)
==30762==    by 0x7947602: gensec_gse_client_start (gse.c:786)
==30762==    by 0xBC87A3A: gensec_start_mech (gensec_start.c:743)
==30762==    by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774)
==30762==    by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633)
==30762==  Address 0x17259928 is 40 bytes inside a block of size 496 free'd
==30762==    at 0x4C2F50B: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30762==    by 0x79462CA: gse_context_init (gse.c:238)
==30762==    by 0x794636E: gse_init_client (gse.c:268)
==30762==    by 0x7947602: gensec_gse_client_start (gse.c:786)
==30762==    by 0xBC87A3A: gensec_start_mech (gensec_start.c:743)
==30762==    by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774)
==30762==    by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633)
==30762==    by 0xBC813E2: gensec_spnego_client_negTokenInit_start (spnego.c:537)
==30762==    by 0xBC84084: gensec_spnego_update_pre (spnego.c:1943)
==30762==    by 0xBC83AE5: gensec_spnego_update_send (spnego.c:1741)
==30762==    by 0xBC85622: gensec_update_send (gensec.c:449)
==30762==    by 0x551BFD0: cli_session_setup_gensec_local_next (cliconnect.c:997)
==30762==  Block was alloc'd at
==30762==    at 0x4C306B5: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30762==    by 0x107EA7AE: krb5_init_context_profile (in /usr/lib64/libkrb5.so.3.3)
==30762==    by 0xB853215: smb_krb5_init_context_common (krb5_samba.c:3597)
==30762==    by 0x794615B: gse_context_init (gse.c:209)
==30762==    by 0x794636E: gse_init_client (gse.c:268)
==30762==    by 0x7947602: gensec_gse_client_start (gse.c:786)
==30762==    by 0xBC87A3A: gensec_start_mech (gensec_start.c:743)
==30762==    by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774)
==30762==    by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633)
==30762==    by 0xBC813E2: gensec_spnego_client_negTokenInit_start (spnego.c:537)
==30762==    by 0xBC84084: gensec_spnego_update_pre (spnego.c:1943)
==30762==    by 0xBC83AE5: gensec_spnego_update_send (spnego.c:1741)
==30762==

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14344
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Tue Apr 14 22:55:51 UTC 2020 on sn-devel-184

- - - - -
ab629af7 by Christof Schmitt at 2020-04-16T17:27:40+00:00
smbclient: Remove one level of indentation for the utimes command

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e3ef646c by Christof Schmitt at 2020-04-16T17:27:40+00:00
smbclient: Also allow four digit years in utimes command

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
2d5ffed7 by Christof Schmitt at 2020-04-16T17:27:41+00:00
test_smbclient_s3: Test four-digit year in smbclient utimes

Modify the test to also set the create_time, and specify the year with
using four digits to test the new codepath.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
5c73a2b3 by Christof Schmitt at 2020-04-16T19:06:32+00:00
docs: Update smbclient manpage that four digit years are also allowed

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Christof Schmitt <cs at samba.org>
Autobuild-Date(master): Thu Apr 16 19:06:32 UTC 2020 on sn-devel-184

- - - - -
cb59b75b by Jeremy Allison at 2020-04-16T19:07:35+00:00
s4: torture: SMB2. Add a new test that exposes interesting SD query behavior.

If we open a file without READ_CONTROL, requesting a security
descriptor fails with ACCESS_DENIED if any of the requested
bits OWNER|GROUP|DACL are set.

However, if we send zero as the requested bits then a
security descriptor is returned containing no data,
even though reading an SD should fail based on the
access permissions we have on the handle.

This has been tested against Windows 10, and also
passes on Samba - although in smbd we actually
read the SD off disk first, before nulling out
all the data we read. We shouldn't (we have
no rights to do so) and a subsequent commit
will fix this.

This was discovered when investigating the
smb2.winattr test, which currently relies
on exactly this behavior. It shouldn't
and the next commit will fix that.

I wanted to preserve the current smb2.winattr
behavior in a test though.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3dd78d2d by Jeremy Allison at 2020-04-16T19:07:35+00:00
s3: smbd: Ensure we don't try and read the on-disk security descriptor if no bits are requested.

The sdread test just added shows that a client
can open with READ_ATTRIBUTES and still issue
a query security descriptor. smbd passed that
test as it read the on-disk sd, but then threw
the information away and returned the NULL sd
the client expects.

Make sure that we don't try and read the on-disk
sd if the client doesn't request any bits.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
72a57d37 by Jeremy Allison at 2020-04-16T20:42:58+00:00
s4: torture: SMB2. Fix smb2.winattr to actually read the SD from the server and check it.

We need READ_CONTROL, and actually have to ask for
the OWNER|GROUP|DACL bits if we're going to properly
check the SD.

Tested against Windows 10.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Apr 16 20:42:58 UTC 2020 on sn-devel-184

- - - - -
ad4b53f2 by Volker Lendecke at 2020-04-17T08:32:35+00:00
ctdb: Fix a memleak

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14348
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Fri Apr 17 08:32:35 UTC 2020 on sn-devel-184

- - - - -
3aaa50b6 by Volker Lendecke at 2020-04-18T02:29:34+00:00
pidl: Align integer types in scompat files

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aa22ae6b by Volker Lendecke at 2020-04-18T02:29:34+00:00
libsmb: Slightly simplify get_ipc_connect()

No else required with an early return

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9ff5968a by Volker Lendecke at 2020-04-18T02:29:34+00:00
smbtree: Add "fail:" target, more failure paths with follow

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
595e3f25 by Volker Lendecke at 2020-04-18T02:29:34+00:00
utils: Convert smbtree to use libsmbclient

We have the domain browsing functionality in libsmbclient, don't
duplicate it in smbtree with special code. Not too much gain in lines
of code, but the new code is much more regular and reuses
functionality provided elsewhere.

This removes the "-b" option from smbtree, libsmbclient always does
that.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
092da6ec by Volker Lendecke at 2020-04-18T04:12:48+00:00
libsmb: Move clirap2.c to utils/

It's only used in net_rap.c, expansion to other users is
unlikely. Don't link it into libsmbclient anymore. It saves roughly
50k from the everywhere-linked libsmb.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat Apr 18 04:12:48 UTC 2020 on sn-devel-184

- - - - -
5651fafe by Anoop C S at 2020-04-21T17:37:43+00:00
dbwrap_watch: Set rec->value_valid while returning nested share_mode_do_locked()

As reported on samba-technical by Rouven WEILER <Rouven_Weiler at gmx.net>:
https://lists.samba.org/archive/samba-technical/2020-April/135116.html

Following backtrace was observed with vfs_fruit for time machine backup:

[2020/04/10 08:00:38.107917,  0] ../../lib/dbwrap/dbwrap.c:82(dbwrap_record_get_value)
  PANIC: assert failed at ../../lib/dbwrap/dbwrap.c(82): rec->value_valid
[2020/04/10 08:00:38.108499,  0] ../../source3/lib/util.c:830(smb_panic_s3)
  PANIC (pid 3427): assert failed: rec->value_valid
[2020/04/10 08:00:38.109541,  0] ../../lib/util/fault.c:265(log_stack_trace)
  BACKTRACE: 37 stack frames:
   #0 /usr/lib/samba/amd64/libsamba-util.so.0.0.1'log_stack_trace+0x26 [0xfffffd7fee51de66]
   #1 /usr/lib/samba/amd64/libsmbconf.so.0'smb_panic_s3+0x26 [0xfffffd7fedf5a596]
   #2 /usr/lib/samba/amd64/libsamba-util.so.0.0.1'smb_panic+0x1f [0xfffffd7fee51df3f]
   #3 /usr/lib/samba/private/amd64/libdbwrap-samba4.so'dbwrap_record_get_value+0x2a [0xfffffd7feccb627a]
   #4 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'get_share_mode_lock+0x109 [0xfffffd7fee7195c9]
   #5 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'smbd_contend_level2_oplocks_begin+0xa1 [0xfffffd7fee7f7761]
   #6 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'brl_lock+0x635 [0xfffffd7fee710f45]
   #7 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'do_lock_fn+0xa4 [0xfffffd7fee70d534]
   #8 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'share_mode_do_locked_fn+0x86 [0xfffffd7fee7174b6]
   #9 /usr/lib/samba/amd64/libsmbconf.so.0'dbwrap_watched_do_locked_fn+0xfa [0xfffffd7fedf622ca]
   #10 /usr/lib/samba/private/amd64/libdbwrap-samba4.so'db_tdb_do_locked+0x12f [0xfffffd7feccb95cf]
   #11 /usr/lib/samba/private/amd64/libdbwrap-samba4.so'dbwrap_do_locked+0x48 [0xfffffd7feccb69a8]
   #12 /usr/lib/samba/amd64/libsmbconf.so.0'dbwrap_watched_do_locked+0x6f [0xfffffd7fedf60d7f]
   #13 /usr/lib/samba/private/amd64/libdbwrap-samba4.so'dbwrap_do_locked+0x48 [0xfffffd7feccb69a8]
   #14 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'share_mode_do_locked+0xd2 [0xfffffd7fee719b82]
   #15 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'do_lock+0xf0 [0xfffffd7fee70dfe0]
   #16 /usr/lib/samba/amd64/vfs/fruit.so'fruit_create_file+0x7ba [0xfffffd7fe88855aa]
   #17 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'smbd_smb2_request_process_create+0xa07 [0xfffffd7fee7d3237]
   #18 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'smbd_smb2_request_dispatch+0xc8f [0xfffffd7fee7c985f]
   #19 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'smbd_smb2_connection_handler+0x621 [0xfffffd7fee7ca7e1]
   #20 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'tevent_common_invoke_fd_handler+0x80 [0xfffffd7fecd3a580]
   #21 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'epoll_event_loop_once+0x22c [0xfffffd7fecd4180c]
   #22 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'std_event_loop_once+0x40 [0xfffffd7fecd3f8f0]
   #23 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'_tevent_loop_once+0x95 [0xfffffd7fecd39bd5]
   #24 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'tevent_common_loop_wait+0x23 [0xfffffd7fecd39e43]
   #25 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'std_event_loop_wait+0x40 [0xfffffd7fecd3f870]
   #26 /usr/lib/samba/private/amd64/libsmbd-base-samba4.so'smbd_process+0x777 [0xfffffd7fee7b8677]
   #27 /usr/lib/samba/sbin/amd64/smbd'smbd_accept_connection+0x189 [0x40d5b9]
   #28 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'tevent_common_invoke_fd_handler+0x80 [0xfffffd7fecd3a580]
   #29 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'epoll_event_loop_once+0x22c [0xfffffd7fecd4180c]
   #30 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'std_event_loop_once+0x40 [0xfffffd7fecd3f8f0]
   #31 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'_tevent_loop_once+0x95 [0xfffffd7fecd39bd5]
   #32 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'tevent_common_loop_wait+0x23 [0xfffffd7fecd39e43]
   #33 /usr/lib/samba/private/amd64/libtevent.so.0.10.2'std_event_loop_wait+0x40 [0xfffffd7fecd3f870]
   #34 /usr/lib/samba/sbin/amd64/smbd'main+0x1a0f [0x40f9ff]
   #35 /usr/lib/samba/sbin/amd64/smbd'_start_crt+0x83 [0x408e73]
   #36 /usr/lib/samba/sbin/amd64/smbd'_start+0x18 [0x408dd8]

In this particular nested share_mode_do_locked() invocation, callback
comes through dbwrap_watched_do_locked_fn() where it fails to update
rec->value_valid which further gets assigned to static_share_mode_record
within share_mode_do_locked_fn().

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

Signed-off-by: Anoop C S <anoopcs at redhat.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Apr 21 17:37:43 UTC 2020 on sn-devel-184

- - - - -
f3f81e8f by Jeremy Allison at 2020-04-21T18:37:39+00:00
s3: torture: Add an SMB1-specific test SMB1-SYSTEM-SECURITY.

NB. This is also tested in samba3.base.createx_access
but this makes it very explicit what we're looking for.

Shows SMB1 allows explicit open of a file with only
he SEC_FLAG_SYSTEM_SECURITY access mask requested.
SMB2 doesn't.

Requires a Windows 10 system with a user with
SeSecurityPrivilege set. Passes against Windows 10
with SMB1 enabled.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3f7821c9 by Jeremy Allison at 2020-04-21T18:37:39+00:00
s3: torture: Run the SMB1-SYSTEM-SECURITY test.

Calls the test in the previous commit by adding
SeSecurityPrivilege first, running the SMB1-SYSTEM-SECURITY
test then removing SeSecurityPrivilege.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ad5f6b82 by Jeremy Allison at 2020-04-21T18:37:39+00:00
s3: torture: Add a basic SMB2 SACL test.

Shows bits needed to set/get a SACL.  We need a script within Samba to run this
as it depends on a user with SeSecurityPrivilege to work.

Test does the following:

1). Create a test file.
2). Open with SEC_FLAG_SYSTEM_SECURITY *only*. ACCESS_DENIED.
    NB. SMB2-only behavior. SMB1 allows this as tested in SMB1-SYSTEM-SECURITY.
3). Open with SEC_FLAG_SYSTEM_SECURITY|FILE_WRITE_ATTRIBUTES.
4). Write SACL. Should fail with ACCESS_DENIED (seems to need WRITE_DAC).
5). Close (3).
6). Open with SEC_FLAG_SYSTEM_SECURITY|SEC_STD_WRITE_DAC.
7). Write SACL. Success.
8). Close (4).
9). Open with SEC_FLAG_SYSTEM_SECURITY|READ_ATTRIBUTES.
10). Read SACL. Success.
11). Read DACL. Should fail with ACCESS_DENIED (no READ_CONTROL).
12). Close (9).
13 - and on error). Delete test file.

Passes against Windows 10.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b338636a by Jeremy Allison at 2020-04-21T18:37:39+00:00
s3: torture: Call the smbtorture3 SMB2-SACL test.

Calls the test in the previous commit by adding
SeSecurityPrivilege first, running the SMB2-SACL test
then removing SeSecurityPrivilege.

Demonstrates the difference between server behavior
with SEC_FLAG_SYSTEM_SECURITY against SMB1 and SMB2 servers.

Mark as knownfail for now.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
81b26559 by Jeremy Allison at 2020-04-21T18:37:39+00:00
s3: smbd: When writing a security descriptor SACL, ensure both SEC_FLAG_SYSTEM_SECURITY|SEC_STD_WRITE_DAC are set.

smbtorture3 SMB2-SACL tests this against Windows10 (and Samba).

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fff86ad4 by Ralph Boehme at 2020-04-21T18:37:39+00:00
smbd: use helper variables in open_file()

Simplify an if expression by using helper variables, no change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>

- - - - -
21b88579 by Jeremy Allison at 2020-04-21T18:37:39+00:00
smbd: Ensure SEC_FLAG_SYSTEM_SECURITY also opens the underlying fd.

smbtorture3 SMB2-SAL test shows this is needed as we store the SACL in the same
data store as the DACL.

Without this, opening a file with SEC_FLAG_SYSTEM_SECURITY | READ_ATTRIBUTES
would do a stat open, meaning when we call SMB_VFS_FGET_NT_ACL()
on the fsp we have no open fd to work on.

Pair-Programmed-With: Jeremy Allison <jra at samba.org>
Signed-off-by: Ralph Boehme <slow at samba.org>

- - - - -
d53c3f2b by Jeremy Allison at 2020-04-21T18:37:40+00:00
s3: smbd: Reformat code in SEC_FLAG_SYSTEM_SECURITY check in create_file_unixpath().

No logic change but uses modern formatting and will
make it easier to add another clause in the next commit.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1ebec705 by Jeremy Allison at 2020-04-21T20:17:10+00:00
s3: smbd: Refuse open in create_file_unixpath() with only SEC_FLAG_SYSTEM_SECURITY set.

We now pass smbtorture3 SMB2-SACL like Windows 10 does.
Note this is an SMB2-only behavior. SMB1 allows an open
with only SEC_FLAG_SYSTEM_SECURITY set as tested in
smbtorture3 SMB1-SYSTEM-SECURITY.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Apr 21 20:17:10 UTC 2020 on sn-devel-184

- - - - -
b7fb6100 by Martin Schwenke at 2020-04-22T01:48:02+00:00
util: Fix signed/unsigned integer comparison

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Wed Apr 22 01:48:03 UTC 2020 on sn-devel-184

- - - - -
9cea0cc5 by Jeremy Allison at 2020-04-22T08:15:35+00:00
s3: torture: Add the tests from resolve_realpath_name() to canonicalize_absolute_path().

canonicalize_absolute_path() has a bug.

In canonicalize_absolute_path()

///a/./././///component/../////path/ -> /a//path

It should go to /a/path. Mark as knownfail.

Adding these tests so I can ultimately remove
resolve_realpath_name() and re-use the existing
canonicalize_absolute_path() code in vfs_widelinks.c

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d01e11cf by Jeremy Allison at 2020-04-22T08:15:35+00:00
s3: lib: Fix canonicalize_absolute_path() to pass the tests from resolve_realpath_name()

Remove the knownfail.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
594c3712 by Jeremy Allison at 2020-04-22T08:15:35+00:00
s3: util: Replace the old (hard to understand) canonicalize_absolute_path() with a version created from resolve_realpath_name() in vfs_widelinks.c

This code is *much* more comprehensible and passes the
stricter test set than the original (unfixed) canonicalize_absolute_path()
out of the gate.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e4427ff8 by Jeremy Allison at 2020-04-22T08:15:35+00:00
s3: lib: Remove the old canonicalize_absolute_path().

This code was really hard to understand.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
045e8898 by Jeremy Allison at 2020-04-22T08:15:35+00:00
s3: selftest: Remove test_vfs_widelinks.

All of the tests that were in there
are now tested in samba3.smbtorture_s3.LOCAL-CANONICALIZE-PATH
along with other paths.

Clean revert of f7fe3474298 not possible due to
changes in source3/selftest/tests.py

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fa1087bc by Jeremy Allison at 2020-04-22T09:51:08+00:00
s3: VFS: widelinks. Change call to resolve_realpath_name() -> canonicalize_absolute_path().

That code was moved into source3/lib/util_path.c.

We now have *one* canonicalize_absolute_path() funtion,
tested more completely.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Apr 22 09:51:08 UTC 2020 on sn-devel-184

- - - - -
bd90ca6f by Ralph Boehme at 2020-04-22T21:08:39+00:00
smbd: let unix_convert() fail early if initial stat fails with EACCES

Doing directory scans on the path components is not going to change this, so
give up early. No change in behaviour, as we would just fail later in
get_real_filename() otherwise.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Apr 22 21:08:39 UTC 2020 on sn-devel-184

- - - - -
4ab753f0 by Andrew Bartlett at 2020-04-23T04:36:29+00:00
source4/setup: Remove files unused since the LDAP backend was removed

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
54a35604 by Andrew Bartlett at 2020-04-23T06:12:20+00:00
provision: Remove final code for the LDAP backend

The LDAP backend for the Samba AD DC, aiming to store the AD DC in
an existing LDAP server was largely removed many years aga, but the
other parts were removed in 2b0fc74a0916a6ab0d5ac007cc5e100d4682b2ea.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Apr 23 06:12:20 UTC 2020 on sn-devel-184

- - - - -
fdfc480a by Renaud Fortier at 2020-04-23T08:07:51+00:00
ctdb-scripts: Update nfs-ganesha-callout

On debian buster, this variable doesn't exist anymore. Look at this PR
as a reference:

  https://github.com/gluster/storhaug/pull/30

Signed-off-by: Renaud Fortier <renaud.fortier at fsaa.ulaval.ca>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Thu Apr 23 08:07:51 UTC 2020 on sn-devel-184

- - - - -
205acab5 by Ralph Boehme at 2020-04-23T19:50:38+00:00
smbd: remove initial stat() EACCES handling from unix_convert()

This was added by bd90ca6f00b (my bad) but it breaks filesystems with NFS4
permissions.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Apr 23 19:50:38 UTC 2020 on sn-devel-184

- - - - -
4524daaf by Volker Lendecke at 2020-04-23T21:53:38+00:00
lib: Fix a valgrind error

I just came across this failure with a new test:

==16654== Invalid read of size 4
==16654==    at 0x4950947: tevent_req_is_in_progress (tevent_req.c:270)
==16654==    by 0x5AEEE8F: writev_trigger (async_sock.c:375)
==16654==    by 0x494F9E7: tevent_queue_immediate_trigger (tevent_queue.c:149)
==16654==    by 0x494F53C: tevent_common_invoke_immediate_handler (tevent_immediate.c:166)
==16654==    by 0x494F642: tevent_common_loop_immediate (tevent_immediate.c:203)
==16654==    by 0x4959E5E: epoll_event_loop_once (tevent_epoll.c:918)
==16654==    by 0x495665A: std_event_loop_once (tevent_standard.c:110)
==16654==    by 0x494DFCE: _tevent_loop_once (tevent.c:772)
==16654==    by 0x4950A6A: tevent_req_poll (tevent_req.c:300)
==16654==    by 0x4D166C9: tevent_req_poll_ntstatus (tevent_ntstatus.c:109)
==16654==    by 0x18C98B: run_readdir_timestamp (test_readdir_timestamp.c:489)
==16654==    by 0x161BC5: run_test (torture.c:14896)
==16654==    by 0x162726: main (torture.c:15136)
==16654==  Address 0x91bb878 is 216 bytes inside a block of size 853 free'd
==16654==    at 0x48369AB: free (vg_replace_malloc.c:530)
==16654==    by 0x49B405E: _tc_free_internal (talloc.c:1221)
==16654==    by 0x49B4116: _talloc_free_internal (talloc.c:1247)
==16654==    by 0x49B547C: _talloc_free (talloc.c:1789)
==16654==    by 0x50ECE3B: smb2cli_req_writev_done (smbXcli_base.c:3468)
==16654==    by 0x4950648: _tevent_req_notify_callback (tevent_req.c:141)
==16654==    by 0x49507A9: tevent_req_finish (tevent_req.c:193)
==16654==    by 0x49507D6: _tevent_req_done (tevent_req.c:199)
==16654==    by 0x5AEEE28: writev_do (async_sock.c:363)
==16654==    by 0x5AEEE83: writev_trigger (async_sock.c:374)
==16654==    by 0x494F9E7: tevent_queue_immediate_trigger (tevent_queue.c:149)
==16654==    by 0x494F53C: tevent_common_invoke_immediate_handler (tevent_immediate.c:166)
==16654==    by 0x494F642: tevent_common_loop_immediate (tevent_immediate.c:203)
==16654==    by 0x4959E5E: epoll_event_loop_once (tevent_epoll.c:918)
==16654==    by 0x495665A: std_event_loop_once (tevent_standard.c:110)
==16654==    by 0x494DFCE: _tevent_loop_once (tevent.c:772)
==16654==    by 0x4950A6A: tevent_req_poll (tevent_req.c:300)
==16654==    by 0x4D166C9: tevent_req_poll_ntstatus (tevent_ntstatus.c:109)
==16654==    by 0x18C98B: run_readdir_timestamp (test_readdir_timestamp.c:489)
==16654==    by 0x161BC5: run_test (torture.c:14896)
==16654==    by 0x162726: main (torture.c:15136)
==16654==  Block was alloc'd at
==16654==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==16654==    by 0x49B300F: __talloc_with_prefix (talloc.c:782)
==16654==    by 0x49B31E6: _talloc_pool (talloc.c:837)
==16654==    by 0x49B3394: _talloc_pooled_object (talloc.c:905)
==16654==    by 0x49501A6: _tevent_req_create (tevent_req.c:79)
==16654==    by 0x5AEE956: writev_send (async_sock.c:266)
==16654==    by 0x50ECBCA: smb2cli_req_compound_submit (smbXcli_base.c:3396)
==16654==    by 0x50ECD49: smb2cli_req_send (smbXcli_base.c:3447)
==16654==    by 0x50FE34F: smb2cli_create_send (smb2cli_create.c:153)
==16654==    by 0x490325E: cli_smb2_create_fnum_send (cli_smb2_fnum.c:273)
==16654==    by 0x48D0146: cli_ntcreate_send (clifile.c:2504)
==16654==    by 0x18B737: create_ts_send (test_readdir_timestamp.c:59)
==16654==    by 0x18BF77: create_ts_files_send (test_readdir_timestamp.c:253)
==16654==    by 0x18C35C: create_files_send (test_readdir_timestamp.c:336)
==16654==    by 0x18C953: run_readdir_timestamp (test_readdir_timestamp.c:482)
==16654==    by 0x161BC5: run_test (torture.c:14896)
==16654==    by 0x162726: main (torture.c:15136)

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Apr 23 21:53:38 UTC 2020 on sn-devel-184

- - - - -
025e4572 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: change variable name start to name in unix_convert()

start always points at the current single component name in the path traversal
loop.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
67e1e818 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: rename ctx variable to mem_ctx in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
10eadd60 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: in unix_convert() replace all local variable with a state struct

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ec2adb43 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: use a different error out in one place in unix_convert()

The error label is only used for OOM conditions no smb_fname of dirpath.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b9d61a23 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: factor out path loop in unix_convert()

Just a copy&paste of everything in the for loop without any changes other then
removing one indentation level. Even keeping the gotos, removing them comes in
the next commit.

No change in behaviuour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
beb8ff55 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: remove goto from unix_convert_step()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a2f45282 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: factor out unix_convert_step_stat() from unix_convert_step()

The diff looks more complicated that it is: everything in the new
unix_convert_step_stat() is moved *as is* from unix_convert_step() without
further changes.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a5b0271e by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: use an early exit if stat succeeds in unix_convert_step_stat()

Allows decreasing the indentation level of the bulk of the code that handles
stat failure. Best viewed with `git show -w`.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e8fc1965 by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: factor out unix_convert_step_search_fail()

Again, just moving code from unix_convert_step_stat() without any logic changes.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
90713cbd by Ralph Boehme at 2020-04-24T21:46:27+00:00
smbd: add some logging to unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e7dfe87a by Jeremy Allison at 2020-04-24T23:21:16+00:00
smbd: unix_convert_step(). Fix use of state->end as a boolean, always compare with NULL.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Apr 24 23:21:16 UTC 2020 on sn-devel-184

- - - - -
1f97aeac by David Disseldorp at 2020-04-27T12:19:58+00:00
traffic_packets: fix SyntaxWarning: "is" with a literal

Python 3.8 adds this warning via https://bugs.python.org/issue34850:
  the "is" and "is not" operator sometimes is used with string and
  numerical literals. This code "works" on CPython by accident, because
  of caching on different levels (small integers and strings caches,
  interned strings, deduplicating constants at compile time). But it
  shouldn't work on other implementations, and can not work even on
  early or future CPython versions.

Reported-by: L. van Belle <belle at samba.org>
Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Noel Power <noel.power at suse.com>

Autobuild-User(master): David Disseldorp <ddiss at samba.org>
Autobuild-Date(master): Mon Apr 27 12:19:59 UTC 2020 on sn-devel-184

- - - - -
861dd8c4 by Volker Lendecke at 2020-04-28T09:08:39+00:00
ctdb: Fix duplicate ;;

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
4f3db63d by Volker Lendecke at 2020-04-28T09:08:39+00:00
ctdb-protocol: Add new control CTDB_CONTROL_ECHO_DATA

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
6f56f456 by Volker Lendecke at 2020-04-28T09:08:39+00:00
ctdb-protocol: Add marshalling for struct ctdb_echo_data

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
bdabf781 by Volker Lendecke at 2020-04-28T09:08:39+00:00
ctdb-protocol: Add marshalling for control ECHO_DATA

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
d9ccd853 by Volker Lendecke at 2020-04-28T09:08:39+00:00
ctdb: Implement CTDB_CONTROL_ECHO_DATA

Testing control: 4 bytes msec delay plus a blob, return the request after the
delay. This is an enhanced "ping" which can be used to test asynchronous
clients.

Doesn't have the full protocol implementation yet

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

- - - - -
9b63cbd7 by Volker Lendecke at 2020-04-28T09:08:39+00:00
libsmb: Factor out prep_basic_information_buf()

Will be used in cli_setfileinfo_ext next

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b57bb1fe by Volker Lendecke at 2020-04-28T09:08:39+00:00
libsmb: Add cli_setfileinfo_ext()

Analogue to cli_setpathinfo_ext()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
684d3d06 by Volker Lendecke at 2020-04-28T09:08:39+00:00
torture3: test readdir timestamp

Create -o files per -N client connections, set a specific timestamp, then write
a bit. This leads to the locking.tdb dmasters to be spread across all nodes.
Then list from one node. This makes sure that the async share mode fetch works
right.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6829e736 by Volker Lendecke at 2020-04-28T09:08:39+00:00
torture3: Fix the local-dbwrap-ctdb test

We need to O_CREAT the database when connecting

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
262a7aa7 by Volker Lendecke at 2020-04-28T09:08:39+00:00
torture3: Rename LOCAL-DBWRAP-CTDB->LOCAL-DBWRAP-CTDB1

There will be more

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
af75d0af by Volker Lendecke at 2020-04-28T09:08:39+00:00
selftest: Run local-dbwrap-ctdb1 test

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c70b8f06 by Volker Lendecke at 2020-04-28T09:08:39+00:00
lib: Add ctdbd_init_async_connection()

Prepare for ctdb_req_send/recv doing tevent_req based async ctdb
requests

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
177de8ec by Volker Lendecke at 2020-04-28T09:08:40+00:00
lib: Add ctdbd_prep_hdr_next_reqid()

Preparation for generic ctdb_req_send/recv: No need to expose
ctdbd_next_reqid(), do basic preparations of a ctdb_req_header

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e1418589 by Volker Lendecke at 2020-04-28T09:08:40+00:00
lib: Add ctdbd_req_send/recv

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7a7d56c5 by Volker Lendecke at 2020-04-28T09:08:40+00:00
torture3: Test ctdb_req_send/recv

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
296114cf by Volker Lendecke at 2020-04-28T09:08:40+00:00
lib: Use ctdbd_req_send/recv in ctdb_parse_send/recv

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ca063446 by Volker Lendecke at 2020-04-28T09:08:40+00:00
lib: Remove unused ctdbd_setup_fde() and callees

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c949d15a by Volker Lendecke at 2020-04-28T09:08:40+00:00
lib: Nobody sets ctdbd_connection->fde anymore, remove it

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6233929f by Volker Lendecke at 2020-04-28T10:46:22+00:00
lib: Remove unused elements from ctdbd_connection

Nobody set them, only the destructor referenced them

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Apr 28 10:46:22 UTC 2020 on sn-devel-184

- - - - -
2f55b662 by Ralph Boehme at 2020-04-28T18:09:39+00:00
smbd: add missing done check from unix_convert_step_stat() refactoring

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a3ddd679 by David Mulder at 2020-04-28T18:09:39+00:00
Add SMB2 lsa helper routines

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 3763052c2a95ac9bd60f00458389a5245cf5d58d)

- - - - -
67e589c1 by David Mulder at 2020-04-28T18:09:39+00:00
Convert samba4.base.maximum_allowed to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit d9edfeea668362269d812f82b1957ed16ff56dd4)

- - - - -
18db8bd9 by David Mulder at 2020-04-28T18:09:39+00:00
Implement alt name query for smb2

Implements smb2_qpathinfo_alt_name() and
RAW_FILEINFO_SMB2_ALT_NAME_INFORMATION.

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 097df343ce21c8340aee7f42f233fe74b92b47e2)

- - - - -
c690428e by David Mulder at 2020-04-28T18:09:39+00:00
Convert samba4.base.mangle test to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 9437b44668c9f7742d6d4fe0891ac4d9fda7c804)

- - - - -
34311553 by David Mulder at 2020-04-28T18:09:39+00:00
s4:torture: Convert samba4.base.tcon test to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit eb167bc43dbe196ef5b3bfd24160c72c74113dea)

- - - - -
dedb4f24 by David Mulder at 2020-04-28T19:46:32+00:00
s4:torture: Convert samba3.raw.mkdir test to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 888abcaf8ffbec45fc47520bd3f544e3aa6f58f2)

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Apr 28 19:46:32 UTC 2020 on sn-devel-184

- - - - -
c7a4578d by Alexander Bokovoy at 2020-04-28T22:55:29+00:00
s3: pass DCE RPC handle type to create_policy_hnd

Various RPC services expect policy handles of a specific type.

s3 RPC server did not allow to create policy handles with a specific
type while actually requiring that policy handle type itself in some
places.

Make sure we are able to specify the policy on-wire handle type when
creating the policy handle. The changes follow s4 DCE RPC server
implementation.

The original logic to always set on-wire handle type to 0 can be tracked
down to commit fdeea341ed1bae670382e45eb731db1b5838ad21 when we didn't
really know about differences in on-wire handle types.

All but LSA trusted domain RPC calls do not check the on-wire handle
type in s3 RPC server.

Fixes trusted domain operations when Samba RPC client attempts to call
s3 RPC server to perform lsa_lsaRSetForestTrustInformation in FreeIPA.
This fix is a pre-requisite for FreeIPA-FreeIPA forest trust.

Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Apr 28 22:55:29 UTC 2020 on sn-devel-184

- - - - -
ae5cb734 by Andrew Bartlett at 2020-04-29T06:29:31+00:00
librpc: Provide clearer debug messages for malformed DCE/RPC bind

REF: https://lists.samba.org/archive/samba/2020-April/229334.html

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
dc280f88 by Björn Baumbach at 2020-04-29T08:08:21+00:00
samba-tool: fetch "no such subcommand" error and print error message

This patch especially improves the case where extra arguments are used.

Without this patch just the attributes are mentioned as invalid, if
samba-tool is called with an invalid/unknown subcommand.

Example without this patch:
  # samba-tool sites list --all
  Usage: samba-tool sites <subcommand>

  samba-tool sites: error: no such option: --all

This can be deceptive for users. Is looks like the "list" command
does not provide a "--all" option.

Example with this patch:
  # samba-tool sites list --all
  samba-tool sites: no such subcommand: list

  Usage: samba-tool sites <subcommand>
  (...)

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Apr 29 08:08:21 UTC 2020 on sn-devel-184

- - - - -
3abd92d7 by Andreas Schneider at 2020-04-29T09:44:55+00:00
docs-xml: Fix usernames in pam_winbind manpages

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Apr 29 09:44:55 UTC 2020 on sn-devel-184

- - - - -
9596eefb by Andreas Schneider at 2020-04-29T10:15:28+00:00
s4:torture: Print account and authority name

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
- - - - -
a454c9cd by Andreas Schneider at 2020-04-29T11:53:41+00:00
testprogs: Add client kerberos test

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Apr 29 11:53:41 UTC 2020 on sn-devel-184

- - - - -
5fe180e7 by Ralph Boehme at 2020-04-29T16:39:39+00:00
s3/lib: add parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
eafd4160 by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_acl_common: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7f68944a by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_aio_pthread: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8bd6908b by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_ceph: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
036ed35b by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_default: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
25985703 by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_gpfs: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aa125a7d by Ralph Boehme at 2020-04-29T16:39:39+00:00
vfs_linux_xfs_sgid: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4d1ba69a by Ralph Boehme at 2020-04-29T16:39:39+00:00
smbd: use parent_smb_fname() in can_delete_file_in_directory()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3cc0dcad by Ralph Boehme at 2020-04-29T16:39:39+00:00
smbd: use synthetic_smb_fname() in check_parent_exists()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c0a9c869 by Ralph Boehme at 2020-04-29T16:39:39+00:00
smbd: use parent_smb_fname() in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
58a99593 by Ralph Boehme at 2020-04-29T16:39:39+00:00
smbd: use parent_smb_fname() in copy_internals()

Prepares for converting file_set_dosmode() to struct smb_filename.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
61bf5410 by Ralph Boehme at 2020-04-29T16:39:39+00:00
smbd: use parent_smb_fname() in check_parent_access()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4c497c77 by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in non_widelink_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
16f866a1 by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in open_file_ntcreate()

Prepares for converting a bunch of functions to struct smb_filename later..

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
90a198bc by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in mkdir_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3830ba0d by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in inherit_new_acl()

Note: has to rename the variable parent_smb_fname otherwise it conflicts with
the function name.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
75b85a4d by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in parent_dirname_compatible_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
adf75b8c by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in smb_unix_mknod()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8fdfbc8d by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in check_reduced_name_with_privilege()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aa0ec8a2 by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: use parent_smb_fname() in check_reduced_name()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d9ae1c78 by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: pass struct smb_filename to directory_has_default_acl()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
224b1405 by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: align file_set_dosmode() args one per line

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
214dea7d by Ralph Boehme at 2020-04-29T16:39:40+00:00
smbd: pass struct smb_filename parent_dir to file_set_dosmode()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
45a560bc by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: pass struct smb_filename smb_fname_parent to unix_mode()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9f64f301 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: add previous version timestamp to struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
37a97368 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: copy twrp in cp_smb_filename()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
84743b72 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: realign is_visible_file() args one per line

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4cc86556 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: pass dirname as struct smb_filename to is_visible_file()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0ff2dda3 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: convert parent_dir arg of open_file() to struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bf504ac3 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: convert inherit_access_posix_acl() arg parent_dir to struct smb_filename

This also fixes a bug introduced by cea8e57eac2ed7b90a5c5d207bf392ff0546398e
where inherit_access_posix_acl() used the smb_fname->base_name instead of
inherit_from_dir in synthetic_smb_fname() to get an struct smb_filename of the
parent directory.

Nobody complained so far, fix it silently.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3eb42c24 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: convert inherit_from_dir arg of change_file_owner_to_parent() to struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
328716b9 by Ralph Boehme at 2020-04-29T16:39:41+00:00
smbd: convert inherit_from_dir arg of change_dir_owner_to_parent() to struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
954d877a by Ralph Boehme at 2020-04-29T18:16:02+00:00
smbd: remove unneeded parent_dir variable from mkdir_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Apr 29 18:16:02 UTC 2020 on sn-devel-184

- - - - -
3be17c89 by Alexander Bokovoy at 2020-04-30T07:09:55+00:00
s3 rpc server: set on-wire handle type explicitly

Since wire_handle.handle_type is uint32_t, we can simply assign uint8_t
handle type to it without using SIVAL() macros. Further unify with s4
RPC server code flow.

Fixes CID 1462616
>>> CID 1462616:    (CONSTANT_EXPRESSION_RESULT)
>>> "(uint32_t)handle_type >> 16" is 0 regardless of the values of its operands. This occurs as a value.
284             SIVAL(&rpc_hnd->wire_handle.handle_type, 0 , handle_type);

Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Alexander Bokovoy <ab at samba.org>
Autobuild-Date(master): Thu Apr 30 07:09:55 UTC 2020 on sn-devel-184

- - - - -
7288e9a4 by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: smbd: In posix_fget_nt_acl() remove the fall-back to path based operations.

Previously we'd do this for directory opens, but directory opens
now always have an open fd. stat opens don't have permissions
to read a security descriptor anyway.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
031d6657 by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: VFS: shadow_copy2. SMB_VFS_FGET_NT_ACL() makes no sense in this module.

Once we have an open fsp we know we've gone through the pathname
translation.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2ef629fe by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: VFS: ceph_snapshots. Remove ceph_snap_gmt_fget_nt_acl().

This fallback was only used for directories. Now we always
have a valid fd for directories it is no longer needed.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
26e48cb1 by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: VFS: ceph_snapshots. Remove duplicate definition of get_nt_acl_fn.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3373500f by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: VFS: snapper. Remove snapper_gmt_fget_nt_acl().

This fallback was only used for directories. Now we always
have a valid fd for directories it is no longer needed.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
668ef247 by Jeremy Allison at 2020-04-30T07:33:40+00:00
s3: smbd: Reformat calls to is_visible_file() to one arg per line.

Will make it easier to see parameter change in a later commit.

No logic changes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2243ba78 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Change is_visible_file() to take a directory handle not a name.

No change in functionality as the name is
easily retrieved from the directory handle
(it's always the name we opened the directory with)
and this will allow us to use the directory handle
fsp later.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
98c8785c by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Reformat uses of directory_has_default_acl().

Makes it easier to add a dirfsp parameter.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
152fb23f by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Add a dirfsp parameter to directory_has_default_acl().

Not yet used, but will make it easier to move to SMB_VFS_GET_NT_ACL_AT()
later.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d7f4bb57 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Cleanup - move the function get_nt_acl_no_snum() to it's user module.

Make static. It was only called from one place.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
dc0ea4a1 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Move the fsp check up one level from check_access().

This allows us to call check_access_fsp() directly when
we have an fsp, and to add in the dirfsp for relative
name access to check_access() in the next commit, making
it clear what it's for (and not confusing it with the
file fsp).

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3fa18f98 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Reformat spacing for parameters of check_access().

Makes it easier to see the removal of the parameter next.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3a7fb967 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Make check_access() a simple wrapper around smbd_check_access_rights().

Now we call check_access_fsp() separately in the callers we don't need the fsp
parameter anymore.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
cc5b49b8 by Jeremy Allison at 2020-04-30T07:33:41+00:00
s3: smbd: Reformat callers of check_access().

Makes it easier to see when we add the dirfsp
parameter.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d3be759a by Jeremy Allison at 2020-04-30T09:11:55+00:00
s3: smbd: Add dirfsp parameter to check_access().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu Apr 30 09:11:56 UTC 2020 on sn-devel-184

- - - - -
4371c62f by Ralph Boehme at 2020-04-30T19:32:44+00:00
s4/torture: add a comprehensive "non-oplock-break-trigger" access mask test case

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aa3b3e18 by Ralph Boehme at 2020-04-30T19:32:45+00:00
s4/torture: add a comprehensive "non-lease-break-trigger" access mask test case

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
00001286 by Ralph Boehme at 2020-04-30T19:32:45+00:00
smbd: rename is_stat_open() to is_oplock_stat_open()

Testing stat opens with with leases reveals that that the access mask

  SYNCHRONIZE_ACCESS | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES

is specific to oplocks.

See also:

https://lists.samba.org/archive/cifs-protocol/2020-March/003409.html

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9b0a31af by Ralph Boehme at 2020-04-30T19:32:45+00:00
smbd: add is_lease_stat_open()

This adds a leases specific stat opens access mask check function.

See also:

https://lists.samba.org/archive/cifs-protocol/2020-March/003409.html

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
62621bd6 by Ralph Boehme at 2020-04-30T21:10:43+00:00
smbd: use is_lease_stat_open() in delay_for_oplock()

This allows READ_CONTROL_ACCESS in the access mask as stat open if a file has
only leases.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Apr 30 21:10:43 UTC 2020 on sn-devel-184

- - - - -
f467727d by Gary Lockyer at 2020-05-04T02:59:31+00:00
CVE-2020-10704: lib util asn1: Add ASN.1 max tree depth

Add maximum parse tree depth to the call to asn1_init, which will be
used to limit the depth of the ASN.1 parse tree.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b0832d20 by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: libcli ldap: test recursion depth in ldap_decode_filter_tree

Add tests to check that ASN.1 ldap requests with deeply nested elements
are rejected.  Previously there was no check on the on the depth of
nesting and excessive nesting could cause a stack overflow.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
767558d4 by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: lib util asn1: Check parse tree depth

Check the current depth of the parse tree and reject the input if the
depth exceeds that passed to asn1_init

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
5d6bcef4 by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: ldapserver tests: Limit search request sizes

Add tests to ensure that overly long (> 256000 bytes) LDAP search
requests are rejected.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d7e52138 by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: smb.conf: Add max ldap request sizes

Add two new smb.conf parameters to control the maximum permitted ldap
request size.

Adds:
   ldap max anonymous request size       default 250Kb
   ldap max authenticated request size   default 16Mb

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
28ee4acc by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: S4 ldap server: Limit request sizes

Check the size of authenticated and anonymous ldap requests and reject
them if they exceed the limits in smb.conf

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3149ea0a by Gary Lockyer at 2020-05-04T02:59:32+00:00
CVE-2020-10704: libcli ldap_message: Add search size limits to ldap_decode

Add search request size limits to ldap_decode calls.

The ldap server uses the smb.conf variable
"ldap max search request size" which defaults to 250Kb.
For cldap the limit is hard coded as 4096.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
bac80934 by Gary Lockyer at 2020-05-04T04:40:10+00:00
CVE-2020-10704 libcli ldap: Check search request lengths.

Check the search request lengths against the limits passed to
ldap_decode.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Gary Lockyer <gary at samba.org>
Autobuild-Date(master): Mon May  4 04:40:10 UTC 2020 on sn-devel-184

- - - - -
5603d267 by Andrew Bartlett at 2020-05-04T08:19:41+00:00
CVE-2020-10700: dsdb: Add test for ASQ and ASQ in combination with paged_results

Thanks to Andrei Popa <andrei.popa at next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
c309e6b2 by Andrew Bartlett at 2020-05-04T08:19:41+00:00
CVE-2020-10700: ldb: Always use ldb_next_request() in ASQ module

We want to keep going down the module stack, and not start from the top again.

ASQ is above the ACL modules, but below paged_results and we do not wish to
re-trigger that work.

Thanks to Andrei Popa <andrei.popa at next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
906aa7dd by Andrew Bartlett at 2020-05-04T10:14:28+00:00
CVE-2020-10700: dsdb: Do not permit the ASQ control for the GUID search in paged_results

ASQ is a very strange control and a BASE search can return multiple results
that are NOT the requested DN, but the DNs pointed to by it!

Thanks to Andrei Popa <andrei.popa at next-gen.ro> for finding,
reporting and working with us to diagnose this issue!

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(master): Mon May  4 10:14:28 UTC 2020 on sn-devel-184

- - - - -
1a53b81a by Jeremy Allison at 2020-05-04T13:55:32+00:00
s3: smbd: Reformat definition and callers of can_delete_file_in_directory().

Makes future addition of parameter easier to see.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
839a2fb7 by Jeremy Allison at 2020-05-04T13:55:32+00:00
s3: smbd: Add dirfsp parameter to can_delete_file_in_directory().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6d83b785 by Jeremy Allison at 2020-05-04T13:55:32+00:00
s3: smbd: Reformat caller of user_can_write_file().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
18f67e35 by Jeremy Allison at 2020-05-04T13:55:32+00:00
s3: smbd: Add dirfsp parameter to user_can_write_file().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
21d16fe2 by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Reformat users of can_write_to_file().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7c1f1e52 by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Add dirfsp parameter to can_write_to_file().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b4acf740 by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Reformat users of smbd_check_access_rights().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
49ec754f by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Add a dirfsp parameter to smbd_check_access_rights().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f24e1abe by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Reformat users of user_can_read_file().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c9c8c83c by Jeremy Allison at 2020-05-04T13:55:33+00:00
s3: smbd: Add a dirfsp parameter to user_can_read_file().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3e6e9e42 by Jeremy Allison at 2020-05-04T13:55:34+00:00
s3: smbd: Reformat users of check_parent_access().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
66a4e6b5 by Jeremy Allison at 2020-05-04T13:55:34+00:00
s3: smbd: Add a dirfsp parameter to check_parent_access().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c7144b7a by Jeremy Allison at 2020-05-04T13:55:34+00:00
s3: smbd: Reformat users of smbd_calculate_access_mask().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a20d0667 by Jeremy Allison at 2020-05-04T13:55:34+00:00
s3: smbd: Add a dirfsp parameter to smbd_calculate_access_mask().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
976a6030 by Jeremy Allison at 2020-05-04T13:55:34+00:00
s3: smbd: Reformat users of smbd_calculate_maximum_allowed_access().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
29cbfd0b by Jeremy Allison at 2020-05-04T15:33:08+00:00
s3: smbd: Add a dirfsp parameter to smbd_calculate_maximum_allowed_access().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Mon May  4 15:33:09 UTC 2020 on sn-devel-184

- - - - -
4d424974 by Jule Anger at 2020-05-05T09:40:26+00:00
pytdb: add python binding for storev()

Signed-off-by: Jule Anger <ja at sernet.de>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
0847f56f by Jule Anger at 2020-05-05T11:24:52+00:00
pytdb tests: add test for storev()

Signed-off-by: Jule Anger <ja at sernet.de>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue May  5 11:24:52 UTC 2020 on sn-devel-184

- - - - -
e3e902f5 by Volker Lendecke at 2020-05-05T11:48:38+00:00
vfs_widelinks: Fix small typos

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
652242f5 by Volker Lendecke at 2020-05-05T11:48:38+00:00
vfs_virusfilter: Fix canonicalizing socket path

canonicalize_absolute_path() returns its result, the previous code was
a no-op

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
489023e4 by Volker Lendecke at 2020-05-05T11:48:38+00:00
locking: Move SMB_OFF_T_BITS macro to its only user

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e96f6b0f by Volker Lendecke at 2020-05-05T11:48:38+00:00
locking: Move br_off typedef to where it's used

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b3dec1bc by Volker Lendecke at 2020-05-05T11:48:38+00:00
registry3: Align a few integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d0deaf90 by Volker Lendecke at 2020-05-05T11:48:38+00:00
torture4: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
78737c68 by Volker Lendecke at 2020-05-05T11:48:38+00:00
lib: Remove two unused macro definitions

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0ad92739 by Volker Lendecke at 2020-05-05T11:48:38+00:00
lib: Fix a comment

The "deleted bit" went away with 341223a00596e

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
abae5889 by Volker Lendecke at 2020-05-05T11:48:38+00:00
rpc_server3: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
50a1e995 by Volker Lendecke at 2020-05-05T11:48:39+00:00
net: "net g_lock locks" needs to print binary keys

In 2017 g_lock changed to take TDB_DATA as a key

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
909c82fe by Volker Lendecke at 2020-05-05T11:48:39+00:00
net: Add g_lock dumpall

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1814c14f by Volker Lendecke at 2020-05-05T11:48:39+00:00
librpc: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1226f435 by Volker Lendecke at 2020-05-05T11:48:39+00:00
lib: Move push_skip_string() to clirap2.c

It's only used there

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2d6448a3 by Volker Lendecke at 2020-05-05T11:48:39+00:00
libsmb: Add a NULL check after talloc_strdup()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
3d2abb67 by Volker Lendecke at 2020-05-05T11:48:39+00:00
libsmb: Use talloc_strndup() to cut a backslash

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
157554f3 by Volker Lendecke at 2020-05-05T11:48:39+00:00
libsmb: Align integer types in net_share_enum_rpc()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2e3be139 by Volker Lendecke at 2020-05-05T11:48:39+00:00
libsmb: Add a NULL check

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7cd687fd by Volker Lendecke at 2020-05-05T11:48:39+00:00
smbd: Simplify share_mode_entry_get()

If we don't use a DATA_BLOB, we can more correctly state in the
prototype that the buffer we parse is constant.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7c3cce98 by Volker Lendecke at 2020-05-05T11:48:39+00:00
smbd: Simplify reset_share_mode_entry()

This has more lines, but it's a lot simpler: reset_share_mode_entry is
only called during durable reconnect, which only works with a single
share mode entry. See durable_reconnect_fn(). Thus we don't have to
keep the share mode array sorted, there is just a single entry.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6d339990 by Volker Lendecke at 2020-05-05T11:48:39+00:00
smbd: Make sure share_mode_entry_do() maintains sorting order

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7905afcd by Volker Lendecke at 2020-05-05T11:48:39+00:00
smbd: Make share_mode_entry_find() take a const pointer

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
955b3c3d by Volker Lendecke at 2020-05-05T11:48:40+00:00
smbd: Convert get_share_mode_blob_header() to use a const ptr

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b2dfd4cc by Volker Lendecke at 2020-05-05T11:48:40+00:00
smbd: Make share_mode_memcache_fetch() use a const ptr

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
14cc4a65 by Volker Lendecke at 2020-05-05T11:48:40+00:00
smbd: Make parse_share_modes() use a const ptr

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
733ae9cd by Volker Lendecke at 2020-05-05T11:48:40+00:00
smbd: Make share_mode_do_locked() use a const uint8_t *

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1be128ee by Volker Lendecke at 2020-05-05T13:23:49+00:00
smbd: Make share_mode_for_one_entry() use just a uint8*

"num_share_modes" is passed separately, so "data.dsize" was not used

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue May  5 13:23:49 UTC 2020 on sn-devel-184

- - - - -
ae91d67a by Volker Lendecke at 2020-05-05T15:35:35+00:00
libsmb: Fix indentation in cli_RNetShareEnum()

Also remove a level of indentation with a "goto done;"

Best review with "git show -b", almost no code change

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4a9fe4ef by Volker Lendecke at 2020-05-05T15:35:35+00:00
libsmb: Protect cli_RNetShareEnum() against rprcnt<6

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ce8b70df by Volker Lendecke at 2020-05-05T15:35:35+00:00
libsmb: Protect cli_RNetServerEnum against rprcnt<6

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f80c97cb by Volker Lendecke at 2020-05-05T17:12:04+00:00
libsmb: Protect cli_oem_change_password() from rprcnt<2

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue May  5 17:12:04 UTC 2020 on sn-devel-184

- - - - -
2d02da5d by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_gpfs: pass smb_fname to gpfsacl_emu_chmod()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5732a260 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_streams_depot: pass dirname to walk_streams()/collect_one_stream() as struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c893b9cd by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_streams_depot: realign synthetic_smb_fname() to one arg per line

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fdbb90a8 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_vxfs: realign vxfs_compare() args to one per line

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
abc16faf by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_vxfs: pass name as struct smb_filename to vxfs_compare()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7c10d078 by Ralph Boehme at 2020-05-05T19:18:38+00:00
smbd: realign args calling synthetic_smb_fname() in change_dir_owner_to_parent()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3f15b66f by Ralph Boehme at 2020-05-05T19:18:38+00:00
smbd: realign synthetic_smb_fname() args in check_reduced_name_with_privilege()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0692c3e9 by Ralph Boehme at 2020-05-05T19:18:38+00:00
s3/lib: realign synthetic_smb_fname() args in synthetic_smb_fname_split()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b6452b4a by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_catia: realign synthetic_smb_fname() args in catia_readdir_attr()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
edf2cde0 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_fill_label()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3892c5b0 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_gmt_convert_dir()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f0a4d8c7 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_default: realign synthetic_smb_fname() args in vfswrap_fs_capabilities()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2f10c390 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_default: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f1ed7687 by Ralph Boehme at 2020-05-05T19:18:38+00:00
vfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f2b9f246 by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2a658c54 by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_fruit: realign synthetic_smb_fname() args in delete_invalid_meta_stream()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f7bf27cb by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_fruit: realign synthetic_smb_fname() args in fruit_get_bandsize()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b0988120 by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_glusterfs: realign synthetic_smb_fname() args in vfs_gluster_realpath()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
64f4981b by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_gpfs: realign synthetic_smb_fname() args in gpfsacl_emu_chmod()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e78acc76 by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_virusfilter: realign synthetic_smb_fname() args in quarantine_create_dir()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bdaa6cae by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_virusfilter: realign synthetic_smb_fname() args in infected_file_action_quarantine()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4381def0 by Ralph Boehme at 2020-05-05T19:18:39+00:00
vfs_xattr_tdb: realign synthetic_smb_fname() args in xattr_tdb_get_file_id()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7cca2c15 by Ralph Boehme at 2020-05-05T19:18:39+00:00
s3/printing: realign synthetic_smb_fname() args in driver_unlink_internals()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
917b8a47 by Ralph Boehme at 2020-05-05T19:18:39+00:00
s3/printing: realign synthetic_smb_fname() args in print_spool_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b9af0ecb by Ralph Boehme at 2020-05-05T19:18:39+00:00
s3/rpc_server: fss: realign synthetic_smb_fname() args in snap_path_exists()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b102ab4f by Ralph Boehme at 2020-05-05T19:18:39+00:00
smbd: realign synthetic_smb_fname() args in file_new()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
15f438dd by Ralph Boehme at 2020-05-05T19:18:39+00:00
smbd: realign synthetic_smb_fname() args in msg_file_was_renamed()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
730f6d59 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: realign synthetic_smb_fname() args in open_np_file()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ed271943 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: realign synthetic_smb_fname() args in smbd_dirptr_lanman2_entry()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8bf629a0 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: realign synthetic_smb_fname() args in vfs_GetWd()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ab3152bf by Ralph Boehme at 2020-05-05T19:18:40+00:00
net: vfs: realign synthetic_smb_fname() args in net_vfs_get_ntacl()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b74653f2 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: add twrp arg to synthetic_smb_fname()

Most places take twrp from a local struct smb_filename variable that the
function is working on. Some don't for various reasons:

o synthetic_smb_fname_split() is only called in very few places where we don't
  expect twrp paths

o implementations of SMB_VFS_GETWD(), SMB_VFS_FS_CAPABILITIES() and
  SMB_VFS_REALPATH() return the systems view of cwd and realpath without twrp info

o VFS modules implementing previous-versions support (vfs_ceph_snapshots,
  vfs_shadow_copy2, vfs_snapper) synthesize raw paths that are passed to VFS NEXT
  functions and therefor do not use twrp

o vfs_fruit: macOS doesn't support VSS

o vfs_recycle: in recycle_create_dir() we need a raw OS path to create a directory

o vfs_virusfilter: a few places where we need raw OS paths

o vfs_xattr_tdb: needs a raw OS path for SMB_VFS_NEXT_STAT()

o printing and rpc server: don't support VSS

o vfs_default_durable_reconnect: no Durable Handles on VSS handles, this might
  be enhances in the future. No idea if Windows supports this.

o get_real_filename_full_scan: hm.... FIXME??

o get_original_lcomp: working on a raw path

o msdfs: doesn't support VSS

o vfs_get_ntquota: synthesizes an smb_filename from ".", so doesn't support VSS
  even though VFS modules implement it

o fd_open: conn_rootdir_fname is a raw path

o msg_file_was_renamed: obvious

o open_np_file: pipes don't support VSS

o Python bindings: get's a raw path from the caller

o set_conn_connectpath: raw path

o set_conn_connectpath: raw path

o torture: gets raw paths from the caller

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
69458cc2 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: refactor canonicalize_snapshot_path()

This prepares for adding additional code after calling rearrange_snapshot_path().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f8bb2f59 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: move time_t twrp to @GMT string token conversion to canonicalize_snapshot_path()

Prepares for canonicalize_snapshot_path() being the one-stop shop for
previous-versions related stuff in subsequent commits.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8a8fe887 by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: let canonicalize_snapshot_path() fill in struct smb_filename.twrp

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1e5164af by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: pass twrp as NTTIME to filename_convert() and all the way down to canonicalize_snapshot_path()

Also pass by value rather then by reference.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
09b841aa by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: realign args of get_real_filename() and friends

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
82daff3e by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: pass struct smb_filename to get_real_filename()

Prepares for passing struct smb_filename to SMB_VFS_GET_REAL_FILENAME().

This also makes it necessary to move the NULL or empty path checks to
unix_convert_step_stat().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9b78da9e by Ralph Boehme at 2020-05-05T19:18:40+00:00
smbd: realign smb_vfs_call_get_real_filename() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
af1af901 by Ralph Boehme at 2020-05-05T19:18:41+00:00
vfs_glusterfs: realign vfs_gluster_get_real_filename() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0c61b265 by Ralph Boehme at 2020-05-05T19:18:41+00:00
s3/vfs: change VFS interface comment to be a single multi-line comment

Looks much better imho. :)

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f9c67060 by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: convert SMB_VFS_GET_REAL_FILENAME() arg path to be a struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
96921b6f by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: make canonicalize_snapshot_path() public

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7fca428c by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: call canonicalize_snapshot_path() on link target paths from client

Prepares for having canonicalize_snapshot_path() strip any @GMT token from link
targets. In the future VFS modules won't be doing @GMT token stripping, so we
have to do it here.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
26ca22fa by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: vfs: convert link_contents arg of SMB_VFS_SYMLINKAT() to struct smb_filename

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b6b0c3d1 by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: print twrp in smb_fname_str_dbg()

This looses precision by going from NTTIME to time_t, but GMT_FORMAT only has
seconds granularity anyway and @GMT token as defined by MS-SMB2 as well.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f109be3c by Ralph Boehme at 2020-05-05T19:18:41+00:00
vfs_default: use cp_smb_filename_nostream() in vfswrap_streaminfo()

Ensure twrp field and whatever else may be added in the future is correctly
copied over to smb_fname_cp.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
64a3a318 by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: fullpath based on fsp->fsp_name may contain an @GMT token

This ensure unix_convert() calls canonicalize_snapshot_path() on the path to
process the @GMT token, so smb_fname->twrp is filled in with the converted time
value of the @GMT token.

When canonicalize_snapshot_path() starts actually stripping off @GMT tokens, we
can remove this again.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e9a6552d by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: realign smb_fname_base initialisation in dptr_ReadDirName()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3073586f by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: set twrp in dptr_ReadDirName()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d66de7d5 by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: realign smb_fname member initialisation in smbd_dirptr_get_entry()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
386574f2 by Ralph Boehme at 2020-05-05T19:18:41+00:00
smbd: initialize twrp in smb_fname in smbd_dirptr_get_entry()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d9129993 by Ralph Boehme at 2020-05-05T19:18:42+00:00
smbd: move a DEBUG in unix_convert()

Ensure a successfull conversion via early exit also logs a message.

While at it, use smb_fname_str_dbg() to print the string which ensure any stream
component or twrp value is also printed.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
31b5a369 by Ralph Boehme at 2020-05-05T19:18:42+00:00
smbd: set twrp in vfs_stat_smb_basename()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
671319bc by Ralph Boehme at 2020-05-05T19:18:42+00:00
smbd: realign target_fname initialisation in process_symlink_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
872b0919 by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_default: set twrp in smb_fname in vfswrap_get_dos_attributes_getxattr_done()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c289f58b by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_fruit: set twrp in smb_fname in fruit_fstat_meta_stream()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
89eb4c02 by Ralph Boehme at 2020-05-05T19:18:42+00:00
smbd: set twrp in target_fname in target_fname()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
40e7750b by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_shadow_copy2: pass orig_name as struct smb_filename to shadow_copy2_strip_snapshot()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9fb49179 by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal()

Use smb_fname->twrp instead if the @GMT token and assert both the twrp value and
the converted @GMT string token have the same value.

With this commit passing CI (which it did), we can somewhat safely assume that
anything that calls into the VFS stack is correctly passing struct
smb_filename.twrp from unix_convert() to the VFS without loosing the twrp value
in one of the myriad places where we copy the original struct smb_filename value
one way or another.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3515ab6c by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_shadow_copy2: use struct smb_filename.twrp instead of @GMT string token

Removes the asserts which were only needed to prove patchset correctness.

If smb_fname->twrp is zero, the path won't contain an @GMT token, so we can skip
the stripping logic and directly goto out.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6cefa15b by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_snapper: pass struct smb_filename to snapper_gmt_strip_snapshot()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a2e800d8 by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_snapper: use struct smb_filename.twrp instead of @GMT string token

@GMT tokens are still validated and stripped, but the previous version timestamp
is taken from the struct smb_filename twrp member.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1eb0cb07 by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_ceph_snapshots: pass struct smb_filename to ceph_snap_gmt_strip_snapshot()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8632f7ea by Ralph Boehme at 2020-05-05T19:18:42+00:00
vfs_ceph_snapshots: use struct smb_filename.twrp instead of @GMT string token

@GMT tokens are still validated and stripped, but the previous version timestamp
is taken from the struct smb_filename twrp member.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6e8ffcff by Ralph Boehme at 2020-05-05T19:18:42+00:00
smbd: realigning a complex if expression in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1130c64f by Ralph Boehme at 2020-05-05T19:18:43+00:00
smbd: realign stat_cache_add() args in unix_convert()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
28763125 by Ralph Boehme at 2020-05-05T19:18:43+00:00
smbd: pass translated_path as const to stat_cache_add()

Prepares for doing more stuff with the translated_path in a subsequent commit.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6e364c54 by Ralph Boehme at 2020-05-05T19:18:43+00:00
smbd: strip @GMT token in canonicalize_snapshot_path()

smbd and all previous-versions implementing VFS modules have been patched to
work with struct smb_filename.NTTIME twrp, so we can now safely strip @GMT
tokens from paths.

This also means that "@GMT-something/foo" and "foo" will both come out as "foo",
so we have to take care of the stat-cache now and change it to take and use an
additional twrp arg.

At the same time remove @GMT stripping from shadow_copy2. In theory this could
be made a seperate commit, but due to the absolute path and pstripped logic, it
felt too cumbersome to attempt this.

Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f689f3cb by Ralph Boehme at 2020-05-05T19:18:43+00:00
smbd: pass ucf_flags to canonicalize_snapshot_path()

No change in behaviour. ucf_flags are just now checked *inside*
canonicalize_snapshot_path() instead of the caller.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
55877f95 by Ralph Boehme at 2020-05-05T19:18:43+00:00
smbd: remove processing of @GMT tokens from the SMB2 server

Setting this flag was a hokey hack to trigger @GMT token processing in
filename_convert(). Now that all internal processing is based on struct
smb_filename.NTTIME twrp, we can remove this hack.

With this change, paths containing @GMT tokens received over SMB2 are
subsequently processed unchanged, the @GMT token is not stripped and will hit
the filesystem, mostly resulting in NT_STATUS_NOT_FOUND failures which is the
same behaviour as Windows.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3a52e3f0 by Ralph Boehme at 2020-05-05T19:18:43+00:00
vfs_ceph_snapshots: fix return value of ceph_snap_gmt_strip_snapshot()

The function returns ints and the callers expect ints. Declaring bool while
returning ints works, as generally compilers implement bools as ints.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2dd21e65 by Ralph Boehme at 2020-05-05T19:18:43+00:00
vfs_ceph_snapshots: remove @GMT token stripping from ceph_snap_gmt_strip_snapshot()

Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
773b98c1 by Ralph Boehme at 2020-05-05T19:18:43+00:00
vfs_snapper: remove @GMT token stripping from snapper_gmt_strip_snapshot()

Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8019b3d0 by Jeremy Allison at 2020-05-05T19:18:43+00:00
smbd: Update description of canonicalize_snapshot_path().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2992891e by Jeremy Allison at 2020-05-05T19:18:43+00:00
s3: smbd: Move the initialization of the filename and the call to canonicalize_snapshot_path() *before* zero-length string checks.

canonicalize_snapshot_path() may eat the incoming pathname in total
for SMB1, so we need to check after that call.

Fix the zero-length string check to look at state->smb_fname->base_name
instead of state->orig_path.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2b8ea977 by Jeremy Allison at 2020-05-05T19:18:43+00:00
s4: torture: Add smb2.twrp.openroot test.

Opens the root of a share over SMB2 with a zero-length
filename and a timewarp token.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c3377b4c by Jeremy Allison at 2020-05-05T19:18:43+00:00
s3: torture: Add call to smbtorture smb2.twrp.openroot

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9881c3f9 by Jeremy Allison at 2020-05-05T19:18:43+00:00
s4: torture: Add an SMB1-specific open root of share with @GMT-path test - base.smb1-twrp-openroot

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
35be625b by Jeremy Allison at 2020-05-05T19:18:44+00:00
s3: torture: Add samba3.blackbox.NT1.shadow_copy_torture.

Runs the SMB1 root @GMT-pathname open test.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8d22b9ed by Jeremy Allison at 2020-05-05T20:55:41+00:00
Revert "smbd: fullpath based on fsp->fsp_name may contain an @GMT token"

This reverts commit e593c38f5a8602be497a29e145ccdd4f9cc595e7.

As stated in the original commit message, "When canonicalize_snapshot_path()
starts actually stripping off @GMT tokens, we can remove this again."

canonicalize_snapshot_path() now strips off @GMT tokens from
any SMB1 names, so this is now not needed anymore.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue May  5 20:55:42 UTC 2020 on sn-devel-184

- - - - -
93408f60 by Amitay Isaacs at 2020-05-06T00:06:40+00:00
lib/messaging: Move messages_dgm out of source3

... so CTDB can also use it.

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e595d2a1 by Amitay Isaacs at 2020-05-06T00:06:40+00:00
wscript_build: Remove duplicate recursion in source4/smbd

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
a59fd816 by Amitay Isaacs at 2020-05-06T00:06:40+00:00
lib/util: Build genrand for util core

messages_dgm depends on genrand.

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
23c2195e by Amitay Isaacs at 2020-05-06T01:47:16+00:00
ctdb-build: Add messages_dgm build to ctdb

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed May  6 01:47:16 UTC 2020 on sn-devel-184

- - - - -
1b74a4a3 by Ralph Boehme at 2020-05-06T10:18:38+00:00
vfs_shadow_copy2: log caller location in shadow_copy2_strip_snapshot()

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6557777c by Ralph Boehme at 2020-05-06T10:18:38+00:00
CI: add two tests for shadow_copy2 VFS module

Note that the test "fetch a previous version of a regular file via non-canonical
basepath" doesn't fail by "luck" because it runs into the "creating file"
optimisation in unix_convert().

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
aa5f19dd by Ralph Boehme at 2020-05-06T10:18:38+00:00
smbd: make get_real_filename_full_scan() public

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a3d1ac2a by Ralph Boehme at 2020-05-06T10:18:39+00:00
vfs_shadow_copy2: implement case canonicalisation in shadow_copy2_get_real_filename()

unix_convert() can't do this for us in snapdirseverywhere mode, so we do it
ourselves.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
04da0c34 by Volker Lendecke at 2020-05-06T11:58:42+00:00
test: Make local.event.*.fd1 a bit less flapping

One millisecond seems not enough on slow machines, make the timeout 10 msec

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed May  6 11:58:42 UTC 2020 on sn-devel-184

- - - - -
79b371da by Gary Lockyer at 2020-05-06T21:15:42+00:00
s4 ldap_server: modernize debug calls

Replace DEBUG(0 with DBG_ERR(

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
3d2dd629 by Gary Lockyer at 2020-05-06T22:53:02+00:00
lib util asn1: modernize debug calls

Replace DEBUG(0 with DBG_ERR(

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Gary Lockyer <gary at samba.org>
Autobuild-Date(master): Wed May  6 22:53:02 UTC 2020 on sn-devel-184

- - - - -
2a7fc40f by Amit Kumar at 2020-05-07T08:59:31+00:00
Add a test for smbclient -l basename

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

Signed-off-by: Amit Kumar <amitkuma at redhat.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
c83ce5f4 by Amit Kumar at 2020-05-07T10:38:29+00:00
lib:util: Fix smbclient -l basename dir

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

Pair-Programmed-With: Andreas Schneider <asn at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
Signed-off-by: Amit Kumar <amitkuma at redhat.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu May  7 10:38:29 UTC 2020 on sn-devel-184

- - - - -
4ccb5816 by Stefan Metzmacher at 2020-05-07T14:44:39+00:00
lib/socket: let query_iface_speed_from_name() initialize memory passed to syscalls

I'm not sure if struct initializers would take care of padding,
so I use ZERO_STRUCT().

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d39636ac by Stefan Metzmacher at 2020-05-07T14:44:40+00:00
lib/socket: autodetect RSS using ETHTOOL_GRXRINGS

This is also used as part of 'ethtool -n rdma14' and
'ethtool -x rdma14'.

;#> ethtool -n rdma14
8 RX rings available
rxclass: Cannot get RX class rule count: Operation not supported
RX classification rule retrieval failed

;#> ethtool -x rdma14
RX flow hash indirection table for rdma14 with 8 RX ring(s):
    0:      0     1     2     3     4     5     6     7
    8:      0     1     2     3     4     5     6     7
RSS hash key:
Operation not supported
RSS hash function:
    toeplitz: on
    xor: off
    crc32: off

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5944ec38 by Steven Noonan at 2020-05-07T14:44:40+00:00
interface: allow overriding speed/cap/if_index for named interfaces

Signed-off-by: Steven Noonan <steven at uplinklabs.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fe3380d3 by Stefan Metzmacher at 2020-05-07T14:44:40+00:00
interface: clarify the quoting for advanced "interfaces" options

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
afd3bd01 by Stefan Metzmacher at 2020-05-07T16:23:39+00:00
docs-xml/smbdotconf: clarify the quoting for advanced "interfaces" options

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu May  7 16:23:40 UTC 2020 on sn-devel-184

- - - - -
155883e8 by Jeremy Allison at 2020-05-07T16:24:42+00:00
s3: VFS: Remove now-unused variable in shadow_copy2_get_real_filename().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
14df5d20 by Jeremy Allison at 2020-05-07T18:03:16+00:00
s3: RPC: Don't crash on trying to talloc_free(-1) if smb_iconv_open_ex() fails.

Assign output from smb_iconv_open_ex() to a temporary
handle. Only assign to mds_ctx->[handles] if correctly
opened otherwise we end up trying to call smb_iconv_close(-1).

MacOSX Catalina triggers this.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu May  7 18:03:16 UTC 2020 on sn-devel-184

- - - - -
ac333c56 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: Split out fget_nt_acl_common() from get_nt_acl_common().

No change in logic and not yet used, just means it'll be
cleaner when we start adding the xxxAT() versions of SMB_VFS_GET_NT_ACL()..

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4ac3fde1 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: acl_tdb.c: Add fget_acl_blob().

Separate from get_acl_blob() which took both an fsp and a pathname.
Commented out so we still compile.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
936b9aee by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: acl_xattr.c: Add fget_acl_blob().

Separate from get_acl_blob() which took both an fsp and a pathname.
Commented out so we still compile.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d902ea52 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: ACLs. Switch fset_nt_acl_common() over to using fget_acl_blob_fn().

Removes passing in smb_fname to fsp functions.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
441980d4 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: acl_tdb: Change acl_tdb_fget_nt_acl() to use fget_nt_acl_common().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b7847aa2 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: acl_xattr: Change acl_xattr_fget_nt_acl() to use fget_nt_acl_common().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
42651479 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: ACLs. Remove smb_fname argument to get_nt_acl_common().

As a bonus stat_fsp_or_smb_fname() is no longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b4571648 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: vfs_acl_common: Remove unused stat_fsp_or_smb_fname().

Done separately to minimize the diff in the previous patch.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d825d31f by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at().

Add in the dirfsp parameter. Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2437dcc5 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: acl_common: Add a dirfsp parameter to validate_nt_acl_blob().

This sucks, as it's the only function that I've been
unable to easily split into a _fsp and a _pathname version,
it just does too much. Bite the bullet and add a dirfsp
parameter as well as the fsp and smb_fname parameters.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
773b6e17 by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: Add SMB_VFS_GET_NT_ACL_AT().

Currently identical to SMB_VFS_GET_NT_ACL().

Next, add to all VFS modules that implement
get_nt_acl and eventually remove get_nt_acl.

NB. Modules that use smb_vfs_assert_all_fns()
have SMB_VFS_GET_NT_ACL_AT() will not build
until they have this function added.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6db910cf by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: time_audit. Add smb_time_audit_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
1df02b7d by Jeremy Allison at 2020-05-07T19:27:34+00:00
s3: VFS: full_audit. Add smb_full_audit_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2840bf37 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: acl_xattr: Add acl_xattr_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d6700ee3 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: acl_tdb. Add acl_tdb_get_nt_acl().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
373843f5 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: afsacl. Add afsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
cbfbc404 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: aixacl2: Add aixjfs2_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
22c3541e by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: catia. Add catia_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0ebce107 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: ceph_snapshots. Add ceph_snap_gmt_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
95160bbf by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: Add null notice of get_nt_acl_at_fn().

Not strictly needed but glusterfs seems to use
this as a reminder that these functions are not
implemented but pass down to the default.

I'll remove all these when I remove get_nt_acl_fn()
completely.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
731f8ac8 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: gpfs. Add gpfsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4a508eb7 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: media_harmony: Add mh_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0d013ed0 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: vfs4acl_xattr: Add nfs4acl_xattr_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b8ab671a by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: shadow_copy2. Add shadow_copy2_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
0ae43c36 by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: snapper. Add snapper_gmt_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
91f06daf by Jeremy Allison at 2020-05-07T19:27:35+00:00
s3: VFS: unityed_media. Add um_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5bdd4d4f by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: VFS: zfsacl. Add zfsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
300780bb by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in user_can_read_file().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
88fbfe6a by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_no_snum().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5c6fd446 by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in directory_has_default_acl().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
834d674c by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: torture: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in cmd_get_nt_acl().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9746cdfc by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: pysmbd. Change SMB_VFS_GET_NT_ACL() to SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_conn().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c12e03b8 by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_check_access_rights().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
dbfccb9f by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_check_access_rights().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
98dfc4ed by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_calculate_maximum_allowed_access().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6b65156f by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in inherit_new_acl().

Hard code at conn->cwd_fsp for now.

Last user of SMB_VFS_GET_NT_ACL(). This VFS function can
now be removed.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
a920df8f by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: VFS: acl_common. s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in validate_nt_acl_blob().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
36708823 by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: VFS: acl_common: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_common_at().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4ac103bf by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: VFS: streams_xattr. Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in streams_xattr_fget_nt_acl() fallback.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4a7235d3 by Jeremy Allison at 2020-05-07T19:27:36+00:00
s3: VFS: acl_tdb. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
617759ce by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: acl_xattr. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
12777bc7 by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: afsacl. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6a2aa09b by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: aixacl2. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c68f457e by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: catia. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5e361140 by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: ceph_snapshots. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f2f68469 by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: glusterfs. Remove NULL definition of get_nt_acl_fn().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
4f44294c by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: gpfs. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
9507c623 by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: media_harmony. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
e158d42c by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: nfs4acl_xattr. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
04805929 by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: shadow_copy2. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
cb7c617d by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: snapper. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b744ebbc by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: zfsacl. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
67b778cc by Jeremy Allison at 2020-05-07T19:27:37+00:00
s3: VFS: unityed_media. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
8c6628f9 by Jeremy Allison at 2020-05-07T19:27:38+00:00
s3: VFS: time_audit. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
7acbef46 by Jeremy Allison at 2020-05-07T19:27:38+00:00
s3: VFS: full_audit. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c6e71fbd by Jeremy Allison at 2020-05-07T21:04:59+00:00
s3: VFS: Complete the replacement of SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu May  7 21:04:59 UTC 2020 on sn-devel-184

- - - - -
dfdf8217 by Gary Lockyer at 2020-05-08T09:31:31+00:00
build: Allow developer builds with clang 9

Disable clang warnings to allow samba to be compiled with clang 9.

Subsequent commits will fix offending code and re-enable the warnings.

However fixing cast-align warnings has been left for later.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
9df4d6ab by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 parentheses-equality warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
fa833278 by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 logical-not-parentheses warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
5e44b7cd by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 constant-conversion warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
d55812e4 by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 enum-conversion warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c2b00714 by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 unused-function warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
13a2f70a by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 missing-field-initializer warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
8c17b6f8 by Gary Lockyer at 2020-05-08T09:31:31+00:00
Fix clang 9 format-nonliteral warnings

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
e907f002 by Gary Lockyer at 2020-05-08T11:16:18+00:00
Fix clang 9 for-loop-analysis warnings

Review-note: The for loop increment operation was changed and the
             trailing i++ was removed from the loop body.
             The resulting for statement is equivalent to the original

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri May  8 11:16:18 UTC 2020 on sn-devel-184

- - - - -
aa7cc50a by Gary Lockyer at 2020-05-10T21:45:38+00:00
s4 ldap server tests: request size limit tests

Extra tests for ldap maximum request size limits.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
80d9ea13 by Gary Lockyer at 2020-05-10T21:45:38+00:00
s4 cldap server tests: request size limit tests

Add tests for packet size limits.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ac800011 by Gary Lockyer at 2020-05-10T21:45:38+00:00
lib util ASN.1: Panic on ASN.1 tag mismatch

If the ASN.1 depth is zero in asn1_end_tag, call smb_panic. Rather than
ignoring the condition.

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a699256f by Gary Lockyer at 2020-05-10T23:21:08+00:00
lib ldb: Limit depth of ldb_parse_tree

Limit the number of nested conditionals allowed by ldb_parse tree to
128, to avoid potential stack overflow issues.

Credit Oss-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19508

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Gary Lockyer <gary at samba.org>
Autobuild-Date(master): Sun May 10 23:21:08 UTC 2020 on sn-devel-184

- - - - -
d1740fb3 by Marcos Mello at 2020-05-12T10:48:39+00:00
Drop NotifyAccess=all from systemd units

The implicit NotifyAccess=main is enough since Samba daemons do not
fork()/exit() anymore under systemd.

Signed-off-by: Marcos Mello <marcosfrm at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
6b17dcfd by Marcos Mello at 2020-05-12T12:27:11+00:00
winbind.service: drop quotes from $WINBINDOPTIONS variable

systemd parser splits arguments at whitespaces respecting quotes
when necessary.

Signed-off-by: Marcos Mello <marcosfrm at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue May 12 12:27:11 UTC 2020 on sn-devel-184

- - - - -
c83ef1d9 by Ralph Boehme at 2020-05-12T18:15:30+00:00
selftest: split a knownfail entry

Lists the two existing subtests indidivually in preparation of adding a third
that is going to pass against ad_dc_ntvfs.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
2ace545a by Ralph Boehme at 2020-05-12T18:15:30+00:00
s4/torture: reproducer for bug 14375

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
3f37008e by Ralph Boehme at 2020-05-12T18:15:31+00:00
smbd: make conflicting_access available to other functions

The next commit adds more users of conflicting_access.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
59f55aa0 by Ralph Boehme at 2020-05-12T18:15:31+00:00
smbd: fix for bug 14375

... with many thanks to an enthusiastic Samba user from Poland for helping to
track this down.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
bf04ca56 by Ralph Boehme at 2020-05-12T19:52:48+00:00
s3/locking: prime flags in a fresh sharemode data object

This is needed to prime the logic in share_mode_flags_restrict() for the
following scenario:

* (First) CREATE on a file with FILE_SHARE_NONE and
  access_mask=FILE_READ_ATTRIBUTES (a stat-open).

* share_mode_flags_restrict() gets called with

    share_mode_flags_restrict(flags=0,
                              access_mask=0x80,
                              share_mode=0,
                              lease_type=UINT32_MAX)

  and returns a value where none of the FILE_SHARE_* flags is set.

As a result share_mode_data.flags doesn't reflect the share-modes in effect.

This doesn't change any current visible behaviour outside of open_mode_check(),
but it avoids calling share_mode_forall_entries() in open_mode_check_fn()..

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue May 12 19:52:48 UTC 2020 on sn-devel-184

- - - - -
54de0e4a by Stefan Metzmacher at 2020-05-12T19:53:43+00:00
s4:torture: add tests to test the SMB2 read/write offset/length boundaries

[MS-FSA] 2.1.5.2 Server Requests a Read and
2.1.5.3 Server Requests a Write define some contraints.

These tests demonstrate that ((int64_t)offset) < 0) is
not allowed for both reads and writes for SMB.
Also the special case for writes at offset -2 is not possible
nor the append mode with offset < 0.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e02cbd5c by Stefan Metzmacher at 2020-05-12T19:53:43+00:00
lib: util: Add sys_valid_io_range()

This implements the contraints of
[MS-FSA] 2.1.5.2 Server Requests a Read.

The special handling of [MS-FSA] 2.1.5.3 Server Requests a Write
with offset < 0, should be handled by higher layers!
Which means the check can also be used for writes.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
36af33bf by Jeremy Allison at 2020-05-12T19:53:43+00:00
lib: util: Add sys_pread_full().

A pread wrapper that will deal with EINTR and never return a short
read unless pread returns zero meaning EOF.

Thread-safe so may be used as a replacement for pread
inside pread_do() thread functions.

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
3ba7a89c by Jeremy Allison at 2020-05-12T19:53:43+00:00
lib: util: Add sys_pwrite_full().

A pwrite wrapper that will deal with EINTR and never return a short
write unless the file system returns an error. Copes with the
unspecified edge condition of pwrite returning zero by changing
the return to -1, errno = ENOSPC.

Thread-safe so may be used as a replacement for pwrite
inside pwrite_do() thread functions.

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
a6eee38b by Stefan Metzmacher at 2020-05-12T19:53:43+00:00
smb2_server: fix smbd_smb2_request_verify_sizes() for SMB2_OP_WRITE

Writes with a length of 0 are allowed.

The readfile related check we had before was not really useful
as min_dyn_len can only every be 0 or 1 (and for SMB2_OP_WRITE it's
always 1). So we checked
  if (unread_bytes > 0) {
     if (unread_bytes < 1) {
       return error;
     }
  }

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ba68f212 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
s3:smbd: handle 0 length writes as no-op.

They should never touch the SMB_VFS layer
and they never trigger an DISK_FULL error.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
70fa4b88 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
s3:smbd: add vfs_valid_{pread,pwrite}_range() helper functions

These implement the SMB2 visible behavior of the [MS-FSA]
2.1.5.2 Server Requests a Read and 2.1.5.3 Server Requests a Write
constraints. Note that offset < 0 is not allowed over SMB.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6fa753a1 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
smbd: add vfs_valid_{pread,pwrite}_range() checks where needed

I checked all callers of SMB_VFS_PWRITE[_SEND](),
all callers of SMB_VFS_PREAD[_SEND]() and also
places where we append to the file and allocate
more space.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
60f59000 by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: aio_fork: Change sys_pread() -> sys_pread_full() to protect against short reads.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
20ee8b03 by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: aio_fork: Change sys_pwrite() -> sys_pwrite_full() to protect against short writes.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
7daa7990 by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: default. Change sys_pread() -> sys_pread_full() in SMB_VFS_PREAD() to protect against short reads.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ca8c3619 by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: default. Change sys_pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE() to protect against short writes.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
bf2e546b by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to protect against short reads.

Note that as sys_pread_full() deals with the EINTR case
we can remove the do {} while loop here.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
801c06f4 by Jeremy Allison at 2020-05-12T19:53:44+00:00
s3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to protect against short writes.

Note that as sys_pwrite_full() deals with the EINTR case
we can remove the do {} while loop here.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
fadc7043 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
vfs_io_uring: fix the prefix for parametric options from 'vfs_io_uring' to 'io_uring'

This is what the manpage describes.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f78e98e0 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
vfs_io_uring: replace vfs_io_uring_request->state with _tevent_req_data()

We don't need a direct pointer to the state...

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
456533c9 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
vfs_io_uring: introduce vfs_io_uring_request->completion_fn()

We'll need to add more logic than a simple _tevent_req_done()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a1487067 by Stefan Metzmacher at 2020-05-12T19:53:44+00:00
vfs_io_uring: move error handling out of vfs_io_uring_pread_recv()

We should do that as early as possible and that's in
vfs_io_uring_pread_completion().

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a51969b8 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: move error handling out of vfs_io_uring_pwrite_recv()

We should do that as early as possible and that's in
vfs_io_uring_pwrite_completion().

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
40be2232 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: move error handling out of vfs_io_uring_fsync_recv()

We should do that as early as possible and that's in
vfs_io_uring_fsync_completion().

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5005ae3f by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pread_send()

This makes the follow up commits easier as we don't have to care
about overflows.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
388bc2e6 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pwrite_send()

This makes the follow up commits easier as we don't have to care
about overflows.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f96f45c9 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: avoid stack recursion of vfs_io_uring_queue_run()

Instead we remember if recursion was triggered and jump to
the start of the function again from the end.

This should make it safe to be called from the completion_fn().

This is hideously complex stuff, so document the hell
out of it.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ab89b8e7 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: split out a vfs_io_uring_request_submit() function

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9de4f8be by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: split out a vfs_io_uring_pread_submit() function

This can be reused when we add handling for short reads.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2f6abb00 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: split out a vfs_io_uring_pwrite_submit() function

This can be reused when we add handling for short writes.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f085dbf8 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: protect vfs_io_uring_pread_completion() against invalid results

We should never get back more than we asked for.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
283f9687 by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: protect vfs_io_uring_pwrite_completion() against invalid results

We should never get more acked than we asked for.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c57a731c by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results

We should never get back a value > 0.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
42e77c4c by Stefan Metzmacher at 2020-05-12T19:53:45+00:00
vfs_io_uring: retry after a short read in vfs_io_uring_pread_completion()

We need to be prepared for short reads from the kernel depending on
the state of the page cache. Windows and Mac clients don't
expect short reads for files, so we need to retry ourself.

For the future we may be able to play with some io_uring flags
in order to avoid the retries in userspace, but for now we just fix
the data corruption bug...

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0f01b106 by Stefan Metzmacher at 2020-05-12T19:53:46+00:00
vfs_io_uring: retry after a short writes in vfs_io_uring_pwrite_completion()

We need to be prepared for short writes from the kernel depending on
the state of the page cache.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a9651d6b by Jeremy Allison at 2020-05-12T19:53:46+00:00
s3: selftest: Add share definition [bad_iconv] in fileserver.

Creates a utf8 valid filename within that is invalid in CP850.
Useful to test smbclient list directory character set conversions.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
e016671d by Jeremy Allison at 2020-05-12T19:53:46+00:00
s3: selftest: Add test_smbclient_iconv.sh to check client behavior on bad name conversion.

SMB2 and NT1 fail this, CORE already returns NT_STATUS_INVALID_NETWORK_RESPONSE
on bad conversion.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
b10de0bb by Jeremy Allison at 2020-05-12T19:53:46+00:00
s3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.

Can happen if namelen == 0.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
753115a8 by Jeremy Allison at 2020-05-12T19:53:46+00:00
s3: libsmb: In SMB2 return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.

Can happen if namelen == 0.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
393da520 by Jeremy Allison at 2020-05-12T21:32:44+00:00
s3: libsmbclient: Finish unifing bad iconv behavior across CORE NT1 SMB2 protocols.

On bad name conversion, exit the directory listing with an error, but leave the
connection intact. We were already checking for finfo->name == NULL here,
but were ignoring it and not reporting an error.

Remove the knownfail.d/bad_iconv file as we now
behave the same across CORE/NT1/SMB2.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue May 12 21:32:44 UTC 2020 on sn-devel-184

- - - - -
6e419dda by Ralph Boehme at 2020-05-13T13:30:12+00:00
ctdb: increase TasksMax limit, the systemd default is just 512

In 2015 systemd introduced a TasksMax which limits the number of processes in a
unit:

https://lists.freedesktop.org/archives/systemd-devel/2015-November/035006.html

The default of 512 may be too low in certain situations leading to vfork()
failing with errno=EAGAIN when trying to spawn lock-helper processes.

With the default for LockProcessesPerDB being 200 the increased TasksMax limit
should cover the problematic scenario.

Additional background: the failing vfork()s have been seen on production
clusters and were tracked down to being logged in the context of ctdb calling
tdb_repack().

Links:

https://github.com/systemd/systemd/commit/9ded9cd14cc03c67291b10a5c42ce5094ba0912f
https://www.suse.com/support/kb/doc/?id=000015901
https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting
https://www.percona.com/blog/2019/01/02/tasksmax-another-setting-that-can-cause-mysql-error-messages/

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Wed May 13 13:30:12 UTC 2020 on sn-devel-184

- - - - -
84c7eb47 by awalker at 2020-05-13T17:34:43+00:00
lib:param: Fix memory leak in lpcfg_load_internal()

Signed-off-by: awalker <awalker at ixsystems.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed May 13 17:34:43 UTC 2020 on sn-devel-184

- - - - -
ab70153c by Andreas Schneider at 2020-05-14T14:27:26+00:00
testprogs: Add 'net ads join' test for fips

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Thu May 14 14:27:26 UTC 2020 on sn-devel-184

- - - - -
f0df11ce by Ralph Boehme at 2020-05-14T18:07:39+00:00
s4/torture: add a *real* root_dir_fid test

raw.samba3rootdirfid tests with the share root directory as root_dir_fid handle,
that doesn't cover the case where the relative name has more then one path
component. It only works because in unix_convert() we run into the creating file
optimasation.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
54883d4b by Ralph Boehme at 2020-05-14T18:07:39+00:00
smbd: move processing of root_dir_fid outside of SMB_VFS_CREATE_FILE()

The only two callers that pass a root_dir_fid != 0 are reply_ntcreate_and_X()
and call_nt_transact_create(). By moving root_dir_fid processing outside of
SMB_VFS_CREATE_FILE() we can avoid rewriting get_relative_fid_filename() to work
with *AT semantics and dirfsps.

Bonus points: the previous code in both functions passed fname to
filename_convert() which can't really have worked as it is relative to
root_dir_fid so filename_convert() will not be able to stat() the relative path
and it's components.

The only test I can find that uses a root dir_fid is raw.samba3rootdirfid and
that uses a handle on the share root which will work.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7215669d by Ralph Boehme at 2020-05-14T19:43:27+00:00
vfs: remove root_dir_fid arg from SMB_VFS_CREATE_FILE()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu May 14 19:43:27 UTC 2020 on sn-devel-184

- - - - -
a9397f87 by Volker Lendecke at 2020-05-14T20:29:38+00:00
srvsvc: Introduce ctx3 helper var in enum_file_fn()

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ff80f68c by Volker Lendecke at 2020-05-14T20:29:38+00:00
srvsvc: Use a struct assignment in enum_file_fn()

Looks nicer than 5 complex array references...

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
96d68bb9 by Volker Lendecke at 2020-05-14T20:29:38+00:00
srvsvc: Directly use "ctr3->count" instead of "i"

To me this was not very transparent, and now that we have "ctr3" a
single indirect looks okay

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
bda0b387 by Volker Lendecke at 2020-05-14T20:29:38+00:00
srvsvc: Use a struct initializer in net_enum_files()

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
46ab1d47 by Volker Lendecke at 2020-05-14T20:29:38+00:00
srvsvc: Collect file ids in enum_file_fn()

Will be used a few patches down

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
8c080f28 by Volker Lendecke at 2020-05-14T20:29:38+00:00
rpcclient: Use struct initializers in cmd_srvsvc_net_file_enum()

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
1d40cc01 by Volker Lendecke at 2020-05-14T20:29:38+00:00
rpcclient: Make netfileenum cmd print the path names

Needed for the next commit testing netfileenum

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
8e4583f7 by Volker Lendecke at 2020-05-14T20:29:38+00:00
test: Show that netfileenum is broken

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
01db877c by Volker Lendecke at 2020-05-14T22:06:32+00:00
srvsvc: Move brl_get_locks() out of enum_file_fn()

With share_infos.tdb this is a locking order violation:
share_infos.tdb is level 4, brlock.tdb is level 2. Avoid this by first
walking the share_infos.tdb and then fetching all the brlock entries.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu May 14 22:06:32 UTC 2020 on sn-devel-184

- - - - -
38a80a30 by Volker Lendecke at 2020-05-15T00:48:32+00:00
dbwrap: Simplify dbwrap_lock_order_[un]lock()

Directly pass the database name and lock order to the core functions,
avoid passing struct db_context.

In the next steps these functions will become public: locking.tdb will
be based on g_lock.c to avoid holding a tdb-level locking.tdb mutex
while doing complex file system operations like unlink() which can
take ages on FAT for example.

This means that g_lock.c will participate in the dbwrap lock order
protection and needs access to dbwrap_lock_order_[un]lock() without
providing a direct db_context.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5ae58cd0 by Volker Lendecke at 2020-05-15T00:48:32+00:00
dbwrap: Make dbwrap_lock_order_[un]lock() public

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
66d62ed7 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Allow DBWRAP_LOCK_ORDER_NONE in db_open()

locking.tdb will not have a LOCK_ORDER anymore, this will be done by
the code in g_lock.c. We need to allow opening a database with dbwrap
without having a lock order.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
46e8e0cd by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_watch_data_send/recv()

Same concept as dbwrap_watched_watch_send/recv: Get informed if the
underlying data of a record changes. This utilizes the watched
database that g_lock is based upon anyway. To avoid spurious wakeups
by pure g_lock operations this patch adds a sequence number for the
data that is stored in the g_lock data field.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
90dcfa4e by Volker Lendecke at 2020-05-15T00:48:32+00:00
torture: Test g_lock_watch_data_send()/recv()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c38f3714 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_wake_watchers()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3d0cfb82 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_seqnum()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4f2117d6 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Allow additional dbufs in g_lock_store()

Preparation for g_lock_writev_data()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6fb6a699 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_writev_data

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0a043e64 by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_set_lock_order()

Optionally allow a database with g_lock format to participate in the dbwarp
lock order check. Will be used once locking.tdb is based upon g_lock.c

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3bf576bb by Volker Lendecke at 2020-05-15T00:48:32+00:00
lib: Add g_lock_dump_send/recv

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8020f013 by Volker Lendecke at 2020-05-15T00:48:33+00:00
smbd: Base locking.tdb on g_lock.c

This means we don't hold locking.tdb mutexes anymore while we do
filesystem-level operations. This has hurt ctdb quite a bit: A smbd hanging in
an unlink() syscall prevents ctdb from recovering locking.tdb.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7bdd5ad4 by Volker Lendecke at 2020-05-15T00:48:33+00:00
smbd: Move share mode entry parsing up in the file

Will be used by parsing code soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
49951b28 by Volker Lendecke at 2020-05-15T02:27:49+00:00
smbd: Store share_entries in locking.tdb again

The "base on g_lock" patch is a slowdown because we do more tdb
operations. Getting share_entries.tdb back into locking.tdb tries to
speed things up again.

Now that we're based on g_lock we'll most likely use a different
method in order to spread the entries across multiple records.

It still maintains the sorted array of share modes within locking.tdb,
but not as part of the expensive ndr marshalling of the complete
array.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri May 15 02:27:49 UTC 2020 on sn-devel-184

- - - - -
4e08ea2a by Andrew Bartlett at 2020-05-15T06:05:30+00:00
selftest: Avoid running the slowest of the "none" tests in samba-o3

This job is already quite long and these tests are unlikely
to vary between hosts or under the -O3 compile

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
87bf1d68 by Andrew Bartlett at 2020-05-15T06:05:30+00:00
librpc/idl: Add dnsp_DnsProperty_short

This will be used by a test and the DNS server code to parse short dnsProperty
records which come from Windows servers.

This example is from the value that caused Samba to fail as it
can not be parsed as a normal dnsp_DnsProperty

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
6eb2a48f by Andrew Bartlett at 2020-05-15T06:05:30+00:00
selftest: Add test for handling of "short" dnsProperty records

These have been known to be given by Windows DCs that share the same domain
as while invalid, they are not format-checked inbound when set by the DNS
Manager MMC applet over the dnsserver pipe to Windows.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
004e7a1f by Andrew Bartlett at 2020-05-15T07:29:16+00:00
s4/rpc_server/dnsserver: Allow parsing of dnsProperty to fail gracefully

On (eg) the

DC=_msdcs.X.Y,CN=MicrosoftDNS,DC=ForestDnsZones,DC=X,DC=Y

record, in domains that have had a Microsoft Windows DC an attribute:

dNSProperty:: AAAAAAAAAAAAAAAAAQAAAJIAAAAAAAAA

000000 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  >................<
000010 92 00 00 00 00 00 00 00                          >........<
000018

We, until samba 4.12, would parse this as:

pull returned Success
    dnsp_DnsProperty: struct dnsp_DnsProperty
        wDataLength              : 0x00000000 (0)
        namelength               : 0x00000000 (0)
        flag                     : 0x00000000 (0)
        version                  : 0x00000001 (1)
        id                       : DSPROPERTY_ZONE_NS_SERVERS_DA (146)
        data                     : union dnsPropertyData(case 0)
        name                     : 0x00000000 (0)
dump OK

However, the wDataLength is 0.  There is not anything in
[MS-DNSP] 2.3.2.1 dnsProperty to describe any special behaviour
for when the id suggests that there is a value, but wDataLength is 0.

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/445c7843-e4a1-4222-8c0f-630c230a4c80

We now fail to parse it, because we expect an entry with id DSPROPERTY_ZONE_NS_SERVERS_DA
to therefore have a valid DNS_ADDR_ARRAY (section 2.2.3.2.3).

As context we changed it in our commit fee5c6a4247aeac71318186bbff7708d25de5912
because of bug https://bugzilla.samba.org/show_bug.cgi?id=14206
which was due to the artificial environment of the fuzzer.

Microsoft advises that Windows also fails to parse this, but
instead of failing the operation, the value is ignored.

Reported by Alex MacCuish.  Many thanks for your assistance in
tracking down the issue.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri May 15 07:29:17 UTC 2020 on sn-devel-184

- - - - -
73cc25fa by Stefan Metzmacher at 2020-05-15T09:04:35+00:00
smbXsrv_client: fix debug message in smbXsrv_client_create()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
e26b55a2 by Stefan Metzmacher at 2020-05-15T09:04:35+00:00
smbXsrv_client: make sure that we store a valid blob

This fixes a regression introduced by
14182350f8397d27d7642dae595dc52691f0acfe
("librpc ndr: ndr_pull_advance check for unsigned overflow.")
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

ndr_push_smbXsrv_client_global0() is happy with
pushing NULL pointers for r->{local_address,remote_address,remote_name},
while the IDL doesn't allow it.
In turn ndr_pull_smbXsrv_client_global0() no longer ignores the error.

This means multi-channel connections were broken,
and we paniced on a NULL pointer.
It's really sad that we still don't have automated tests for it.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
2ac0f835 by Günther Deschner at 2020-05-15T09:04:36+00:00
smb2_server: update inline comment for max channels

All Windows versions have the limit of 32 channels.

Signed-off-by: Guenther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
0cec9652 by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
smb2_server: make sure we detect stale smbXsrv_connection pointers in smbXsrv_channel_global

Pointer values can be reused (yes, I hit that during my testing!).
Introduce a channel_id to identify connections and also add
some timestamps to make debugging easier.

This makes smbXsrv_session_find_channel() much more robust.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
d8ab88e7 by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
s3:smbd: split out smbXsrv_connection_disconnect_transport()

It's good to have an isolated function that just disconnects the
lower layer transport and remembers the first error status.

This will be used in more placed in the following commits.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
a87c9a92 by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
smb2_server: let smbd_server_connection_terminate_ex() call smbXsrv_connection_disconnect_transport()

If the connection is broken mark it as invalid and close
the socket.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
26ba013e by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
smb2_server: add and use a function that calculated the remaining channels

This is useful for debugging, but also simplies the following changes,
where client->connections may hold disconnected connections until
all pending requests are finished.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
de0e6dfd by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
smb2_server: call smbXsrv_connection_disconnect_transport() early on network errors

It's good to remember the first error we got and makes sure we don't try
any further io on the connection.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
a90ac47d by Stefan Metzmacher at 2020-05-15T09:04:36+00:00
smbXsrv_session: add a smbXsrv_session_disconnect_xconn() helper

This removes the connection references from the session channel
array for each session that's used on the connection.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

- - - - -
ddd8ae51 by Stefan Metzmacher at 2020-05-15T10:26:29+00:00
smb2_server: do async shutdown for pending multi-channel requests

We have wait until all pending requests are done before we can
TALLOC_FREE() the connection structure.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Fri May 15 10:26:29 UTC 2020 on sn-devel-184

- - - - -
ce65e897 by Isaac Boukris at 2020-05-15T10:27:41+00:00
Revert "selftest: allow any kdc error in mitm-s4u2self test"

This reverts commit a53fa8ffe3e36f7921baf5d31a1052747f90aa7d.

This allows a clean revert (and so removal) of the test.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b5adc112 by Isaac Boukris at 2020-05-15T10:27:41+00:00
Revert "selftest: mitm-s4u2self: use zlib for CRC32_checksum calc"

This reverts commit 151f8c0f31d3d17b9418db3793ec14ba7dbf2143.

This allows a clean revert (and so removal) of the test.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
19875a37 by Isaac Boukris at 2020-05-15T10:27:41+00:00
Revert "CVE-2018-16860 selftest: Add test for S4U2Self with unkeyed checksum"

This reverts commit 5639e973c1f6f1b28b122741763f1d05b47bc2d8.

This is no longer needed as the next commit includes a Python
test for this, without the complexity of being inside krb5.kdc.canon.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
8b5e7644 by Isaac Boukris at 2020-05-15T12:25:40+00:00
selftest: add python S4U2Self tests including unkeyed checksums

To test the CRC32 I reverted the unkeyed-checksum fix (43958af1)
and the weak-crypto fix (389d1b97). Note that the unkeyed-md5
still worked even with weak-crypto disabled, and that the
unkeyed-sha1 never worked but I left it anyway.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri May 15 12:25:40 UTC 2020 on sn-devel-184

- - - - -
15457254 by Andreas Schneider at 2020-05-15T13:18:38+00:00
lib:util: Add path_expand_tilde()

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
- - - - -
a15bd549 by Andreas Schneider at 2020-05-15T13:18:38+00:00
lib:util: Add test for path_expand_tilde()

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
- - - - -
04f0c454 by Andreas Schneider at 2020-05-15T14:40:32+00:00
s3:gencache: Allow to open gencache as read-only

This allows client tools to access the cache for ready-only operations
as a normal user.

Example:
    net ads status

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri May 15 14:40:32 UTC 2020 on sn-devel-184

- - - - -
dbfc197f by Michael Adam at 2020-05-15T16:02:47+00:00
s4/torture: Unlink test file at the beginning of smb2.read.position

Pair-Programmed-With: Anoop C S <anoopcs at redhat.com>
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Fri May 15 16:02:47 UTC 2020 on sn-devel-184

- - - - -
17a7618a by Andreas Schneider at 2020-05-18T14:43:40+00:00
selftest: Use Kerberos to join an ad_member

Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
c94f6ddc by Andreas Schneider at 2020-05-18T14:43:40+00:00
selftest: Split out a provision_ad_member() function

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
5dc1c312 by Andreas Schneider at 2020-05-18T14:43:40+00:00
selftest: Add force_fips_mode support to provision_ad_member()

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
984dd641 by Andreas Schneider at 2020-05-18T14:43:40+00:00
selftest: Add ad_member_fips target

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
55cbdac1 by Andreas Schneider at 2020-05-18T14:43:40+00:00
selftest: Run some tests against ad_member_fips

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
4fe51b27 by Andreas Schneider at 2020-05-18T14:43:40+00:00
autobuild: Add ad_member_fips target

Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
242b6cf2 by Andreas Schneider at 2020-05-18T14:43:41+00:00
autobuild: Use sane random sleep values for samba-admem-mit

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
f98b766d by Andreas Schneider at 2020-05-18T16:06:05+00:00
gitlab-ci: Add new runner for samba-admem-fips

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon May 18 16:06:06 UTC 2020 on sn-devel-184

- - - - -
dd1f7502 by Jeremy Allison at 2020-05-18T23:42:57+00:00
s3: lib: Paranoia around use of snprintf copying into a fixed-size buffer from a getenv() pointer.

Post checks for overflow/error.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon May 18 23:42:57 UTC 2020 on sn-devel-184

- - - - -
68380eba by Volker Lendecke at 2020-05-19T10:45:06+00:00
winbindd: Fix a use-after-free when winbind clients exit

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Volker Lendecke <vl at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue May 19 10:45:06 UTC 2020 on sn-devel-184

- - - - -
ec312ee6 by Volker Lendecke at 2020-05-19T12:07:42+00:00
tevent: Fix a tevent tutorial error

We don't pass a tevent_req but a tevent_context to the _send function

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue May 19 12:07:42 UTC 2020 on sn-devel-184

- - - - -
f57673d8 by Björn Jacke at 2020-05-19T14:32:28+00:00
docs: improve desription of map acl inherit

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
14470e4e by Björn Jacke at 2020-05-19T14:32:28+00:00
docs-xml: update list of posible VFS operations for vfs_full_audit

the list of valid operations can be generated by

grep "{ SMB_VFS_OP_" source3/modules/vfs_full_audit.c |sed 's/.*,[ \t]*"//;s/".*//'|grep -v NULL | sort

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

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
79938796 by Björn Jacke at 2020-05-19T15:57:08+00:00
add some missing FSCTL defines

as dodumented in

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/a64e55aa-1152-48e4-8206-edd96444e7f7

FSCTL_SET_OBJECT_ID_EXTENDED
FSCTL_READ_FILE_USN_DATA
FSCTL_WRITE_USN_CLOSE_RECORD
FSCTL_QUERY_ON_DISK_VOLUME_INFO
FSCTL_QUERY_SPARING_INFO
FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX
FSCTL_STORAGE_QOS_CONTROL

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Björn Jacke <bjacke at samba.org>
Autobuild-Date(master): Tue May 19 15:57:08 UTC 2020 on sn-devel-184

- - - - -
f1d204c5 by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: refactor flags computation for fd_open() in open_directory() a bit

No change in behaviour. A subsequent commit will optionally add an additional
flag, this change allows for a smaller diff of that commit.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d60b1134 by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: exit early in the error case in fd_open()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
acffa8f4 by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: add open_flags arg to in open_internal_dirfsp_at()

The only caller passes in what was used internally, so no change in
behaviour. Prepares for calling open_internal_dirfsp_at() from
filename_convert() with additional flags.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0b31a9ce by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: update function documentation header to match actual function argument names

Leaving p_cont_wcard unchanges as updating that would break the nice
indentation... :)

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
60c47a5d by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: remove unused variable twrp_name from filename_convert_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
15303ee1 by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: prepare for replacing SMB_VFS_READLINKAT() with SMB_VFS_STATX() in the future

Add a large comment inside process_symlink_open() explaining why we need to call
SMB_VFS_READLINKAT().

As we don't make use of the returned name and just rely on SMB_VFS_REALPATH()
doing its job, remove target_fname

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
97d06123 by Ralph Boehme at 2020-05-21T05:23:29+00:00
smbd: move conn_rootdir_fname to non_widelink_open()

No change in behaviour. This just simplifies fd_open() a bit which will make it
easier to add an fd_openat() later.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4c720a05 by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: set fsp_name of conn->cwd_fsp

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a6344334 by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: remove dirfsp arg from [create|open]_internal_dirfsp_at()

These are the functions that *create* dirfsps, they can't *take* dirfsps as that
would be recursive...

Both functions just take a pathname and the internal opening of the underlying
fd is secured from symlink races by our chdir("p/a/t/h") ; open(".", O_RDONLY);
logic in non_widelink_open().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c51a8f36 by Ralph Boehme at 2020-05-21T05:23:30+00:00
vfs_aio_pthread: pass smb_fname to open_async()

Not yet used.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bd87aeb3 by Ralph Boehme at 2020-05-21T05:23:30+00:00
vfs_aio_pthread: pass smb_fname to create_private_open_data()

Not yet used.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a30825f2 by Ralph Boehme at 2020-05-21T05:23:30+00:00
vfs_aio_pthread: SMB_VFS_OPEN() is called with cwd=parent directory of the file

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ef17a408 by Ralph Boehme at 2020-05-21T05:23:30+00:00
vfs_aio_pthread: avoid parent_smb_fname()

opd->dname was only needed for debug messages, use opd->fsp_name for that. And
opd->fname can be just made a copy of smb_fname. This avoids calling
parent_smb_fname().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
84cf205f by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: rename open_internal_dirfsp_at() to open_internal_dirfsp()

Having removed the unused dirfsp parameter this is not an AT function. Security
is provided by symlink safe fd_open().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8883dacb by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: rename create_internal_dirfsp_at() to create_internal_dirfsp()

Having removed the unused dirfsp parameter this is not an AT function.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
95574894 by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: move fstat from create_internal_dirfsp() to open_internal_dirfsp()

The original idea of doing the fstat in create_internal_dirfsp() was to return
from the function with a valid file_id and that requires valid stat info.

However, as dirfsp->fh->fd will still be -1 at this point vfs_stat_fsp() will
fallback to path-based stat() which must be avoided.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
373d02da by Ralph Boehme at 2020-05-21T05:23:30+00:00
vfs: add dirfsp to struct files_struct

As fsp->fsp_name will be a AT-name in the future, we need something to retrieve
the full path for an fsp from for stuff like fsp_str_dbg().

As there are functions like vfs_stat_fsp() that have internal fallbacks to
path-based VFS functions if fsp->fh->fh == -1, having the original dirfsp as
part of the fsp helps in converting the internal VFS functions to AT versions.

In the future when all such internal fallbacks are eliminated we can remove
fsp->dirfsp to avoid the additional fd per fsp and use a fsp->path or similar.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1736ef26 by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: add flag "is_dirfsp" to the fsp_flags

This denotes pure VFS layer dirfsps that are used in *AT varients of VFS
interface functions and which bypass the FSA layer, requiring special handling
in codepaths closing/freeing the fsp.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a947b67d by Ralph Boehme at 2020-05-21T05:23:30+00:00
smbd: handling of fsp->dirfsps in close_file()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
44cd4159 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: add dirfsp arg to SMB_VFS_CREATE_FILE()

As create_file_default() still need to be updated in the future to replace the
SMB_VFS_STAT() calls with AT-based versions, it asserts (dirfsp ==
dirfsp->conn->cwd_fsp).

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
12b28445 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: realign create_file_unixpath() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9f5fd738 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: pass dirfsp to create_file_unixpath()

As the calls to

* lease_match()
* open_streams_for_delete()
* check_base_file_access
* SMB_VFS_STAT

and others needs to be updated to work with atnames in the
future, we assert (dirfsp == conn->cwd_fsp).

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
227e14ac by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: realign args in calls to open_directory()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1f581fb3 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: pass dirfsp to open_directory()

As the calls to

* SMB_VFS_LSTAT()
* get_share_mode_lock()

and maybe others still have to be updated to work with atnames, we
assert (dirfsp == conn->cwd_fsp).

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
67373681 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: use dirfsp in open_directory()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0ca3f13b by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: set fsp->dirfsp in open_directory()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
31a4a3a5 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: pass dirfsp to mkdir_internal()

Not really used for now and marked with

SMB_ASSERT(dirfsp == conn->cwd_fsp)

because it needs to be updated later to work with real dirfsp.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0591904b by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: fix SMB_VFS_MKDIRAT() arg alignment in mkdir_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
435a19ea by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: fix check_parent_access() args alignment in mkdir_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
68b28275 by Ralph Boehme at 2020-05-21T05:23:31+00:00
smbd: use dirfsp in mkdir_internal()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5a7ce143 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: set fsp->dirfsp in create_file_unixpath()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4ae6e5f0 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: set dirfsp in the SMB2 DH reconnect

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
dd4d4f81 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: assert (fsp->dirfsp == conn->cwd_fsp) in open_file_ntcreate()

There's a bunch of stuff that needs updating to work with atnames.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a77f28dc by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: remove redundant conn arg from open_file()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5c67a3e8 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: realign args to open_file() in open_file_ntcreate()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
134114aa by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: realign args to fd_open_atomic() in open_file()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
02f744a5 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: realign fd_open_atomic() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c0551b22 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: remove redundant conn arg from fd_open_atomic()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f4b37191 by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: remove redundant conn arg from fd_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f22bf66f by Ralph Boehme at 2020-05-21T05:23:32+00:00
smbd: realign non_widelink_open() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d708d002 by Ralph Boehme at 2020-05-21T06:43:04+00:00
smbd: remove redundant conn arg from non_widelink_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Thu May 21 06:43:04 UTC 2020 on sn-devel-184

- - - - -
19a1ed2c by Ralph Boehme at 2020-05-21T20:38:31+00:00
s3/vfs: add vfs_at_fspcwd()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d3c16d93 by Ralph Boehme at 2020-05-21T20:38:31+00:00
vfs_fruit: pass down cwdfsp as dirfsp in fruit_open()

Not yet used, that comes when we add fruit_openat(). Passing cwdfsp as dirfsp
ensures when calling openat() we get the same behaviour as open().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e4a38916 by Ralph Boehme at 2020-05-21T20:38:31+00:00
vfs: add SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
dc061a23 by Ralph Boehme at 2020-05-21T20:38:31+00:00
vfs_aio_pthread: realign create_private_open_data args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9bb9d6d1 by Ralph Boehme at 2020-05-21T20:38:31+00:00
vfs_aio_pthread: realign create_private_open_data() args

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
42858577 by Ralph Boehme at 2020-05-21T20:38:31+00:00
vfs_aio_pthread: add dirfsp arg to create_private_open_data()

Prepares for an upcoming aio_pthread_openat_fn(). open_async() passes fspcwd.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bae76f86 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_aio_pthread: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e7b42183 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_audit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
01d949bc by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_cap: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f9ef244e by Jeremy Allison at 2020-05-21T20:38:32+00:00
s3: VFS: catia: Change saved_errno to catia_saved_errno in a macro.

This is a common variable name.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6efb7013 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_catia: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
605c0b3a by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_ceph: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
06e14449 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_ceph_snapshots: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9173b5fd by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_commit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
39b2da61 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_default: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8aff66d4 by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_error_inject: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
104302ae by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_extd_audit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
df7882dd by Ralph Boehme at 2020-05-21T20:38:32+00:00
vfs_full_audit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d14696f1 by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_shadow_copy2: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
07cb0b40 by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_time_audit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c71215bd by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_widelinks: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3ca5297a by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_fruit: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
712cd71f by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_glusterfs: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
91b7ef1c by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_gpfs: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
01f83451 by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_media_harmony: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d93d7318 by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_prealloc: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3e5cb65f by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_preopen: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6bd62377 by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_snapper: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
dcddc45c by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_streams_depot: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
35765b8f by Ralph Boehme at 2020-05-21T20:38:33+00:00
vfs_streams_xattr: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6939beac by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_syncops: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
739e100f by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_unityed_media: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7d0616f5 by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_virusfilter: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
87b2ab8f by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_xattr_tdb: implement SMB_VFS_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
86ddd925 by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_fruit: use SMB_VFS_NEXT_OPENAT()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a912c1d8 by Jeremy Allison at 2020-05-21T20:38:34+00:00
s3: VFS: fruit. Now we've gotten rid of SMB_VFS_OPEN(), add const to the functions called by fruit_openat().

Remove the hack that allowed openat() to call non-const functions.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
643a441e by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs_shadow_copy2: use SMB_VFS_NEXT_OPENAT() in shadow_copy2_get_shadow_copy_data()

These are paths not under user control, so it should be safe to call it with
AT_FDCWD and multi-component paths.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c57d76ec by Ralph Boehme at 2020-05-21T20:38:34+00:00
smbd: use SMB_VFS_OPENAT() in non_widelink_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1304fd92 by Ralph Boehme at 2020-05-21T20:38:34+00:00
s3/pysmbd: use SMB_VFS_OPENAT() in init_files_struct()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b1d8bb6a by Ralph Boehme at 2020-05-21T20:38:34+00:00
s3/torture: use SMB_VFS_OPENAT() in cmd_open()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1a3cf6ba by Ralph Boehme at 2020-05-21T20:38:34+00:00
s3/torture: use SMB_VFS_OPENAT() in cmd_set_nt_acl()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
32588c02 by Ralph Boehme at 2020-05-21T20:38:34+00:00
vfs: remove SMB_VFS_OPEN()

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
eaf1c6a3 by Ralph Boehme at 2020-05-21T20:38:35+00:00
smbd: add fd_openat()

Until we actually start passing real dirfsps to fd_openat(), fd_openat()
internally calls fd_open().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
75d6943e by Ralph Boehme at 2020-05-21T20:38:35+00:00
smbd: use fd_openat()

This leaves basically two callers of fd_open():

* open_internal_dirfsp_at()
* smbd_smb2_query_directory_send()

Those will be the only codepaths that use full paths relative to the share root
and so require and use the symlink race protection provided by
non_widelink_open().

Of course, until we actuall start passing real dirfsps to fd_openat(),
fd_openat() internally calls fd_open().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
76118b48 by Ralph Boehme at 2020-05-21T20:38:35+00:00
smbd: prepare fsp_str_dbg() for atnames

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c68133d4 by Ralph Boehme at 2020-05-21T22:01:25+00:00
smbd: prepare DH disconnect for AT-names

This ensure cookie.base_name is set to the full path to deal with fsp->fsp_name
being an atname in the future.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu May 21 22:01:25 UTC 2020 on sn-devel-184

- - - - -
c28914bf by Martin Schwenke at 2020-05-22T06:41:44+00:00
ctdb-build: Fix a typo

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

- - - - -
21b9844b by Martin Schwenke at 2020-05-22T06:41:44+00:00
ctdb-daemon: Add separate hot keys array for database statistics

There are 2 reasons for this.  Sorting of hot keys is broken and will
be changed to an implementation that needs a named (i.e. not
anonymous) structure.  Also, at least one non-protocol field will be
added to facilitate more useful logging.

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

- - - - -
f9f60c2a by Martin Schwenke at 2020-05-22T06:41:44+00:00
ctdb-daemon: Switch some variables to unsigned

These should be unsigned but luck is currently on our side.

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

- - - - -
1ab39b32 by Martin Schwenke at 2020-05-22T06:41:44+00:00
ctdb-daemon: Fix bug in slot 0 comparison optimisation

This is only valid if all slots are in use.

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

- - - - -
baf058dc by Martin Schwenke at 2020-05-22T06:41:44+00:00
ctdb-daemon: Update hot key logging

This message indicates that a hot key was added, so say that.  After
all the hot key slots have been filled the id will always be 0, so
don't bother logging it.

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

- - - - -
5c8dfbbf by Martin Schwenke at 2020-05-22T06:41:45+00:00
ctdb-daemon: Add extra logging of hot keys

ctdbd currently only logs when a new hot key is added.  If a key gets
hotter then nothing new is logged.

Log hot key updates when the number of migrations has doubled since
the last time that key was logged.

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

- - - - -
53b73b9b by Martin Schwenke at 2020-05-22T06:41:45+00:00
ctdb-daemon: Fix sorting of hot keys

The current code only ever swaps with slot 0.  This will only ever
happen with slots 0 and 1, so probably never sorts.

Replace with qsort().

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

- - - - -
fb382526 by Martin Schwenke at 2020-05-22T06:41:45+00:00
ctdb-tests: Update fetch_ring to take database and key on command line

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

- - - - -
1e55591b by Martin Schwenke at 2020-05-22T08:05:54+00:00
ctdb-tests: Add a new fetch ring test that also checks hot keys

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

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Fri May 22 08:05:54 UTC 2020 on sn-devel-184

- - - - -
10b195fe by Andreas Schneider at 2020-05-24T23:55:36+00:00
gitlab-ci: Create a single samba-fips runner

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f133019d by Björn Jacke at 2020-05-24T23:55:36+00:00
replace, attr.: use function attributes only if supported by feature macro (or old gcc)

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

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
22870830 by Björn Jacke at 2020-05-24T23:55:36+00:00
tdb: also use __has_attribute macro to check for attribute support

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2f75b35e by Björn Jacke at 2020-05-24T23:55:36+00:00
talloc: also use portable __has_attribute macro to check for attribute support

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a4041ee6 by Björn Jacke at 2020-05-24T23:55:36+00:00
ldb: also use portable __has_attribute macro to check for attribute support

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
ebdacf18 by Samuel Cabrero at 2020-05-24T23:55:36+00:00
selftest: Add test for handle types

The test is written for SAMR, but as the handle type is verified by the
server core library it also applies to other RPC services.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
72f73efd by Samuel Cabrero at 2020-05-24T23:55:36+00:00
librpc: core: Move the s4 handles implementation to the RPC server core

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
711ca4fa by Samuel Cabrero at 2020-05-24T23:55:36+00:00
s3: rpc_server: Strip out access check field from s3 handles implementation

The handle based security model is a SAMR specific feature. The access
granted is stored in the handle's associated data after creating it and
the access is verified after searching the handle.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
da9749ac by Samuel Cabrero at 2020-05-24T23:55:36+00:00
s3: rpc_server: pass DCE/RPC handle type to find_policy_handle

Following changes in commit c7a4578d06427a82ead287f0c5248c1a54cc9336
pass the handle type to the handle search functions. The handle type will
be verified unless passing DCESRV_HANDLE_ANY to find functions.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2bde4076 by Samuel Cabrero at 2020-05-24T23:55:36+00:00
s3: rpc_server: Remove SAMR specific policy_handle_create() function

Now that we pass the handle type to the generic handle creation and find
functions we can drop the specific SAMR ones.

The policy_handle_create() function labeled the talloc chunk used to
allocate the handle's associated data, and the policy_handle_find() is
checking the name matches with the expected data. The check is performed
now by the generic functions based on the handle type so we can drop
these SAMR specific functions.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7273b4bc by Samuel Cabrero at 2020-05-24T23:55:36+00:00
s3: rpc_server: Move SAMR handle based access check to a wrapper function

Now that the type associated to the handle is the same for all handle
types we can wrap the access check.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
be024932 by Samuel Cabrero at 2020-05-24T23:55:36+00:00
s3: rpc_server: Remove SAMR specific policy_handle_find() function

The generic function already checks the handle type.

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f98b3b6f by Samuel Cabrero at 2020-05-24T23:55:37+00:00
pidl: Set dce_call in pipes_struct before dispatching call

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
70fa7e81 by Samuel Cabrero at 2020-05-24T23:55:37+00:00
s3: rpc_server: Drop s3 rpc handles implementation

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
10cea64e by Samuel Cabrero at 2020-05-24T23:55:37+00:00
s3: rpc_server: Remove dead code

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
6edcf680 by Samuel Cabrero at 2020-05-24T23:55:37+00:00
s3: rpc_server: Avoid casts calling to find_policy_by_hnd()

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
e05e9df7 by Matt Taylor at 2020-05-24T23:55:37+00:00
build: quota wscript error message spelling fix

Signed-off-by: Matt Taylor <liverbugg at rinux.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7ae03a19 by Matt Taylor at 2020-05-25T01:16:46+00:00
build: add configure option to control vfs_snapper build

vfs_snapper is currently built if dbus development headers / libraries
are detected during configure. This commit adds new --disable-snapper
and --enable-snapper (default) configure parameters. When enabled,
configure will fail if the dbus development headers / libraries are
missing.

Signed-off-by: Matt Taylor <liverbugg at rinux.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Mon May 25 01:16:46 UTC 2020 on sn-devel-184

- - - - -
66caa6b2 by Volker Lendecke at 2020-05-25T08:13:27+00:00
libsmb: Align calls to SMBC_dlist_contains()

Everywhere else it's called as !SMBC_dlist_contains()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
20b99b03 by Volker Lendecke at 2020-05-25T08:13:27+00:00
libsmb: Make SMBC_dlist_contains return bool

It returned True/False, and is used as boolean only. Modernize
formatting a bit.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4734b64e by Volker Lendecke at 2020-05-25T08:13:27+00:00
libsmb: Simplify callers of SMBC_dlist_contains()

This function already does the NULL check on the file pointer

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
abff0c5e by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Remove a pointless ZERO_STRUCT()

"c" is a pointer that was initialized to NULL above

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
abf9d1d7 by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Use IS[DOT]DOT

strequal is not necessary here

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c52a05d7 by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Avoid casts

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
52d4825a by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Remove some lines that were never used

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
3cc45aae by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f34dd442 by Volker Lendecke at 2020-05-25T08:13:28+00:00
torture3: Remove some ancient unused code

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4487ba9c by Volker Lendecke at 2020-05-25T08:13:28+00:00
libsmb: Remove unused cli_errstr()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
da766db4 by Volker Lendecke at 2020-05-25T09:36:15+00:00
libsmb: Apply some const to parse_finfo_id_both_directory_info()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon May 25 09:36:15 UTC 2020 on sn-devel-184

- - - - -
b2e41836 by David Mulder at 2020-05-26T09:56:39+00:00
s3-net: disable net_ads_gpo_apply() and net_ads_gpo_refresh()

These are now handled in samba-gpupdate, and the
net ads gpo refresh has not worked for some time.

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
c40e354f by Stefan Metzmacher at 2020-05-26T11:22:07+00:00
libgpo: Remove unused code

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue May 26 11:22:07 UTC 2020 on sn-devel-184

- - - - -
7754a557 by Jeremy Allison at 2020-05-26T21:35:55+00:00
s3: VFS: cap. Fixup mistake using the wrong parameter to capencode.

Caught by Coverity.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue May 26 21:35:55 UTC 2020 on sn-devel-184

- - - - -
d279cf7b by Andrew Bartlett at 2020-05-27T20:55:26+00:00
lib/util: Allow gdb to be started by samba_start_debugger() under the default Ubuntu restrictions

Ubuntu (in particular) restricts ptrace by default for security reasons
but the processe to be traced can allow tracing by a child process
using prctl().  This matches what is done for panic action =

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
bb912a48 by Andrew Bartlett at 2020-05-27T22:17:10+00:00
OID: Reserve 1.3.6.1.4.1.7165.777.x for use on the wiki

This allows us to handle some OIDs more freely and use them in example schema
without patching the main git repo each time.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Gary Lockyer <gary at samba.org>
Autobuild-Date(master): Wed May 27 22:17:10 UTC 2020 on sn-devel-184

- - - - -
6e6e0bc6 by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:cli_pipe: remove unused 'use_kerberos' from cli_rpc_pipe_open_generic_auth()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
84f04f90 by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:net: remove unused net_use_machine_account()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
715d8751 by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:net: always set ctx->opt_user_specified = true when we overwrite opt_user_name

If we force changing the used username we should make that clear.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
e7119198 by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:net: add net_context_creds() helper function

Pair-Programmed-With: Andreas Schneider <asn at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f6e0582e by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:net: avoid prompting for a password if --use-ccache is used

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
e8d71172 by Stefan Metzmacher at 2020-05-28T06:43:37+00:00
s3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ee4eab14 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:cli_pipe: improve debug messages in cli_rpc_pipe_open_with_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
1aaf32c3 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:cli_pipe: remove unused cli_rpc_pipe_open_generic_auth()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
bec9c47c by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
examples/fuse/smb2mount: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f399e7e6 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:rpcclient: make use of get_cmdline_auth_info_creds() in cmd_spoolss.c

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
a72cac6b by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:mdfind: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f8275387 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:smbcquotas: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
16fbb196 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:smbcacls: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
24653012 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:libsmb: make use of get_cmdline_auth_info_creds() in get_ipc_connect()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2079a8f8 by Andreas Schneider at 2020-05-28T06:43:38+00:00
s3:rpcclient: Rename creds to trust_creds

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
b0c06861 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:rpcclient: Use get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
f563d009 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:rpc_server/spoolss: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4fb99f92 by Stefan Metzmacher at 2020-05-28T06:43:38+00:00
s3:libnet_join: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
cf142ab6 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
b7c366f1 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:net: make use of net_context_creds() in connect_to_service()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
ceaa3ead by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:netlookup: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
b610549d by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libnet_join: call cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
719a2f58 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:net: make use of net_context_creds() in net_ads_printer_publish()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2723a8ed by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:locktest2: use cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ff2123d4 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb_server: don't use auth related flags in SMBC_server_internal()

These are ignored at the lower levels if we're passing cli_credential
structures along.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
cf041240 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb_server: split out SMBC_auth_credentials() helper

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4386986f by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4f373395 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb_server: fix error handling in SMBC_server_internal()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0b3e3311 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb: remove unused cli_cm_force_encryption()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0de5c488 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:libsmb: remove unused cli_full_connection()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0c742ee2 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:smbspool: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f66f4788 by Stefan Metzmacher at 2020-05-28T06:43:39+00:00
s3:torture: don't use CLI_FULL_CONNECTION_USE_KERBEROS in open_nbt_connection()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f2087876 by Stefan Metzmacher at 2020-05-28T06:43:40+00:00
s3:rpcclient: avoid using auth related CLI_FULL_CONNECTION_* flags

We use get_cmdline_auth_info_creds() and pass cli_credentials arround.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
d15c6a0d by Stefan Metzmacher at 2020-05-28T06:43:40+00:00
examples/fuse/smb2mount: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
bae35ebc by Stefan Metzmacher at 2020-05-28T08:04:12+00:00
s3:libsmb: remove finally unused credential flags

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu May 28 08:04:12 UTC 2020 on sn-devel-184

- - - - -
652b7333 by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Remove an outdated comment

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3cf84f0e by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Trim #includes

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
2c6138f4 by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Remove clistr_pull_talloc()

This was just a 1:1 wrapper around pull_string_talloc()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5c8312f8 by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Use async cli_smb2_unlink in async cli_unlink

No need to call the sync wrapper in cli_unlink()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f8eb7545 by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a92a4324 by Volker Lendecke at 2020-05-28T19:11:38+00:00
libsmb: Remove sync cli_smb2_unlink()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1692b8a6 by Volker Lendecke at 2020-05-28T19:11:38+00:00
pylibsmb: Use async cli_unlink also for smb2

Async cli_smb2_unlink was just added

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c164c036 by Volker Lendecke at 2020-05-28T19:11:38+00:00
smbclient: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e4b7d590 by Volker Lendecke at 2020-05-28T19:11:38+00:00
smbclient: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
535731a2 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Reformat calls to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
eec64f24 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
41ff5579 by Volker Lendecke at 2020-05-28T19:11:39+00:00
smbcacls: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
358ad280 by Volker Lendecke at 2020-05-28T19:11:39+00:00
smbcacls: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d9027c56 by Volker Lendecke at 2020-05-28T19:11:39+00:00
smbcacls: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ecc25735 by Volker Lendecke at 2020-05-28T19:11:39+00:00
smbcacls: Fix typo "inherated"->"inherited"

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fe1e4dc9 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Use async cli_smb2_rmdir in async cli_rmdir

No need to call the sync wrapper in cli_rmdir()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
81a491dc by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
19bb7b00 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Remove sync cli_smb2_rmdir()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
825948c7 by Volker Lendecke at 2020-05-28T19:11:39+00:00
pylibsmb: Use async cli_rmdir also for smb2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fafdb5e3 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Add async cli_smb2_chkpath_send/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c4bf5b23 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Use async cli_smb2_chkpath in async cli_chkpath

No need to call the sync wrapper in cli_chkpath()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
44875bda by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Remove sync cli_smb2_chkpath()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e724c51d by Volker Lendecke at 2020-05-28T19:11:39+00:00
pylibsmb: Use async cli_chkpath also for smb2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9b598a28 by Volker Lendecke at 2020-05-28T19:11:39+00:00
libsmb: Add async cli_smb2_mkdir_send()/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
93675b4f by Volker Lendecke at 2020-05-28T19:11:40+00:00
libsmb: Use async cli_smb2_mkdir in async cli_mkdir

No need to call the sync wrapper in cli_mkdir()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
99ced4cc by Volker Lendecke at 2020-05-28T19:11:40+00:00
libsmb: Remove sync cli_smb2_mkdir()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0b6debbb by Volker Lendecke at 2020-05-28T19:11:40+00:00
pylibsmb: Use async cli_mkdir also for smb2

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5c918d40 by Volker Lendecke at 2020-05-28T20:35:41+00:00
libsmb: Use tevent_req_received() in cli_qfileinfo_recv()

That takes care of doing the early talloc_free(state)

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu May 28 20:35:41 UTC 2020 on sn-devel-184

- - - - -
7f16ecc5 by Volker Lendecke at 2020-05-29T08:34:31+00:00
torture3: Check error code for quotactl on a non-quota file handle

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
d18c7666 by Volker Lendecke at 2020-05-29T09:55:10+00:00
smbd: Protect smbd_smb2_getinfo_send() against invalid quota files

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Fri May 29 09:55:10 UTC 2020 on sn-devel-184

- - - - -
b0b73253 by Isaac Boukris at 2020-05-29T12:11:28+00:00
Add a test to check dNSHostName with netbios aliases

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
aa098532 by Isaac Boukris at 2020-05-29T12:11:29+00:00
Fix accidental overwrite of dnsHostName by the last netbios alias

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
1df7604b by Isaac Boukris at 2020-05-29T12:11:29+00:00
Refactor ads_keytab_add_entry() to make it iterable

so we can more easily add msDS-AdditionalDnsHostName entries.

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
97cd636d by Isaac Boukris at 2020-05-29T12:11:29+00:00
Add a test for msDS-AdditionalDnsHostName entries in keytab

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
2b62bd51 by Isaac Boukris at 2020-05-29T12:11:29+00:00
Add msDS-AdditionalDnsHostName entries to the keytab

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
ce0e96e6 by Isaac Boukris at 2020-05-29T13:33:28+00:00
Add net-ads-join dnshostname=fqdn option

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri May 29 13:33:28 UTC 2020 on sn-devel-184

- - - - -
8c254d84 by Ralph Boehme at 2020-05-29T18:38:40+00:00
smbd: remove dead code

LINKS_READ_ONLY is not defined anywhere since ages.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cbe80cee by Ralph Boehme at 2020-05-29T20:02:55+00:00
smbd: don't free smb_fname_parent in unix_mode()

The TALLOC_FREEs should have been removed as part of
45a560bce3ef06c211e60e3932521303cc396896. Sorry!

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri May 29 20:02:55 UTC 2020 on sn-devel-184

- - - - -
367c0d19 by Ralph Boehme at 2020-05-30T01:17:36+00:00
smbd: avoid become_user_without_service() in close_remove_share_mode()

Here we called become_user_without_service() just in order to be able to fetch
the nt_token and unix_token subsequently via
get_current_[nt|u]tok(conn). The same can be achieved by fetching the
session_info with smbXsrv_session_info_lookup().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3d099937 by Ralph Boehme at 2020-05-30T01:17:36+00:00
smbd: avoid become_user_without_service() in close_directory()

Here we called become_user_without_service() just in order to be able to fetch
the nt_token and unix_token subsequently via get_current_[nt|u]tok(conn). The
same can be achieved by fetching the session_info with
smbXsrv_session_info_lookup().

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
792c82d6 by Ralph Boehme at 2020-05-30T01:17:36+00:00
smbd: RIP conn->origpath

conn->origpath is always a duplicate of conn->connectpath.

The only function that sets conn->connectpath is set_conn_connectpath() and
everywhere it's called, there's a subsequent talloc_strdup() into
conn->origpath.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b7e77ce3 by Ralph Boehme at 2020-05-30T01:17:36+00:00
s3:auth: fill in info3 domain name in passwd_to_SamInfo3()

This is needed for make_session_info_from_username() to fill in the domain
name. The callchain goes like this:

make_session_info_from_username()
-> make_server_info_pw()
-> passwd_to_SamInfo3()

Other callers of passwd_to_SamInfo3() are also affected. A subsequent change
will let set_conn_force_user_group() user the domainname from the session_info
returned from make_session_info_from_username() to create substitution
context. Without this fix domain name would be NULL.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0b9ddce9 by Ralph Boehme at 2020-05-30T01:17:36+00:00
libcli: simplify an if condition

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c14a95dc by Ralph Boehme at 2020-05-30T02:40:22+00:00
smbd: simplify uid_entry_in_group()

conn->session_info is always valid since
1fa05e5c76e718142326915f8671299217a093df and preceeding commits.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat May 30 02:40:22 UTC 2020 on sn-devel-184

- - - - -
1ded80ae by David Disseldorp at 2020-06-03T03:57:12+00:00
s3/rpc_server: remove unnecessary srv_fss_agent.h header

The srv_fssa_start() / _cleanup() functions are called via the
DCESRV_INTERFACE_FILESERVERVSSAGENT_INIT / SHUTDOWN_SERVER hooks,
so needn't be public.

Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Reviewed-by: Samuel Cabrero <scabrero at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Jun  3 03:57:12 UTC 2020 on sn-devel-184

- - - - -
3063e160 by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: libsmb: Info level SMB2_FIND_ID_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Fix the SMB2 parsing code.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5e3e6c4c by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
be52f87c by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: libsmb: Info level SMB_FIND_INFO_STANDARD encodes attibutes as a uint16, not a uint8.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
6463f261 by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: libsmb: Info level SMB_FIND_EA_SIZE encodes attibutes as a uint16, not a uint8.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
84134812 by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: torture: Add a MSDFS-ATTRIBUTE test.

Framework to drive comes next.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
2a470512 by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: torture: Add test for getting attibutes on an MSDFS link.

Mark as knownfail for now.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
65b8c0cf by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: VFS: Change the function signature for SMB_VFS_READ_DFS_PATHAT() to take a non-const smb_filename.

Otherwise there's no good way to return proper stat(2) information
for a DFS link without making assumptions it's a symlink store.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c4f5dfee by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: VFS: cap. Ensure read_dfs_pathat() returns stat info.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
d9f5e365 by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: VFS: catia. Ensure read_dfs_pathat() returns stat info.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
5e9e7e2d by Jeremy Allison at 2020-06-03T04:54:38+00:00
s3: VFS: ceph. Ensure read_dfs_pathat() returns stat info.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
636c8374 by Jeremy Allison at 2020-06-03T04:54:39+00:00
s3: VFS: gluster. Ensure read_dfs_pathat() returns stat info.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
50cb3ef0 by Jeremy Allison at 2020-06-03T04:54:39+00:00
s3: VFS: shadow_copy2. Ensure read_dfs_pathat() returns stat info.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
ab018150 by Jeremy Allison at 2020-06-03T06:19:21+00:00
s3: VFS: default. Ensure read_dfs_pathat() returns stat info.

Remove the knownfail.d/msdfs-attr file.

Everything now passes.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Jun  3 06:19:21 UTC 2020 on sn-devel-184

- - - - -
887b09f1 by Andrew Bartlett at 2020-06-03T15:55:10+00:00
Update SECURITY.md to point to security releases

Signed-off-by: Andrew Bartlet <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Jun  3 15:55:10 UTC 2020 on sn-devel-184

- - - - -
469aaaea by Jeremy Allison at 2020-06-04T17:11:36+00:00
examples: clifuse: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
8db0ba66 by Jeremy Allison at 2020-06-04T17:11:36+00:00
s3: libsmb: In struct file_info rename mode -> attr.

Cleanup.  It's never been a UNIX mode, always a DOS attribute field.
Make that explicit.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
14894dce by Jeremy Allison at 2020-06-04T17:11:36+00:00
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
ab59d5b5 by Jeremy Allison at 2020-06-04T17:11:36+00:00
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
a5f5cbc2 by Jeremy Allison at 2020-06-04T17:11:36+00:00
s3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
8db68d74 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change size of finfo->attr to uint32_t.

That's what modern servers return.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
97fa1bc9 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter from mode -> pattr.

Also rename attr pointers to pattr.

They are pointers to attributes.

Only parameter name changes, no logic changes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
60758ca4 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.

They are attributes, not unix modes.

Once they have the right name, we can start moving all uses to uint32_t.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
62389689 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.

Will make it easier to move to 32 bit attributes later.

No logic changes, just a rename.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
bac7442a by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: smbclient: Rename mode parameter to attr.

This is a DOS attribute, not a UNIX mode.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
054ff63a by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t attribute.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
9305039f by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
808d873c by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
d29884e7 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.

Fix all callers. All libsmb SMB2 calls now return 32 bit attributes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
b34107f9 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e2726bed by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
2f1fbb67 by Jeremy Allison at 2020-06-04T17:11:37+00:00
s3: libsmb: Rename uint16_t attr -> sattr (short attributes).

This will make it easier to add 32-bit attr value later.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
ad5d5d94 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
3849ceaa by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
e527ccd2 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
83493d47 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.

Only used in torture.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
30b3475f by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names mode -> attr.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
2d6b1ef7 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_smb2_setatr() to use 32-bit attributes.

The SMB_SET_FILE_BASIC_INFO info level this uses in SMB2
sets 32-bit attributes, so don't use SSVAL, use SIVAL.

No change needed in callers as implicit casts work fine.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
8ae2851e by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Make cli_list_old() take 32-bit attribute.

Only uses 16 on the wire. No change needed in callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
fe3879b3 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Make cli_list_trans() and cli_list take a 32-bit attribute.

All sub-functions take 32-bits, and all callers now are
compatible with 32-bit attributes.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
8ad8a8f7 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.

Fix the callers. Only sets 16 bits on the wire for this level.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
39b42f04 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_setpathinfo_ext() to take 32-bit attributes.

Fix the callers. Note the special casing of mapping (uint16)-1 -> (uint32_t)-1
in SMBC_setatr() where we can't change the ABI.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
98d5efd3 by Jeremy Allison at 2020-06-04T17:11:38+00:00
s3: libsmb: Change cli_setfileinfo_ext() and async version to take a uint32_t attr.

Fix all callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
2eb1a7f1 by Jeremy Allison at 2020-06-04T17:11:39+00:00
s3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.

Fix the callers.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
7c3f3add by Jeremy Allison at 2020-06-04T17:11:39+00:00
s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an old protocol send.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
199a7343 by Jeremy Allison at 2020-06-04T17:11:39+00:00
s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an old protocol send.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
c7e3a003 by Jeremy Allison at 2020-06-04T17:11:39+00:00
s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned on SMB1 out-of-range attribute use.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
f607172e by Jeremy Allison at 2020-06-04T17:11:39+00:00
s3: client. Move to all 32-bit attributes in smbclient.

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
4d1a84b3 by Volker Lendecke at 2020-06-04T17:11:39+00:00
libsmb: Add async cli_qfileinfo_basic

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bc7fc08f by Volker Lendecke at 2020-06-04T17:11:39+00:00
torture3: Use cli_qfileinfo_basic() in run_posix_append()

Only Samba does the SMB1 posix extensions, and we do the "advanced"
trans-based call.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b56cc5bf by Volker Lendecke at 2020-06-04T17:11:39+00:00
net: Copy hires timestamps in net_copy_fileattr()

In this routine we're using cli_ntcreate, so I would assume the hires
timestamp calls to be available. My goal is to reduce the use of the
second-resolution calls and potentially push their fallback use into
clifile.c.

Only tested manually.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c90d3df4 by Volker Lendecke at 2020-06-04T17:11:39+00:00
net: Align integer types, move variable closer to its use

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1a14d8cf by Volker Lendecke at 2020-06-04T17:11:39+00:00
libsmb: Use SMBgetattrE in cli_qfileinfo_basic_send() if necessary

This is a behaviour change: Before this patch, independent of the actual
protocol we tried to do the trans2 getinfo call. All the remaining callers just
do a direct fallback to SMBgetattrE when that fails without even looking at the
error code. Here we deterministically decide after the negotiated protocol
which flavour to use without a fallback.

It *might* be relevant for very old embedded systems that we don't know, but if
we break something we can easily fix it.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
29866ad7 by Volker Lendecke at 2020-06-04T17:11:39+00:00
libsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users

cli_qfileinfo_basic() now takes care of this centrally

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
068c7f4d by Volker Lendecke at 2020-06-04T17:11:39+00:00
libsmb: Remove unused sync version of cli_getattrE()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
34e2881b by Volker Lendecke at 2020-06-04T17:11:40+00:00
libsmb: Make qfileinfo_basic available for smb2 in async mode

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ee40012f by Volker Lendecke at 2020-06-04T17:11:40+00:00
pylibsmb: Use cli_qfileinfo_basic_send() in py_smb_filesize()

This now does all protocols asynchronously

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ba8ba883 by Volker Lendecke at 2020-06-04T17:11:40+00:00
libsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()

This was the only remaining user of cli_smb2_getattrE(), and as
cli_qfileinfo_basic() now does all protocols, we can get rid of
cli_smb2_getattrE().

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cedbe17c by Volker Lendecke at 2020-06-04T17:11:40+00:00
libsmb: Remove unused cli_smb2_getattrE()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8a3556d0 by Volker Lendecke at 2020-06-04T17:11:40+00:00
torture3: Fix a debug message

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f619c611 by Volker Lendecke at 2020-06-04T17:11:40+00:00
libsmb: Use cli_qfileinfo_basic() in cli_smb2_qpathinfo2()

Last user of cli_smb2_qfileinfo_basic().

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6f1db2d1 by Volker Lendecke at 2020-06-04T18:36:17+00:00
libsmb: Remove unused cli_smb2_qfileinfo_basic()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Jun  4 18:36:17 UTC 2020 on sn-devel-184

- - - - -
824fa5f4 by Björn Baumbach at 2020-06-05T10:32:30+00:00
python: fix slow's mail address

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

- - - - -
d159b4c0 by Björn Baumbach at 2020-06-05T10:32:31+00:00
s4-auth/unix_token: separate out filling the unix_info elements in a struct session_info

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

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

- - - - -
bde136a2 by Björn Baumbach at 2020-06-05T10:32:31+00:00
s4-auth/unix_token: add new function auth_session_info_set_unix()

Used to fill the unix info in a struct auth_session_info similar to
auth_session_info_fill_unix().

The new auth_session_info_set_unix() receives the uid and gid for
the unix token as an parameter. It does not query the unix token from
winbind (via security_token_to_unix_token()).
This is useful to fill a user session info manually if winbind is not
available.

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

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

- - - - -
d72a512e by Björn Baumbach at 2020-06-05T10:32:31+00:00
pyauth: add python binding for auth_session_info_set_unix()

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

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

- - - - -
efea16f3 by Björn Baumbach at 2020-06-05T10:32:31+00:00
python/samba/provision: set unix session info for user session, used for sysvol acl reset

The unix session info is required and expected by e.g. many vfs
modules. Missing unix session info leads to samba panic.

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

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

- - - - -
26fd73de by Björn Baumbach at 2020-06-05T10:32:31+00:00
tests/pysmbd: fill session unix info in ntacl tests

Valid unix info is required.

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

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

- - - - -
72d69eef by Björn Baumbach at 2020-06-05T11:54:06+00:00
pysmbd: make sure that session unix info is filled

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

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

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Fri Jun  5 11:54:06 UTC 2020 on sn-devel-184

- - - - -
05e14173 by Stefan Metzmacher at 2020-06-05T13:17:55+00:00
s4:torture:smb2: use delete-on-close in test_rw_invalid()

We test the limits here and leave a 16TB file with zeros.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Fri Jun  5 13:17:55 UTC 2020 on sn-devel-184

- - - - -
b458f8fb by Stefan Metzmacher at 2020-06-09T16:02:59+00:00
s3:libsmb: add a cache for cli_session_creds_prepare_krb5()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
- - - - -
9e922b75 by Andreas Schneider at 2020-06-09T16:02:59+00:00
talloc: Mark ptr of talloc_unlink() not as a tainted scalar

This should address a lot of issues reported by Coverity.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
- - - - -
7e36b1ec by Stefan Metzmacher at 2020-06-09T17:24:30+00:00
s3:libads: remove unused "GSSAPI" support

All AD servers support "GSS-SPNEGO". So we better
remove code that doesn't use gensec.

If we ever need this back we could use the
"gssapi_krb5_sasl" gensec module explicit
or just pass the SASL mech list to gensec.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue Jun  9 17:24:31 UTC 2020 on sn-devel-184

- - - - -
922bce26 by Martin Schwenke at 2020-06-09T19:46:37+00:00
util: Simplify input validation

It appears that snprintf(3) is being used for input validation.
However, this seems like overkill because it causes szPath to be
copied an extra time.  The mostly likely protections being sought
here, according to https://cwe.mitre.org/data/definitions/20.html,
look to be DoS attacks involving CPU and memory usage.  A simpler
check that uses strnlen(3) can mitigate against both of these and is
simpler.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>
- - - - -
847208cd by Martin Schwenke at 2020-06-09T19:46:37+00:00
util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD

NSS_BUFLEN_PASSWD is not defined on FreeBSD.  Use
sysconf(_SC_GETPW_R_SIZE_MAX) instead, as per POSIX.

Use a dynamically allocated buffer instead of trying to cram all of
the logic into the declarations.  This will come in useful later
anyway.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>
- - - - -
ddac6b2e by Martin Schwenke at 2020-06-09T21:07:24+00:00
util: Reallocate larger buffer if getpwuid_r() returns ERANGE

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Tue Jun  9 21:07:24 UTC 2020 on sn-devel-184

- - - - -
158cea3b by Andrew Bartlett at 2020-06-10T05:44:37+00:00
Remove "undocumented" target mentioned in configure script

This was left over from 12aed897ec688d5bc379690208e8b85158b8227f

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

- - - - -
cedd00fd by Andrew Bartlett at 2020-06-10T05:44:37+00:00
docs-xml: Remove references to building docs using Plucker

This was for Palm OS based handheld devices, Windows Mobile devices, and other PDAs...

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

- - - - -
ccb606c4 by Andrew Bartlett at 2020-06-10T05:44:37+00:00
docs-xml: Remove final references to Samba3-HOWTO and Samba3-ByExample

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

- - - - -
9392c3f8 by Andrew Bartlett at 2020-06-10T05:44:37+00:00
docs-xml: Remove references to inkscape (not used any more, no more SVG files)

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

- - - - -
4a3ed0d8 by Andrew Bartlett at 2020-06-10T05:44:37+00:00
docs-xml: Remove GNU TexInfo build

This does not build and is not a common or required format for
documentation any more.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

- - - - -
0208d5f6 by Andrew Bartlett at 2020-06-10T07:11:59+00:00
Add docs build to CI

We did not check we could actually build the HTML of the
Samba Developers guide and HTML of the manpages previously.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Jun 10 07:11:59 UTC 2020 on sn-devel-184

- - - - -
accbd9ee by Andreas Schneider at 2020-06-10T10:10:15+00:00
Revert "s3:libsmb: add a cache for cli_session_creds_prepare_krb5()"

This reverts commit b458f8fbb7febf3584fa648128b4e1dc764059f7.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Jun 10 10:10:16 UTC 2020 on sn-devel-184

- - - - -
f501881a by Anoop C S at 2020-06-10T19:08:40+00:00
vfs_default: Remove an unused data member

This was added as part of 7f7ce0ec2f3e3cfb46314e5ad3ea6b5c49085f1d but
never got consumed.

Signed-off-by: Anoop C S <anoopcs at redhat.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c5b10466 by David Disseldorp at 2020-06-10T19:08:40+00:00
dbwrap_rbt: support TDB_INSERT and TDB_MODIFY store flags

These flags provide insert-new and overwrite-existing record semantics
respectively.

Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
00a0da05 by David Disseldorp at 2020-06-10T19:08:40+00:00
s3/torture: use stack buffer for rbtree loop

Using the stack here simplifies the error paths.

Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
787092b5 by David Disseldorp at 2020-06-10T20:28:45+00:00
s3/torture: test rbtree TDB_INSERT and TDB_MODIFY flags

Confirm that record overwrite with TDB_INSERT and record insert with
TDB_MODIFY both fail with appropriate error values.

Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jun 10 20:28:45 UTC 2020 on sn-devel-184

- - - - -
fd60ab27 by Volker Lendecke at 2020-06-10T22:20:46+00:00
registry3: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
e343773a by Volker Lendecke at 2020-06-10T22:20:46+00:00
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0221337a by Volker Lendecke at 2020-06-10T22:20:46+00:00
vfs: Fix typos

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
675bb46a by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Align some integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9081138a by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Align integer types

gcc complained that the if-condition compared unsigned rb_size with a
signed value. Somehow through the arithmetic the uint16_t's got
promoted to integer.

Also, avoid some printf casts

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d71564e0 by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Do early return in do_list_helper().

Align integer types.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a10dbe17 by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Slightly simplify do_list()

Nonrecursive listing is just a special case of recursive
listing. do_list_helper() checks that.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a2243f75 by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Simplify do_list_helper()

Do an early return when we don't want to recurse

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
032105dd by Volker Lendecke at 2020-06-10T22:20:46+00:00
smbclient: Simplify the queue for recursive listing

We now have talloc and the DLIST macros. That simplifies things a bit.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
31753815 by Volker Lendecke at 2020-06-10T23:43:04+00:00
smbclient: Simplify do_list()

With the DLIST-based work queue we don't need to protect the "list
head" from reallocation anymore

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jun 10 23:43:04 UTC 2020 on sn-devel-184

- - - - -
c8080bbd by Björn Baumbach at 2020-06-11T01:21:30+00:00
s3-libads: use ldap_init_fd() to initialize a ldap session if possible

Use the known ip address of the ldap server to open the connection and
initialize the ldap session with ldap_init_fd().

This avoid unnecessary DNS lookups which might block or prevent the
successful connection.

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

Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
6095a4f0 by Isaac Boukris at 2020-06-11T02:48:58+00:00
kdc: allow checksum of PA-FOR-USER to be HMAC_MD5

even if the tgt session key uses different hmac.

Per [MS-SFU] 2.2.1 PA-FOR-USER the checksum is
always HMAC_MD5, and that's what windows 7 client
and MIT client send.

In heimdal both the client and kdc use the checksum of
the tgt key instead and therefore work with each other
but windows and MIT clients fail against heimdal KDC.

Windows KDC allows either checksum (HMAC_MD5 or from
tgt) so we should do the same to support all clients.

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Jun 11 02:48:58 UTC 2020 on sn-devel-184

- - - - -
eae301e1 by Rowland Penny at 2020-06-11T04:37:37+00:00
samba-tool dns query --help: Someone forgot 'PTR' from the list of record types

Signed-off-by: Rowland Penny <rpenny at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Jun 11 04:37:37 UTC 2020 on sn-devel-184

- - - - -
197f97bc by Isaac Boukris at 2020-06-12T20:42:38+00:00
selftest: add test for disallowed-forwardable server

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
8fdff19c by Isaac Boukris at 2020-06-12T20:42:38+00:00
heimdal: apply disallow-forwardable on server in TGS request

upstream commit: 839b073facd2aecda6740224d73e560bc79965dc

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
a823cc1e by Isaac Boukris at 2020-06-12T20:42:38+00:00
selftest: allow EncASRepPart to be encoded as EncTGSRepPart

that's how MIT kdc encodes it, clients accept both.

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
9b302a57 by Isaac Boukris at 2020-06-12T20:42:38+00:00
selftest: test forwardable flag in cross-realm tgt tickets

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
fb7dfdbe by Isaac Boukris at 2020-06-12T20:42:38+00:00
selftest: test forwardable flag in cross-realm with s4u2proxy

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
7655a029 by Isaac Boukris at 2020-06-12T22:10:34+00:00
db-glue.c: set forwardable flag on cross-realm tgt tickets

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

Match Windows behavior and allow the forwardable flag to be
set in cross-realm tickets. We used to allow forwardable to
any server, but now that we apply disallow-forwardable policy
in heimdal we need to explicitly allow in the corss-realm case
(and remove the workaround we have for it the MIT plugin).

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Jun 12 22:10:34 UTC 2020 on sn-devel-184

- - - - -
07856586 by Andrew Bartlett at 2020-06-12T22:11:43+00:00
Update README.contributing to point to new Contributing wiki page

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
8a08dc00 by Andrew Bartlett at 2020-06-12T22:11:43+00:00
Update README.md with more up to date information

In particular, point to the new Contribute page on the wiki

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
bfe4e84b by Andrew Bartlett at 2020-06-12T22:11:43+00:00
docs: Remove the statement about why we moved to Waf

This is not important for new users or developers, and has little useful information

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6446e86b by Andrew Bartlett at 2020-06-12T22:11:43+00:00
build: Put the note from the bottom of the old BUILD_SYSTEMS.txt somewhere useful

This statement on how we handle --with options is best placed near where
the options are set, so developers see it when trying to choose the
correct thing to do.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5ad6dcf2 by Andrew Bartlett at 2020-06-12T22:11:43+00:00
docs: Point to wiki Contribute page rather than samba-technical

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
ad7639a1 by Andrew Bartlett at 2020-06-12T22:11:43+00:00
Remove outdated install_with_python.sh

This was a cludge to help get past the need for Python on
the Samba build farm in particular.  We now need Python3
by default so clearly this has not been used in quite some
time so is safe to remove.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c433e177 by Andrew Bartlett at 2020-06-12T22:11:43+00:00
docs: protocolfreedom.org is no longer

It is just a random spam site now

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4aba00b5 by David Mulder at 2020-06-12T23:32:30+00:00
doc: Add markup to README.Coding for samba wiki links

Adding markup to the README.Coding allows us to
link to sections of the document from the samba
wiki and prevents documentation duplication.

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Jun 12 23:32:30 UTC 2020 on sn-devel-184

- - - - -
5c06ab83 by Douglas Bagnall at 2020-06-13T05:25:31+00:00
python: do not always import urllib

Only provision.py wants a function from urllib, but we were importing
it in samba.compat, which is imported by samba, mening that every
python script importing anything from samba took 40ms longer to start
up.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
2323ea6f by Douglas Bagnall at 2020-06-13T05:25:31+00:00
python: do not always import socket_server

This cost around 10ms for every Python script, and was only used in one
test.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3fb21ed1 by Douglas Bagnall at 2020-06-13T05:25:31+00:00
ldb/mod/paged_searches: cope with NULL control data

We won't get NULL data over ldap, but it can be set via 'local_oid:'.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
def6b65c by Douglas Bagnall at 2020-06-13T05:25:31+00:00
ldb/controls: avoid stealing our own stuff

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
e73c89f1 by Douglas Bagnall at 2020-06-13T05:25:31+00:00
ldb commandline: don't crash if a received control contains no data

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
0f6c8a75 by Douglas Bagnall at 2020-06-13T05:25:31+00:00
dsdb/mod/acl_util: do not deref NULL sd_flags control

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d827392f by Douglas Bagnall at 2020-06-13T06:50:11+00:00
replmd: slightly clarify a comment

it has been a long time since we introduced "control", so lets remind
ourselves which control it was.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Sat Jun 13 06:50:12 UTC 2020 on sn-devel-184

- - - - -
86008f5e by Volker Lendecke at 2020-06-15T17:59:38+00:00
net: Align integer types

"i" is used to loop over an int as well. Introduce an int helper
variable that is autoconverted without warnings

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b654f256 by Volker Lendecke at 2020-06-15T17:59:38+00:00
tsocket: Fix a typo

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
38814784 by Volker Lendecke at 2020-06-15T17:59:39+00:00
smbd: Fix typos

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1e7ff44f by Volker Lendecke at 2020-06-15T17:59:39+00:00
lib: Move a #define ip_equal_v4() to nmbd/nmbd.h

It's only used there

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1943e967 by Volker Lendecke at 2020-06-15T17:59:39+00:00
smbd: Reduce indentation in check_reduced_name()

No change in behaviour.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
d304341e by Volker Lendecke at 2020-06-15T17:59:39+00:00
smbd: Apply a bit of README.Coding to unix_convert()

Looking at that more closely right now...

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
7e73527a by Volker Lendecke at 2020-06-15T17:59:39+00:00
libcli: Slightly simplify smb2cli_req_recv() with an early return

One if-condition less

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c751c710 by Volker Lendecke at 2020-06-15T17:59:39+00:00
libcli: Move IO_REPARSE_TAG definitions to smb_constants.h

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
10d88310 by Volker Lendecke at 2020-06-15T17:59:39+00:00
libcli: Add tevent_req_received() calls to smb2cli_create_recv()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
9f7791a9 by Volker Lendecke at 2020-06-15T17:59:39+00:00
libsmb: Add overflow protection to symlink_reparse_buffer_marshall()

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
0c18e2fd by Volker Lendecke at 2020-06-15T17:59:39+00:00
lib: Remove an unused macro

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
1cb17b54 by Volker Lendecke at 2020-06-15T17:59:39+00:00
ldb: Avoid a cast (unsigned long long) in ldbmodify.c

We have %zu for size_t

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
a4f2b8da by Volker Lendecke at 2020-06-15T19:25:39+00:00
vfs: Move reparse point functions to util_reparse.c

Shamelessly copied from from Jeremy's smb2-unix branch :-)

No change in behaviour, but we will have to cope with reparse points in the
future.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Jun 15 19:25:40 UTC 2020 on sn-devel-184

- - - - -
6114a4a5 by Andreas Schneider at 2020-06-16T09:08:33+00:00
s3:rpc_server: Pass a pointer to add_filemeta()

Review with: git show -U10

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
155d9e0b by Andreas Schneider at 2020-06-16T09:08:33+00:00
s3:lib: Avoid a NULL pointer deref on log level 10

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
e7d49266 by Andreas Schneider at 2020-06-16T09:08:34+00:00
s3:notifyd: Check return value of lp_load_initial_only()

Found by Coverity.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
c57276ca by Andreas Schneider at 2020-06-16T09:08:34+00:00
s3:samr: Add missing NULL pointer check

Found by Coverity.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
9b34cee6 by Andreas Schneider at 2020-06-16T09:08:34+00:00
s3:rpc_server: Check return code of set_blocking()

Found by Coverity.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
de493a3e by Andreas Schneider at 2020-06-16T09:08:34+00:00
s3:locking: Remove dead code

Found by Coverity.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
e7204f3c by Andreas Schneider at 2020-06-16T09:08:34+00:00
s4:torture: Make sure that ctx is initialized to NULL

If we go to done and call smbc_free_context() the pointer should be
initialized.

Found by clang.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
ccf1c222 by Andreas Schneider at 2020-06-16T09:08:34+00:00
s3:smbd: Fix a possibile null pointer dereference

Found by clang.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

- - - - -
0a2fae2d by Andreas Schneider at 2020-06-16T10:30:16+00:00
s3:lib: Make sure that have_rsrc is initialized

This is never set to false, only to true in the code.

Found by clang.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Tue Jun 16 10:30:17 UTC 2020 on sn-devel-184

- - - - -
5f957449 by Anoop C S at 2020-06-17T08:23:33+00:00
vfs_glusterfs: Enable caching of selinux xattr by default

Signed-off-by: Anoop C S <anoopcs at redhat.com>
Reviewed-by: Guenther Deschner <gd at samba.org>

Autobuild-User(master): Anoop C S <anoopcs at samba.org>
Autobuild-Date(master): Wed Jun 17 08:23:33 UTC 2020 on sn-devel-184

- - - - -
94645056 by Andrew Bartlett at 2020-06-17T14:25:28+00:00
docs: Ensure "use mmap" always has the correct default

We clarify the smb.conf manpage entry for "use mmap" to match the actual behaviour

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
10543188 by Andrew Bartlett at 2020-06-17T14:25:28+00:00
docs: Remove defaults test exception for "mit kdc command"

This ensures the documentation matches the code.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
3d1b6ddc by Andrew Bartlett at 2020-06-17T15:48:06+00:00
docs: Add caution against extending this list

We want correct documentation if at all possible.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Jun 17 15:48:06 UTC 2020 on sn-devel-184

- - - - -
53e3a959 by Andreas Schneider at 2020-06-17T17:42:02+00:00
s3:lib:tls: Use better priority lists for modern GnuTLS

We should use the default priority list. That is a good practice,
because TLS protocol hardening and phasing out of legacy algorithms,
is easier to co-ordinate when happens at a single place. See crypto
policies of Fedora.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Wed Jun 17 17:42:02 UTC 2020 on sn-devel-184

- - - - -
4e51e832 by Isaac Boukris at 2020-06-18T15:20:40+00:00
Fix a typo in recent net man page changes

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
4605d7ae by Isaac Boukris at 2020-06-18T15:20:40+00:00
selftest: add tests for binary msDS-AdditionalDnsHostName

Like the short names added implicitly by Windows DC.

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
9a447fb7 by Isaac Boukris at 2020-06-18T16:43:47+00:00
Properly handle msDS-AdditionalDnsHostName returned from Windows DC

Windows DC adds short names for each specified msDS-AdditionalDnsHostName
attribute, but these have a suffix of "\0$" and thus fail with
ldap_get_values(), use ldap_get_values_len() instead.

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Thu Jun 18 16:43:47 UTC 2020 on sn-devel-184

- - - - -
36bd6edd by Alexander Bokovoy at 2020-06-19T07:16:37+00:00
lib/ldb: add unit test for ldb_ldap internal code

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14413
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
990a0fc4 by Alexander Bokovoy at 2020-06-19T08:35:33+00:00
ldb_ldap: fix off-by-one increment in lldb_add_msg_attr

Fix regression introduced by commit ce2bf5c72b6423fff680b3d6a9042103a6cdda55

lldb_add_msg_attr() calls ldb_msg_add_empty() which, in turn, calls
calls _ldb_msg_add_el() which already increments msg->num_elements by one.

As a result, msg->num_elements is bigger than the actual number of
elements and any iteration over elements would step over elements array
boundary.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14413
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Jun 19 08:35:33 UTC 2020 on sn-devel-184

- - - - -
a2bc150a by Andreas Schneider at 2020-06-19T09:37:36+00:00
python: Run cmdline tools for default docs test in parallel

Running samba.tests.docs on my machine:
before -> (3m52.582s)
after  -> (2m6.952s)

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
e478470f by Andreas Schneider at 2020-06-19T10:59:30+00:00
python: Run cmdline tools for arbitary docs test in parallel

Running samba.tests.docs on my machine:
before -> (2m6.952s)
after  -> (22.298s)

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Jun 19 10:59:30 UTC 2020 on sn-devel-184

- - - - -
27709178 by Andreas Schneider at 2020-06-19T19:54:04+00:00
python: Fix get_max_worker_count() to always have two runners

Thanks to Jim Brown.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: David Mulder <dmulder at suse.com>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Jun 19 19:54:04 UTC 2020 on sn-devel-184

- - - - -
f0904a2f by Anoop C S at 2020-06-21T15:00:34+00:00
vfs_shadow_copy: Fix a log message

Signed-off-by: Anoop C S <anoopcs at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
c5bb40ec by Anoop C S at 2020-06-21T16:20:26+00:00
vfs_shadow_copy2: Fix a log message

Signed-off-by: Anoop C S <anoopcs at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Anoop C S <anoopcs at samba.org>
Autobuild-Date(master): Sun Jun 21 16:20:26 UTC 2020 on sn-devel-184

- - - - -
f9dd6735 by Isaac Boukris at 2020-06-22T09:59:04+00:00
Fix usage of ldap_get_values_len for msDS-AdditionalDnsHostName

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Jun 22 09:59:04 UTC 2020 on sn-devel-184

- - - - -
e4e65d02 by Christof Schmitt at 2020-06-22T12:07:37+00:00
libcli: Remove define for ERROR_INVALID_DATATYPE

The auto-generated define WERR_INVALID_DATATYPE is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
172ae564 by Christof Schmitt at 2020-06-22T12:07:37+00:00
libcli: Remove define STATUS_NO_MORE_EAS

The auto-generated define NT_STATUS_NO_MORE_EAS is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
b7062251 by Christof Schmitt at 2020-06-22T12:07:37+00:00
libcli: Remove define for STATUS_INVALID_EA_FLAG

The auto-generated define NT_STATUS_INVALID_EA_FLAG is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
fb7ac081 by Christof Schmitt at 2020-06-22T12:07:37+00:00
smbd: Use NT_STATUS_NOTIFY_CLEANUP instead of STATUS_NOTIFY_CLEANUP

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
85380ab9 by Christof Schmitt at 2020-06-22T12:07:37+00:00
torture: Use NT_STATUS_NOTIFY_CLEANUP instead of STATUS_NOTIFY_CLEANUP

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
d5f29c07 by Christof Schmitt at 2020-06-22T12:07:38+00:00
libcli: Remove define for STATUS_NOTIFY_CLEANUP

The auto-generated NT_STATUS_NOTIFY_CLEANUP is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
0b72c411 by Christof Schmitt at 2020-06-22T12:07:38+00:00
smbd: Use NT_STATUS_NOTIFY_ENUM_DIR instead of STATUS_NOTIFY_ENUM_DIR

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
3c90253a by Christof Schmitt at 2020-06-22T12:07:38+00:00
smbclient: Use NT_STATUS_NOTIFY_ENUM_DIR instead of STATUS_NOTIFY_ENUM_DIR

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
eec333da by Christof Schmitt at 2020-06-22T12:07:38+00:00
smbtorture: Use NT_STATUS_NOTIFY_ENUM_DIR instead of STATUS_NOTIFY_ENUM_DIR

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
73d45230 by Christof Schmitt at 2020-06-22T12:07:38+00:00
ntvfs: Use NT_STATUS_NOTIFY_ENUM_DIR instead of STATUS_NOTIFY_ENUM_DIR

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
6c2b1981 by Christof Schmitt at 2020-06-22T12:07:38+00:00
libcli: Remove define for STATUS_NOTIFY_ENUM_DIR

The auto-generated define NT_STATUS_NOTIFY_ENUM_DIR is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
37a51b10 by Christof Schmitt at 2020-06-22T12:07:38+00:00
libcli: Use NT_STATUS_PENDING instead of STATUS_PENDING

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
0a877e9b by Christof Schmitt at 2020-06-22T12:07:38+00:00
smbtorture: Use NT_STATUS_PENDING instead of STATUS_PENDING

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
7fe58187 by Christof Schmitt at 2020-06-22T12:07:38+00:00
source4/libcli: Use NT_STATUS_PENDING instead of STATUS_PENDING

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
315271f8 by Christof Schmitt at 2020-06-22T12:07:38+00:00
source4/smb_server: Use NT_STATUS_PENDING instead of STATUS_PENDING

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
7bd08bed by Christof Schmitt at 2020-06-22T12:07:38+00:00
smbd: Use NT_STATUS_PENDING instead of STATUS_PENDING

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
1dbb2752 by Christof Schmitt at 2020-06-22T12:07:38+00:00
libcli: Remove define for STATUS_PENDING

The auto-generated define NT_STATUS_PENDING is still available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
b467f86a by Christof Schmitt at 2020-06-22T12:07:38+00:00
libcli: Remove define STATUS_STOPPED_ON_SYMLINK

The auto-generated define NT_STATUS_STOPPED_ON_SYMLINK is still
available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
- - - - -
e1335efa by Christof Schmitt at 2020-06-22T13:30:51+00:00
libcli: Remove define STATUS_EA_LIST_INCONSISTENT

The auto-generated define NT_STATUS_EA_LIST_INCONSISTENT is still
available.

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Jun 22 13:30:51 UTC 2020 on sn-devel-184

- - - - -
225db614 by Andreas Schneider at 2020-06-22T14:34:32+00:00
bootstrap: Add back quota-devel on CentOS8

https://bugs.centos.org/view.php?id=16549

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
d6275ebb by Andreas Schneider at 2020-06-22T14:34:32+00:00
gitlab-ci: Use Fedora 32 to test FIPS mode

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
- - - - -
ba5a73b1 by Andreas Schneider at 2020-06-22T15:53:30+00:00
tests: Only run mdsparser test if we build with spotlight support

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Jun 22 15:53:30 UTC 2020 on sn-devel-184

- - - - -
68d716bd by Isaac Boukris at 2020-06-23T00:54:26+00:00
ldap.c: clarify the need for ldap_get_values_len() in a code comment

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d701bc15 by Gary Lockyer at 2020-06-23T02:15:35+00:00
libcli ldap tests: remove use of zero length array

libcli/ldap/tests/ldap_message_test.c defines a zero length array
(uint8_t buf[0]), which is a GCC extension and breaks the build with
some strict compilers like xlc.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Jun 23 02:15:35 UTC 2020 on sn-devel-184

- - - - -
9513d02e by Andrew Bartlett at 2020-06-23T05:07:00+00:00
python: Correctly re-raise the LdbError if the embedded error is not ldb.ERR_UNWILLING_TO_PERFORM

The current code attempts a SAMR based password set for all errors,
we want to continue on LDAP or local LDB (in the restore case) unless
we really got the specific error given by Windows 2000.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: David Mulder <dmulder at suse.com>

Autobuild-User(master): Gary Lockyer <gary at samba.org>
Autobuild-Date(master): Tue Jun 23 05:07:00 UTC 2020 on sn-devel-184

- - - - -
d473df78 by Stefan Metzmacher at 2020-06-23T06:46:39+00:00
third_party/socket_wrapper: Update socket_wrapper to version 1.2.5

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Tue Jun 23 06:46:39 UTC 2020 on sn-devel-184

- - - - -
1a6b7146 by Andrew at 2020-06-23T08:08:29+00:00
nsswitch: silence openpam error messages about unexpected responses

Openpam will log an error message when it receives an unexpected
response. On servers using openpam, convert an unexpected response
into PAM_SERVICE_ERR and log what we're doing so that logging behavior
is more user-configurable.

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

Signed-off-by: Andrew <awalker at ixsystems.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Jun 23 08:08:29 UTC 2020 on sn-devel-184

- - - - -
cd52a280 by David Mulder at 2020-06-23T16:32:30+00:00
Create Registry.pol group policy extension parser

Create a parent class for parsing Registry.pol
files by group policy extensions.

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
a9d1ccc5 by David Mulder at 2020-06-23T16:32:30+00:00
gpo: Run Group Policy Scripts

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
97a8f999 by David Mulder at 2020-06-23T16:32:30+00:00
gpo: Test gpo scripts apply

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
e32f4602 by David Mulder at 2020-06-23T16:32:30+00:00
Add python binding for DATADIR build path

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
2c1ebd07 by David Mulder at 2020-06-23T16:32:30+00:00
samba-tool: add command for installing gpo samba admx

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
ab50d348 by David Mulder at 2020-06-23T17:53:21+00:00
gpo: Test samba-tool gpo admxload

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): David Mulder <dmulder at samba.org>
Autobuild-Date(master): Tue Jun 23 17:53:22 UTC 2020 on sn-devel-184

- - - - -
f206d37f by Jeremy Allison at 2020-06-24T18:53:32+00:00
s3: selftest: Add samba3.blackbox.aio-outstanding test.

Shows smbd panics if connection is terminated (torn down)
by killing the client with outstanding aio requests in the
queue. As we're closing smbd we should cope with this.

Followup-bugfix for:

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
c7a4a7f1 by Jeremy Allison at 2020-06-24T18:53:32+00:00
s3: smbd: Make smbXsrv_client_valid_connections() external.

We will need to this ensure our client connections are
terminated in close_file before exiting with outstanding
aio.

Followup-bugfix for:

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
20565373 by Jeremy Allison at 2020-06-24T20:14:15+00:00
s3: smbd: Allow a SHUTDOWN_CLOSE on a file with outstanding aio if there are no client connections alive.

The process is exiting now so pthreads will never complete to cause
problems.

Remove the knownfail.d/aio_outstanding entry.

Followup-bugfix for:

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jun 24 20:14:15 UTC 2020 on sn-devel-184

- - - - -
fc9f6418 by David Mulder at 2020-06-24T20:50:24+00:00
s4:torture: Convert samba4.base.secleak test to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>

- - - - -
c96347f2 by David Mulder at 2020-06-24T20:50:24+00:00
s4:torture: Convert samba4.base.vuid test to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>

- - - - -
914ebe66 by David Mulder at 2020-06-24T20:50:24+00:00
Convert samba4.base.deny* tests to smb2

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Noel Power <noel.power at suse.com>

- - - - -
fad2bd8e by David Mulder at 2020-06-24T22:13:10+00:00
torture4: openattr always succeeds

Because this test returned true, it would always
succeed, despite failures in the test. Make it
return false if there are failures. Also, removed
a stray CHECK_MAX_FAILURES introduced by commit
8773e743 that caused the test to *always* fail
(but always be ignored).

Signed-off-by: David Mulder <dmulder at suse.com>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): David Mulder <dmulder at samba.org>
Autobuild-Date(master): Wed Jun 24 22:13:11 UTC 2020 on sn-devel-184

- - - - -
6b6086bb by Michael Adam at 2020-06-27T04:20:38+00:00
s4:torture/smb2: fix and improve the smb2.lock.replay test

The test was wrong in that it used an invalid
lock sequence bucket (65) where it actually wanted
to use a valid on (64), and hence the test results
(which were adapted to the real responses) were not
quite logical.

This patch fixes this and also improves some of
the comments so that the flow of the patch becomes
a little more obvious.

Pair-Programmed-With: Günther Deschner <gd at samba.org>

Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Günther Deschner <gd at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
3b1b2e60 by Stefan Metzmacher at 2020-06-27T04:20:38+00:00
s4:torture/smb2: make smb2.lock.replay_broken_windows more obvious

This test checks the SMB 2.1.0 behaviour of lock sequence checking,
which is only turned on for resilient handles.

Even Windows Server 2019 only implements lock sequence checking only
for resilient and persistent handles as a server.
While its client side uses lock sequence checking if it negotiated
multichannel with the server.

Hopefully this will be fixed in future Windows versions.

Make it clear that this test is supposed to pass against the legacy
Windows servers which violate the specification:

  [MS-SMB2] 3.3.5.14 Receiving an SMB2 LOCK Request

  ...

  ... if Open.IsResilient or Open.IsDurable or Open.IsPersistent is
  TRUE or if Connection.Dialect belongs to the SMB 3.x dialect family
  and Connection.ServerCapabilities includes
  SMB2_GLOBAL_CAP_MULTI_CHANNEL bit, the server SHOULD<314>
  perform lock sequence verification ...

  ...

  <314> Section 3.3.5.14: Windows 7 and Windows Server 2008 R2 perform
  lock sequence verification only when Open.IsResilient is TRUE.
  Windows 8 through Windows 10 v1909 and Windows Server 2012 through
  Windows Server v1909 perform lock sequence verification only when
  Open.IsResilient or Open.IsPersistent is TRUE.

Note <314> also applies to all versions (at least) up to Windows Server v2004.

Hopefully this will be fixed in future Windows versions and they
will avoid Note <314>.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
fdb346b2 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s4:torture/smb2: add smb2.lock.replay_smb3_specification test

This implements a test that checks for the specified behaviour.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
b2ce954e by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s3:smbXsrv.idl: add lock_sequence_array to smbXsrv_open_global0

This is needed for lock replay detection.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
5846e482 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s3:smbXsrv_open: initialize smbXsrv_open_global->lock_sequence_array with 0xFF

This is way to mark an entry as invalid (.valid = false).

Pair-Programmed-With: Michael Adam <obnox at samba.org>

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6b5bd280 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s3:smb2_lock: pass in_lock_sequence to smbd_smb2_lock_send()

Take the value from the client if the dialect is SMB2_10 or higher,
otherwise default to 0.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
6fc8ed13 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
docs-xml/smbdotconf: add "smb2 disable lock sequence checking"

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
303a01d9 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s3:smb2_lock: implement lock_sequence replay detection

While windows enables it only for resilient and persistent handles a SMB server
SHOULD (according to MS-SMB2 section 3.3.5.14 ) activate processing of lock
sequence numbers:

... if Open.IsResilient or Open.IsDurable or Open.IsPersistent is TRUE or if
Connection.Dialect belongs to the SMB 3.x dialect family and
Connection.ServerCapabilities includes SMB2_GLOBAL_CAP_MULTI_CHANNEL ...

We only support durable handles or multichannel, so we only implement
these according to the specification.

But we have 'smb2 disable lock sequence checking = yes' to force
to match the Windows Server bahavior, which only supports this
for resilient and persistent handles.

Pair-Programmed-With: Michael Adam <obnox at samba.org>
Pair-Programmed-With: Guenther Deschner <gd at samba.org>

Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Guenther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
f1ecaa75 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
selftest/Samba3: support durable handles on the 'aio' share

This means we can test the lock sequence checking via the
'samba3.smb2.lock aio(nt4_dc)' test.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
c603a50a by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s4:torture/smb2: remove MULTI_CHANNEL checking from smb2.replay.channel-sequence

This test doesn't need multi-channel. But we need to
force using the channel_sequence, as our client libraries
only use them for multi-channel connections or persistent handles.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
4ef206b0 by Stefan Metzmacher at 2020-06-27T04:20:39+00:00
s4:torture/smb2: adjust durable v2 tests to pass against Windows Server 2019

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
db10b14c by Stefan Metzmacher at 2020-06-27T05:42:05+00:00
s3:smbd: fix the handling of the durable_v2_timeout

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat Jun 27 05:42:05 UTC 2020 on sn-devel-184

- - - - -
d93a6d26 by Bjoern Jacke at 2020-06-29T18:19:04+00:00
util: fix build on AIX by fixing the order of replace.h include

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

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Björn Jacke <bjacke at samba.org>
Autobuild-Date(master): Mon Jun 29 18:19:04 UTC 2020 on sn-devel-184

- - - - -
a89efdfe by Günther Deschner at 2020-06-30T07:51:48+00:00
libgpo: only install group policy admx files when building as DC

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: David Mulder <dmulder at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>

Autobuild-User(master): Anoop C S <anoopcs at samba.org>
Autobuild-Date(master): Tue Jun 30 07:51:48 UTC 2020 on sn-devel-184

- - - - -
21350116 by Isaac Boukris at 2020-06-30T09:42:33+00:00
share_mode_lock.c: initialize out param

detected by covscan:
source3/locking/share_mode_lock.c:1563:6: warning: Branch condition evaluates to a garbage value

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: David Mulder <dmulder at suse.com>

Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
Autobuild-Date(master): Tue Jun 30 09:42:33 UTC 2020 on sn-devel-184

- - - - -
91453f11 by Andrew Bartlett at 2020-07-01T13:34:30+00:00
dsdb: Allow "password hash userPassword schemes = CryptSHA256" to work on RHEL7

On RHEL7 crypt_r() will set errno.  This is a problem because the implementation of crypt_r()
in RHEL8 and elsewhere in libcrypt will return non-NULL but set errno on failure.

The workaround is to use crypt_rn(), provided only by libcrypt, which will return NULL
on failure, and so avoid checking errno in the non-failure case.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
2c4ecf00 by Andrew Bartlett at 2020-07-01T13:34:30+00:00
selftest: Split samba.tests.samba_tool.user_virtualCryptSHA into GPG and not GPG parts

This allows the userPassword (not GPG) part of the test to run on hosts without
python3-gpg (eg RHEL7) while still testing the userPassword handling.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
cabf873b by Andrew Bartlett at 2020-07-01T13:34:30+00:00
selftest: Run test of how userPassword / crypt() style passwords are stored in quicktest

This ensures that the crypt_r()/crypt_rn()/crypt() behaviour is tested in all
the samba-o3 builds and so is checked on RHEL7 in GitLab CI.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
d3086501 by Andreas Schneider at 2020-07-01T14:56:33+00:00
tls: Use NORMAL:-VERS-SSL3.0 as the default configuration

This seems to be really broken in GnuTLS and the documentation is also
not correct.

This partially reverts 53e3a959b958a3b099df6ecc5f6e294e96bd948e

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Wed Jul  1 14:56:33 UTC 2020 on sn-devel-184

- - - - -
f59490dc by Jeremy Allison at 2020-07-01T18:59:53+00:00
s3: libsmb: Fix SMB2 client rename bug to a Windows server.

Fix bug where renaming to a target name of one
UCS2 character (name length 2 bytes) fails to
a Windows 10 SMB2 server.

The Windows 10 SMB2 server has a minimum length
for a SMB2_FILE_RENAME_INFORMATION buffer of
24 bytes. It returns NT_STATUS_INFO_LENGTH_MISMATCH
if the length is less. This isn't an alignment
issue as Windows client happily 2-byte align
for larget target name sizes. Also the Windows 10
SMB1 server doesn't have this restriction.

If the name length is too short, pad out with
zeros to 24 bytes.

Hard to add a test for this as we don't want to
add this silly restriction to the Samba server
as it would break all non-Windows clients.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jul  1 18:59:53 UTC 2020 on sn-devel-184

- - - - -
b2f27a47 by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: vlv: Use strcmp(), not strncmp() checking the NULL terminated control OIDs

The end result is the same, as sizeof() includes the trailing NUL, but this
avoids having to think about that.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
914e0cfa by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: vlv: Do not re-ASQ search the results of an ASQ search with VLV

This is a silly combination, but at least try and keep the results sensible
and avoid a double-dereference.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
ec1c7d62 by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: selftest: Add test to confirm VLV interaction with ASQ

Tested against Windows 1709.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
ff0b1df8 by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: vlv: Another workaround for mixing ASQ and VLV

This is essentially an alternative patch, but without the correct
behaviour.  Instead this just avoids a segfault.

Included in case we have something simialr again in
another module.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
cac84d91 by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: selftest: Add test to show that VLV and paged_results are incompatible

As tested against Windows Server 1709

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
60078f4f by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: dsdb: Fix crash when vlv and paged_results are combined

The GUID is not returned in the DN for some reason in this (to be banned)
combination.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
9197d85c by Andrew Bartlett at 2020-07-02T09:01:40+00:00
CVE-2020-10730: dsdb: Ban the combination of paged_results and VLV

This (two different paging controls) makes no sense and fails against
Windows Server 1709.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
4d99cab6 by Gary Lockyer at 2020-07-02T09:01:40+00:00
CVE-2020-10730: s4 dsdb paged_results: Prevent repeat call of ldb_module_done

Check the return code from paged_results, if it is not LDB_SUCCESS
ldb_module_done has already been called, and SHOULD NOT be called again.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f88b69f5 by Gary Lockyer at 2020-07-02T09:01:40+00:00
CVE-2020-10730: s4 dsdb vlv_pagination: Prevent repeat call of ldb_module_done

Check the return code from vlv_results, if it is not LDB_SUCCESS
ldb_module_done has already been called, and SHOULD NOT be called again.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
d8b9bb27 by Gary Lockyer at 2020-07-02T09:01:41+00:00
CVE-2020-10730: lib ldb: Check if ldb_lock_backend_callback called twice

Prevent use after free issues if ldb_lock_backend_callback is called
twice, usually due to ldb_module_done being called twice. This can happen if a
module ignores the return value from function a function that calls
ldb_module_done as part of it's error handling.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
f4b2fd00 by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: pytests: hand-rolled invalid dns/nbt packet tests

The client libraries don't allow us to make packets that are broken in
certain ways, so we need to construct them as byte strings.

These tests all fail at present, proving the server is rendered
unresponsive, which is the crux of CVE-2020-10745.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
bc896d75 by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: librpc/tests: cmocka tests of dns and ndr strings

These time the push and pull function in isolation.

Timing should be under 0.0001 seconds on even quite old hardware; we
assert it must be under 0.2 seconds.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
601e8a3f by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: ndr_dns: move ndr_push_dns_string core into sharable function

This is because ndr_nbt.c does almost exactly the same thing with
almost exactly the same code, and they both do it wrong. Soon they
will both be using the better version that this will become. Though in
this patch we just move the code, not fix it.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
bb637379 by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: ndr/dns_utils: correct a comment

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
51a45718 by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: ndr_dns: do not allow consecutive dots

The empty subdomain component is reserved for the root domain, which we
should only (and always) see at the end of the list. That is, we expect
"example.com.", but never "example..com".

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
c3fa8ada by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: dns_util/push: forbid names longer than 255 bytes

As per RFC 1035.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
cc3a6776 by Douglas Bagnall at 2020-07-02T09:01:41+00:00
CVE-2020-10745: ndr/dns-utils: prepare for NBT compatibility

NBT has a funny thing where it sometimes needs to send a trailing dot as
part of the last component, because the string representation is a user
name. In DNS, "example.com", and "example.com." are the same, both
having three components ("example", "com", ""); in NBT, we want to treat
them differently, with the second form having the three components
("example", "com.", "").

This retains the logic of e6e2ec0001fe3c010445e26cc0efddbc1f73416b.

Also DNS compression cannot be turned off for NBT.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

- - - - -
32c333de by Andrew Bartlett at 2020-07-02T09:01:41+00:00
CVE-2020-10760 dsdb: Ensure a proper talloc tree for saved controls

Otherwise a paged search on the GC port will fail as the ->data was
not kept around for the second page of searches.

An example command to produce this is
 bin/ldbsearch --paged -H ldap://$SERVER:3268 -U$USERNAME%$PASSWORD

This shows up later in the partition module as:

ERROR: AddressSanitizer: heap-use-after-free on address 0x60b00151ef20 at pc 0x7fec3f801aac bp 0x7ffe8472c270 sp 0x7ffe8472c260
READ of size 4 at 0x60b00151ef20 thread T0 (ldap(0))
    #0 0x7fec3f801aab in talloc_chunk_from_ptr ../../lib/talloc/talloc.c:526
    #1 0x7fec3f801aab in __talloc_get_name ../../lib/talloc/talloc.c:1559
    #2 0x7fec3f801aab in talloc_check_name ../../lib/talloc/talloc.c:1582
    #3 0x7fec1b86b2e1 in partition_search ../../source4/dsdb/samdb/ldb_modules/partition.c:780

or

smb_panic_default: PANIC (pid 13287): Bad talloc magic value - unknown value
(from source4/dsdb/samdb/ldb_modules/partition.c:780)

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
17fc8d2b by Andrew Bartlett at 2020-07-02T09:01:41+00:00
CVE-2020-10760 dsdb: Add tests for paged_results and VLV over the Global Catalog port

This should avoid a regression.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
b232a7bc by Andrew Bartlett at 2020-07-02T09:01:41+00:00
CVE-2020-14303 Ensure an empty packet will not DoS the NBT server

Signed-off-by: Andrew Bartlett <abartlet at samba.org>

- - - - -
3cc0f1ee by Gary Lockyer at 2020-07-02T10:26:24+00:00
CVE-2020-14303: s4 nbt: fix busy loop on empty UDP packet

An empty UDP packet put the nbt server into a busy loop that consumes
100% of a cpu.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>

Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(master): Thu Jul  2 10:26:24 UTC 2020 on sn-devel-184

- - - - -
9f3d2ba7 by Volker Lendecke at 2020-07-02T10:38:34+00:00
ldb_ldap: Fix a memleak

Don't allocate a temporary value on a long-term context

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: David Mulder <dmulder at samba.org>

- - - - -
9d988ce0 by Volker Lendecke at 2020-07-02T10:38:34+00:00
pdb_dsdb: Fix typos

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
011a2a82 by Volker Lendecke at 2020-07-02T10:38:34+00:00
ldap_client: Make ldap_parse_basic_url take care of ldapi as well

SUSV4's sscanf has the %m modifier, which allocates the right
amount. Remove those SMB_ASSERTS for string buffers.

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
61bc9936 by Volker Lendecke at 2020-07-02T10:38:34+00:00
ldap_client: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

- - - - -
7082902d by Volker Lendecke at 2020-07-02T12:01:06+00:00
ldap_client: Make ldap_parse_basic_url() IPv6-address aware

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Thu Jul  2 12:01:06 UTC 2020 on sn-devel-184

- - - - -
5aeaa695 by Ralph Boehme at 2020-07-02T12:03:33+00:00
lib/debug: assert file backend

The debug file backend is a built-in default, if it's missing we're totally
screwed.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
71488b81 by Ralph Boehme at 2020-07-02T13:25:29+00:00
lib/debug: set the correct default backend loglevel to MAX_DEBUG_LEVEL

This fixed a regression introduced by commit
c83ce5f4f99aef94530411ec82cc03e9935b352d for bug #14345.

The backend loglevel globally restricts logging of a particular backend. If this
value is smaller then any explicitly configured logging class, logging for this
class is skipped.

Eg, given the following logging config in smb.conf:

  log level = 1 auth_json_audit:3@/var/log/samba/samba_auth_audit.log

the default class loglevel of 1 (dbgc_config[DBGC_ALL].loglevel) will be
assigned to the backend loglevel.

So even though the logging class auth_json_audit is configured at level 3, this
doesn't become effective as the file backend drops all log messages with a level
below 1.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Jul  2 13:25:29 UTC 2020 on sn-devel-184

- - - - -
b5b80102 by Andrew at 2020-07-02T15:25:31+00:00
s3:winbind:idmap_ad - make failure to get attrnames for schema mode fatal

Add check for failure to resolve the OID array for the schema mode into
names.

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

Signed-off-by: Andrew <awalker at ixsystems.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
bcba4bb2 by Stefan Metzmacher at 2020-07-02T15:25:31+00:00
s4:torture/smb2: add smb2.delete-on-close-perms.BUG14427

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
b2b5ae09 by Stefan Metzmacher at 2020-07-02T15:25:31+00:00
s3:smbd: reformat if statement for caching in vfs_ChDir()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
f3f330f6 by Stefan Metzmacher at 2020-07-02T15:25:31+00:00
s3:smbd: make sure vfs_ChDir() always sets conn->cwd_fsp->fh->fd = AT_FDCWD

This is what all consumers of conn->cwd_fsp->fh->fd expect!

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
fbb8bbe1 by Ralph Boehme at 2020-07-02T15:25:31+00:00
smbd: increase loglevel when leases_db_del() with anything then NT_STATUS_NOT_FOUND

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
383a2457 by Ralph Boehme at 2020-07-02T15:25:31+00:00
s3/leases: log NDR decoding failure with level 0 in leases_db_get_fn()

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

Signed-off-by: Ralph Boehme <slow at samba.org>

- - - - -
e4328db1 by Ralph Boehme at 2020-07-02T15:25:31+00:00
smbd: inverse if/else logic in get_lease_type()

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
3f4a8658 by Ralph Boehme at 2020-07-02T15:25:32+00:00
smbd: let get_lease_type() take a non-const share_mode_entry

We're going to add a call to share_entry_stale_pid(share_mode_entry) which takes
a non-const pointer (in order to eventually set e->state = true).

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

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
05d4466a by Ralph Boehme at 2020-07-02T16:45:42+00:00
smbd: check for stale pid in get_lease_type()

If leases_db_get() failed the leases_db record might have been cleaned up for
stale processes. Check if the share-mode-entry owner is stale in this case and
return a 0 lease state. In any other case, log a debug messages and panic..

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

Signed-off-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu Jul  2 16:45:42 UTC 2020 on sn-devel-184

- - - - -
213a8d55 by Douglas Bagnall at 2020-07-06T12:30:33+00:00
s4/winbind/idmap: check the right variable (CID 1272950)

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
- - - - -
e78db8a7 by Douglas Bagnall at 2020-07-06T12:30:33+00:00
policy/gp: always close a file (CID 1445119)

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
- - - - -
91995410 by Douglas Bagnall at 2020-07-06T12:30:33+00:00
pypidl: check the result of py_dcerpc_ndr_pointer_deref()

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
- - - - -
8bd7669d by Douglas Bagnall at 2020-07-06T13:56:17+00:00
dsdb/password_hash: don't double assign variables (CID 1363048, 1034720)

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Mon Jul  6 13:56:17 UTC 2020 on sn-devel-184

- - - - -
21769368 by Stefan Metzmacher at 2020-07-07T01:25:49+00:00
s3:leases: log errors with level 0 in leases_db_do_locked_fn()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
58adf349 by Stefan Metzmacher at 2020-07-07T02:47:46+00:00
s3:smbd: check for stale pid in delay_for_oplock_fn() when leases_db_get() fails

If leases_db_get() failed the leases_db record might have been cleaned up for
stale processes. Check if the share-mode-entry owner is stale in this case and
return ignore the entry. In any other case, log a debug messages and panic.

Commit 05d4466a6d1ad048fa86aea09ec0a56a7b961369
"smbd: check for stale pid in get_lease_type()" fixed only one half of
this.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jul  7 02:47:46 UTC 2020 on sn-devel-184

- - - - -
2a7317e0 by Stefan Metzmacher at 2020-07-07T09:37:37+00:00
s3:wscript: vfs_gpfs needs kernel oplock support

It uses symbols, which are only available if we have
HAVE_KERNEL_OPLOCKS_LINUX defined.

This is not the case when building withing the
Windows Subsystem for Liux (WSL). So we better don't try to
build the vfs_gpfs module there.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue Jul  7 09:37:37 UTC 2020 on sn-devel-184

- - - - -
b7832c2c by Stefan Metzmacher at 2020-07-07T10:30:39+00:00
selftest/Samba4: split out _setup_ad_dc()

setup_ad_dc() was used for more than 'ad_dc'.
Setting up 'ad_dc' means not all missing arguments are
passed as undef.

The following had no effect

        if (!defined($conf_opts)) {
                $conf_opts = "";
        }

and $conf_opts results in a string of 'HASH(....)'

So we better pass explicit undef arguments from setup_ad_dc() to
_setup_ad_dc() now.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
f6eb56bf by Stefan Metzmacher at 2020-07-07T10:30:39+00:00
lib/torture: make torture_subunit_test_name() public

This makes it easier to modify.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
a4a6c03b by Stefan Metzmacher at 2020-07-07T10:30:39+00:00
lib/torture: add back links to the parent objects

This makes would allow the full name of a test to be constructed
if needed in future.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
0e0d89b5 by Stefan Metzmacher at 2020-07-07T10:30:40+00:00
lib/torture: fix subunit names of nested suites

E.g. passing 'smb2.multichannel.generic' to smbtorture results in

- interface_info
- num_channels

While passing 'smb2.multichannel' to smbtorture results in:

- generic.interface_info
- genetic.num_channels
- oplocks.test1
...
- leases.test1
...

Before we got this:

- interface_info
- num_channels
- test1
...
- test1

That made it impossible to add knownfail entries for

leases.test1 vs. oplocks.test1

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
90251923 by Stefan Metzmacher at 2020-07-07T10:30:40+00:00
s4:torture: use prefix_name() for all names in run_matching()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
4e39e437 by Stefan Metzmacher at 2020-07-07T10:30:40+00:00
s4:torture: avoid multiple recursions into the test lists

torture_run_suite_restricted() and torture_run_tcase_restricted()
already handle recursion. If we call them from smbtorture
we should avoid our own recursion.

Without this passing 'smb2.multichannel.*' results in running
tests more than once.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
8902eb82 by Sachin Prabhu at 2020-07-07T10:30:40+00:00
s4:torture: Add command line parameter --fullname

This argument is used to print out the the full name which includes the
name of the test suite.

For example, the name in the output for the test smb2.read.dir is "dir".
By using the --fullname parameter, the name used will be
"smb2.read.dir".

The default continues to be to use the shortname.

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Sachin Prabhu <sprabhu at redhat.com>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
32f05b05 by Sachin Prabhu at 2020-07-07T10:30:40+00:00
s4:torture/local: Add new test to check smbtorture --fullname

Add new always pass test to test smbtorture --fullname.

Since we test the printing of the fullname of the test, the test is
placed at the bottom of several levels of test suites.

test : local.smbtorture.level1.level2.level3.always_pass

Signed-off-by: Sachin Prabhu <sprabhu at redhat.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
- - - - -
31d187be by Sachin Prabhu at 2020-07-07T12:16:34+00:00
s4:selftest: test for smbtorture subunit names with and without --fullname

We check the output with both --fullname and with the default shortname
to ensure it works as expected.

We also do tests for each level and test relative names are used.

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Sachin Prabhu <sprabhu at redhat.com>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User((no branch)): Stefan Metzmacher <metze at samba.org>
Autobuild-Date((no branch)): Tue Jul  7 12:16:34 UTC 2020 on sn-devel-184

- - - - -
054f58e4 by Samuel Cabrero at 2020-07-07T12:17:30+00:00
selftest: Split samba4 epmapper expected failures into individual tests

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: David Mulder <dmulder at suse.com>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
072cdbd3 by Samuel Cabrero at 2020-07-07T12:17:30+00:00
s4:torture: Do not skip epmapper lookup terminate test in samba4

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: David Mulder <dmulder at suse.com>
Reviewed-by: Andreas Schneider <asn at samba.org>

- - - - -
61e93698 by Samuel Cabrero at 2020-07-07T13:43:14+00:00
s4:rpc_server: Implement epmapper LookupHandleFree

Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: David Mulder <dmulder at suse.com>
Reviewed-by: Andreas Schneider <asn at samba.org>

Autobuild-User(master): Samuel Cabrero <scabrero at samba.org>
Autobuild-Date(master): Tue Jul  7 13:43:14 UTC 2020 on sn-devel-184

- - - - -
3dced6a4 by Noel Power at 2020-07-07T21:40:33+00:00
selftest: Add basic smbcacls test(s)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
449259f6 by Noel Power at 2020-07-07T21:40:33+00:00
selftest: run smbcacls test against a share with a DFS link

The commit creates a dfs link in existing 'fileserver' env
share msdfs_share. Additionally we create a new dfs target in
a new share (with associated directory)

Additionally add a known fail as smbcacls doesn't not yet navigate DFS links.
A subsequent commit will fix smcacls to handle DFS (and remove the
knownfail)

Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>

- - - - -
cd5a2d01 by Anubhav Rakshit at 2020-07-07T23:03:00+00:00
s3:smbcacls: Add support for DFS path

smbcacls does not handle DFS paths correctly. This is beacuse once the
command encounters a path which returns STATUS_PATH_NOT_COVERED, it does
not attempt a GET REFERRAL.

We use cli_resolve_path API to perform a DFS path resolution to solve
the above problem.

Additionally this removes the known fail against smbcacls tests
Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Reviewed-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jul  7 23:03:00 UTC 2020 on sn-devel-184

- - - - -
c25fb103 by Stefan Metzmacher at 2020-07-08T09:42:39+00:00
lib/util: add generate_unique_u64() helper function

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
6c68c75b by Stefan Metzmacher at 2020-07-08T09:42:39+00:00
s3:g_lock: avoid very expensive generate_random_buffer() in g_lock_parse()

We don't require a sequence number that is incremented,
we just need a value that's not reused.
We use the new generate_unique_u64(), which is much cheaper!

Using smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 500000
under valgrind --tool=callgrind...

This change replaces this:

 13,129,925,659  PROGRAM TOTALS

  4,125,752,958  ???:_nettle_sha256_compress [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4]
  1,257,005,866  ???:_nettle_aes_encrypt [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4]
    590,000,773  bin/default/../../lib/tdb/common/lock.c:tdb_lock_list
    571,503,429  ???:_nettle_aes_set_key [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4]
    479,000,608  bin/default/../../lib/tdb/common/lock.c:tdb_unlock
    ...

by this:

  6,877,826,377  PROGRAM TOTALS

    590,000,773  bin/default/../../lib/tdb/common/lock.c:tdb_lock_list
    479,000,608  bin/default/../../lib/tdb/common/lock.c:tdb_unlock
    ...
     12,500,033  bin/default/../../lib/util/genrand_util.c:generate_unique_u64
    ...
     8,996,970  ???:_nettle_sha256_compress [/usr/lib/x86_64-linux-gnu/libnettle.so.6.4]

time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 5000000

gives:

   537426 locks/sec

  real    0m19,071s
  user    0m15,061s
  sys     0m3,999s

vs.

   900956 locks/sec

  real    0m11,155s
  user    0m8,293s
  sys     0m2,860s

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
a618776a by Stefan Metzmacher at 2020-07-08T09:42:40+00:00
s3:locking: convert share_mode_lock.c to generate_unique_u64()

Instead of a sequence number that gets incremented we just
need a value that's not reused.

The is a similar change like the commit before at the g_lock.c
layer.

I expect a similar performance improvement here, but
I don't know a specific benchmark test to check.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

- - - - -
4faab2a7 by Stefan Metzmacher at 2020-07-08T11:02:39+00:00
s3:dbwrap_watch: avoid recursion into dbwrap_do_locked() from dbwrap_watched_do_locked_{storev,delete}()

This avoids a lot of overhead!

Using smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 500000
under valgrind --tool=callgrind...

This change replaces this:

 6,877,542,529  PROGRAM TOTALS

   590,000,773  lib/tdb/common/lock.c:tdb_lock_list
   479,000,608  lib/tdb/common/lock.c:tdb_unlock
   446,500,532  lib/tdb/common/io.c:tdb_read
   364,000,824  lib/tdb/common/hash.c:tdb_jenkins_hash
   285,000,532  lib/tdb/common/io.c:tdb_write
   262,054,669  /x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms
   206,500,496  lib/tdb/common/mutex.c:tdb_mutex_lock
   193,000,176  lib/tdb/common/tdb.c:tdb_find
   160,000,256  lib/talloc/talloc.c:_talloc_get_type_abort
   148,500,297  lib/tdb/common/tdb.c:tdb_storev
   140,000,196  lib/tdb/common/lock.c:tdb_lock
   130,000,858  lib/util/debug.c:debuglevel_get_class
   128,003,722  lib/talloc/talloc.c:_talloc_free
   128,000,118  lib/tdb/common/tdb.c:tdb_parse_record
   126,000,576  lib/tdb/common/lock.c:tdb_brlock.part.3
   121,000,272  lib/tdb/common/mutex.c:tdb_mutex_unlock
   118,000,225  /nptl/pthread_mutex_lock.c:__pthread_mutex_lock_full
   112,750,222  lib/tdb/common/freelist.c:tdb_allocate_from_freelist
   108,500,168  lib/tdb/common/io.c:tdb_ofs_read
   102,500,000  lib/tdb/common/io.c:tdb_parse_data

by this:

 5,706,522,398  PROGRAM TOTALS

   434,000,617  lib/tdb/common/lock.c:tdb_lock_list
   389,500,494  lib/tdb/common/io.c:tdb_read
   359,000,488  lib/tdb/common/lock.c:tdb_unlock
   285,000,532  lib/tdb/common/io.c:tdb_write
   237,554,655  /x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms
   208,000,668  lib/tdb/common/hash.c:tdb_jenkins_hash
   206,500,496  lib/tdb/common/mutex.c:tdb_mutex_lock
   160,000,256  lib/talloc/talloc.c:_talloc_get_type_abort
   148,500,297  lib/tdb/common/tdb.c:tdb_storev
   136,000,132  lib/tdb/common/tdb.c:tdb_find
   130,000,858  lib/util/debug.c:debuglevel_get_class
   126,000,576  lib/tdb/common/lock.c:tdb_brlock.part.3
   121,000,272  lib/tdb/common/mutex.c:tdb_mutex_unlock
   118,000,225  /nptl/pthread_mutex_lock.c:__pthread_mutex_lock_full
   112,750,222  lib/tdb/common/freelist.c:tdb_allocate_from_freelist
   112,000,168  lib/tdb/common/lock.c:tdb_lock
    94,500,154  lib/tdb/common/io.c:tdb_ofs_read
    94,000,188  /nptl/pthread_mutex_unlock.c:__pthread_mutex_unlock_full
    86,000,086  lib/dbwrap/dbwrap.c:dbwrap_lock_order_lock
    83,000,083  lib/dbwrap/dbwrap_tdb.c:db_tdb_do_locked

time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 5000000

gives:

  902834 locks/sec

 real    0m11,103s
 user    0m8,233s
 sys     0m2,868s

vs.

 1037262 locks/sec

 real    0m9,685s
 user    0m6,788s
 sys     0m2,896s

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Wed Jul  8 11:02:39 UTC 2020 on sn-devel-184

- - - - -
bd71d2d9 by Günther Deschner at 2020-07-08T15:54:38+00:00
lib/util: allow to set TCP_USER_TIMEOUT socket option

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

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
81652892 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s3:includes: change OPLOCK_BREAK_TIMEOUT from 30 to 35 seconds

This is what windows is using for normal oplock and lease breaks.

Note that windows uses higher values for persistent handles,
they use 60 seconds for oplocks and 180 seconds for leases.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
0d256621 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
libcli/smb: define FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUT

This will be used by smbtorture in order to simulate channel failures
without relying on iptables.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
9f3ab6a1 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:param: use struct initializer in lpcfg_smbcli_options()

We should zero all fields not initialiazed explicitly.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
fe6a6ec4 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:param: use struct initializer in lpcfg_smbcli_session_options()

We should zero all fields not initialiazed explicitly.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
7d068744 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:libcli/smb2: allow smb2_connect*() to fake session and tcon

For multichannel connection we want a way to have just a connection
with a negprot finished.

For now we just fake a tcon and session in order to avoid changes in the
caller. We can clean that up later if needed.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
ce7eaca7 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:libcli/smb2: add const to struct smbcli_options *options for smb2_connect()

It will just be passed to smb2_connect_ext(), which already takes a
const pointer.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
54518820 by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:torture/smb2: add const to options for test_multichannel_create_channel()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
d2b82744 by Günther Deschner at 2020-07-08T15:54:38+00:00
s4:torture/smb2: simplify code to generate list of smb2 channels

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Guenther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
3559a1df by Stefan Metzmacher at 2020-07-08T15:54:38+00:00
s4:torture/smb2: make use of transport_options.only_negprot for multichannel connections

This avoid useless session setups and tree connects on the wire.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
2181f728 by Günther Deschner at 2020-07-08T15:54:38+00:00
s4:torture/smb2: move interface_info test to smb2.multichannel.generic

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

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

- - - - -
a52e7114 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: add break_info.oplock_skip_ack

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
8c7bb245 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: refactor block.c to block the OUTPUT path

In order to create useful tests, we should block the outgoing
tcp packets only. That means we're able to see incoming
break notifications, but prevent outgoing TCP ACKs to be delivered
to the server.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
68a351b7 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: make use of FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUT

This is a way to test without being able to use iptables.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
3d7f8197 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: move smb2_transport blocking to the generic block.[ch]

We may want to use this in other places too, not only multichannel.c

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
31e2b7f0 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: split smb2.oplock.batch22 into a and b

batch22a tests the timeout on a valid connection
and batch22b tests the timeout on a broken/blocked connection.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
f92f24ee by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: fix smb2.multichannel.leases.test2 against windows

We still receive the break on the blocked channel,
it's only the response ACKs, which we are blocking (or simulate to
block).

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
2da65bed by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: remove useless 'smb2.multichannel.leases.test4'

Having a test that would only pass against Samba makes things way
to complex, they're already complex and we should try to behave
like windows as much as possible.

The next commit will add a better test that will work against Windows
Servers and the future Samba servers.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
5bb9da8c by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: (re-)add smb2.multichannel.leases.test4

This tests 32 channels, which is the maximum Windows Server
versions support. (Note that Windows 10 (a Client OS as SMB server,
seems to support only 20 channels and may differ in other aspects,
so we ignore that for now).

This works at least against Windows Server 2019
and we see lease break notification retries every ~ 1.3 seconds
with ~ 5 TCP retransmissions. At that rate we see the remaining
5 retries after the conflicting SMB2 Create already returned.

Older Windows Server versions use much longer timeouts in the TCP-stack,
they send lease break notification retries less often and only 4 in
total, all other channels get TCP-RST packets because of missing
TCP keepalive packets before they're used.
The intervals between lease break notification retries are
~19 seconds for 2012[_R2] and ~25 seconds for 2016.
It means that only ~2 lease break notifications arrive before
the open returns after ~35 seconds.

Note that Windows 10 seems to behave differently and it's not
possible to open all 32 channel used by this test.

Against remote servers it's required to run iptables as root:

 #> smbtorture //server/torture -Uu%p \
    --option="torture:use_iptables=yes" \
    --option="torture:iptables_command=sudo /sbin/iptables" \
    smb2.multichannel.leases.test4

The test will also work against a Samba server
with 'smbd:FSCTL_SMBTORTURE = yes', and won't require iptables
in that case.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
5ad618bc by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s4:torture/smb2: add smb2.multichannel.oplocks.test3{_windows,specification}

This is similar to the smb2.multichannel.leases.test5,
but it tests the oplock case instead of leases.

With Oplocks Windows only sends a single break on the latest channel,
this is not what the spec says...

Maybe we should have a similar test that would expect the
behavior from the [MS-SMB2] (3/4/2020 rev 60.0)
"3.3.4.6 Object Store Indicates an Oplock Break":

  ...

  If the server implements the SMB 3.x dialect family, SMB2 Oplock Break
  Notification MUST be sent to the client using the first available
  connection in Open.Session.ChannelList where Channel.Connection is not
  NULL. If the server fails to send the notification to the client, the
  server MUST retry the send using an alternate connection, if available,
  in Open.Session.ChannelList.
  ...

Here I add one test that demonstrates the Windows behavior:
 smb2.multichannel.oplocks.test3_windows
and a 2nd test that demonstrates the behavior from MS-SMB2.
 smb2.multichannel.oplocks.test3_specification

Note that Windows 10 seems to behave differently and it's not
possible to open all 32 channel used by this test.

Against remote servers it's required to run iptables as root:

 #> smbtorture //server/torture -Uu%p \
    --option="torture:use_iptables=yes" \
    --option="torture:iptables_command=sudo /sbin/iptables" \
    smb2.multichannel.oplocks.test3_windows

 #> smbtorture //server/torture -Uu%p \
    --option="torture:use_iptables=yes" \
    --option="torture:iptables_command=sudo /sbin/iptables" \
    smb2.multichannel.oplocks.test3_specification

The test will also work against a Samba server
with 'smbd:FSCTL_SMBTORTURE = yes', and won't require iptables
in that case.

Samba will get a "smb2 disable oplock break retry" configuration
option to switch between both behaviors, as it's much more common with Samba
that leases are not supported and clients will fallback to
oplocks together with multichannel.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
acf80fd9 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s3:smbd: remove dead code from smbd_smb2_send_break()

Starting with commit 0a924d13cf4bb570cce3955cf0de9d8678b37dbe
("smbd: Send SMB2 oplock breaks unencrypted") we always passed in
session=NULL and tcon=NULL.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
a1e5b8c7 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s3:smbd: pass down session_id to smbd_smb2_send_break()

Oplock break should contain a valid session id of the open file handle,
as file handles are relative to a session.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
60d7f059 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s3:smbd: remove unused session,tcon parameters from smbd_smb2_send_oplock_break()

They are no longer used. However we'll make use of
op->compat->vuid in the next commits, as the session id should be part
of oplock breaks.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
54bd3a46 by Stefan Metzmacher at 2020-07-08T15:54:39+00:00
s3:smbd: add smbd_server_disconnect_client[_ex]()

With multichannel things may not happen only on one connection.
We may need to disconnect all connections of a client, when something
bad happens.

The first users of this will be the lease/oplock break code,
if they are not able allocate memory or something similar
we need to bail out.

Having a special smbXsrv_client based function is better than
calling exit_server*() directly.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
42497b86 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: pass smbXsrv_client to downgrade_lease()

This prepares for multichannel support, where breaks are not bound
to a single connection.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
66c0888d by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: pass down smbXsrv_client to smbd_smb2_send_{oplock,lease}_break()

Which connection is actually used should not matter to the main logic.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
c66110cf by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: setup client->global->client_guid even without multichannel support

It's too confusing if client->global->client_guid and
client->connections->smb2.client.guid don't have the same value..

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
36812aad by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: avoid dereferencing client->connections

There're typically better ways to get the same information.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
61b94187 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: introduce smbXsrv_pending_break infrastructure

This prepares support for oplock/lease break replay from
the server to the client.

We need some state in order to do replays later.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
37c52c2d by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: add smbd_smb2_send_queue.sendfile_body_size

The following patches require the size of the full sendfile() pdu.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
4230bcdf by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: convert smbd_smb2_send_break() into async smbd_smb2_break_send/recv()

This will make it possible to detect errors in order to retry sending
the break on another connection.

For now we always report NT_STATUS_OK, when we delivered the break
notification to the kernel send queue. But that will change in
the following commits.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
bc10e503 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
docs-xml/smbdotconf: add "smb2 disable oplock break retry"

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
557adf8c by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: add logic to retry break notifications on all available channels

For leases we need to use any available connection with the same
client_guid. That means all connections in the client->connections list.

We try the oldest connection first, as that's what windows is doing.

For oplocks we implement the same as that's what the specification
says. Windows behaves different and we have
'smb2 disable oplock break retry = yes' in order to behave like Windows.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
3cd775af by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: add infrastructure to wait for TCP acks

This will be the core of the logic that allows
us to retry break notifications.

When we start the "pending break cycle" we ask for
the current retransmission timemout (rto) on the TCP connection
and remember how many unacked bytes are in the kernel's
send queue. Each time we send bytes into the kernel
we add them to the unacked bytes.
We use a timer using the rto interval in order
to check the amount of unacked bytes again.
The provides send_queu_entry.ack.req will be completed
with tevent_req_done() when everything is completely acked,
tevent_req_nterror(NT_STATUS_IO_TIMEOUT) when
send_queu_entry.ack.timeout is expired or
tevent_req_nterror(connection_error) when the connection
gets disconnected.

It works with support from the FreeBSD and Linux kernels.
For other platforms we just have a fixed rto of 1 second.
And pretend all bytes are acked when we recheck after 1 second.
So only a connection error could trigger tevent_req_nterror(),
but there's no timeout. A follow up commit will most likely
disable support for multi-channel if we don't have kernel support.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
8b8c5c41 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: force multi-channel to be turned off without FreeBSD/Linux support

For now it's safer to disable multi-channel without having support
for TIOCOUTQ/FIONWRITE on tcp sockets.

Using a fixed retransmission timeout (rto) of 1 second would be ok,
but we better require kernel support for requesting for unacked bytes
in the kernel send queue.

"force:server multi channel support = yes" can be used to overwrite
the compile time restriction (mainly for testing).

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
88b0da10 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: make use of the new ack infrastructure for oplock/lease breaks

This finally implements the retry of failed oplock/lease breaks.

Before smbd_smb2_break_send/recv completed directly after
sendmsg() passed the pdu to the kernel.

Now the completion is (at least) deferred until the
the next smbXsrv_connection_ack_checker() run happens
and smbd_smb2_send_queue_ack_bytes() found that
all bytes of the break notification left the kernel
send queue (and were TCP acked).

If the connection is disconnected all pending break
notifications are completed with an error, which is
then returned by smbd_smb2_break_recv().
smbXsrv_pending_break_submit() will then submit
another break notification via the next available
connection/channel.

The smbXsrv_connection_ack_checker() runs each
rto_usecs (between 0.2s and 1.0s). smbd_smb2_break_send()
will set a timeout of 6*rto_usecs (between 1.2s and 6s).
If smbXsrv_connection_ack_checker() detects via
smbd_smb2_send_queue_ack_bytes() that a pending break
notification is pending for more than its timeout
we'll disconnect the connection with NT_STATUS_IO_TIMEOUT.
This will be handled as any other disconnect and
will in turn also trigger the retry on the next channel.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
bd1285d4 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
s3:smbd: implement FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUT

This will be used by smbtorture in order to simulate channel failures
without relying on iptables.

'smbd:FSCTL_SMBTORTURE = yes' is required in order to active this.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
883657a7 by Stefan Metzmacher at 2020-07-08T15:54:40+00:00
selftest/Samba3: make use of 'smbd:FSCTL_SMBTORTURE = yes'

This makes sure the lease/oplock break retry logic based on
missing TCP acks is tested.

We're still not able to run multichannel tests automatically,
as socket wrapper doesn't support fd-passing yet.

But this testing this with single channels is a good start.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
ba66abef by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:ctdbd_conn: make use of ctdbd_control_local() in ctdbd_register_ips()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
57515a43 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:ctdbd_conn: make use of samba_sockaddr in ctdbd_connect()

This avoids compiler warnings like this:
dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
4d924528 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:ctdbd_conn: add ctdbd_control_get_public_ips() and ctdbd_find_in_public_ips()

These will be used in the multi channel code in order to handle
public ip addresses, which can move arround ctdb nodes.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
ad3c5c1a by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: consistently use DLIST_ADD* to fill client->connections in smbd_add_connection()

We should not just overwrite the client->connections pointer if we
reject the connection.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
dbe27672 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: handle NETWORK_ACCESS_DENIED in smbXsrv_client_connection_pass_loop()

smbd_add_connection() may return a valid connection together with
NT_STATUS_NETWORK_ACCESS_DENIED.

We need additional cleanup for that case.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
876a8449 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: fill in xconn->client early in smbd_add_connection()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
ecef3fe0 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: make sure we detect stale smbXsrv_connection pointers in smbXsrv_session_auth0

Pointer values can be reused (yes, I hit that during my testing!).
Introduce a channel_id to identify connections and also add
some timestamps to make debugging easier.

This makes smbXsrv_session_find_auth() much more robust.

This is a similar change as 0cec96526bf4d3209caf36c4a19632ff5d5dd112:
 "smb2_server: make sure we detect stale smbXsrv_connection pointers in smbXsrv_channel_global"

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
ab14a0d1 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: make sure smbXsrv_connection_disconnect_transport() closes the socket fd

I assumed that TALLOC_FREE(xconn->transport.fde) would close the socket,
but until now we didn't use tevent_fd_set_auto_close().

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
af51b75c by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: make smbXsrv_client_connection_pass_loop() more robust

Don't leak fds in the error paths.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
79eaa196 by Stefan Metzmacher at 2020-07-08T15:54:41+00:00
s3:smbd: disconnect the all client connections if a ctdb public ip dropped

For now we keep it simple and any disconnect on a connection that
used a ctdb public address, will disconnect all other remaining
connections.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
3afdf2a8 by Stefan Metzmacher at 2020-07-08T17:16:40+00:00
s3:smbd: skip ctdb public ips in fsctl_network_iface_info()

Multi-Channel clients should not connect to ctdb public ip addresses
(which move between nodes).

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Jul  8 17:16:40 UTC 2020 on sn-devel-184

- - - - -
6a409da9 by Karolin Seeger at 2020-07-09T07:19:37+00:00
WHATSNEW: Add release notes for Samba 4.13.0rc1.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
8c869989 by Karolin Seeger at 2020-07-09T07:19:37+00:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc1 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
8aa9258e by Stefan Metzmacher at 2020-08-06T12:26:31+02:00
VERSION: Bump version up to 4.13.0rc2...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
6ddc1b66 by Isaac Boukris at 2020-08-07T09:18:20+00:00
Add a test with old msDS-SupportedEncryptionTypes

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

Signed-off-by: Isaac Boukris <iboukris at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 07399831794e28c7c2cf0140d0f1d1b5538b5f60)

- - - - -
19fecfaa by Stefan Metzmacher at 2020-08-07T10:39:26+00:00
kdc:db-glue: ignore KRB5_PROG_ETYPE_NOSUPP also for Primary:Kerberos

Currently we only ignore KRB5_PROG_ETYPE_NOSUPP for
Primary:Kerberos-Newer-Keys, but not for Primary:Kerberos.

If a service account has msDS-SupportedEncryptionTypes: 31
and DES keys stored in Primary:Kerberos, we'll pass the
DES key to smb_krb5_keyblock_init_contents(), but may get
KRB5_PROG_ETYPE_NOSUPP.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue Jul 28 14:04:26 UTC 2020 on sn-devel-184

(cherry picked from commit 4baa7cc8e473f6b63316b4ae5db34796c0f864c3)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Fri Aug  7 10:39:26 UTC 2020 on sn-devel-184

- - - - -
f2f122d6 by Andreas Schneider at 2020-08-10T09:25:17+00:00
docs: Fix documentation for require_membership_of of pam_winbind

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 4c74db6978c682f8ba4e74a6ee8157cfcbb54971)

- - - - -
983b35fd by Andreas Schneider at 2020-08-10T09:25:17+00:00
docs: Fix documentation for require_membership_of of pam_winbind.conf

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>
(cherry picked from commit 71b7140fd0a33e7e8c5bf37c2897cea8224b3f01)

- - - - -
8bd4e018 by Martin Schwenke at 2020-08-10T09:25:17+00:00
ctdb-scripts: Use nfsconf as a last resort to set NFS_HOSTNAME

If nfsconf exists then use it as last resort to attempt to extract
[statd]:name from /etc/nfs.conf.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14444
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 334dd8cedda6a341e3b89c9adc8102ea5480e452)

- - - - -
18628ba1 by Martin Schwenke at 2020-08-10T09:25:17+00:00
ctdb-scripts: Use nfsconf as a last resort get nfsd thread count

If nfsconf exists then use it as last resort to attempt to extract
[nfsd]:threads from /etc/nfs.conf.

Invocation of nfsconf requires "|| true" because this script uses "set
-e".  Add a stub that always fails to at least test this much.

RN: Use nfsconf utility for variable values in CTDB NFS scripts
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14444
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Mon Jul 27 07:06:58 UTC 2020 on sn-devel-184

(cherry picked from commit 642dc6ded6426ba2fbf3ac1e5cd71aae11ca245b)

- - - - -
2bdf5e9c by Andrew Bartlett at 2020-08-10T09:25:17+00:00
dbcheck: Allow a dangling forward link outside our known NCs

If we do not have the NC of the target object we can not be really sure
that the object is redundent and so we want to keep it for now
and not (as happened until now) break the dbcheck run made during the
replication stage of a "samba-tool domain backup rename".

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit 05228c4e07013c0e6f78f1330b3b787271282ca8)

- - - - -
ab227e7d by Volker Lendecke at 2020-08-10T09:25:17+00:00
torture3: Align integer types

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

- - - - -
12997bb8 by Volker Lendecke at 2020-08-10T09:25:17+00:00
winbind: Add test for lookuprids cache problem

When reading entries from gencache, wb_cache_rids_to_names() can
return STATUS_SOME_UNMAPPED, which _wbint_LookupRids() does not handle
correctly.

This test enforces this situation by filling gencache with one wbinfo
-R and then erasing the winbindd_cache.tdb. This forces winbind to
enter the domain helper process, which will then read from gencache
filled with the previous wbinfo -R.

Without having the entries cached this does not happen because
wb_cache_rids_to_names() via the do_query: path calls deep inside
calls dcerpc_lsa_lookup_sids_noalloc(), which hides the
STATUS_SOME_UNMAPPED that came in as lsa_LookupSids result value.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14435
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
(cherry picked from commit 04eafce653afcff517317d2b190acc4f0cbf4c61)

- - - - -
bb49e891 by Volker Lendecke at 2020-08-10T10:46:37+00:00
winbind: Fix lookuprids cache problem

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14435
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Thu Jul  9 21:40:52 UTC 2020 on sn-devel-184

(cherry picked from commit cd4122d91e942ca465c03505d5e148117f505ba4)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Mon Aug 10 10:46:37 UTC 2020 on sn-devel-184

- - - - -
78a6cce9 by Martin Schwenke at 2020-08-12T09:52:08+00:00
ctdb-tests: Stop cat command failure from causing test failure

In certain circumstance, which aren't obvious, cat(1) can fail when
attempting to write a lot of data.  This is due to something (probably
write(2)) returning EAGAIN.

Given that the -v option should only really be used for test
debugging, ignore the failure instead of spending time debugging it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14446
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 3ff8765d04c0fb950b7be4f9a049999aeb08223b)

- - - - -
5df2c348 by Isaac Boukris at 2020-08-12T11:16:04+00:00
Remove depracated "ldap ssl ads" smb.conf option

Signed-off-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Wed Aug 12 11:16:04 UTC 2020 on sn-devel-184

- - - - -
2dace996 by Karolin Seeger at 2020-08-14T09:59:09+02:00
WHATSNEW: Add release notes for Samba 4.13.0rc2.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
8c7bedcc by Karolin Seeger at 2020-08-14T09:59:48+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc2 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
2bd88d07 by Karolin Seeger at 2020-08-14T10:01:35+02:00
VERSION: Bump version up to 4.13.0rc3...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
031618f0 by Christof Schmitt at 2020-08-19T08:34:09+00:00
util: Allow symlinks in directory_create_or_exist

Commit 9f60a77e0b updated the check to avoid having files or other
objects instead of a directory. This missed the valid case that there
might be a symlink to a directory. Updated the check accordingly to
allow symlinks to directories.

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

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 672212cecdd7a7de40acdc81c56e2996ea82c090)

- - - - -
97d3c93e by Christof Schmitt at 2020-08-19T09:56:13+00:00
util: Add cmocka unit test for directory_create_or_exists

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

Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Sun Aug 16 07:06:59 UTC 2020 on sn-devel-184

(cherry picked from commit e89ec78e9a262a6e7bb9082323083eb5f1609655)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Wed Aug 19 09:56:13 UTC 2020 on sn-devel-184

- - - - -
b44b26b9 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
selftest: Add test for suppression of deprecation warnings

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit d3ff49f48507d8a64b9c4847f79d7939f647e6f0)

- - - - -
dcf92a69 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
param: Allow tests to silence deprecation warnings

This helps make output sensitive tests more reliable.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit d14cc45c98a77fb8a6ac96181eec33f368b8dbd8)

- - - - -
e3c608d2 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
selftest: Do not let deprecated option warnings muck this test up

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 9e212dd15e6c484d69f236f3c6d7186f0e6353b4)

- - - - -
1338e3a4 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: Deprecate NT4-like domains and SMBv1-only protocol options

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit c6aa710f8da9ef92b388f1c0c59b2dd3c602ad2d)

- - - - -
7b480565 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: deprecate "client use spnego"

This parameter is appicable only to SMBv1 and we are deprecating SMBv1 specific
authentication options for possible removal.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 1b85db57e53533ce14beb79f6d949a08f6ef9f91)

- - - - -
100e32db by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: deprecate "client lanman auth"

This parameter is appicable only to SMBv1 and we are deprecating SMBv1 specific
authentication options for possible removal.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit ac8e5ea22d9f9b16a79f519f69852b46ac798541)

- - - - -
e2b9972f by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: deprecate "client NTLMv2 auth"

This parameter is appicable only to SMBv1 and we are deprecating SMBv1 specific
authentication options for possible removal.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 5543c11c8b007b49641758428af7ba3976683438)

- - - - -
af78b53f by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: deprecate "client plaintext auth"

This parameter is appicable only to SMBv1 and we are deprecating SMBv1 specific
authentication options for possible removal.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 37583b19d2c3dbf3e9d0498a39b8b9d9c727e1d4)

- - - - -
8dbeb263 by Andrew Bartlett at 2020-08-24T13:52:19+00:00
docs: deprecate "raw NTLMv2 auth"

This parameter is appicable only to SMBv1 and we are deprecating SMBv1 specific
authentication options for possible removal.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 8c9d9441edce2e8d7f0428d0ec5e209ed8a55dbc)

- - - - -
e0aa042c by Andrew Bartlett at 2020-08-24T15:13:29+00:00
WHATSNEW: list deprecated parameters

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Aug 18 01:32:21 UTC 2020 on sn-devel-184

(cherry picked from commit 20606fd0a4c4697ff99da59f748af6908d929901)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Mon Aug 24 15:13:30 UTC 2020 on sn-devel-184

- - - - -
51f8ccf2 by Günther Deschner at 2020-08-27T10:48:07+00:00
docs: Add missing winexe manpage

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Thu Aug 20 12:55:23 UTC 2020 on sn-devel-184

(cherry picked from commit a9b6a8378e5db19d5d5ecd42f08ec3abd49ad5b8)

- - - - -
5ad1f837 by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Drop unused nodemap argument from update_flags_on_all_nodes()

An unused argument needlessly extends the length of function calls.  A
subsequent change will allow rec->nodemap to be used if necessary.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 6982fcb3e6c940d0047aac3b6bfbc9dfdc8d7214)

- - - - -
3e3124af by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Change update_flags_on_all_nodes() to take rec argument

This makes fields such as recmaster and nodemap easily available if
required.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit cb3a3147b7a3a29d7806733791e1fa6ba2e46680)

- - - - -
6fc2ec16 by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Introduce some local variables to improve readability

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit f681c0e947741151f8fb95d88edddfd732166dc1)

- - - - -
abc8222f by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Use update_flags_on_all_nodes()

This is clearer than using the MODFLAGS control directly.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 915d24ac12d27c21649d9e64d201d9df9d583129)

- - - - -
299d4e3f by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Improve a call to update_flags_on_all_nodes()

This should take a PNN, not an array index.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit b1e631ff929fd87392a80895d1c8d265d9df42dc)

- - - - -
267bb7fa by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Move ctdb_ctrl_modflags() to ctdb_recoverd.c

This file is the only user of this function.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a88c10c5a9afcf0a3dcadef07dd95af498bfa47a)

- - - - -
6d8271ff by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Flatten update_flags_on_all_nodes()

The logic currently in ctdb_ctrl_modflags() will be optimised so that
it no longer matches the pattern for a control function.  So, remove
this function and squash its functionality into the only caller.

Although there are some superficial changes, the behaviour is
unchanged.

Flattening the 2 functions produces some seriously weird logic for
setting the new flags, to the point where using ctdb_ctrl_modflags()
for this purpose now looks very strange.  The weirdness will be
cleaned up in a subsequent commit.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 0c6a7db3ba84b8355359b0a8c52690b234bb866d)

- - - - -
b0bf26df by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Do not retrieve nodemap from recovery master

It is already in rec->nodemap.

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 9475ab044161e687b9ced3a477746393565b49b1)

- - - - -
991907cf by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Correctly find nodemap entry for pnn

Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 3654e416770cc7521dcc3c15976daeba37023304)

- - - - -
3261adfc by Martin Schwenke at 2020-08-27T10:48:07+00:00
ctdb-recoverd: Simplify calculation of new flags

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

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Fri Jul 24 06:03:23 UTC 2020 on sn-devel-184

(cherry picked from commit 5ce6133a75107abdcb9fcfd93bc7594812dc5055)

- - - - -
772dfb02 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Basic cleanups for get_remote_nodemaps()

Don't log an error on failure - let the caller can do this.  Apart
from this: fix up coding style and modernise the remaining error
message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 52f520d39cd92e1cf2413fd7e0dd362debd6f463)

- - - - -
245f0043 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Fix a local memory leak

The memory is allocated off the memory context used by the current
iteration of main loop.  It is freed when main loop completes the fix
doesn't require backporting to stable branches.  However, it is sloppy
so it is worth fixing.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d2d90f250214582d7124b8137aa2cf5032b2f285)

- - - - -
97ed7d28 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Change signature of get_remote_nodemaps()

Change 1st argument to a rec context, since this will be needed later.
Drop the nodemap argument and access it via rec->nodemap instead.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 3324dd272c7dafa92cd9c3fd0af8f50084bcdaaa)

- - - - -
092beb2f by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Move memory allocation into get_remote_nodemaps()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 2eaa0af6160588b6e3364b181d0976477d12b51b)

- - - - -
05b46fa6 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Add an intermediate state struct for nodemap fetching

This will allow an error callback to be added.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a079ee31690cf7110f46b41989ffcfb83b7626d6)

- - - - -
da94f78c by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Add fail callback to assign banning credits

Also drop error handling in main_loop() that is replaced by this
change.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 10ce0dbf1c11eaaab7b28b6bbd014235a36d1962)

- - - - -
a1f00ebe by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Fix node_pnn check and assignment of nodemap into array

This array is indexed by the same index as nodemap, not the PNN.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 368c83bfe3bbfff568d14f65e7b1ffa41d5349ac)

- - - - -
48ca1987 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Change get_remote_nodemaps() to use connected nodes

The plan here is to use the nodemaps retrieved by get_remote_nodes()
in update_local_flags().  This will improve efficiency, since
get_remote_nodes() fetches flags from nodes in parallel.  It also
means that get_remote_nodes() can be used exactly once early on in
main_loop() to retrieve remote nodemaps.  Retrieving nodemaps multiple
times is unnecessary and racy - a single monitoring iteration should
not fetch flags multiple times and compare them.

This introduces a temporary behaviour change but it will be of no
consequence when the above changes are made.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 762d1d8a9605f97973a2c1176de5d29fcc61d15a)

- - - - -
7fe08880 by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Do not fetch the nodemap from the recovery master

The nodemap has already been fetched from the local node and is
actually passed to this function.  Care must be taken to avoid
referencing the "remote" nodemap for the recovery master.  It also
isn't useful to do so, since it would be the same nodemap.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d50919b0cb28f299c9b6985271b29d4f27c5f619)

- - - - -
8e10b67f by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Get remote nodemaps earlier

update_local_flags() will be changed to use these nodemaps.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 910a0b3b747a987ba69b6a0b6256e964b7d85dfe)

- - - - -
98580fca by Martin Schwenke at 2020-08-27T10:48:08+00:00
ctdb-recoverd: Change update_local_flags() to use already retrieved nodemaps

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 702c7c4934e79a9161fdc59df70df30ae492d89f)

- - - - -
58627af1 by Martin Schwenke at 2020-08-27T12:11:01+00:00
ctdb-recoverd: Rename update_local_flags() -> update_flags()

This also updates remote flags so the name is misleading.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 4aa8e72d60e92951b35190d2ffcfdb1bfb756609)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Thu Aug 27 12:11:01 UTC 2020 on sn-devel-184

- - - - -
15ec9863 by Karolin Seeger at 2020-08-28T10:41:20+02:00
WHATSNEW: Add release notes for Samba 4.13.0rc3.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
f5f22da6 by Karolin Seeger at 2020-08-28T11:18:15+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc3 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
04630942 by Karolin Seeger at 2020-08-28T11:19:18+02:00
VERSION: Bump version up to 4.13.0rc4...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
fa74a0a2 by Volker Lendecke at 2020-09-03T13:34:10+00:00
build: Wrap a long line

There will be another entry in the next commit

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit c8c2f8ba73324ba43ccef9f6d1c0c726d7ec0d25)

- - - - -
6179ac98 by Volker Lendecke at 2020-09-03T13:34:10+00:00
torture: Test ldap session expiry

LDAP connections should time out when the kerberos ticket used to authenticate
expires. Windows does this with a RFC4511 section 4.4.1 message (that as of
August 2020 is encoded not according to the RFC) followed by a TCP disconnect.

ldb sees the section 4.4.1 as a protocol violation and returns
LDB_ERR_PROTOCOL_ERROR.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 35c4bb0b0c55a65490fe199edb1a534548104e95)

- - - - -
caf9cfa8 by Volker Lendecke at 2020-09-03T13:34:10+00:00
ldap_server: Add the krb5 expiry to conn->limits

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 77f72fb01faba45babfe6080f805361492ce49e5)

- - - - -
3824ce0d by Volker Lendecke at 2020-09-03T13:34:10+00:00
ldap_server: Terminate LDAP connections on krb ticket expiry

See RFC4511 section 4.4.1 and

https://lists.samba.org/archive/cifs-protocol/2020-August/003515.html

for details: Windows terminates LDAP connections when the krb5 ticket
expires, Samba should do the same. This patch slightly deviates from
Windows behaviour by sending a LDAP exop response with msgid 0 that is
ASN1-encoded conforming to RFC4511.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit eb72f887b0bf91c050fd5d911f58a1b3ff9b8bcc)

- - - - -
67676bc4 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Only free() ld->pending if "req" is part of it

Best reviewed with "git show -U10". We need to check that "req" is
actually the last request that is being freed before freeing the whole
array.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit b85dbc9ccf80d8c19aff33c1da83954e5d6a37ef)

- - - - -
73deb833 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Fix tldap_msg_received()

The callback of "req" might have destroyed "ld", we can't reference
this anymore after calling tevent_req_done(req). Defer calling the
callbacks, which also means that the callbacks can't have added
anything to ld->pending.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit f816ccb8f4d212fe7f6bf36f90cbb9297c899786)

- - - - -
a3758fa5 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Always remove ourselves from ld->pending at cleanup time

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 14f6d1996ec38620b1c05a3b6c0e26dd21801fac)

- - - - -
4b02185e by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Maintain the ldap read request in tldap_context

Required for proper connection rundown, we need to TALLOC_FREE() the
read request before shutting down the tstream

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit cb852c9dc0d0fa1d3e7473082ad6b460106b314b)

- - - - -
468286f4 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Centralize connection rundown on error

Whenever send or recv return -1, we have to cancel all pending
requests and our transport stream is no longer usable: Discard it upon
such an error.

To avoid duplicate state, tldap_connection_ok() now looks at whether
we have a tstream_context around.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit f745f5b12560dbcb7be6f3ffb3bc10704c87149c)

- - - - -
4f695a62 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Make sure all requests are cancelled on rundown

Put messages into the ld->pending array before sending them out, not
after they have been sent.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 2a2a6b27cccb2409d321c7e03feb8baa047d1bf4)

- - - - -
4a4af2c2 by Volker Lendecke at 2020-09-03T13:34:10+00:00
tldap: Add PRINTF_ATTRIBUTE declaration to tldap_debug()

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit a2b281bed022c04427ef478529462ff84fe42908)

- - - - -
725dda2b by Stefan Metzmacher at 2020-09-03T13:34:10+00:00
idmap_ad: Pass tldap debug messages on to DEBUG()

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 7af2df01dff62d6d9ca572f320ef60dea41d6064)

- - - - -
c785fc60 by Volker Lendecke at 2020-09-03T13:34:11+00:00
test: Test winbind idmap_ad ticket expiry behaviour

We need to make sure that winbind's idmap_ad deals fine with an
expired krb ticket used to connect to AD via LDAP. In a customer
situation we have seen the RFC4511 section 4.4.1 unsolicited ldap exop
response coming through, but the TCP disconnect that Windows seems to
do after that did not make it. Winbind deals fine with a TCP
disconnect, but right now it does not handle just the section 4.4.1
response properly: It completely hangs.

This test requests a ticket valid for 5 seconds and makes the LDAP
server postpone the TCP disconnect after the ticket expiry for 10
seconds. The tests that winbind reacts to the ticket expiry exop
response by making sure in this situation the wbinfo call running into
the issue takes less than 8 seconds. If it did not look at the expiry
exop response, it would take more than 10 seconds.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14465
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit a4ecd112e7754ab25bcae749594952a28c4c8905)

- - - - -
1549dc56 by Volker Lendecke at 2020-09-03T13:34:11+00:00
tldap: Receiving "msgid == 0" means the connection is dead

We never use msgid=0, see tldap_next_msgid(). RFC4511 section 4.4.1
says that the unsolicited disconnect response uses msgid 0. We don't
parse this message, which supposedly is an extended response: Windows
up to 2019 sends an extended response in an ASN.1 encoding that does
not match RFC4511.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Fri Aug 21 20:37:25 UTC 2020 on sn-devel-184

(cherry picked from commit ccaf661f7c75717341140e3fbfb2a48f96ea952c)

- - - - -
43119289 by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:selftest: also run durable_v2_reconnect_delay_msec in samba3.blackbox.durable_v2_delay

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 560fe7b38f0c8d53079fabf3f984b11748270035)

- - - - -
e62a37e9 by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:share_mode_lock: reproduce problem with stale disconnected share mode entries

This reproduces the origin of "PANIC: assert failed in get_lease_type()"
(https://bugzilla.samba.org/show_bug.cgi?id=14428).

share_mode_cleanup_disconnected() removes disconnected entries from
leases.tdb and brlock.tdb but not from locking.tdb.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 444f2bedf723b89bb9f493c47812bff2154c4113)

- - - - -
4aa4f12f by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:share_mode_lock: let share_mode_forall_entries/share_entry_forall evaluate e.stale first

It's not really clear why e.stale would be ignored if *modified is set
to true.

This matches the behavior of share_mode_entry_do()

This also makes sure we see the removed entry in level 10 logs again.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit deb2f782c95a5e59a0a5da4272239c2d31bc2b6d)

- - - - -
8a8b90eb by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:share_mode_lock: consistently debug share_mode_entry records

share_mode_entry_do(), share_mode_forall_entries() and
share_entry_forall() print the record before the callback is called
and when it was modified or deleted.

This makes it much easier to debug problems.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 4d740ac2084a68c6d4836cd83ea5d5f1ee9d37a2)

- - - - -
b83efaec by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:share_mode_lock: add missing 'goto done' in share_mode_cleanup_disconnected()

When cleanup_disconnected_lease() fails we should stop,
at least we do that if brl_cleanup_disconnected() fails.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 1aa1ac97082f81f6dc62f345823d2dd345e0afd7)

- - - - -
0a682a18 by Stefan Metzmacher at 2020-09-03T13:34:11+00:00
s3:share_mode_lock: make sure share_mode_cleanup_disconnected() removes the record

This fixes one possible trigger for "PANIC: assert failed in get_lease_type()"
https://bugzilla.samba.org/show_bug.cgi?id=14428

This is no longer enough to remove the record:

   d->have_share_modes = false;
   d->modified = true;

Note that we can remove it completely from
share_mode_cleanup_disconnected() as
share_mode_forall_entries() already sets it
when there are no entries left.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit b5c0874fd5d31e252cf9ac8b84bde5c536b1e8ef)

- - - - -
df1ff55d by Stefan Metzmacher at 2020-09-03T14:55:14+00:00
s3:share_mode_lock: remove unused reproducer for bug #14428

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Mon Aug 31 13:34:17 UTC 2020 on sn-devel-184

(cherry picked from commit b02f1d676f6e62a0a4b33b9b08f8f51a68b561ca)

Autobuild-User(v4-13-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-13-test): Thu Sep  3 14:55:14 UTC 2020 on sn-devel-184

- - - - -
be07e268 by David Disseldorp at 2020-09-04T12:37:35+00:00
build: toggle vfs_snapper using --with-shared-modules

7ae03a19b3c ("build: add configure option to control vfs_snapper build")
added new --enable-snapper and --disable-snapper configure parameters to
control whether the vfs_snapper module was built.
The new parameters conflicted with existing
--with-shared-modules=[!]vfs_snapper behaviour.

This change reinstates working --with-shared-modules=[!]vfs_snapper
functionality. vfs_snapper stays enabled by default, but only on Linux.
Linux systems lacking the dbus library and header files should
explicitly disable the module via --with-shared-modules=!vfs_snapper as
documented.

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

Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Björn Jacke <bjacke at samba.org>

Autobuild-User(master): David Disseldorp <ddiss at samba.org>
Autobuild-Date(master): Wed Sep  2 16:24:50 UTC 2020 on sn-devel-184

(cherry picked from commit b6805d5e0bcf1716f87e84bcbb2fd8f93c38a8a3)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Fri Sep  4 12:37:35 UTC 2020 on sn-devel-184

- - - - -
29e15b80 by Karolin Seeger at 2020-09-07T12:45:48+02:00
WHATSNEW: Add release notes for Samba 4.13.0rc4.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
caa4cf52 by Karolin Seeger at 2020-09-07T12:46:21+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc4 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
99d555f7 by Karolin Seeger at 2020-09-07T12:47:09+02:00
VERSION: Bump version up to 4.13.0rc5...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
b29103ef by Jean-Marc Saffroy at 2020-09-10T08:21:26+00:00
Add vfs_ring.

- - - - -
191c2cd7 by Volker Lendecke at 2020-09-10T08:21:26+00:00
vfs_ring: Adapt to 4.13 VFS

- - - - -
88a31703 by Stefan Metzmacher at 2020-09-10T08:21:26+00:00
lib/replace: move lib/replace/closefrom.c from ROKEN_HOSTCC_SOURCE to REPLACE_HOSTCC_SOURCE

This is where it really belongs and we avoid the strange interaction
with source4/heimdal_build/config.h. This a follow up for commit
f31333d40e6fa38daa32a3ebb32d5a317c06fc62.

This fixes a build problem if libbsd-dev is not installed.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Björn Jacke <bjacke at samba.org>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue Sep  8 13:59:58 UTC 2020 on sn-devel-184

(cherry picked from commit 0022cd94587b805a525b0b9ef71ff0f15780424a)

- - - - -
3e145fef by Andreas Schneider at 2020-09-10T08:21:27+00:00
s3:libads: Remove DES legacy types for Kerberos

We already removed DES support for Kerberos in Samba 4.12.

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>
(cherry picked from commit 9cf1aecd73e011ad03ddb072760454379b3f0a32)

- - - - -
41f9aef2 by Andreas Schneider at 2020-09-10T08:21:27+00:00
s3:libads: Only add RC4 if weak crypto is allowed

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>
(cherry picked from commit a5303967287cef0c3d0b653e2aca73d25d438cf7)

- - - - -
a0c9e2e4 by Andreas Schneider at 2020-09-10T09:42:30+00:00
s3:libads: Also add a realm entry for the domain name

This is required if we try to authenticate as Administrator at DOMAIN so it
can find the KDC. This fixes 'net ads join' for ad_member_fips if we
require Kerberos auth.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>
(cherry picked from commit 6444a743525532c70634e2dd4cacadce54ba2eab)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Thu Sep 10 09:42:31 UTC 2020 on sn-devel-184

- - - - -
b3845522 by Andrew Bartlett at 2020-09-11T09:59:57+00:00
WHATSNEW: Announce the end of Python 2.6/2.7 support to build Samba

This is a warning for 4.14, to give users the normal deprecation
notice.

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

Signed-off-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Fri Sep 11 09:59:57 UTC 2020 on sn-devel-184

- - - - -
d61eb491 by Karolin Seeger at 2020-09-14T12:06:18+02:00
Revert "vfs_ring: Adapt to 4.13 VFS"

This reverts commit 191c2cd7b93524fc1ee119c0f995171fb38dc210.

- - - - -
7a9537a3 by Karolin Seeger at 2020-09-14T12:06:18+02:00
Revert "Add vfs_ring."

This reverts commit b29103ef46a9f80a0184d4d999f22512b7fdcd89.

- - - - -
90835ba1 by Andreas Schneider at 2020-09-14T12:06:18+02:00
s3:tests: Add test for 'valid users = DOMAIN\%U'

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
(cherry picked from commit 53b6dd951249052772e1ffcf651b7efd0963b931)

- - - - -
8bd284a5 by Andreas Schneider at 2020-09-14T12:06:18+02:00
s3:smbd: Fix %U substitutions if it contains a domain name

'valid users = DOMAIN\%U' worked with Samba 3.6 and broke in a newer
version.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
(cherry picked from commit 5de7c91e6d4e98f438157a7675c8582cabdd828d)

- - - - -
47e446f3 by Andreas Schneider at 2020-09-14T12:06:18+02:00
waf: Only use gnutls_aead_cipher_encryptv2() for GnuTLS > 3.6.14

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 94808cc50e4350a8c3bc250a886e8d4e7802dd12)

- - - - -
a0074cac by Karolin Seeger at 2020-09-15T12:20:26+02:00
WHATSNEW: Add release notes for Samba 4.13.0rc5.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
f5fd34cc by Karolin Seeger at 2020-09-15T12:21:10+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc5 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
45d4e546 by Karolin Seeger at 2020-09-15T12:23:47+02:00
VERSION: Bump version up to 4.13.0rc5...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
b57b6004 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): libcli/auth: add netlogon_creds_random_challenge()

It's good to have just a single isolated function that will generate
random challenges, in future we can add some logic in order to
avoid weak values, which are likely to be rejected by a server.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
9d90cd2b by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): s4:torture/rpc: make use of netlogon_creds_random_challenge()

This will avoid getting flakey tests once our server starts to
reject weak challenges.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
acf80197 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): libcli/auth: make use of netlogon_creds_random_challenge() in netlogon_creds_cli.c

This will avoid getting rejected by the server if we generate
a weak challenge.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
5f28e4f7 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server:netlogon: make use of netlogon_creds_random_challenge()

This is not strictly needed, but makes things more clear.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
afa0ec41 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): s4:rpc_server:netlogon: make use of netlogon_creds_random_challenge()

This is not strictly needed, but makes things more clear.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
fdac1570 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): libcli/auth: add netlogon_creds_is_random_challenge() to avoid weak values

This is the check Windows is using, so we won't generate challenges,
which are rejected by Windows DCs (and future Samba DCs).

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ba9110a1 by Stefan Metzmacher at 2020-09-18T13:27:15+02:00
CVE-2020-1472(ZeroLogon): libcli/auth: reject weak client challenges in netlogon_creds_server_init()

This implements the note from MS-NRPC 3.1.4.1 Session-Key Negotiation:

 7. If none of the first 5 bytes of the client challenge is unique, the
    server MUST fail session-key negotiation without further processing of
    the following steps.

It lets ./zerologon_tester.py from
https://github.com/SecuraBV/CVE-2020-1472.git
report: "Attack failed. Target is probably patched."

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
ed94cb18 by Stefan Metzmacher at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4:rpc_server/netlogon: protect netr_ServerPasswordSet2 against unencrypted passwords

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
4ad58d61 by Jeremy Allison at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server/netlogon: Fix mem leak onto p->mem_ctx in error path of _netr_ServerPasswordSet2().

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

Signed-off-by: Jeremy Allison <jra at samba.org>

- - - - -
6e8f1830 by Jeremy Allison at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server/netlogon: protect netr_ServerPasswordSet2 against unencrypted passwords

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
befc2aca by Stefan Metzmacher at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4:rpc_server/netlogon: refactor dcesrv_netr_creds_server_step_check()

We should debug more details about the failing request.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
b6f91e77 by Stefan Metzmacher at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4:rpc_server/netlogon: support "server require schannel:WORKSTATION$ = no"

This allows to add expections for individual workstations, when using "server schannel = yes".
"server schannel = auto" is very insecure and will be removed soon.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
32dd379f by Stefan Metzmacher at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4:rpc_server/netlogon: log warnings about unsecure configurations

This should give admins wawrnings until they have a secure
configuration.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Günther Deschner <gd at samba.org>

- - - - -
7ab19ec5 by Günther Deschner at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server/netlogon: refactor dcesrv_netr_creds_server_step_check()

We should debug more details about the failing request.

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Günther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
b93e1dcd by Günther Deschner at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server/netlogon: support "server require schannel:WORKSTATION$ = no"

This allows to add expections for individual workstations, when using "server schannel = yes".
"server schannel = auto" is very insecure and will be removed soon.

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Günther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
6192153d by Günther Deschner at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s3:rpc_server/netlogon: log warnings about unsecure configurations

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

Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

Signed-off-by: Günther Deschner <gd at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
e5c7800b by Stefan Metzmacher at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): docs-xml: document 'server require schannel:COMPUTERACCOUNT'

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
7c88d85c by Gary Lockyer at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4 torture rpc: Test empty machine acct pwd

Ensure that an empty machine account password can't be set by
netr_ServerPasswordSet2

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>

- - - - -
e4dc8227 by Gary Lockyer at 2020-09-18T13:27:16+02:00
CVE-2020-1472(ZeroLogon): s4 torture rpc: repeated bytes in client challenge

Ensure that client challenges with the first 5 bytes identical are
rejected.

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

Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>

[abartlet at samba.org: backported from master as test order was flipped]

- - - - -
ba279325 by Stefan Metzmacher at 2020-09-18T14:00:23+02:00
WHATSNEW: document the 'smb2 disable oplock break retry' option

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
049388ae by Stefan Metzmacher at 2020-09-18T14:01:29+02:00
WHATSNEW: document the planed removal of "server schannel"

Also add "server require schannel:COMPUTER"

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
de91bb3d by Stefan Metzmacher at 2020-09-18T14:03:37+02:00
WHATSNEW: Add release notes for Samba 4.13.0rc6.

CVE-2020-1472: Samba impact of "ZeroLogon".

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
09ef8ab5 by Stefan Metzmacher at 2020-09-18T14:04:45+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0rc6 release.

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
d8b4efed by Stefan Metzmacher at 2020-09-18T14:05:27+02:00
VERSION: Bump version up to 4.13.0rc7...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Stefan Metzmacher <metze at samba.org>

- - - - -
2034fefb by Karolin Seeger at 2020-09-22T15:31:49+02:00
WHATSNEW: Add release notes for Samba 4.13.0.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
3fe82c20 by Karolin Seeger at 2020-09-22T15:33:16+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.0 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
cbcc754b by Karolin Seeger at 2020-09-22T15:41:37+02:00
VERSION: Bump version up to 4.13.1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
e32a1f1b by Karolin Seeger at 2020-09-23T09:45:35+02:00
WHATSNEW: Fix release notes.

"server schannel" has not been removed.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
3ebed681 by Karolin Seeger at 2020-10-26T14:46:35+01:00
VERSION: Bump version up to 4.13.1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
22528b76 by Jeremy Allison at 2020-10-26T14:58:22+01:00
s4: torture: Add smb2.notify.handle-permissions test.

Add knownfail entry.

CVE-2020-14318

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

Signed-off-by: Jeremy Allison <jra at samba.org>

- - - - -
5dd4c789 by Jeremy Allison at 2020-10-26T14:58:22+01:00
s3: smbd: Ensure change notifies can't get set unless the directory handle is open for SEC_DIR_LIST.

Remove knownfail entry.

CVE-2020-14318

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

Signed-off-by: Jeremy Allison <jra at samba.org>

- - - - -
595dd9fc by Volker Lendecke at 2020-10-26T14:59:31+01:00
CVE-2020-14323 winbind: Fix invalid lookupsids DoS

A lookupsids request without extra_data will lead to "state->domain==NULL",
which makes winbindd_lookupsids_recv trying to dereference it.

Reported by Bas Alberts of the GitHub Security Lab Team as GHSL-2020-134

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14436
Signed-off-by: Volker Lendecke <vl at samba.org>

- - - - -
0b259a48 by Volker Lendecke at 2020-10-26T14:59:31+01:00
CVE-2020-14323 torture4: Add a simple test for invalid lookup_sids winbind call

We can't add this test before the fix, add it to knownfail and have the fix
remove the knownfail entry again. As this crashes winbind, many tests after
this one will fail.

Reported by Bas Alberts of the GitHub Security Lab Team as GHSL-2020-134

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14436
Signed-off-by: Volker Lendecke <vl at samba.org>

- - - - -
4cbf95e7 by Douglas Bagnall at 2020-10-26T15:00:36+01:00
CVE-2020-14383: s4/dns: Ensure variable initialization with NULL.

Based on patches from Francis Brosnan Blázquez <francis at aspl.es>
and Jeremy Allison <jra at samba.org>

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra at samba.org>
(based on commit 7afe449e7201be92bed8e53cbb37b74af720ef4e)

- - - - -
862d6fb6 by Douglas Bagnall at 2020-10-26T15:00:36+01:00
CVE-2020-14383: s4/dns: do not crash when additional data not found

Found by Francis Brosnan Blázquez <francis at aspl.es>.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Douglas Bagnall <dbagnall at samba.org>
Autobuild-Date(master): Mon Aug 24 00:21:41 UTC 2020 on sn-devel-184

(based on commit df98e7db04c901259dd089e20cd557bdbdeaf379)

- - - - -
a9bf4f90 by Laurent Menase at 2020-10-27T08:22:01+00:00
winbind: Fix a memleak

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14388
Signed-off-by: Laurent Menase <laurent.menase at hpe.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Noel Power <noel.power at suse.com>

Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Mon Sep 14 13:33:13 UTC 2020 on sn-devel-184

(cherry picked from commit 8f868b0ea0b4795668f7bc0b028cd85686b249fb)

- - - - -
a6606369 by Anoop C S at 2020-10-27T08:22:01+00:00
vfs_shadow_copy2: Avoid closing snapsdir twice

As per man page for closedir(3):

. . .
The  closedir() function closes the directory stream associated with
dirp.  A successful call to closedir() also closes the underlying file
descriptor associated with dirp.
. . .

Therefore we don't have to attempt an additional close of file
descriptor after closedir().

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Anoop C S <anoopcs at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>

Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Oct 14 10:08:24 UTC 2020 on sn-devel-184

(cherry picked from commit 74fbe0b987a0333cca28bb6a547e5b4b4f2e706d)

- - - - -
895bc9a7 by Martin Schwenke at 2020-10-27T08:22:01+00:00
ctdb-recoverd: Drop unnecessary code

This has already been done in update_flags().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14513
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 3ab52b528673e08caa66f00e963528c591a84fe1)

- - - - -
710b287b by Martin Schwenke at 2020-10-27T08:22:01+00:00
ctdb-recoverd: Drop unnecessary and broken code

update_flags() has already updated the recovery master's canonical
node map, based on the flags from each remote node, and pushed out
these flags to all nodes.

If i == j then the node map has already been updated from this remote
node's flags, so simply drop this case.

Although update_flags() has updated flags for all nodes, it did not
update each node map in remote_nodemaps[] to reflect this.  This means
that remote_nodemaps[] may contain inconsistent flags for some nodes
so it should not be used to check consistency when i != j.

Further, a meaningful difference in flags can only really occur if
update_flags() failed.  In that case this code is never reached.

These observations combine to imply that this whole loop should be
dropped.

This leaves potential sub-second inconsistencies due to out-of-band
healthy/unhealthy flag changes pushed via CTDB_SRVID_PUSH_NODE_FLAGS.
These updates could be dropped (takeover run asks each node for
available IPs rather than making centralised decisions based on node
flags) but for now they will be fixed in the next iteration of
main_loop().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14513
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 4b01f54041dee469971f244e64064eed46de2ed5)

- - - - -
e759ecda by Martin Schwenke at 2020-10-27T08:22:01+00:00
ctdb-tests: Strengthen node state checking in ctdb disable/enable test

Check that the desired state is set on all nodes instead of just the
test node.  This ensures that node flags have correctly propagated
across the cluster.

RN: Fix remaining ctdb disable/enable bug

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14513
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Oct  6 04:32:06 UTC 2020 on sn-devel-184

(cherry picked from commit b68105b8f7c20692d23d457f2777edcf44f12bb8)
Signed-off-by: Martin Schwenke <martin at meltin.net>

- - - - -
a89a78aa by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
python/tests: add DynamicTestCase setUpDynamicTestCases() infrastructure

This can be used in order to run a sepcific test (coded just once)
with an autogenerated set of arguments.

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

Pair-Programmed-With: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit 80347deb544b38be6c6814e5d1b82e48ebe83fd1)

- - - - -
f92b61ec by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:tests: add AclVisibiltyTests

This tests a sorts of combinations in order to
demonstrate the visibility of objects depending on:

- with or without fDoListObject
- with or without explicit DENY ACEs
- A hierachy of objects with 4 levels from the base dn
- SEC_ADS_LIST (List Children)
- SEC_ADS_LIST_LIST_OBJECT (List Object)
- SEC_ADS_READ_PROP
- all possible scopes and basedns

This demonstrates that NO_SUCH_OBJECT doesn't depend purely
on the visibility of the base dn, it's still possible to
get children returned und an invisible base dn.

It also demonstrates the additional behavior with "List Object" mode.
See [MS-ADTS] 5.1.3.3.6 Checking Object Visibility

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit 06d134406739e76b97273db3023855150dbaebbc)

- - - - -
540cd43b by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:acl_read: introduce aclread_check_object_visible() helper

In future this will do more than aclread_check_parent(),
if we implement fDoListObject and SEC_ADS_LIST_OBJECT handling.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit d2dd7c2a5c1f8ee30f0f3b41f933d082b0c75f7c)

- - - - -
24e0a440 by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:acl_read: fully set up 'struct aclread_context' before the search base acl check

This makes further change much easier.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit c4a3028de726d6708f57d02f9162a4d62d1b6ae7)

- - - - -
ee5b2e3b by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:acl_read: make use of aclread_check_object_visible() for the search base

We should only have one place to do access checks.

Use 'git show -w' to see the minimal diff.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit faff8e6c89777c38443e561235073c336cfb2e9c)

- - - - -
160a2d6a by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:acl_read: defer LDB_ERR_NO_SUCH_OBJECT

We may need to return child objects even if the base dn
is invisible.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit e1529bedb2b6c8553e69a42537ac0cffd03af6d6)

- - - - -
0918966f by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:util: add dsdb_do_list_object() helper

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
(cherry picked from commit ffc0bdc6d49e88da1ee408956365da163ff3e1b2)

- - - - -
b15f35b5 by Stefan Metzmacher at 2020-10-27T08:22:01+00:00
s4:dsdb:acl_read: Implement "List Object" mode feature

See [MS-ADTS] 5.1.3.3.6 Checking Object Visibility

I tried to avoid any possible overhead for the common cases:

- SEC_ADS_LIST (List Children) is already granted by default
- fDoListObject is off by default

Overhead is only added if the administrator turned on
the fDoListObject feature and removed SEC_ADS_LIST (List Children)
from a parent object.

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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Oct 21 08:48:02 UTC 2020 on sn-devel-184

(cherry picked from commit 7223f6453b1b38c933c9480c637ffd06d9f39b97)

- - - - -
15e15f7c by Khem Raj at 2020-10-27T08:22:01+00:00
nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h

glibc 2.32 will define these varibles [1] which results in conflicts
with these static function names, therefore prefix these function names
with samba_ to avoid it

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=499a92df8b9fc64a054cf3b7f728f8967fc1da7d

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Noel Power <npower at samba.org>

Autobuild-User(master): Noel Power <npower at samba.org>
Autobuild-Date(master): Tue Jul 28 10:52:00 UTC 2020 on sn-devel-184

(cherry picked from commit 6e496aa3635557b59792e469f7c7f8eccd822322)

- - - - -
069c5acc by Andreas Schneider at 2020-10-27T08:22:01+00:00
python: Create targetdir recursively

This fixes `make test` in a release tarball.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 76db796181419967a483bcd71fe0cca313ccaf82)

- - - - -
daeada8e by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Add remove_directory to common test functions

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 3770f28c6289a9328b81968a4548bfaeb8bd40aa)

- - - - -
33b116da by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve demote-saveddb test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit e58ccdaa1a1e5943aa02ecba88d1de0323777041)

- - - - -
62e97089 by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve tombstones-expunge test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit e4194355f4c346179ceafe5086897c0c50c108d6)

- - - - -
2aad7937 by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve runtime-links test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit a9765084f11eae991516f150d1cd1c2370854ec7)

- - - - -
7b2c975a by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve dbcheck-links test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit d8fe4315c85811ef3c5a1cfa42bf416bc1c8109e)

- - - - -
7357ddef by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve functionalprep test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 28720d66df017bfaadd44378dfffaaab4e30cf22)

- - - - -
e51a5e8a by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve dbcheck-oldrelease test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 32305d607f43a84fa862f9f97c0dc1ea51b45ab7)

- - - - -
995478c9 by Andreas Schneider at 2020-10-27T08:22:02+00:00
testprogs: Fix and improve upgradeprovision-oldrelease test

This fixes running `make test` in a release tarball!

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Oct 22 17:28:39 UTC 2020 on sn-devel-184

(cherry picked from commit 1432d225b0426e366649cde4837eff58ee95b0c8)

- - - - -
d76e1b43 by Andreas Schneider at 2020-10-27T08:22:02+00:00
third_party: Update resolv_wrapper to version 1.1.7

This fixes some Samba tests which redirect stderr to stdout and then get
more messages than expected.

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
(cherry picked from commit fbe58531a20cbbe0906f13e370329f3030d4ce96)

- - - - -
fe28ffc4 by Andreas Schneider at 2020-10-27T08:22:02+00:00
s3:script: Fix test_dfree_quota.sh

source3/script/tests/test_dfree_quota.sh: line 200: [: missing `]'

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 9bc9f8ce66ef02d7d77cfd31dc2a72102d546d75)

- - - - -
a4c24173 by Andreas Schneider at 2020-10-27T08:22:02+00:00
buildtools: Do not install binaries which are for selftest

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 8fa0d3331b2b2c450d86bffec0a6f39320fcb8c0)

- - - - -
cfd5b368 by Andreas Schneider at 2020-10-27T08:22:02+00:00
unittests: Mark test binaries for selftest

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 2d89ddb012d1d84871da10a61a0449f88d4eba5e)

- - - - -
b5b7a958 by Andreas Schneider at 2020-10-27T08:22:02+00:00
s3:modules: Do not install vfs modules only used for testing

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
(cherry picked from commit 6e25613a3141000ac1b7e8edb146dfc320972e8b)

- - - - -
61cd114b by Andreas Schneider at 2020-10-27T08:22:02+00:00
examples:auth: Do not install example plugin

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>

Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Oct 23 15:32:08 UTC 2020 on sn-devel-184

(cherry picked from commit 3b5b23ea848d82ec0a6d01d4e1cbb62c4c3cbb3b)

- - - - -
8e2ef3cd by Amitay Isaacs at 2020-10-27T08:22:03+00:00
bind9-dlz: Bind 9.13.x switched to using bool as isc_boolean_t instead of int.

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit cdb6c5d1eca1c0f6967941dbd1da07be6b53d302)

- - - - -
b5bc60e7 by Amitay Isaacs at 2020-10-27T08:22:03+00:00
provision: BIND 9.13.x is not supported

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit 95278618829227632b2bcb29fc272e600607ea41)

- - - - -
63d94da7 by Amitay Isaacs at 2020-10-27T08:22:03+00:00
bind9-dlz: Add support for BIND 9.14.x

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit a167a2154d4909e8e1f97d9f36d0e4c947f2d944)

- - - - -
4e65cc60 by Amitay Isaacs at 2020-10-27T08:22:03+00:00
provision: Add support for BIND 9.14.x

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit 016c1174ef783990f93e348ee82f5c989c43cbbf)

- - - - -
34513738 by Amitay Isaacs at 2020-10-27T08:22:03+00:00
provision: BIND 9.15.x is not supported

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit 4d09797652059c3ed5b2a4f94f2181ce14d39972)

- - - - -
f6b6867d by Amitay Isaacs at 2020-10-27T08:22:03+00:00
bind9-dlz: Add support for BIND 9.16.x

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit ca3c18a236dedfdfbf225dcfcd0418f1634d8759)

- - - - -
a831cc57 by Amitay Isaacs at 2020-10-27T08:22:03+00:00
provision: Add support for BIND 9.16.x

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>
(cherry picked from commit 5b2ccb1c7cad5cded5dad37a18a7d42c1680b2f7)

- - - - -
24ae26cb by Amitay Isaacs at 2020-10-27T08:22:03+00:00
provision: BIND 9.17.x is not supported

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

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Rowland Penny <rpenny at samba.org>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Thu Sep 24 05:55:43 UTC 2020 on sn-devel-184

(cherry picked from commit 1bccc67ce7c6364a95fbfeb095938522671578a8)

- - - - -
ff781ba4 by Björn Jacke at 2020-10-27T08:22:03+00:00
docs: fix default value of spoolss:architecture

"Windows x64" is the default here since a couple of years already.

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

Signed-off-by: Bjoern Jacke <bjacke at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Oct  6 23:06:50 UTC 2020 on sn-devel-184

(cherry picked from commit c587685dde2448d1f68ada47ce5ad42b02a118ce)

- - - - -
5a70cd80 by Karolin Seeger at 2020-10-27T10:04:21+01:00
WHATSNEW: Add release notes for Samba 4.13.1.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
9e9941a8 by Karolin Seeger at 2020-10-27T10:04:58+01:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.1 release.

o CVE-2020-14318: Missing handle permissions check in SMB1/2/3 ChangeNotify.
o CVE-2020-14323: Unprivileged user can crash winbind.
o CVE-2020-14383: An authenticated user can crash the DCE/RPC DNS with easily
                  crafted records.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
c4938561 by Alexander Bokovoy at 2020-10-27T10:50:29+00:00
daemons: report status to systemd even when running in foreground

When systemd launches samba services, the configuration we have in
systemd service files expects that the main process (/usr/sbin/*)
would use sd_notify() to report back its status. However, we only use
sd_notify() when running become_daemon().

As a result, samba/smbd/winbindd/nmbd processes never report back its
status and the status updates from other childs (smbd, winbindd, etc)
are not accepted as we now have implied NotifyAccess=main since commit
d1740fb3d5a72cb49e30b330bb0b01e7ef3e09cc

This leads to a timeout and killing samba process by systemd. Situation
is reproducible in Fedora 33, for example.

Make sure that we have required status updates for all daemons in case
we aren't runnning in interactive mode.

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

Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Oct 26 19:58:18 UTC 2020 on sn-devel-184

(cherry picked from commit 3e27dc4847bd35ca8914be087d5a8ca096510399)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Tue Oct 27 10:50:29 UTC 2020 on sn-devel-184

- - - - -
c2fef893 by Karolin Seeger at 2020-10-29T10:40:21+01:00
Merge tag 'samba-4.13.1' into v4-13-test

samba: tag release samba-4.13.1

- - - - -
05aa0b4b by Karolin Seeger at 2020-10-29T10:40:54+01:00
VERSION: Bump version up to 4.13.2.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
1b6b8530 by Alexander Bokovoy at 2020-10-30T12:26:29+00:00
smb.conf.5: add clarification how configuration changes reflected by Samba

Users of Linux distributions know to read smb.conf(5) manual page but
apparently not many of them read smbd(8) and winbindd(8) to understand
how changes to smb.conf file are reflected in the running processes.

Add a small section that makes it clear where to find relevant
information. Also correct the information in smbd, nmbd, and winbindd
manual pages.

The interval at which smbd does check for smb.conf changes was increased
from 60 seconds to 180 seconds in 1999 with commit 3db52feb1f3b.

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

Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Isaac Boukris <iboukris at samba.org>

Autobuild-User(master): Alexander Bokovoy <ab at samba.org>
Autobuild-Date(master): Tue Oct 20 08:50:13 UTC 2020 on sn-devel-184

(cherry picked from commit e32846f0692df44b4ee929c5ed6ba1de88ec4bd2)

- - - - -
bca2f0e9 by Amitay Isaacs at 2020-10-30T12:26:29+00:00
libndr: Avoid assigning duplicate versions to symbols

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

Symbols _ndr_push_error and _ndr_pull_error keep getting redefined as
they are included without wildcard in abi_match.  Apparently on linux ld
does not complain about duplicate symbols, but on freebsd ld fails to
link with following error:

  [ 918/3912] Linking bin/default/librpc/libndr.so
  ld: error: duplicate symbol '_ndr_pull_error' in version script
  ld: error: duplicate symbol '_ndr_push_error' in version script
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit 4cd195aafefb02b6921ea8439dd3897f8c74b012)

- - - - -
1b03a345 by Ralph Boehme at 2020-10-30T12:26:29+00:00
vfs_zfsacl: use handle based facl() call to query ZFS filesytem ACL

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

Pair-Programmed-With: Andrew Walker <awalker at ixsystems.com>
Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit f763b1e43640082af80c855a4a519f7747a6c87c)

- - - - -
50bb5034 by Andrew Walker at 2020-10-30T12:26:29+00:00
vfs_zfsacl: Add new parameter to stop automatic addition of special entries

Prevent ZFS from automatically adding NFSv4 special entries (owner@, group@,
everyone@). ZFS will automatically add these these entries when calculating the
inherited ACL of new files if the ACL of the parent directory lacks an
inheriting special entry. This may result in user confusion and unexpected
change in permissions of files and directories as the inherited ACL is
generated. Blocking this behavior is achieved by setting an inheriting
everyone@ that grants no permissions and not adding the entry to the file's
Security Descriptor.

This change also updates behavior so that the fd-based syscall facl() is
used where possible.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14470
RN: vfs_zfsacl: Add new parameter to stop automatic addition of special entries

Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit c10ae30c1185463eb937f69c1fc9914558087167)

- - - - -
2a6c27d6 by Ralph Boehme at 2020-10-30T12:26:29+00:00
vfs_zfsacl: README.Coding fix

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

Pair-Programmed-With: Andrew Walker <awalker at ixsystems.com>
Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit a182f2e6cdded739812e209430d340097acc0031)

- - - - -
c64c277b by Ralph Boehme at 2020-10-30T12:26:29+00:00
vfs_zfsacl: use a helper variable in zfs_get_nt_acl_common()

No change in behaviour.

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

Pair-Programmed-With: Andrew Walker <awalker at ixsystems.com>
Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 13b4f913b06457d8e1f7cf71c85722bbecabd990)

- - - - -
d9d66199 by Andrew Walker at 2020-10-30T12:26:29+00:00
vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special

When ZFS aclmode is set to "passthrough" chmod(2)/fchmod(2) will result
in special entries being modified in a way such that delete, delete_child,
write_named_attr, write_attribute are stripped from the returned ACL entry,
and the kernel / ZFS treats this as having rights equivalent to the desired
POSIX mode. Historically, samba has added delete_child to the NFSv4 ACL, but
this is only really called for in the case of special entries in this
particular circumstance.

Alter circumstances in which delete_child is granted so that it only
is added to special entries. This preserves the intend post-chmod behavior,
but avoids unnecessarily increasing permissions in cases where it's not
intended. Further modification of this behavior may be required so that
we grant a general read or general write permissions set in case of
POSIX read / POSIX write on special entries.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14471
RN: vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special

Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit c1a37b4f31d5252ce074d41f69e526aa84b0d3b3)

- - - - -
6521b0ff by Amitay Isaacs at 2020-10-30T12:26:30+00:00
ctdb-common: Avoid aliasing errors during code optimization

When compiling with GCC 10.x and -O3 optimization, the IP checksum
calculation code generates wrong checksum.  The function uint16_checksum
gets inlined during optimization and ip4pkt->tcp data gets wrongly
aliased.

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

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

Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Wed Oct 21 05:52:28 UTC 2020 on sn-devel-184

(cherry picked from commit 6aa396b0cd1f83f45cb76a4f3123d99135e8dd8c)

- - - - -
e424e1d6 by Alexander Bokovoy at 2020-10-30T12:26:30+00:00
DNS Resolver: support both dnspython before and after 2.0.0

`dnspython` 2.0.0 has many changes and several deprecations like:

```
> dns.resolver.resolve() has been added, allowing control of whether
search lists are used. dns.resolver.query() is retained for backwards
compatibility, but deprecated. The default for search list behavior can
be set at in the resolver object with the use_search_by_default
parameter. The default is False.

> dns.resolver.resolve_address() has been added, allowing easy
address-to-name lookups.
```

The new class `DNSResolver`:
- provides the compatibility layer
- defaults the previous behavior (the search list configured in the
  system's resolver configuration is used for relative names)
- defaults lifetime to 15sec (determines the number of seconds
  to spend trying to get an answer to the question)

The compatibility shim was developed by Stanislav Levin for FreeIPA and
adopted for Samba by Alexander Bokovoy.

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

Signed-off-by: Stanislav Levin <slev at altlinux.org>
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit 183d5d63f4b40accda3b3ffc980fea391612f964)

- - - - -
dbba939c by Andreas Schneider at 2020-10-30T13:53:37+00:00
s4:torture: Pass buffer correctly to write()

../../source4/torture/basic/denytest.c: In function ‘torture_createx_specific.isra’:
../../source4/torture/basic/denytest.c:2372:9: error: ‘write’ reading 56 bytes from a region of size 8 [-Werror=stringop-overflow=]
 2372 |   res = write(data_file_fd, &cxd, cxd_len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 5f92ec6988d2f4c20eab9449cbe17317588f6634)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Fri Oct 30 13:53:37 UTC 2020 on sn-devel-184

- - - - -
8079e2a9 by Sachin Prabhu at 2020-11-03T08:48:45+00:00
docs-xml/manpages: Add warning about write-behind translator for vfs_glusterfs

Add warning about data corruption with the write-behind translator.

The data corruption is highlighted by the smbtorture test smb2.rw.rw1.
More information about this data corruption issue is available in the
bz.

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

Signed-off-by: Sachin Prabhu <sprabhu at redhat.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
(cherry picked from commit 08f8f665d409ee7b93840c25a8142f2ce8bacfa1)

- - - - -
3d5be93e by Günther Deschner at 2020-11-03T08:48:45+00:00
s3-vfs_glusterfs: refuse connection when write-behind xlator is present

s3-vfs_glusterfs: refuse connection when write-behind xlator is present

Once the new glusterfs api is available we will programmtically disable
the translator, for now we just refuse the connection as there is
a potential for serious data damage.

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

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
Pair-Programmed-With: Sachin Prabhu <sprabhu at redhat.com>
Pair-Programmed-With: Anoop C S <anoopcs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Nov  2 21:40:33 UTC 2020 on sn-devel-184

(cherry picked from commit 2a49ccbcf5e3ff0f6833bcb7f04b800125f1783f)

- - - - -
2599b6bd by Jeremy Allison at 2020-11-03T10:16:27+00:00
s3: modules: vfs_glusterfs: Fix leak of char **lines onto mem_ctx on return.

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

Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Nov  3 01:56:59 UTC 2020 on sn-devel-184

(cherry picked from commit 7d846cd178d653600c71ee4bd6a491a9e48a56da)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-13-test): Tue Nov  3 10:16:27 UTC 2020 on sn-devel-184

- - - - -
c2df3732 by Karolin Seeger at 2020-11-03T13:31:02+01:00
WHATSNEW: Add relase notes for Samba 4.13.2.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
ffef4e94 by Karolin Seeger at 2020-11-03T13:31:03+01:00
VERSION: Disable GIT_SNAPSHOT for the 4.13.2 release.

Signed-off-by: Karolin Seeger <kseeger at samba.org>

- - - - -
4531eed0 by Mathieu Parent at 2020-11-10T11:17:38+01:00
Update d/gbp.conf, d/watch and d/README.source for 4.13

- - - - -
002c2936 by Mathieu Parent at 2020-11-10T11:19:44+01:00
New upstream version 4.13.2+dfsg
- - - - -
89b352db by Mathieu Parent at 2020-11-10T11:20:53+01:00
Update upstream source from tag 'upstream/4.13.2+dfsg'

Update to upstream version '4.13.2+dfsg'
with Debian dir 519c3fa61e12eb0b1a2e3e3bf0132bdecebb28ff
- - - - -
b7ab6fcb by Mathieu Parent at 2020-11-10T11:31:01+01:00
Update patches

- - - - -
155f96c0 by Jelmer Vernooij at 2020-11-10T11:31:18+01:00
Always specify rpath for private libraries

Last-Update: 2012-02-24
Applied-Upstream: no

- - - - -
8db4bedf by Christian Perrier at 2020-11-10T11:31:18+01:00
64 bit fix for libsmbclient

Bug-Debian: http://bugs.debian.org/221618
Forwarded: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=221618#27

- - - - -
2b529f34 by Christian Perrier at 2020-11-10T11:31:18+01:00
Mention smbldap-tools package in examples/LDAP/README

Bug-Debian: http://bugs.debian.org/341934
Forwarded: not-needed

- - - - -
6a6745ba by Steve Langasek at 2020-11-10T11:31:18+01:00
Use the pager alternative as pager is PAGER is undefined

Bug-Debian: http://bugs.debian.org/135603
Forwarded: not-needed

- - - - -
800c4cba by mathiaz at ubuntu.com at 2020-11-10T11:31:18+01:00
Enable net usershares by default at build time

Enable net usershares by default at build time, with a limit of 100, and update
the corresponding documentation.

Bug-Debian: http://bugs.debian.org/443230
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/128548
Forwarded: not-needed

- - - - -
dbd98d8f by Eloy A. Paris at 2020-11-10T11:31:18+01:00
Add "Debian" as vendor suffix

Forwarded: not-needed

- - - - -
9cb66166 by Jeroen Dekkers at 2020-11-10T11:31:18+01:00
Add so version number to private libraries for dpkg-shlibdeps

We also want dpkg-shlibdeps to generate correct dependency information
for the private libraries in our binary packages, but dpkg-shlibdeps
only works when the library has a version number.

Origin: vendor
Forwarded: not-needed

- - - - -
d9fc611a by Brian May at 2020-11-10T11:31:18+01:00
Patch in symbol table from rfc3454, for Heimdal scripts

Status: cherry-picked from heimdal package

- - - - -
1006f3b8 by Mathieu Parent at 2020-11-10T11:31:18+01:00
smbd.service: Run update-apparmor-samba-profile before start

Bug-Debian: https://bugs.debian.org/896080

- - - - -
b1da10a9 by Rafael David Tinoco at 2020-11-10T11:31:18+01:00
fix nfs related service names

Upstream defines nfs related service names based on the Linux
distribution. This patch fixes the names for Debian and derivatives.

Bug-Debian: https://bugs.debian.org/929931
Bug-Ubuntu: https://bugs.launchpad.net/bugs/722201
Last-Update: 2018-08-05

- - - - -
1f823e99 by Mathieu Parent at 2020-11-10T11:31:18+01:00
Rename mdfind to mdsearch

GNUstep as an mdfind binary, and both should be co-instalable.

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

Signed-off-by: Mathieu Parent <math.parent at gmail.com>

- - - - -
33f6a7c9 by Mathieu Parent at 2020-11-10T11:33:45+01:00
Bump build-depends ldb >= 2.2.0

- - - - -
fc78e311 by Mathieu Parent at 2020-11-11T21:56:58+01:00
Changelog for previous commits

- - - - -
3a43d131 by Mathieu Parent at 2020-11-11T21:56:58+01:00
Remove unused python3-crypto dependency (Closes: #971292)

- - - - -
d54b6a34 by Mathieu Parent at 2020-11-11T22:09:57+01:00
Install new files

- - - - -
f93ea94c by Mathieu Parent at 2020-11-12T09:03:05+01:00
Update symbols

- - - - -
4fd01d1c by Mathieu Parent at 2020-11-12T09:46:50+01:00
Enable Spotlight with ES backend (Closes: #956096, #956482)

- - - - -
3fcca8d5 by Mathieu Parent at 2020-11-12T09:46:50+01:00
Standards-Version: 4.5.0

- - - - -
757cad19 by Mathieu Parent at 2020-11-12T09:46:50+01:00
Add missing Build-Depends-Package in libsmbclient.symbols and libwbclient0.symbols

- - - - -
c4efb674 by Mathieu Parent at 2020-11-12T09:46:50+01:00
d/copyright: Fix duplicate-globbing-patterns

- - - - -
1ac9124f by Mathieu Parent at 2020-11-12T10:24:19+01:00
Remove outdated/malformed lintian overrides

- - - - -
408890df by Mathieu Parent at 2020-11-12T10:24:19+01:00
d/winbind.logrotate: Only reload winbindd when running (Closes: #946821)

- - - - -
ed151e7b by Mathieu Parent at 2020-11-12T10:31:53+01:00
Bump to debhelper compat 13

- - - - -
139074e7 by Mathieu Parent at 2020-11-12T10:33:05+01:00
Add another library-not-linked-against-libc override

- - - - -
9678bb3d by Mathieu Parent at 2020-11-12T11:23:06+01:00
Release 2:4.13.2+dfsg-1 to experimental

- - - - -


30 changed files:

- .gitlab-ci.yml
- − BUILD_SYSTEMS.txt
- PFIF.txt
- README.Coding → README.Coding.md
- README.contributing
- README.md
- SECURITY.md
- VERSION
- WHATSNEW.txt
- auth/credentials/pycredentials.c
- auth/credentials/tests/bind.py
- auth/gensec/gensec.c
- auth/gensec/gensec_internal.h
- auth/gensec/gensec_start.c
- auth/gensec/spnego.c
- auth/kerberos/kerberos_pac.c
- auth/kerberos/pac_utils.h
- auth/ntlmssp/ntlmssp.c
- bootstrap/.gitlab-ci.yml
- bootstrap/READMD.md
- bootstrap/config.py
- bootstrap/generated-dists/Vagrantfile
- − bootstrap/generated-dists/centos6/Dockerfile
- − bootstrap/generated-dists/centos6/bootstrap.sh
- − bootstrap/generated-dists/centos6/packages.yml
- bootstrap/generated-dists/centos7/bootstrap.sh
- bootstrap/generated-dists/centos7/packages.yml
- bootstrap/generated-dists/centos8/bootstrap.sh
- bootstrap/generated-dists/centos8/packages.yml
- bootstrap/generated-dists/debian10/bootstrap.sh


The diff was not included because it is too large.


View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/5e91202a9df42203698a34cd0428f77f5732cfc3...9678bb3dd777737580312fe7bef6cebc9b972ae3

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/5e91202a9df42203698a34cd0428f77f5732cfc3...9678bb3dd777737580312fe7bef6cebc9b972ae3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20201112/7342a1b9/attachment-0001.html>


More information about the Pkg-samba-maint mailing list