]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agoctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect()
Martin Schwenke [Fri, 6 Mar 2020 05:11:23 +0000 (16:11 +1100)] 
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@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Mar 12 05:29:20 UTC 2020 on sn-devel-184

(cherry picked from commit 319c93f0c6a949545229b616dfbd4f51baf11171)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Thu Mar 19 12:19:52 UTC 2020 on sn-devel-184

5 years agoctdb-tcp: Factor out function ctdb_tcp_start_outgoing()
Martin Schwenke [Fri, 6 Mar 2020 04:59:32 +0000 (15:59 +1100)] 
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@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 3c8747fe29486a4f95308b335a5e3ec1807f62cb)

5 years agoctdb-tcp: add ctdb_tcp_stop_incoming()
Ralph Boehme [Sat, 29 Feb 2020 10:54:51 +0000 (11:54 +0100)] 
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@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 2c73dbafba50b28e72a8ec7b4382fae42fca6d17)

5 years agoctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing()
Ralph Boehme [Fri, 28 Feb 2020 10:36:00 +0000 (11:36 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 1e2a967ff41cc29c3a0d7f61a46937c68fdb90ba)

5 years agoctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb()
Ralph Boehme [Sat, 29 Feb 2020 11:28:20 +0000 (12:28 +0100)] 
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@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit ea37ecdcd5960311f54a7a5510b88a654da23daa)

5 years agoctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb()
Ralph Boehme [Sat, 29 Feb 2020 11:13:12 +0000 (12:13 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit b83ef98c7466b2a81968555de83fb977bb6ca9f0)

5 years agoctdb-tcp: move free of inbound queue to TCP restart
Noel Power [Sat, 29 Feb 2020 15:49:28 +0000 (15:49 +0000)] 
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@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 0ff1b78fc2f0491f9e11131d0040bdaba8873770)

5 years agoctdb-daemon: more logical whitespace, debug modernisation
Martin Schwenke [Sun, 1 Mar 2020 05:40:41 +0000 (16:40 +1100)] 
ctdb-daemon: more logical whitespace, debug modernisation

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 15762a34559599cf908e30651a2d4c11560068ed)

5 years agoctdb-daemon: ensure restart() callback is called in half-connected state
Ralph Boehme [Sat, 29 Feb 2020 11:26:19 +0000 (12:26 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 6a4fa0785fc83561939fa41617d526eb96c1af89)

5 years agonmblib: avoid undefined behaviour in handle_name_ptrs()
Douglas Bagnall [Sun, 19 Jan 2020 02:08:58 +0000 (15:08 +1300)] 
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@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb  7 10:19:39 UTC 2020 on sn-devel-184

(cherry picked from commit 3bc7acc62646b105b03fd3c65e9170a373f95392)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Wed Mar 18 12:26:06 UTC 2020 on sn-devel-184

5 years agovfs_recycle: prevent flooding the log if we're called on non-existant paths
Ralph Boehme [Fri, 6 Mar 2020 11:22:25 +0000 (12:22 +0100)] 
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@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): Isaac Boukris <iboukris@samba.org>
Autobuild-Date(master): Mon Mar  9 14:15:06 UTC 2020 on sn-devel-184

5 years agolibrpc: fix IDL for svcctl_ChangeServiceConfigW
Günther Deschner [Wed, 4 Mar 2020 14:23:43 +0000 (15:23 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit ebda529b59105e9b70cc74377fe4d54cc16b4f37)

5 years agos4-torture: add ndr svcctl testsuite
Günther Deschner [Thu, 5 Mar 2020 19:42:21 +0000 (20:42 +0100)] 
s4-torture: add ndr svcctl testsuite

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit c3fa0b2df9fc53dddcc3160b6a3dc751bbb389a4)

5 years agos4-torture: add rpc test for ChangeServiceConfigW
Günther Deschner [Thu, 5 Mar 2020 21:45:48 +0000 (22:45 +0100)] 
s4-torture: add rpc test for ChangeServiceConfigW

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 0825324bc75d2ab10164a1f137be782d84c822b8)

5 years agoVFS: default: add support for FILE_ATTRIBUTE_OFFLINE to async dosmode
Ralph Boehme [Mon, 24 Feb 2020 14:03:56 +0000 (15:03 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a23f8d913fa8d77bab394aea9a8e7df2704e8b19)

5 years agoVFS: default: use correct type for pathlen in vfswrap_getxattrat_do_sync()
Ralph Boehme [Mon, 24 Feb 2020 13:30:37 +0000 (14:30 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ace296b97642d9160ea66db89dcd0f24a21dba4e)

5 years agoVFS: default: avoid a crash in vfswrap_getxattrat_do_sync()
Ralph Boehme [Mon, 24 Feb 2020 13:29:01 +0000 (14:29 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit cbca811212a930b94f9917e5a82b6a95ab085e91)

5 years agoVFS: default: remove unused arg from vfswrap_is_offline()
Ralph Boehme [Mon, 24 Feb 2020 13:28:19 +0000 (14:28 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 99873724cd493366c9957fd9fe230d52a6f02691)

5 years agoVFS: default: let vfswrap_is_offline() take conn, not handle
Ralph Boehme [Mon, 24 Feb 2020 13:24:12 +0000 (14:24 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d4c69d82bdc0fa029609032a9d32f32fa1708beb)

5 years agosmbd: ignore set NTACL requests which contain S-1-5-88 NFS ACEs
Ralph Boehme [Thu, 27 Feb 2020 16:01:10 +0000 (17:01 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar  3 19:15:10 UTC 2020 on sn-devel-184

(cherry picked from commit f89c7ad851681c0e0ab39a1bedb3eeb672516fbb)

5 years agovfs_fruit: tmsize prevent overflow Force the type during arithmetic in order to preve...
Art M. Gallagher [Tue, 3 Mar 2020 21:51:46 +0000 (21:51 +0000)] 
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@artmg.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar  7 01:37:31 UTC 2020 on sn-devel-184

(cherry picked from commit b0ba7cd4f96a6ea227943cb05ef51a463e292b2d)

5 years agoVERSION: Bump version up to 4.12.1...
Karolin Seeger [Tue, 3 Mar 2020 09:58:57 +0000 (10:58 +0100)] 
VERSION: Bump version up to 4.12.1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for the 4.12.0 release... samba-4.12.0
Karolin Seeger [Tue, 3 Mar 2020 09:47:25 +0000 (10:47 +0100)] 
VERSION: Disable GIT_SNAPSHOT for the 4.12.0 release...

and bump version up to 4.12.0.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add release notes for Samba 4.12.0.
Karolin Seeger [Tue, 3 Mar 2020 09:45:39 +0000 (10:45 +0100)] 
WHATSNEW: Add release notes for Samba 4.12.0.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoselftest: Test behaviour of DNS scavenge with an existing dNSTombstoned value
Andrew Bartlett [Thu, 30 Jan 2020 03:44:05 +0000 (16:44 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Feb  6 16:24:25 UTC 2020 on sn-devel-184

(cherry picked from commit c8e3c78d4f2a6f3e122fe458aa6835772290a700)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Wed Feb 26 12:35:59 UTC 2020 on sn-devel-184

5 years agodsdb: Correctly handle memory in objectclass_attrs
Andrew Bartlett [Thu, 30 Jan 2020 03:41:39 +0000 (16:41 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 3657bbc21182d764ddfcd603025f24ec240fd263)

5 years agoVERSION: Bump version up to 4.12.0rc5...
Karolin Seeger [Wed, 26 Feb 2020 07:38:24 +0000 (08:38 +0100)] 
VERSION: Bump version up to 4.12.0rc5...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for th Samba 4.12.0rc4 release. samba-4.12.0rc4
Karolin Seeger [Wed, 26 Feb 2020 07:37:26 +0000 (08:37 +0100)] 
VERSION: Disable GIT_SNAPSHOT for th Samba 4.12.0rc4 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add release notes for Samba 4.12.0rc4.
Karolin Seeger [Tue, 25 Feb 2020 08:57:47 +0000 (09:57 +0100)] 
WHATSNEW: Add release notes for Samba 4.12.0rc4.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoldb: version 2.1.1
Stefan Metzmacher [Tue, 25 Feb 2020 10:06:27 +0000 (11:06 +0100)] 
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@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Feb 25 12:59:02 UTC 2020 on sn-devel-184

(cherry picked from commit 0ca46a37268c8219192abc3ab5f2546a02ed8862)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Tue Feb 25 21:09:41 UTC 2020 on sn-devel-184

5 years agoldb: Add tests aimed at the SCOPE_ONELEVEL bug in particular
Andrew Bartlett [Wed, 12 Feb 2020 03:28:01 +0000 (16:28 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 0b8ab0200805127e36eeb2affe561f3aee59604a)

5 years agoldb: Fix search with scope ONE and small result sets
Andrew Bartlett [Fri, 7 Feb 2020 03:56:13 +0000 (16:56 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 3c7261c43da491b57f50e0e64d7050d85c6b973e)

5 years agoldb: Ensure @IDXONE modes is tested in ldb.python (apy.py) tests
Andrew Bartlett [Wed, 12 Feb 2020 00:44:44 +0000 (13:44 +1300)] 
ldb: Ensure @IDXONE modes is tested in ldb.python (apy.py) tests

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ec34a7095705592279647c5046a000e0bf052d1a)

5 years agoldb: Add tests aimed at the SCOPE_ONELEVEL particular
Andrew Bartlett [Tue, 11 Feb 2020 22:45:36 +0000 (11:45 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 167676973b7f1db563da04d54e8ce5668034081c)

5 years agoldb: Add tests for one-level indexes in conjunction with other indexes
Andrew Bartlett [Mon, 10 Feb 2020 01:08:29 +0000 (14:08 +1300)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 17bd63dbea7f6e6358f81f0ac5b9392b2321bb32)

5 years agosmbd: Separate aio_pthread indicator from normal EINTR
Volker Lendecke [Thu, 20 Feb 2020 13:13:35 +0000 (14:13 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 20 22:14:25 UTC 2020 on sn-devel-184

(cherry picked from commit aebe427b77b5315eb5d2b05b8c72824ca0389723)

5 years agolib: Map EINPROGRESS->NT_STATUS_MORE_PROCESSING_REQUIRED
Volker Lendecke [Thu, 20 Feb 2020 09:25:16 +0000 (10:25 +0100)] 
lib: Map EINPROGRESS->NT_STATUS_MORE_PROCESSING_REQUIRED

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4a943d842a51674425f0c4019f823ef0a9d09f49)

5 years agotest: Show that smbd does not handle EINTR from open() correctly
Volker Lendecke [Wed, 19 Feb 2020 14:25:38 +0000 (15:25 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7bbba73b30f06304e9a2ad48e853d9ec8171dd30)

5 years agotest: Intercept open in vfs_error_inject
Volker Lendecke [Wed, 19 Feb 2020 13:44:11 +0000 (14:44 +0100)] 
test: Intercept open in vfs_error_inject

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14285
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 305204a241b74c599f4f6a064cac6608afd9c893)

5 years agoWHATSNEW: Announce new Spotlight backend for Elasticsearch
Ralph Boehme [Thu, 20 Feb 2020 13:19:04 +0000 (14:19 +0100)] 
WHATSNEW: Announce new Spotlight backend for Elasticsearch

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Fri Feb 21 10:46:08 UTC 2020 on sn-devel-184

5 years agoWHATSNEW: samba-tool improvements
Andrew Bartlett [Fri, 21 Feb 2020 00:04:39 +0000 (13:04 +1300)] 
WHATSNEW: samba-tool improvements

This text is based on https://gitlab.com/samba-team/samba/-/merge_requests/1015
by Björn Baumbach, just re-worked a little to suit the WHATSNEW.

I wrote the second section

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add zlib and fuzzing notes
Andrew Bartlett [Thu, 20 Feb 2020 23:24:02 +0000 (12:24 +1300)] 
WHATSNEW: Add zlib and fuzzing notes

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
5 years agobuild: Do not check if system perl modules should be bundled
Andrew Bartlett [Sun, 2 Feb 2020 20:51:12 +0000 (09:51 +1300)] 
build: Do not check if system perl modules should be bundled

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

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

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

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
(cherry picked from commit cf4984947b39e9f6f8afd29de8a760703bf9e092)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Thu Feb 20 12:58:46 UTC 2020 on sn-devel-184

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

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

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Feb  2 10:09:11 UTC 2020 on sn-devel-184

(cherry picked from commit af47a77673f58cc6436798b250c90be0e325d20e)

5 years agos3: DFS: Don't allow link deletion on a read-only share.
Jeremy Allison [Fri, 7 Feb 2020 00:20:59 +0000 (16:20 -0800)] 
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@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0450593e38d62fe0b925d789486517ade31fe3c6)

5 years agos3: DFS: Don't allow link creation on a read-only share.
Jeremy Allison [Thu, 6 Feb 2020 23:55:13 +0000 (15:55 -0800)] 
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@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit b4195cd488e1366887acfea6ae03bf4198514a15)

5 years agoVERSION: Bump version up to 4.12.0rc4...
Karolin Seeger [Wed, 19 Feb 2020 10:09:30 +0000 (11:09 +0100)] 
VERSION: Bump version up to 4.12.0rc4...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for the 4.12.0rc3 release. samba-4.12.0rc3
Karolin Seeger [Wed, 19 Feb 2020 10:08:49 +0000 (11:08 +0100)] 
VERSION: Disable GIT_SNAPSHOT for the 4.12.0rc3 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Add release notes for Samba 4.12.0rc3.
Karolin Seeger [Wed, 19 Feb 2020 10:08:16 +0000 (11:08 +0100)] 
VERSION: Add release notes for Samba 4.12.0rc3.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW.txt update explaining SMB_VFS_CREATE_DFS_PATHAT() / SMB_VFS_READ_DFS_PATHAT().
Jeremy Allison [Wed, 19 Feb 2020 00:23:22 +0000 (16:23 -0800)] 
WHATSNEW.txt update explaining SMB_VFS_CREATE_DFS_PATHAT() / SMB_VFS_READ_DFS_PATHAT().

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Wed Feb 19 07:52:15 UTC 2020 on sn-devel-184

5 years agos3: DFS: Remove is_msdfs_link_internal() - no longer used.
Jeremy Allison [Wed, 12 Feb 2020 21:54:08 +0000 (13:54 -0800)] 
s3: DFS: Remove is_msdfs_link_internal() - no longer used.

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 18 22:34:16 UTC 2020 on sn-devel-184

(cherry picked from commit 9ee1320049cf148a2bb102bbdee4a4bcc24c0de1)

5 years agos3: DFS: Change the last use of is_msdfs_link_internal() -> SMB_VFS_READ_DFS_PATHAT...
Jeremy Allison [Wed, 12 Feb 2020 21:52:58 +0000 (13:52 -0800)] 
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.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 94068b5438013479b0426fea7f83bbd7f8f935e9)

5 years agos3: DFS: Replace calls to is_msdfs_link_internal() inside dfs_path_lookup() with...
Jeremy Allison [Wed, 12 Feb 2020 21:41:56 +0000 (13:41 -0800)] 
s3: DFS: Replace calls to is_msdfs_link_internal() inside dfs_path_lookup() with SMB_VFS_READ_DFS_PATHAT().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 3c77a9e7116bc3f1e3c9bf89c28a32bdb6cdffe1)

5 years agos3: DFS: Change dfs_path_lookup() to return struct referral list and count directly.
Jeremy Allison [Wed, 12 Feb 2020 21:17:51 +0000 (13:17 -0800)] 
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().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 1668c9ee15b421093756ac9d709f55ce3e808791)

5 years agos3: DFS: Parse the returned target path in dfs_path_lookup().
Jeremy Allison [Tue, 11 Feb 2020 22:21:12 +0000 (14:21 -0800)] 
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().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 1ffc52abedae9787f745795a4f502c26b4c005d1)

5 years agos3: DFS: Change simple is_msdfs_link() call to use SMB_VFS_READ_DFS_PATHAT().
Jeremy Allison [Tue, 11 Feb 2020 21:35:53 +0000 (13:35 -0800)] 
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.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 07a3cd56cddfc0e27a75ca76e556e2fdb18c3291)

5 years agos3: VFS: vfs_time_audit: Add read_dfs_pathat().
Jeremy Allison [Fri, 14 Feb 2020 21:08:04 +0000 (13:08 -0800)] 
s3: VFS: vfs_time_audit: Add read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0528584482f798753d636675da778917f50ca845)

5 years agos3: VFS: vfs_full_audit: Add read_dfs_pathat().
Jeremy Allison [Tue, 11 Feb 2020 18:02:18 +0000 (10:02 -0800)] 
s3: VFS: vfs_full_audit: Add read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 263df988831a40ba751b19c1715277e80095818c)

5 years agos3: VFS: catia: Add read_dfs_pathat().
Jeremy Allison [Tue, 11 Feb 2020 18:02:00 +0000 (10:02 -0800)] 
s3: VFS: catia: Add read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 16acdc348db71a29bec93d62073ca30a4a920389)

5 years agos3: VFS: cap: Add cap_read_dfs_pathat().
Jeremy Allison [Tue, 11 Feb 2020 17:48:05 +0000 (09:48 -0800)] 
s3: VFS: cap: Add cap_read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 9f6c01b2cd82963bfa05552aa41dfafcb0bf7637)

5 years agos3: VFS: shadow_copy2: Add shadow_copy2_read_dfs_pathat().
Jeremy Allison [Tue, 28 Jan 2020 20:12:09 +0000 (12:12 -0800)] 
s3: VFS: shadow_copy2: Add shadow_copy2_read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 9e92d46b757d6a4cdd0f956c24b30df89adf2798)

5 years agos3: VFS: gluster: Add vfs_gluster_read_dfs_pathat().
Jeremy Allison [Tue, 28 Jan 2020 18:46:43 +0000 (10:46 -0800)] 
s3: VFS: gluster: Add vfs_gluster_read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 018af49b93f8e9a2cbc0d40cc68b8202e5c95c9a)

5 years agos3: VFS: ceph: Add vfswrap_ceph_read_dfs_pathat().
Jeremy Allison [Tue, 28 Jan 2020 18:18:04 +0000 (10:18 -0800)] 
s3: VFS: ceph: Add vfswrap_ceph_read_dfs_pathat().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit e52e2135dd9b8bd2e65261c210e7b8d36a727396)

5 years agos3: VFS: Add SMB_VFS_READ_DFS_PATHAT().
Jeremy Allison [Tue, 28 Jan 2020 17:51:17 +0000 (09:51 -0800)] 
s3: VFS: Add SMB_VFS_READ_DFS_PATHAT().

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 96bc3298fc025d1d76fc06833fece6c62faa5e1a)

5 years agos3: smbd: dfs: Clean up exits / talloc heirarchy in parse_msdfs_symlink().
Jeremy Allison [Tue, 28 Jan 2020 17:36:26 +0000 (09:36 -0800)] 
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.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 74b47bf578dab9ce94a9f2439fa672e51afe809e)

5 years agos3: smbd: dfs: Make parameter names consistent.
Jeremy Allison [Tue, 28 Jan 2020 17:28:30 +0000 (09:28 -0800)] 
s3: smbd: dfs: Make parameter names consistent.

Initialize reflist to NULL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit ed527dc1d8bd21d942bc14677d83363144e5f46b)

5 years agos3: smbd: dfs: Allow parse_msdfs_symlink() to be called with NULL pointers.
Jeremy Allison [Tue, 28 Jan 2020 00:45:20 +0000 (16:45 -0800)] 
s3: smbd: dfs: Allow parse_msdfs_symlink() to be called with NULL pointers.

In case we don't want all the data.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 4e4afc52e6f63fa4058310c6b0a0314b8f73c189)

5 years agos3: smbd: dfs: Apply some README.Coding to parse_msdfs_symlink().
Jeremy Allison [Tue, 28 Jan 2020 00:42:11 +0000 (16:42 -0800)] 
s3: smbd: dfs: Apply some README.Coding to parse_msdfs_symlink().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit a211c640878d856e859ab2fdfbbe61036240b8eb)

5 years agos3: smbd: dfs: Make parse_msdfs_symlink() external.
Jeremy Allison [Tue, 28 Jan 2020 00:35:25 +0000 (16:35 -0800)] 
s3: smbd: dfs: Make parse_msdfs_symlink() external.

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 012b812188f636d9b8cf0edee34df5d43d2ac0a8)

5 years agos3: smbd: dfs: Move lp_msdfs_shuffle_referrals() call out of parse_msdfs_symlink().
Jeremy Allison [Tue, 28 Jan 2020 00:31:52 +0000 (16:31 -0800)] 
s3: smbd: dfs: Move lp_msdfs_shuffle_referrals() call out of parse_msdfs_symlink().

Removes dependency on snum for what is text parsing code.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 028c33e09ab52b55f33f83e26a12498f57918334)

5 years agos3: smbd: dfs: Cleanup, reformat calls to parse_msdfs_symlink()
Jeremy Allison [Tue, 28 Jan 2020 00:29:46 +0000 (16:29 -0800)] 
s3: smbd: dfs: Cleanup, reformat calls to parse_msdfs_symlink()

Make parameter easier to change.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit d22b0d907252939c2ded9d73cc67dbbf8bb57fb7)

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14282

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

(cherry picked from commit 042249d95ff59d304cf37914860ee0c4d1f546f8)

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

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit fa2f83e13aa92a12bd8d0113576a04a1e4431a44)

5 years agoWHATSNEW: announce vfs_io_uring
Stefan Metzmacher [Mon, 17 Feb 2020 14:46:53 +0000 (15:46 +0100)] 
WHATSNEW: announce vfs_io_uring

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:modules: add vfs_io_uring module
Stefan Metzmacher [Wed, 5 Jun 2019 15:01:49 +0000 (17:01 +0200)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Feb 15 11:37:45 UTC 2020 on sn-devel-184

(cherry picked from commit 195e88cea34c983afc02cfb521a60cdd1edbe9e1)

5 years agobootstrap: replace libaio-dev/libaio-devel with liburing-dev/liburing-devel
Stefan Metzmacher [Fri, 7 Feb 2020 10:00:21 +0000 (11:00 +0100)] 
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@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fb5a99fa0200785ef1b5a8c9bc4a645d09fbeb5e)

5 years agolib/replace: remove unused check for aio.h
Stefan Metzmacher [Fri, 7 Feb 2020 10:02:18 +0000 (11:02 +0100)] 
lib/replace: remove unused check for aio.h

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c1b9bf993402f7d74f992c609ede94653e87172f)

5 years agolib: Fix a shutdown crash with "clustering = yes"
Volker Lendecke [Tue, 11 Feb 2020 21:10:32 +0000 (22:10 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Feb 18 13:05:53 UTC 2020 on sn-devel-184

(cherry picked from commit f1577c2bc13c91ea912ae461870e470065f250c1)

5 years agolib: Introduce messaging_context->per_process_talloc_ctx
Volker Lendecke [Tue, 11 Feb 2020 20:57:42 +0000 (21:57 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 7209357f9ba5525a207d301b299931d6bdee9c2f)

5 years agolib: Add a TALLOC_CTX to base register_msg_pool_usage() on
Volker Lendecke [Tue, 11 Feb 2020 20:47:39 +0000 (21:47 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit dab982d88e9132cbff52db22f441c08ee59bb159)

5 years agolib: Simplify register_msg_pool_usage()
Volker Lendecke [Tue, 11 Feb 2020 20:26:18 +0000 (21:26 +0100)] 
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@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8a23031b7bfea4cdaa71d6815bca24dcc3685b22)

5 years agoauth: Fix CID 1458418 Null pointer dereferences (REVERSE_INULL)
Volker Lendecke [Wed, 12 Feb 2020 14:40:32 +0000 (15:40 +0100)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ef0350221e194a3dd3350eab02b38baeb32d8fd3)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Tue Feb 18 09:27:36 UTC 2020 on sn-devel-184

5 years agoauth: Fix CID 1458420 Null pointer dereferences (REVERSE_INULL)
Volker Lendecke [Wed, 12 Feb 2020 14:39:54 +0000 (15:39 +0100)] 
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@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 503fc8f2ba662ecbec0788bd1710440464dc5cfd)

5 years agoctdb-tcp: Make error handling for outbound connection consistent
Martin Schwenke [Tue, 28 Jan 2020 05:49:14 +0000 (16:49 +1100)] 
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
RN: Retry inter-node TCP connections on more transient failures

Reported-by: 耿纪超 <gengjichao@jd.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a40fc709cc972dadb40efbf1394b10fae3cfcc07)

5 years agowinbindd: handling missing idmap in getgrgid()
Stefan Metzmacher [Wed, 22 Jan 2020 17:00:07 +0000 (17:00 +0000)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb  5 17:56:58 UTC 2020 on sn-devel-184

(cherry picked from commit 4d0bda9467ac3f45f85f48a281cdb173ce1064eb)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Tue Feb 11 10:01:33 UTC 2020 on sn-devel-184

5 years agobootstrap: Remove un-used dependency python3-crypto
Andrew Bartlett [Fri, 13 Dec 2019 17:59:45 +0000 (06:59 +1300)] 
bootstrap: Remove un-used dependency python3-crypto

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

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 446c92017369007139af7532dae8503f9db40d48)

5 years agos3:auth_sam: map an empty domain or '.' to the local SAM name
Stefan Metzmacher [Thu, 23 Jan 2020 15:21:43 +0000 (16:21 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 590df382bea44eec2dbfd2a28c659b0a29188bca)

5 years agos3:selftest: test authentication with an empty userdomain and upn names
Stefan Metzmacher [Tue, 4 Feb 2020 10:32:05 +0000 (11:32 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit a9eeea6ef78cc44c8423c7125fa1376921060018)

5 years agos3:auth_sam: introduce effective_domain helper variables
Stefan Metzmacher [Thu, 23 Jan 2020 15:21:43 +0000 (16:21 +0100)] 
s3:auth_sam: introduce effective_domain helper variables

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit a63e2a312c761093fedb09bd234b6736485a930a)

5 years agos3:auth_sam: make sure we never handle empty usernames
Stefan Metzmacher [Thu, 23 Jan 2020 15:17:30 +0000 (16:17 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 01b8374e7942141e7f6cbdec7623c981a008e4c1)

5 years agos3:auth_sam: unify the debug messages of all auth_sam*_auth() functions
Stefan Metzmacher [Thu, 23 Jan 2020 15:13:59 +0000 (16:13 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 72ef8d3a52c1ab07c079a4c014ba8ac7bff528f7)

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

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

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 85b168c6dac88f5065c0ec6e925937439f2c12ed)

5 years agolibcli:smb: Don't use forward declartions for GnuTLS typedefs
Stefan Metzmacher [Thu, 6 Feb 2020 14:36:35 +0000 (15:36 +0100)] 
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Feb  7 13:48:27 UTC 2020 on sn-devel-184

(cherry picked from commit 3894f878183e645421ec440afd8e010218a58eef)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Mon Feb 10 10:10:46 UTC 2020 on sn-devel-184

5 years agowafsamba: Do not use 'rU' as the 'U' is deprecated in Python 3.9
Andreas Schneider [Wed, 5 Feb 2020 15:58:26 +0000 (16:58 +0100)] 
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@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb  6 07:30:13 UTC 2020 on sn-devel-184

(cherry picked from commit 52722746a5eb40c309ba59f78bd8e3d897417bdc)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Thu Feb  6 13:10:31 UTC 2020 on sn-devel-184

5 years agoWHATSNEW: Add some more changes since 4.11.
Karolin Seeger [Wed, 5 Feb 2020 09:43:43 +0000 (10:43 +0100)] 
WHATSNEW: Add some more changes since 4.11.

Mention new parameter 'spotlight backend' and note that vfs_netatalk has been
removed.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Wed Feb  5 11:40:25 UTC 2020 on sn-devel-184

5 years agolibcli:smb: Improve check for gnutls_aead_cipher_(en|de)cryptv2
Andreas Schneider [Fri, 24 Jan 2020 15:34:42 +0000 (16:34 +0100)] 
libcli:smb: Improve check for gnutls_aead_cipher_(en|de)cryptv2

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

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

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Feb  4 06:44:00 UTC 2020 on sn-devel-184

(cherry picked from commit d459ca04fc46a52276a860e73ae9ec8f813c260e)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Wed Feb  5 08:45:30 UTC 2020 on sn-devel-184

5 years agoVERSION: Bump version up to 4.12.0rc3...
Karolin Seeger [Tue, 4 Feb 2020 10:09:35 +0000 (11:09 +0100)] 
VERSION: Bump version up to 4.12.0rc3...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for the 4.12.0rc2 release. samba-4.12.0rc2
Karolin Seeger [Tue, 4 Feb 2020 10:08:41 +0000 (11:08 +0100)] 
VERSION: Disable GIT_SNAPSHOT for the 4.12.0rc2 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add release notes for Samba 4.12.0rc2.
Karolin Seeger [Tue, 4 Feb 2020 10:08:05 +0000 (11:08 +0100)] 
WHATSNEW: Add release notes for Samba 4.12.0rc2.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoscript/release.sh: Don't use quotations any longer.
Karolin Seeger [Tue, 28 Jan 2020 10:48:53 +0000 (11:48 +0100)] 
script/release.sh: Don't use quotations any longer.

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

(cherry picked from commit f699df32cdbae4fbc585c259828029c74163323b)