vlendec/samba-autobuild/.git
5 years agoctdb-client: Remove ununsed functions from old client code
Amitay Isaacs [Mon, 30 Apr 2018 09:32:13 +0000 (19:32 +1000)]
ctdb-client: Remove ununsed functions from old client code

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 01c8dc7e15b8764a9b8c8e34b84d0cab790edf47)

5 years agorpc_server: Fix NetSessEnum with stale sessions
Christof Schmitt [Tue, 24 Apr 2018 20:53:41 +0000 (13:53 -0700)]
rpc_server: Fix NetSessEnum with stale sessions

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 25 22:49:07 CEST 2018 on sn-devel-144

(cherry picked from commit a6fade4e10760284ef56abf45d3fa70038091cbe)

5 years agoselftest: Add testcase for querying sessions after smbd crash
Christof Schmitt [Tue, 24 Apr 2018 20:52:59 +0000 (13:52 -0700)]
selftest: Add testcase for querying sessions after smbd crash

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e04846c7df8e3eec1f3dbb2fc5eaf47ceb1c44d2)

5 years agorpcclient: Print number of entries for NetSessEnum
Christof Schmitt [Tue, 24 Apr 2018 19:18:49 +0000 (12:18 -0700)]
rpcclient: Print number of entries for NetSessEnum

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 501819fa9e7926c2f54cb92d508ac0e8437fd476)

5 years agoprinting: return the same error code as windows does on upload failures
Björn Jacke [Thu, 19 Apr 2018 14:14:38 +0000 (16:14 +0200)]
printing: return the same error code as windows does on upload failures

Some print drivers inf files are broken and cause driver installation to fail
on Samba servers. Windows returns WERR_APP_INIT_FAILURE in that case, we should
do the same. Windows machines are less unlucky with that.

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Apr 25 13:55:25 CEST 2018 on sn-devel-144

(cherry picked from commit 35f2afe411a3b22fb1befadb3bee8da1bc14753c)

5 years agos3: tests: Regression test to ensure we can never return a DIRECTORY attribute on...
Jeremy Allison [Wed, 11 Apr 2018 17:33:22 +0000 (10:33 -0700)]
s3: tests: Regression test to ensure we can never return a DIRECTORY attribute on a stream.

Tests streams_xattr and also streams_depot.

Inspired from a real-world test case by Andrew Walker <awalker@ixsystems.com>.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 12 02:04:28 CEST 2018 on sn-devel-144

(cherry picked from commit 82beaf868f252c4bc975ddafd80240af6f679b83)

5 years agos3: smbd. Generic fix for incorrect reporting of stream dos attributes on a directory
Jeremy Allison [Wed, 11 Apr 2018 18:05:14 +0000 (11:05 -0700)]
s3: smbd. Generic fix for incorrect reporting of stream dos attributes on a directory

According to MS-FSA a stream name does not have
separate DOS attribute metadata, so we must return
the DOS attribute from the base filename. With one caveat,
a non-default stream name can never be a directory.

As this is common to all streams data stores, we handle
it here instead of inside all stream VFS modules.

Otherwise identical logic would have to be added to
all streams modules in their [f]get_dos_attribute_fn()
VFS calls.

Found in real-world use case by Andrew Walker <awalker@ixsystems.com>.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 118e77d86a7171f589f805fa4f63246b0cb63672)

5 years agos3: vfs: vfs_streams_xattr: Don't blindly re-use the base file mode bits.
Jeremy Allison [Wed, 11 Apr 2018 15:41:00 +0000 (08:41 -0700)]
s3: vfs: vfs_streams_xattr: Don't blindly re-use the base file mode bits.

When returning the stat struct for an xattr stream,
we originally base the st_ex_mode field on the value
from the base file containing the xattr. If the base
file is a directory, it will have S_IFDIR set in st_ex_mode,
but streams can never be directories, they must be reported
as regular files.

The original code OR'ed in S_IFREG, but neglected to
AND out S_IFDIR.

Note this is not a complete to fix bug 13380 as
it doesn't fix the generic case with all streams
modules. See later fix and regression test.

Found in real-world use case by Andrew Walker <awalker@ixsystems.com>.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 4d839d0f46b723ed6809bb932b9ebe4ead2cec82)

5 years agonsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is...
Stefan Metzmacher [Tue, 24 Apr 2018 08:59:05 +0000 (10:59 +0200)]
nsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is not accessable.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit ffe970007bf934955f72ec2d73bf8f94a2b796eb)

Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-8-test): Wed May  2 18:56:45 CEST 2018 on sn-devel-144

5 years agoldb: Release ldb 1.3.3 ldb-1.3.3
Andrew Bartlett [Sun, 29 Apr 2018 23:15:55 +0000 (11:15 +1200)]
ldb: Release ldb 1.3.3

* Fix failure to upgrade to the GUID index DB format
* Add tests for GUID index behaviour

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoldb: Add test to show a reindex failure must not leave the DB corrupt
Andrew Bartlett [Mon, 26 Mar 2018 03:07:45 +0000 (16:07 +1300)]
ldb: Add test to show a reindex failure must not leave the DB corrupt

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr  5 07:53:10 CEST 2018 on sn-devel-144

(cherry picked from commit 653a0a1ba932fc0cc567253f3e153b2928505ba2)

5 years agolib ldb tests: Prepare to run api and index test on tdb and lmdb
Gary Lockyer [Mon, 5 Mar 2018 20:13:31 +0000 (09:13 +1300)]
lib ldb tests: Prepare to run api and index test on tdb and lmdb

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

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

5 years agoldb_tdb: Ensure we can not commit an index that is corrupt due to partial re-index
Andrew Bartlett [Mon, 26 Mar 2018 03:01:13 +0000 (16:01 +1300)]
ldb_tdb: Ensure we can not commit an index that is corrupt due to partial re-index

The re-index traverse can abort part-way though and we need to ensure
that the transaction is never committed as that will leave an un-useable db.

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

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

5 years agoldb_tdb: Add tests for truncated index keys
Gary Lockyer [Wed, 21 Feb 2018 02:12:40 +0000 (15:12 +1300)]
ldb_tdb: Add tests for truncated index keys

Tests for the index truncation code as well as the GUID index
format in general.

Covers truncation of both the DN and equality search keys.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-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): Sat Mar  3 09:58:40 CET 2018 on sn-devel-144

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

(cherry picked into 4.8 and cut down to operate without truncated
index values from master commit 4c0c888b571d4c21ab267024178353925a8c087c
by Andrew Bartlett)

5 years agoldb_tdb: Do not fail in GUID index mode if there is a duplicate attribute
Gary Lockyer [Tue, 27 Feb 2018 22:47:22 +0000 (11:47 +1300)]
ldb_tdb: Do not fail in GUID index mode if there is a duplicate attribute

It is not the job of the index code to enforce this, but do give a
a warning given it has been detected.

However, now that we do allow it, we must never return the same
object twice to the caller, so filter for it in ltdb_index_filter().

The GUID list is sorted, which makes this cheap to handle, thankfully.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335

(cherry picked from commit 5c1504b94d1417894176811f18c5d450de22cfd2)

5 years agoVERSION: Bump version up to 4.8.2...
Karolin Seeger [Thu, 26 Apr 2018 07:17:47 +0000 (09:17 +0200)]
VERSION: Bump version up to 4.8.2...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for the 4.8.1 release. samba-4.8.1
Karolin Seeger [Thu, 26 Apr 2018 07:16:58 +0000 (09:16 +0200)]
VERSION: Disable GIT_SNAPSHOT for the 4.8.1 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add release notes for Samba 4.8.1.
Karolin Seeger [Thu, 26 Apr 2018 07:16:27 +0000 (09:16 +0200)]
WHATSNEW: Add release notes for Samba 4.8.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agos3:modules: fix the build of vfs_aixacl2.c
Stefan Metzmacher [Wed, 21 Mar 2018 06:48:16 +0000 (07:48 +0100)]
s3:modules: fix the build of vfs_aixacl2.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Apr  3 20:18:58 CEST 2018 on sn-devel-144

(cherry picked from commit 702665cc52d5dc05ae636519e1ffe9c296f5ef77)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Fri Apr 20 16:53:16 CEST 2018 on sn-devel-144

5 years agoldb/tests: avoid 'return void_function();' which isn't portable
Stefan Metzmacher [Wed, 21 Mar 2018 06:33:16 +0000 (07:33 +0100)]
ldb/tests: avoid 'return void_function();' which isn't portable

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit 666dda907b7f190b2dff1f2639bd2518240b9fb2)

5 years agolib/crypto: avoid 'return void_function();' which isn't portable
Stefan Metzmacher [Wed, 21 Mar 2018 06:33:16 +0000 (07:33 +0100)]
lib/crypto: avoid 'return void_function();' which isn't portable

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit 7ae77db3b29ef08e1f74aa413049b995a598a5dd)

5 years agos3:modules: make virusfilter_io_connect_path() more portable
Stefan Metzmacher [Wed, 21 Mar 2018 06:25:11 +0000 (07:25 +0100)]
s3:modules: make virusfilter_io_connect_path() more portable

We have existing utility functions to prepare a socket.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit 74278a70389e2479d80ec5c88b01a09c141e8d39)

5 years agos3:modules: fix the picky-developer build of vfs_virusfilter.c on FreeBSD 11
Stefan Metzmacher [Tue, 20 Mar 2018 11:10:01 +0000 (12:10 +0100)]
s3:modules: fix the picky-developer build of vfs_virusfilter.c on FreeBSD 11

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit fb7b67af984812784756574df4f0fb55d472181b)

5 years agovfs_virusfilter: Fix CID 1428738 Macro compares unsigned to 0
Volker Lendecke [Tue, 30 Jan 2018 11:37:30 +0000 (12:37 +0100)]
vfs_virusfilter: Fix CID 1428738 Macro compares unsigned to 0

vsnprintf returns "int" and not "size_t"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 31 05:28:48 CET 2018 on sn-devel-144

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

(cherry picked from commit 21eb5169f46b8d819a5d5d028baff581e4e63de6)

5 years agovfs_virusfilter: Fix CID 1428740 Macro compares unsigned to 0
Volker Lendecke [Tue, 30 Jan 2018 11:36:14 +0000 (12:36 +0100)]
vfs_virusfilter: Fix CID 1428740 Macro compares unsigned to 0

vsnprintf returns "int" and not "size_t"

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

(cherry picked from commit 734404bbe911fd4aa6565b2a2aaecab4fbbf3c45)

5 years agovfs_virusfilter: Fix CID 1428739 Buffer not null terminated
Volker Lendecke [Tue, 30 Jan 2018 11:34:11 +0000 (12:34 +0100)]
vfs_virusfilter: Fix CID 1428739 Buffer not null terminated

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

(cherry picked from commit 8a4409c956bdbe5d928e685b7c219566d467a627)

5 years agonsswitch: fix the developer build of nsswitch/wins.c on freebsd 11
Stefan Metzmacher [Sat, 21 Oct 2017 12:15:12 +0000 (14:15 +0200)]
nsswitch: fix the developer build of nsswitch/wins.c on freebsd 11

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit dc160247d13e2c63574a7e7ec7720fc4c690483b)

5 years agonsswitch: add some const to _nss_winbind_initgroups_dyn() prototype
Stefan Metzmacher [Sat, 21 Oct 2017 12:14:34 +0000 (14:14 +0200)]
nsswitch: add some const to _nss_winbind_initgroups_dyn() prototype

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit d5be3b3279162005d9ebea2eda71d455e4c48739)

5 years agonsswitch: maintain prototypes for the linux based functions only once
Stefan Metzmacher [Sat, 21 Oct 2017 12:08:15 +0000 (14:08 +0200)]
nsswitch: maintain prototypes for the linux based functions only once

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit b8c30abb02f461f16af4da83eecd173993974dc1)

5 years agolib/replace: define __[u]intptr_t_defined if we prove an replacement
Stefan Metzmacher [Tue, 20 Mar 2018 20:46:12 +0000 (21:46 +0100)]
lib/replace: define __[u]intptr_t_defined if we prove an replacement

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit 329a229af3c3c9475b9254ca68c413ec18fa3b71)

5 years agos3:passdb: Do not return OK if we don't have pinfo set up
Andreas Schneider [Tue, 17 Apr 2018 06:55:23 +0000 (08:55 +0200)]
s3:passdb: Do not return OK if we don't have pinfo set up

This prevents a crash in fill_mem_keytab_from_secrets()

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

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

5 years agolib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.c
Stefan Metzmacher [Tue, 20 Mar 2018 15:49:30 +0000 (16:49 +0100)]
lib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit f2ff61ce9e8ab56d8a69fce29c9f214d5d98f89e)

5 years agowinbindd: add retry to _winbind_SendToSam
Ralph Boehme [Mon, 12 Mar 2018 18:54:37 +0000 (19:54 +0100)]
winbindd: add retry to _winbind_SendToSam

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 15 20:57:44 CET 2018 on sn-devel-144

(cherry picked from commit c37fbfcb248e5a8d6088a28eb0c1a62423f94502)

5 years agowinbindd: add retry to _winbind_DsrUpdateReadOnlyServerDnsRecords
Ralph Boehme [Mon, 12 Mar 2018 18:53:53 +0000 (19:53 +0100)]
winbindd: add retry to _winbind_DsrUpdateReadOnlyServerDnsRecords

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit e608f058b8f2d2295e24498daa35852de3212b23)

5 years agowinbindd: add retry to _wbint_DsGetDcName
Ralph Boehme [Mon, 12 Mar 2018 18:53:26 +0000 (19:53 +0100)]
winbindd: add retry to _wbint_DsGetDcName

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit fcf8edf9b8cdf5f3897c1a63ed97c302a231742f)

5 years agowinbindd: add retry to _wbint_LookupSids()
Ralph Boehme [Mon, 12 Mar 2018 16:09:34 +0000 (17:09 +0100)]
winbindd: add retry to _wbint_LookupSids()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit c2cd2d3f3137e27cd6e4cabd34f27b49251f078d)

5 years agowinbindd: use reset_cm_connection_on_error() instead of dcerpc_binding_handle_is_conn...
Ralph Boehme [Mon, 12 Mar 2018 15:53:49 +0000 (16:53 +0100)]
winbindd: use reset_cm_connection_on_error() instead of dcerpc_binding_handle_is_connected()

This catches more errors and triggers retry as appropriate.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 6244a2beb184de8d050389e304f087ef153d61dd)

5 years agowinbindd: fix logic calling dcerpc_binding_handle_is_connected()
Ralph Boehme [Mon, 12 Mar 2018 15:15:02 +0000 (16:15 +0100)]
winbindd: fix logic calling dcerpc_binding_handle_is_connected()

The calls were missing the negation operator, a retry should be
attempted is the binding handle got somehow disconnected behind the
scenes and is NOT connected.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 08718af36f3ed6cf2308beb3800abfb0414f94b9)

5 years agowinbindd: call dcerpc_binding_handle_is_connected() from reset_cm_connection_on_error()
Ralph Boehme [Mon, 12 Mar 2018 15:11:37 +0000 (16:11 +0100)]
winbindd: call dcerpc_binding_handle_is_connected() from reset_cm_connection_on_error()

To consolidate the error handling for RPC calls, add the binding handle
as an additional argument to reset_cm_connection_on_error().

All callers pass NULL for now, so no change in behaviour up to here.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 966ff3793a867a5ffe1a49e48c8ab3ecb02f8359)

5 years agowinbindd: force netlogon reauth for certain errors in reset_cm_connection_on_error()
Ralph Boehme [Mon, 12 Mar 2018 12:39:59 +0000 (13:39 +0100)]
winbindd: force netlogon reauth for certain errors in reset_cm_connection_on_error()

NT_STATUS_RPC_SEC_PKG_ERROR is returned by the server if the server
doesn't know the server-side netlogon credentials anymore, eg after a
reboot. If this happens we must force a full netlogon reauth.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2d1f00cc3ad77bed4e810dc910979e6cdf582216)

5 years agowinbindd: call reset_cm_connection_on_error() from reconnect_need_retry()
Ralph Boehme [Mon, 12 Mar 2018 11:20:04 +0000 (12:20 +0100)]
winbindd: call reset_cm_connection_on_error() from reconnect_need_retry()

This ensures we use the same disconnect logic in the reconnect backend,
which calls reconnect_need_retry(), and in the dual_srv frontend which
calls reset_cm_connection_on_error.

Both reset_cm_connection_on_error() and reconnect_need_retry() are very
similar, both return a bool indicating whether a retry should be
attempted, unfortunately the functions have a different default return,
so I don't dare unifying them, but instead just call one from the other.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 2837b796af3e491b6bb34bd441758ae214f629ee)

5 years agowinbindd: make reset_cm_connection_on_error() public
Ralph Boehme [Mon, 12 Mar 2018 10:29:22 +0000 (11:29 +0100)]
winbindd: make reset_cm_connection_on_error() public

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 17749a5d9fa08da1c61de45728656a2c9b85782d)

5 years agowinbindd: check for NT_STATUS_IO_DEVICE_ERROR in reset_cm_connection_on_error()
Ralph Boehme [Mon, 12 Mar 2018 10:12:34 +0000 (11:12 +0100)]
winbindd: check for NT_STATUS_IO_DEVICE_ERROR in reset_cm_connection_on_error()

reconnect_need_retry() already checks for this error, it surfaces up
from tstream_smbXcli_np as a mapping for EIO.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a33c1d25e0422483c903001dd246626f84c4cbc1)

5 years agowinbindd: add and use ldap_reconnect_need_retry() in winbindd_reconnect_ads.c
Ralph Boehme [Mon, 12 Mar 2018 12:30:01 +0000 (13:30 +0100)]
winbindd: add and use ldap_reconnect_need_retry() in winbindd_reconnect_ads.c

ldap_reconnect_need_retry() is a copy of reconnect_need_retry() minus
the RPC connection invalidation.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a8d5e4d36768bc199c631626488b2d0acbd6e91a)

5 years agowinbind: Keep "force_reauth" in invalidate_cm_connection
Volker Lendecke [Wed, 28 Feb 2018 15:09:28 +0000 (15:09 +0000)]
winbind: Keep "force_reauth" in invalidate_cm_connection

Right now I don't see a way to actually force a re-serverauth
from the client side as long as an entry in netlogon_creds_cli.tdb
exists. cm_connect_netlogon goes through invalidate_cm_connection, and
this wipes our wish to force a reauthenticatoin. Keep this intact until
we actually did reauthenticate.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4b7a9d560a51b51ac88f30276c87edc097b00d0b)

5 years agowinbind: Add smbcontrol disconnect-dc
Volker Lendecke [Wed, 28 Feb 2018 15:08:44 +0000 (15:08 +0000)]
winbind: Add smbcontrol disconnect-dc

Make a winbind child drop all DC connections

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(backported from commit 0af88b98e7e1bba14827305257e77b63dc82d902)

5 years agoutils: Add destroy_netlogon_creds_cli
Volker Lendecke [Wed, 28 Feb 2018 07:59:08 +0000 (07:59 +0000)]
utils: Add destroy_netlogon_creds_cli

This is a pure testing utility that will garble the netlogon_creds_cli
session_key. This creates a similar effect to our schannel credentials
as does a domain controller reboot.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit bffae41842fe218959fe6f8b43df694feec1589c)

6 years agosmbclient: Handle ENUM_DIR in "notify" command
Volker Lendecke [Mon, 30 Oct 2017 15:15:03 +0000 (16:15 +0100)]
smbclient: Handle ENUM_DIR in "notify" command

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
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 Apr  5 04:05:52 CEST 2018 on sn-devel-144

(cherry picked from commit 1452677ef0044815df0702de5424d4711e18144b)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Thu Apr 19 16:16:41 CEST 2018 on sn-devel-144

6 years agolibsmb: Handle IO_TIMEOUT in cli_smb2_notify properly
Volker Lendecke [Mon, 30 Oct 2017 13:36:46 +0000 (14:36 +0100)]
libsmb: Handle IO_TIMEOUT in cli_smb2_notify properly

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

6 years agolibsmb: Handle long-running smb2cli_notify
Volker Lendecke [Mon, 30 Oct 2017 13:34:12 +0000 (14:34 +0100)]
libsmb: Handle long-running smb2cli_notify

This likely runs into a timeout. Properly cancel the smb2 request,
allowing the higher-level caller to re-issue this request on an existing
handle.

I did not see a proper way to achieve this with tevent_req_set_endtime or
something like that.

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

6 years agorpc_server: Init local_server_* in make_internal_rpc_pipe_socketpair
Volker Lendecke [Wed, 11 Apr 2018 08:42:21 +0000 (10:42 +0200)]
rpc_server: Init local_server_* in make_internal_rpc_pipe_socketpair

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13370
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 11 15:19:19 CEST 2018 on sn-devel-144

(cherry picked from commit 212815969f4a706bc8395e2f6dbf225318ff2ad7)

6 years agolibads: Fix the build --without-ads
Volker Lendecke [Sat, 3 Feb 2018 06:07:24 +0000 (07:07 +0100)]
libads: Fix the build --without-ads

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Feb  6 02:47:44 CET 2018 on sn-devel-144

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

(cherry picked from commit 859698d29b547217356851094ed8188236e717b6)

6 years agotorture: Test compound request request counters
Volker Lendecke [Wed, 11 Apr 2018 13:11:10 +0000 (15:11 +0200)]
torture: Test compound request request counters

This will send an unfixed smbd into the

SMB_ASSERT(op->request_count > 0);

in smbd_smb2_request_reply_update_counts

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13215
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Apr 12 14:38:39 CEST 2018 on sn-devel-144

(cherry picked from commit 40edd1bc273f664d5567ef5be169033899acee1f)

Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-8-test): Thu Apr 12 22:55:22 CEST 2018 on sn-devel-144

6 years agos3:smb2_server: correctly maintain request counters for compound requests
Stefan Metzmacher [Wed, 11 Apr 2018 10:14:59 +0000 (12:14 +0200)]
s3:smb2_server: correctly maintain request counters for compound requests

If a session expires during a compound request chain,
we exit smbd_smb2_request_dispatch() with
'return smbd_smb2_request_error(req, ...)' before
calling smbd_smb2_request_dispatch_update_counts().

As req->request_counters_updated was only reset
within smbd_smb2_request_dispatch_update_counts(),
smbd_smb2_request_reply_update_counts() was called
twice on the same request, which triggers
SMB_ASSERT(op->request_count > 0);

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 87e25cd1e45bfe57292b62ffc44ddafc01c61ca0)

6 years agowinbindd: Do not ignore domain in the LOOKUPNAME request
Christof Schmitt [Wed, 28 Feb 2018 19:05:34 +0000 (12:05 -0700)]
winbindd: Do not ignore domain in the LOOKUPNAME request

A LOOKUPNAME request with a domain and a name containing a winbind
separator character would return the result for the joined domain,
instead of the specified domain.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr  6 21:03:31 CEST 2018 on sn-devel-144

(cherry picked from commit 1775ac8aa4dc00b9a0845ade238254ebb8b32429)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Wed Apr 11 17:11:21 CEST 2018 on sn-devel-144

6 years agoAdd test for wbinfo name lookup
Christof Schmitt [Wed, 28 Feb 2018 20:10:43 +0000 (13:10 -0700)]
Add test for wbinfo name lookup

This demonstrates that wbinfo -n / --name-to-sid returns information
instead of failing the request. More specifically the query for
INVALIDDOMAIN//user returns the user SID for the joined domain, instead
of failing the request.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 552a00ec1f6795b9025298931a6cc50ebe552052)

6 years agonsswitch: Fix wbcListGroups test
Christof Schmitt [Fri, 30 Mar 2018 21:35:03 +0000 (14:35 -0700)]
nsswitch: Fix wbcListGroups test

With an AD DC, wbcListGroups returns the users in the DOMAIN SEPARATOR
GROUPNAME format.  The test then calls wbcLookupName with the domain
name and the previous string (including domain and separator) as
username. Fix this by passing the correct username and adding some
additional checks.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit f4db4e86c341a89357082e81e30c302440647530)

6 years agonsswitch: Fix wbcListUsers test
Christof Schmitt [Fri, 30 Mar 2018 21:28:46 +0000 (14:28 -0700)]
nsswitch: Fix wbcListUsers test

With an AD DC, wbcListUsers returns the users in the DOMAIN SEPARATOR
USERNAME format.  The test then calls wbcLookupName with the domain name
and the previous string (including domain and separator) as username.
Fix this by passing the correct username and adding some additional
checks.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 3c146be404affc894c0c702bbfbfcc4fb9ed902b)

6 years agotest_smbclient_s3.sh: Use correct separator in "list with backup privilege" test
Christof Schmitt [Fri, 16 Mar 2018 20:52:14 +0000 (13:52 -0700)]
test_smbclient_s3.sh: Use correct separator in "list with backup privilege" test

Samba selftest uses the forward slash as winbind separator and in the
USERNAME passed to the test. "net sam rights" expect the backslash. Map
the separator used in selftest to a backslash to avoid creating an
incorrect username DOMAIN\DOMAIN/USERNAME.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6f07afad07d9c670a00d9d314a8134efdda5e424)

6 years agos3: smbd: Unix extensions attempts to change wrong field in fchown call.
Jeremy Allison [Mon, 9 Apr 2018 16:32:23 +0000 (09:32 -0700)]
s3: smbd: Unix extensions attempts to change wrong field in fchown call.

Cut and paste error.

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

Reported-by: Rungta, Vandana <vrungta@amazon.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Apr 10 00:45:56 CEST 2018 on sn-devel-144

(cherry picked from commit 3227b110d065500ed84fc70063da70ab35823a2e)

6 years agos3: smbd: Fix memory leak in vfswrap_getwd()
Jeremy Allison [Fri, 6 Apr 2018 20:52:52 +0000 (13:52 -0700)]
s3: smbd: Fix memory leak in vfswrap_getwd()

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>.
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Apr  9 21:48:12 CEST 2018 on sn-devel-144

(cherry picked from commit 461a1172ff819692aa0a2dc5ce7fc5379c8a529e)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Tue Apr 10 14:44:28 CEST 2018 on sn-devel-144

6 years agos3: lib: messages: Don't use the result of sec_init() before calling sec_init().
Lutz Justen [Wed, 4 Apr 2018 16:50:12 +0000 (09:50 -0700)]
s3: lib: messages: Don't use the result of sec_init() before calling sec_init().

Commit ad8c7171ba86e8a47d78b0c7329bb814e5a8871e accidently
moved sec_init() to the point after sec_initial_uid() is
called in the call to directory_create_or_exist_strict().
I missed this in the review (sorry). This works as root
as initial_uid/initial_gid are static (and so initialized
as zero) but doesn't work on ChromeOS as this code isn't
running as root.

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

Signed-off-by: Lutz Justen <ljusten@google.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr  4 23:52:02 CEST 2018 on sn-devel-144

(cherry picked from commit e895b6cf4a7eb3d50d618a022be74db85975bf69)

6 years agodsdb: Fix CID 1034966 Uninitialized scalar variable
Volker Lendecke [Wed, 28 Mar 2018 20:43:53 +0000 (15:43 -0500)]
dsdb: Fix CID 1034966 Uninitialized scalar variable

"continue" in a do-while loop jumps to the "while"-check, so "id_exists" needs
to be initialized by that point.

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

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

6 years agos3:smbd: don't use the directory cache for SMB2/3
Ralph Boehme [Thu, 29 Mar 2018 18:06:47 +0000 (20:06 +0200)]
s3:smbd: don't use the directory cache for SMB2/3

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

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): Fri Mar 30 03:51:48 CEST 2018 on sn-devel-144

(cherry picked from commit 66052fdccd28922cf1caa2bc750e39051a6414cf)

6 years agoctdb-scripts: Drop "net serverid wipe" from 50.samba event script
Amitay Isaacs [Wed, 28 Mar 2018 23:45:19 +0000 (10:45 +1100)]
ctdb-scripts: Drop "net serverid wipe" from 50.samba event script

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

There is no serverid database anymore.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144

(cherry picked from commit 6b75d2c650aa9ee632122fa87ea8a2a98f1fa613)

6 years agoms_schema: fix python2.6 incompatibility
Björn Baumbach [Thu, 15 Mar 2018 17:32:31 +0000 (18:32 +0100)]
ms_schema: fix python2.6 incompatibility

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit a27db0b61e40b6b503b53e3579867e227f1971b8)

6 years agosamba-tool visualize: fix python2.6 incompatibility
Björn Baumbach [Tue, 20 Mar 2018 11:15:22 +0000 (12:15 +0100)]
samba-tool visualize: fix python2.6 incompatibility

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 21 09:25:51 CET 2018 on sn-devel-144

(cherry picked from commit 9312a1cdafbd5a0140d72502487c4e478dc578d2)

6 years agos4: torture: Test all combinations of directory open with existing directory to ensur...
Jeremy Allison [Wed, 28 Mar 2018 20:19:12 +0000 (13:19 -0700)]
s4: torture: Test all combinations of directory open with existing directory to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 29 23:13:42 CEST 2018 on sn-devel-144

(cherry picked from commit c98cd0f25edaae7558f18fd331e2fef3aabb61f2)

Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-8-test): Fri Apr  6 13:50:18 CEST 2018 on sn-devel-144

6 years agos4: torture: Test all combinations of directory create to ensure behavior is the...
Jeremy Allison [Wed, 28 Mar 2018 20:17:14 +0000 (13:17 -0700)]
s4: torture: Test all combinations of directory create to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit fd9084336e7e86ccec83141d880fd7c336c23b6c)

6 years agos4: torture: Test all combinations of file open with existing file to ensure behavior...
Jeremy Allison [Wed, 28 Mar 2018 18:44:40 +0000 (11:44 -0700)]
s4: torture: Test all combinations of file open with existing file to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 820b35bb1ceb445eb3659b67eedfb0a2f5b2f976)

6 years agos4: torture: Test all combinations of file create to ensure behavior is the same.
Jeremy Allison [Wed, 28 Mar 2018 18:00:59 +0000 (11:00 -0700)]
s4: torture: Test all combinations of file create to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 22fe8dcb77565495886244e88bb0433363d1f80a)

6 years agos4: torture: Ensure a failed file create doesn't create the file.
Jeremy Allison [Wed, 28 Mar 2018 17:54:30 +0000 (10:54 -0700)]
s4: torture: Ensure a failed file create doesn't create the file.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 53cdf7a9a18ed547eade4c3cdd80d286058e440d)

6 years agos3: smbd: Files or directories can't be opened DELETE_ON_CLOSE without delete access.
Jeremy Allison [Wed, 28 Mar 2018 19:42:20 +0000 (12:42 -0700)]
s3: smbd: Files or directories can't be opened DELETE_ON_CLOSE without delete access.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 2514bee0a3b0a12430e2679ee590075c54d4803a)

6 years agoctdb-client: Client code should never free the client context
Amitay Isaacs [Thu, 8 Mar 2018 00:35:55 +0000 (11:35 +1100)]
ctdb-client: Client code should never free the client context

This should never have been done.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 376e9794e2d19e8d17b0bdde36ce8a1a205986c6)

6 years agoctdb-client: Add missing initialization of tevent_context
Amitay Isaacs [Mon, 19 Mar 2018 02:58:43 +0000 (13:58 +1100)]
ctdb-client: Add missing initialization of tevent_context

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 4e37be92bfb790150b3791bef552aa4acf8f78b7)

6 years agoctdb-client: Do not try to allocate 0 sized record
Amitay Isaacs [Mon, 19 Mar 2018 02:38:28 +0000 (13:38 +1100)]
ctdb-client: Do not try to allocate 0 sized record

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 92a68af1a8473dc2a5d9d6036830f944e968606d)

6 years agoFix invocation of gnutls_aead_cipher_encrypt()
Timur I. Bakeyev [Thu, 22 Mar 2018 04:47:58 +0000 (05:47 +0100)]
Fix invocation of gnutls_aead_cipher_encrypt()

Which was failing with GNUTLS_E_SHORT_MEMORY_BUFFER - The given memory
buffer is too short to hold parameters.

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

Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Mar 23 07:25:30 CET 2018 on sn-devel-144

(cherry picked from commit b9f0c7f93c058685e24d104432978bd40b94b49f)

6 years agoAllow AESNI to be used on all processor supporting AESNI, not just Intel's This impro...
Eric Vannier [Fri, 23 Mar 2018 04:32:56 +0000 (21:32 -0700)]
Allow AESNI to be used on all processor supporting AESNI, not just Intel's This improves performance/reduced CPU usage. Tests performed: - Ran on Ivy Bridge and Ryzen and verified that AESNI is detected (crypto tests) - Ran on Ryzen, and observed 50% increased speed.

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

Signed-off-by: Eric Vannier <evannier@google.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 27 13:50:09 CEST 2018 on sn-devel-144

(cherry picked from commit 77d88d75f6262a855e818a9b2b4018f8b6ced7b0)

6 years agos3: docs: Add documentation for "smb2" and "smb2_credits" debug classes.
Jeremy Allison [Wed, 21 Mar 2018 19:56:12 +0000 (12:56 -0700)]
s3: docs: Add documentation for "smb2" and "smb2_credits" debug classes.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit fc922bd29b40a20450f16728fa7347f8f83d3bcd)

6 years agos3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.
Jeremy Allison [Wed, 21 Mar 2018 19:52:49 +0000 (12:52 -0700)]
s3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit ad973fddef00d6d92443be89e7f5404006a94d99)

6 years agolib: debug: Add DBGC_XXX versions of the macros to allow class-specific messages.
Jeremy Allison [Wed, 21 Mar 2018 19:40:50 +0000 (12:40 -0700)]
lib: debug: Add DBGC_XXX versions of the macros to allow class-specific messages.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit cdde6d93605d15a59e816a35e8e02ca193bf1403)

6 years agos3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files...
Jeremy Allison [Wed, 21 Mar 2018 19:01:05 +0000 (12:01 -0700)]
s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files with it.

Will allow easier smb2-specific debugging.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 8dabcf8948c2e514b489169c34673e093519b583)

6 years agolib:replace: Fix linking when libtirpc-devel overwrites system headers
Noel Power [Thu, 15 Mar 2018 16:46:39 +0000 (16:46 +0000)]
lib:replace: Fix linking when libtirpc-devel overwrites system headers

Some systems (like SUSE currently) install the new tirpc headers by
overwritting the existing system location used by gcc. This patch will
detect if the headers in the system location belong to tirpc or not.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 618c714b6b6c0b63993299b40b9a466adb753cc2)

6 years agos3:smbd: map nterror on smb2_flush errorpath
Anton Nefedov via samba-technical [Thu, 15 Mar 2018 11:38:41 +0000 (14:38 +0300)]
s3:smbd: map nterror on smb2_flush errorpath

smbd_smb2_flush_recv() expects nterror in tevent_req, and otherwise
aborts in tevent_req_is_nterror()

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

Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 98623129446672521b7fa41d3457b8ce95db828c)

6 years agoctdb-tests: Don't use nc -d or -w options
Martin Schwenke [Thu, 8 Mar 2018 00:49:56 +0000 (11:49 +1100)]
ctdb-tests: Don't use nc -d or -w options

nmap-ncat is used in some distributions to replace netcat.  It has a
different meaning for these options.

We can get the same effect as the current combination of -d and -w by
piping a sleep process to nc.  Subsequent use of $! works because it
gets the last process in pipeline.

Note that redirecting from /dev/null doesn't work with some versions
of nc.  They just exit when they get EOF.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 9e954bcbf43d67a18ee55f84cda0b09028f96b92)

6 years agos3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.
Jeremy Allison [Mon, 19 Mar 2018 22:46:41 +0000 (15:46 -0700)]
s3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.

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

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

6 years agos4: vfs: fruit tests: Add regression test for dealing with NFS ACE entries.
Jeremy Allison [Thu, 15 Mar 2018 21:45:06 +0000 (14:45 -0700)]
s4: vfs: fruit tests: Add regression test for dealing with NFS ACE entries.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 17 04:04:32 CET 2018 on sn-devel-144

(cherry picked from commit a6054c01c29c2507e0d5a6aa110fee4fd5c5eeb9)

6 years agoselftest: vfs.fruit: add xattr_tdb where possible
Ralph Boehme [Fri, 16 Mar 2018 20:57:31 +0000 (21:57 +0100)]
selftest: vfs.fruit: add xattr_tdb where possible

This makes the tests indepent from fs xattr support.

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

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

6 years agoselftest: run vfs.fruit_netatalk test against seperate share
Ralph Boehme [Fri, 16 Mar 2018 20:55:26 +0000 (21:55 +0100)]
selftest: run vfs.fruit_netatalk test against seperate share

These tests require a fs with xattr support. This allows adding
xattr_tdb to all other shares in the next commit.

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

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

6 years agos3: smbd: vfs_fruit: Replace code in fruit_fget_nt_acl() with remove_virtual_nfs_aces().
Jeremy Allison [Thu, 15 Mar 2018 16:57:09 +0000 (09:57 -0700)]
s3: smbd: vfs_fruit: Replace code in fruit_fget_nt_acl() with remove_virtual_nfs_aces().

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

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

6 years agos3: smbd: vfs_fruit: Replace code in check_ms_nfs() with remove_virtual_nfs_aces().
Jeremy Allison [Thu, 15 Mar 2018 16:54:41 +0000 (09:54 -0700)]
s3: smbd: vfs_fruit: Replace code in check_ms_nfs() with remove_virtual_nfs_aces().

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

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

6 years agos3: smbd: vfs_fruit: Add remove_virtual_nfs_aces() a generic NFS ACE remover.
Jeremy Allison [Thu, 15 Mar 2018 16:52:30 +0000 (09:52 -0700)]
s3: smbd: vfs_fruit: Add remove_virtual_nfs_aces() a generic NFS ACE remover.

Not yet used, will be used to tidyup existing code.

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

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

6 years agos3: vfs_fruit. Change check_ms_nfs() to remove the virtual ACE's generated by fruit_f...
Jeremy Allison [Fri, 2 Mar 2018 21:53:55 +0000 (13:53 -0800)]
s3: vfs_fruit. Change check_ms_nfs() to remove the virtual ACE's generated by fruit_fget_nt_acl().

Ensures they don't get stored in the underlying ACL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar  8 04:09:38 CET 2018 on sn-devel-144

(cherry picked from commit e0b147f650fe59f606d1faffe57059e6e9d7837b)

6 years agos3: vfs_fruit. If the security descriptor was modified, ensure we set the flags corre...
Jeremy Allison [Fri, 2 Mar 2018 21:51:54 +0000 (13:51 -0800)]
s3: vfs_fruit. If the security descriptor was modified, ensure we set the flags correctly to reflect the ACE's left.

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

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

6 years agos3: vfs_fruit: Ensure we operate on a copy of the incoming security descriptor.
Jeremy Allison [Fri, 2 Mar 2018 21:21:37 +0000 (13:21 -0800)]
s3: vfs_fruit: Ensure we operate on a copy of the incoming security descriptor.

This will allow us to modify it in the next commit.

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

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

6 years agos3: vfs_fruit. Ensure we only return one set of the 'virtual' UNIX ACE entries.
Jeremy Allison [Fri, 2 Mar 2018 21:07:48 +0000 (13:07 -0800)]
s3: vfs_fruit. Ensure we only return one set of the 'virtual' UNIX ACE entries.

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

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

6 years agos3: smbd: Fix possible directory fd leak if the underlying OS doesn't support fdopendir()
Jeremy Allison [Wed, 14 Feb 2018 21:23:12 +0000 (13:23 -0800)]
s3: smbd: Fix possible directory fd leak if the underlying OS doesn't support fdopendir()

HPUX has this problem.

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

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): Fri Feb 23 22:56:35 CET 2018 on sn-devel-144

(cherry picked from commit 5ad5e7966f555b1d2b39d276646934a2cd2535e6)

6 years agos3: ldap: Ensure the ADS_STRUCT pointer doesn't get freed on error, we don't own...
Jeremy Allison [Wed, 24 Jan 2018 22:09:43 +0000 (14:09 -0800)]
s3: ldap: Ensure the ADS_STRUCT pointer doesn't get freed on error, we don't own it here.

Thanks to Isaac Boukris <iboukris@gmail.com> for finding the
issue and testing this fix.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 26 02:25:20 CET 2018 on sn-devel-144

(cherry picked from commit e7425bd5245ffea68b7e8f794c9b5f864d103769)

6 years agos3:auth: make use of make_{server,session}_info_anonymous()
Stefan Metzmacher [Fri, 2 Mar 2018 13:40:19 +0000 (14:40 +0100)]
s3:auth: make use of make_{server,session}_info_anonymous()

It's important to have them separated from make_{server,session}_info_guest(),
because there's a fundamental difference between anonymous (the client requested
no authentication) and guest (the server lies about the authentication failure).

When it's really an anonymous connection, we should reflect that in the
resulting session info.

This should fix a problem where Windows 10 tries to join
a Samba hosted NT4 domain and has SMB2/3 enabled.

We no longer return SMB_SETUP_GUEST or SMB2_SESSION_FLAG_IS_GUEST
for true anonymous connections.

The commit message from a few commit before shows the resulting
auth_session_info change.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Mar 16 03:03:31 CET 2018 on sn-devel-144

(cherry picked from commit 1957bf11f127fc08c6622999cadc7dd580ac7d3b)

Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-8-test): Wed Mar 21 02:29:57 CET 2018 on sn-devel-144

6 years agos3:rpc_server: make use of make_session_info_anonymous()
Stefan Metzmacher [Fri, 2 Mar 2018 13:40:19 +0000 (14:40 +0100)]
s3:rpc_server: make use of make_session_info_anonymous()

For unauthenticated connections we should default to a
session info with an anonymous nt token.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0ee9a550944034718ea188b277cca4b6fc5fbc5c)