samba.git
3 hours agotalloc: Fix alignment issues for casting pointers master
Andreas Schneider [Fri, 12 Oct 2018 09:58:26 +0000 (11:58 +0200)]
talloc: Fix alignment issues for casting pointers

warning: cast from 'char *' to 'struct talloc_chunk *' increases required
alignment from 1 to 8

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 19 12:38:50 UTC 2019 on sn-devel-144

19 hours agovfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override
Ralph Boehme [Thu, 29 Nov 2018 10:17:08 +0000 (11:17 +0100)]
vfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override

This was missing in commit 8b1b1cd8cc561378058b915e03996ff567355d81.

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): Mon Mar 18 20:19:30 UTC 2019 on sn-devel-144

20 hours agoselftest: test vfs_nfs4acl_xattr in nfs mode
Ralph Boehme [Mon, 26 Nov 2018 19:51:14 +0000 (20:51 +0100)]
selftest: test vfs_nfs4acl_xattr in nfs mode

The same tests as for the other modes xdr and ndr are marked as
knownfail.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agovfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount
Ralph Boehme [Thu, 29 Nov 2018 10:01:59 +0000 (11:01 +0100)]
vfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount

This adds a new main switch "nfs" to "nfs4acl_xattr:encoding" which
enables to use NFS4 ACLs from an NFS4 mount on a Linux box. Tested with
a FreeBSD NFS4 server.

Supports both NFS 4.0 and 4.1 ACLs.

By default NFS4 servers send user and group identifiers in ACLs as
strings in the format "[USER|GROUP]@DNSDOMAIN". Some NFS4 servers
support sending identifiers as numeric strings. This module does support
this as well, the config knob "nfs4acl_xattr:nfs4_id_numeric = yes|no"
controls behaviour.

When "nfs4acl_xattr:encoding" is set to "nfs", the new option
"nfs4acl_xattr:validate_mode", which defauts to "yes" is set to "no" to
avoid checking and munging the mode on files.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: reformat enum nfs4acl_encoding to one per line
Ralph Boehme [Mon, 26 Nov 2018 15:31:42 +0000 (16:31 +0100)]
nfs4acl_xattr: reformat enum nfs4acl_encoding to one per line

In preperation of adding another enum value.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions
Ralph Boehme [Mon, 26 Nov 2018 15:30:38 +0000 (16:30 +0100)]
nfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: move a define to a common header file
Ralph Boehme [Mon, 26 Nov 2018 15:29:43 +0000 (16:29 +0100)]
nfs4acl_xattr: move a define to a common header file

In preperation of a adding real NFS backend.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: move some functions to a seperate file
Ralph Boehme [Sun, 25 Nov 2018 11:07:26 +0000 (12:07 +0100)]
nfs4acl_xattr: move some functions to a seperate file

These functions will be called from another translation unit in a
subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: append 'i' to nfs4acl functions
Ralph Boehme [Sun, 25 Nov 2018 10:47:48 +0000 (11:47 +0100)]
nfs4acl_xattr: append 'i' to nfs4acl functions

This reflects the new struct names the functions use.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agonfs4acl_xattr: identifiers are XDR encoded as integers
Ralph Boehme [Thu, 22 Nov 2018 17:27:47 +0000 (18:27 +0100)]
nfs4acl_xattr: identifiers are XDR encoded as integers

The structs nfsacl41 and nfsace4 are not RFC 3530 compliant, let's
rename them adding a trailing "i" that indicates that the structs store
identifiers as integers.

  struct nfsace4  -> struct nfsace4i
  struct nfsacl41 -> struct nfsacl41i

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Fix a "assuming signed overflow does not occur" error
Volker Lendecke [Mon, 18 Mar 2019 08:41:57 +0000 (09:41 +0100)]
libsmb: Fix a "assuming signed overflow does not occur" error

Eventually we need to convert internal_resolve_name to "size_t" for
"return_count". But that's a patch for another day :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
20 hours agolibsmb: Align integer types
Volker Lendecke [Mon, 18 Mar 2019 08:32:27 +0000 (09:32 +0100)]
libsmb: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
20 hours agoheimdal: Fix "assuming signed overflow doesnt occur" error
Volker Lendecke [Mon, 18 Mar 2019 08:30:17 +0000 (09:30 +0100)]
heimdal: Fix "assuming signed overflow doesnt occur" error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
20 hours agolibsmb: Use cli_smb2_query_info_fnum
Volker Lendecke [Sun, 10 Mar 2019 18:08:20 +0000 (19:08 +0100)]
libsmb: Use cli_smb2_query_info_fnum

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Add cli_smb2_query_info_fnum
Volker Lendecke [Sun, 10 Mar 2019 17:49:55 +0000 (18:49 +0100)]
libsmb: Add cli_smb2_query_info_fnum

This wraps getting the file handle from the fnum

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Change cli_posix_stat_send to take a pointer to sbuf
Volker Lendecke [Wed, 13 Mar 2019 15:10:33 +0000 (16:10 +0100)]
libsmb: Change cli_posix_stat_send to take a pointer to sbuf

This moves the parsing work from the _recv function into the _done
function. This makes writing the SMB2 call easier later on: We can
have a smb2-specific done function doing the smb2-specific work and we
don't have to fork on protocol in the _recv function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Make cli_posix_[sym|hard]link proper tevent_req functions
Volker Lendecke [Thu, 14 Mar 2019 13:23:35 +0000 (14:23 +0100)]
libsmb: Make cli_posix_[sym|hard]link proper tevent_req functions

Simplify adding SMB2 to those functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Use tevent_req_simple_finish_ntstatus
Volker Lendecke [Thu, 14 Mar 2019 19:46:45 +0000 (20:46 +0100)]
libsmb: Use tevent_req_simple_finish_ntstatus

Less lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agosmbd: Remove two unnecessary return; statements
Volker Lendecke [Fri, 8 Mar 2019 13:58:02 +0000 (14:58 +0100)]
smbd: Remove two unnecessary return; statements

return; is unnecessary at the end of a void function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agotorture3: Fix an error message
Volker Lendecke [Thu, 14 Mar 2019 10:40:23 +0000 (11:40 +0100)]
torture3: Fix an error message

We tried to open "dname", not "fname"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibsmb: Use a direct struct initializer
Volker Lendecke [Sun, 10 Mar 2019 14:40:45 +0000 (15:40 +0100)]
libsmb: Use a direct struct initializer

There's a few ways to initialize a DATA_BLOB to NULL. There's the
variable data_blob_null, there's ZERO_STRUCTP, and the explicit
initializer. And there's the data_blob() macro which calls into
data_blob_talloc_named. You have to look at that routine to see that
this is nothing more than a ZERO_STRUCT() and not calling into
talloc. Choose the more direct way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibcli: Align integer types
Volker Lendecke [Sun, 10 Mar 2019 14:36:53 +0000 (15:36 +0100)]
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agoidl: Remove a trailing empty line
Volker Lendecke [Thu, 14 Mar 2019 15:18:03 +0000 (16:18 +0100)]
idl: Remove a trailing empty line

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agolibcli: Add a comment explaining lack of overflow checks
Volker Lendecke [Thu, 14 Mar 2019 15:13:10 +0000 (16:13 +0100)]
libcli: Add a comment explaining lack of overflow checks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agoidl: Fix a typo
Volker Lendecke [Thu, 14 Mar 2019 16:16:12 +0000 (17:16 +0100)]
idl: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agorpc_server: Give mdssd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:52:16 +0000 (09:52 +0100)]
rpc_server: Give mdssd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agorpc_server: Give fssd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:43:07 +0000 (09:43 +0100)]
rpc_server: Give fssd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agorpc_server: Give lsasd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:40:21 +0000 (09:40 +0100)]
rpc_server: Give lsasd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
20 hours agorpc_server: Give epmd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:36:35 +0000 (09:36 +0100)]
rpc_server: Give epmd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
22 hours agos3:client: Fix smbspool device uri handling
Andreas Schneider [Tue, 12 Mar 2019 10:40:30 +0000 (11:40 +0100)]
s3:client: Fix smbspool device uri handling

If we are executed as a CUPS backend, argv[0] is set to the device uri.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar 18 16:47:55 UTC 2019 on sn-devel-144

24 hours agos3:client: Make sure we work on a copy of the title
Andreas Schneider [Tue, 12 Mar 2019 09:09:14 +0000 (10:09 +0100)]
s3:client: Make sure we work on a copy of the title

We can't be sure we can write to the input buffer.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
24 hours agos3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups
Andreas Schneider [Fri, 4 Jan 2019 08:21:24 +0000 (09:21 +0100)]
s3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups

This should not switch to username,password if cups has been configured
to use negotiate (Kerberos authentication).

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
24 hours agos3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool
Andreas Schneider [Tue, 12 Mar 2019 08:40:58 +0000 (09:40 +0100)]
s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
24 hours agos3:script: Fix jobid check in test_smbspool.sh
Andreas Schneider [Tue, 12 Mar 2019 09:15:05 +0000 (10:15 +0100)]
s3:script: Fix jobid check in test_smbspool.sh

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
4 days agosmbd: fix check_parent_access() talloc stackframe leaks
David Disseldorp [Tue, 12 Mar 2019 17:49:09 +0000 (18:49 +0100)]
smbd: fix check_parent_access() talloc stackframe leaks

check_parent_access() currently leaks a number of allocations onto the
talloc_tos() context in both success and error paths.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Mar 15 11:32:04 UTC 2019 on sn-devel-144

4 days agoctdb-version: Simplify version string usage
Amitay Isaacs [Fri, 15 Mar 2019 01:14:27 +0000 (12:14 +1100)]
ctdb-version: Simplify version string usage

There is no need to write SAMBA_VERSION_STRING as CTDB_VERSION_STRING.
Wherever required use SAMBA_VERSION_STRING directly.

Avoids the confusion with two version.h files.

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

Signed-off-by: Amitay Isaacs <amitay@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Mar 15 06:31:50 UTC 2019 on sn-devel-144

4 days agoctdb-build: Drop creation of .distversion in tarball
Martin Schwenke [Thu, 7 Mar 2019 06:53:25 +0000 (17:53 +1100)]
ctdb-build: Drop creation of .distversion in tarball

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 days agoctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING
Stefan Metzmacher [Fri, 16 Jun 2017 10:15:25 +0000 (12:15 +0200)]
ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING

This way we don't get constant rebuild as SAMBA_VERSION_STRING
is "4.7.0pre1.DEVELOPERBUILD" for the binaries under bin/
instead of "4.7.0pre1.GIT.59e51f6".

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 days agoctdb-tests: Add a test for version consistency checking
Martin Schwenke [Fri, 8 Feb 2019 02:32:16 +0000 (13:32 +1100)]
ctdb-tests: Add a test for version consistency checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-daemon: Add an environment variable to set version
Martin Schwenke [Wed, 6 Feb 2019 02:57:00 +0000 (13:57 +1100)]
ctdb-daemon: Add an environment variable to set version

This can be used to test the version checking logic.  Cache the
version to avoid re-checking the environment variable each time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-tests: Fix remaining common.sh ShellCheck hits
Martin Schwenke [Thu, 7 Mar 2019 04:46:48 +0000 (15:46 +1100)]
ctdb-tests: Fix remaining common.sh ShellCheck hits

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-tests: Shell cleanups in wait_until() function
Martin Schwenke [Thu, 7 Mar 2019 04:40:59 +0000 (15:40 +1100)]
ctdb-tests: Shell cleanups in wait_until() function

This file is included by local_daemons.sh, which is not a bash script
and wait_until() uses the "local" keyword.  Prefixing variable names
with '_' to indicate that they are local changes a lot of lines in
this function.  So, fix indentation, potential quoting problems and
other ShellCheck hits while touching this function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-tests: export CTDB_SCRIPTS_TOOLS_BIN_DIR
Martin Schwenke [Thu, 7 Mar 2019 04:26:27 +0000 (15:26 +1100)]
ctdb-tests: export CTDB_SCRIPTS_TOOLS_BIN_DIR

This isn't used anywhere that requires it to be exported, but the lack
of consistency will cause problems and confusion at some later stage.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-packaging: Test package requires tcpdump
Martin Schwenke [Wed, 6 Mar 2019 08:16:55 +0000 (19:16 +1100)]
ctdb-packaging: Test package requires tcpdump

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-packaging: ctdb package should not own system library directory
Martin Schwenke [Wed, 6 Mar 2019 03:36:01 +0000 (14:36 +1100)]
ctdb-packaging: ctdb package should not own system library directory

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing
Martin Schwenke [Thu, 14 Mar 2019 05:32:02 +0000 (16:32 +1100)]
ctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing

ctdb_sock_addr values are hashed in some contexts.  This means that
all of the memory used for the ctdb_sock_addr should be consistent
regardless of how parsing is done.  The first 2 cases are just sanity
checks but the 3rd case involving an IPv4-mapped IPv6 address is the
real target of this test addition.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb: Initialize addr struct to zero before reparsing as IPV4
Zhu Shangzhong [Tue, 12 Mar 2019 12:49:48 +0000 (20:49 +0800)]
ctdb: Initialize addr struct to zero before reparsing as IPV4

Failed to kill the tcp connection that using IPv4-mapped IPv6 address
(e.g. ctdb_killtcp eth0 ::ffff:192.168.200.44:2049
::ffff:192.168.200.45:863).

When the ctdb_killtcp is used to kill the tcp connection, the IPs and
ports in the connection will be parsed to conn.client and conn.server
(call stack: main->ctdb_sock_addr_from_string->ip_from_string). In
the ip_from_string, as we are using IPv4-mapped IPv6 addresses, the
ipv6_from_string will be used to parse ip to addr.ip6 first. The next
step the ipv4_from_string will be used to reparse ip to addr.ip.

As a result, the data that dump from conn.server is "2 0 8 1 192 168
200 44 0 0 0 0 0 0 0 0 0 0 255 255 192 168 200 44 0 0 0 0", the data
from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0 0 0 0 0 0 255 255
192 168 200 45 0 0 0 0". The connection will be add to conn_list by
ctdb_connection_list_add. Then the reset_connections_send uses conn_list
as parameter to start to reset connections in the conn_list.

In the reset_connections_send, the database "connections" will be
created. The connections from conn_list will be written to the
database(call db_hash_add), and use the data that dump from conn_client
and conn_server as key.

In the reset_connections_capture_tcp_handler, the
ctdb_sys_read_tcp_packet will receive data on the raw socket. And
extract the IPs and ports from the tcp packet. when extracting IP and
port, the tcp4_extract OR tcp6_extract will be used. Then we got the
new conn.client and conn.server. the data that dump from the
conn.server is "2 0 8 1 192 168 200 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0", the data from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0". Finally, we use the data as key to check
if this connection is one being reset(call db_hash_delete). The
db_hash_delete will return ENOENT. Because the two key that being used
by db_hash_delete and db_hash_add are different.

So, the TCP RST will be NOT sent for the connection forever. We should
initialize addr struct to zero before reparsing as IPV4 in the
ip_from_string.

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

Signed-off-by: Zhu Shangzhong <zhu.shangzhong@zte.com.cn>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
4 days agoctdb-tests: Build cluster mutex path manually
Martin Schwenke [Thu, 7 Mar 2019 04:53:31 +0000 (15:53 +1100)]
ctdb-tests: Build cluster mutex path manually

CTDB_CLUSTER_MUTEX_HELPER can't be depended on because it is only set
when the tests are not installed and setting it unconditionally for
this particular use would be wrong.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 days agodbcheck: don't check expired tombstone objects by default anymore
Stefan Metzmacher [Tue, 12 Mar 2019 10:41:01 +0000 (11:41 +0100)]
dbcheck: don't check expired tombstone objects by default anymore

These will be removed anyway and any change on them risks to
be an originating update that causes replication problems.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar 14 03:12:27 UTC 2019 on sn-devel-144

5 days agoblackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones
Stefan Metzmacher [Tue, 12 Mar 2019 10:38:22 +0000 (11:38 +0100)]
blackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoblackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck
Stefan Metzmacher [Tue, 12 Mar 2019 10:04:33 +0000 (11:04 +0100)]
blackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck

These tests operate on provision dumps created long ago, they still
want to run tests on deleted objects, when the next commits remove
processing expired tombstone objects in dbcheck.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: add --selftest-check-expired-tombstones cmdline option
Stefan Metzmacher [Tue, 12 Mar 2019 10:02:18 +0000 (11:02 +0100)]
dbcheck: add --selftest-check-expired-tombstones cmdline option

This will be used by dbcheck tests which operate on static/old provision
dumps in the following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agopython/samba/netcmd: provide SUPPRESS_HELP via Option class
Stefan Metzmacher [Tue, 12 Mar 2019 09:25:40 +0000 (10:25 +0100)]
python/samba/netcmd: provide SUPPRESS_HELP via Option class

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: detect the change after deletion bug
Stefan Metzmacher [Thu, 28 Feb 2019 17:22:18 +0000 (18:22 +0100)]
dbcheck: detect the change after deletion bug

Old versions of 'samba-tool dbcheck' could reanimate
deleted objects, when running at the same time as the
tombstone garbage collection.

When the (deleted) parent of a deleted object
(with the DISALLOW_MOVE_ON_DELETE bit in systemFlags),
is removed before the object itself, dbcheck moved
it in the LostAndFound[Config] subtree of the partition
as an originating change. That means that the object
will be in tombstone state again for 180 days on the local
DC. And other DCs fail to replicate the object as
it's already removed completely there and the replication
only gives the name and lastKnownParent attributes, because
all other attributes should already be known to the other DC.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoblackbox/dbcheck-links.sh: add regression test for lost deleted object repair
Stefan Metzmacher [Mon, 11 Mar 2019 22:14:02 +0000 (23:14 +0100)]
blackbox/dbcheck-links.sh: add regression test for lost deleted object repair

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: add find_repl_attid() helper function
Stefan Metzmacher [Thu, 28 Feb 2019 17:16:27 +0000 (18:16 +0100)]
dbcheck: add find_repl_attid() helper function

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: don't remove dangling one-way links on already deleted objects
Stefan Metzmacher [Mon, 25 Feb 2019 14:35:22 +0000 (15:35 +0100)]
dbcheck: don't remove dangling one-way links on already deleted objects

This would typically happen when the garbage collection
removed a parent object before a child object (both with
the DISALLOW_MOVE_ON_DELETE bit set in systemFlags),
while dbcheck is running at the same time as the garbage collection.
In this case the lastKnownParent attributes points a non existing
object.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: don't move already deleted objects to LostAndFound
Stefan Metzmacher [Mon, 25 Feb 2019 14:35:22 +0000 (15:35 +0100)]
dbcheck: don't move already deleted objects to LostAndFound

This would typically happen when the garbage collection
removed a parent object before a child object (both with
the DISALLOW_MOVE_ON_DELETE bit set in systemFlags),
while dbcheck is running at the same time as the garbage collection.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first
Stefan Metzmacher [Mon, 25 Feb 2019 14:09:36 +0000 (15:09 +0100)]
dbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects
Stefan Metzmacher [Mon, 11 Mar 2019 21:45:46 +0000 (22:45 +0100)]
dbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects

We should never do originating updates on deleted objects.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agodsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename
Stefan Metzmacher [Mon, 11 Mar 2019 21:38:38 +0000 (22:38 +0100)]
dsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename

We need a way to rename an object without updating the replication meta
data.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoblackbox/dbcheck-links.sh: reproduce lost deleted object problem
Stefan Metzmacher [Mon, 11 Mar 2019 13:52:57 +0000 (14:52 +0100)]
blackbox/dbcheck-links.sh: reproduce lost deleted object problem

When a parent object is removed during the tombstone garbage collection
before a child object and samba-tool dbcheck runs at the same time, the
following can happen:

- If the object child had DISALLOW_MOVE_ON_DELETE in systemFlags,
  samba-tool dbcheck moves the object under the LostAndFound[Config]
  object (as an originating update!)
- The lastKnownParent attribute is removed (as an originating update!)

These originating updates cause the object to have an extended time
as tombstone. And these changes are replicated to other DCs,
which very likely already removed the object completely!

This means the destination DC of replication has no chance to handle
the object it gets from the source DC with just 2 attributes (name, lastKnownParent).

The destination logs something like:

  No objectClass found in replPropertyMetaData

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoblackbox/*.sh: pass -u to 'diff'
Stefan Metzmacher [Tue, 12 Mar 2019 09:36:49 +0000 (10:36 +0100)]
blackbox/*.sh: pass -u to 'diff'

This is what we work with every day...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoselftest: Remove unnecessary dns_hub hashmap entries
Tim Beale [Tue, 12 Mar 2019 21:30:25 +0000 (10:30 +1300)]
selftest: Remove unnecessary dns_hub hashmap entries

These are only used within the function, and there's already a local
variable that stores the same info.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoselftest: Use consistent env variables for dns_hub
Tim Beale [Tue, 12 Mar 2019 04:39:50 +0000 (17:39 +1300)]
selftest: Use consistent env variables for dns_hub

Setting up a testenv involves populating 2 different hashmaps - an
intermediary one (usually called 'ctx') and one that is used to populate
the testenv environment variables (usually called 'env_vars' or
'dcvars').
Because the dns_hub setup is very simple, it doesn't need two different
hashmaps. However, the variable names are still a mix of the two
hashmaps.

This patch updates dns_hub to use the second, more finalized hashmap
variable-names.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoselftest: Use new helper function for client's smb.conf IP
Tim Beale [Tue, 12 Mar 2019 01:04:21 +0000 (14:04 +1300)]
selftest: Use new helper function for client's smb.conf IP

This has the side-effect of giving the client an IPv6 address, which it
hasn't had up until now. But it at least makes the client and server
interfaces settings consistent, and gets rid of a hard-coded IP address.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agotests: Make IPv4 assumption explicit
Tim Beale [Tue, 12 Mar 2019 21:18:41 +0000 (10:18 +1300)]
tests: Make IPv4 assumption explicit

This test is asserting the expected number of *IPv4* addresses, not any
interface address (including IPv6). It works currently because the
selftest client doesn't have an IPv6 address in its smb.conf.

This patch makes the IPv4 assumption explicit by importing
interface_ips_v4() from the provision code. We need to tweak this to
pass through an 'all_interfaces' flag, otherwise it filters out the
loopback IP addresses that the testenv is using.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoselftest: Add helper function to get interfaces config
Tim Beale [Tue, 12 Mar 2019 01:00:55 +0000 (14:00 +1300)]
selftest: Add helper function to get interfaces config

Add a helper function to return the IPv4/IPv6 addresses for the
smb.conf. This keeps the netmask assumptions in the same places as
the IP subnet assumptions.

This refactor means we no longer need to store $ctx->{interfaces}, as it
was only used in one place.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agoselftest: Remove secondary client interfaces
Tim Beale [Mon, 25 Feb 2019 23:14:55 +0000 (12:14 +1300)]
selftest: Remove secondary client interfaces

I can't see anything in the tests that ever tries to use these other IP
addresses. While it makes sense that we might want the tests to simulate
multiple different clients (with different IPs), we don't appear to do
this currently.

Removing the spare client addresses minimizes the number of hard-coded
IP addresses in selftest.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 days agos4/scripting: remove obsolete w32err_code.py
Douglas Bagnall [Tue, 12 Mar 2019 21:29:23 +0000 (10:29 +1300)]
s4/scripting: remove obsolete w32err_code.py

This has been replaced by gen_werror.py which shares common code with other scripts
(e.g. gen_ntstatus) and is more likely to work with conteporary microsoft HTML.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agotestsuite: Remove build_farm testsuites
Tim Beale [Mon, 11 Mar 2019 03:03:34 +0000 (16:03 +1300)]
testsuite: Remove build_farm testsuites

This test code is not run (and has not been run for about a decade).
Let's remove it - it's there in the git history if we ever want to try
to repurpose it again.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 12 02:56:05 UTC 2019 on sn-devel-144

7 days agoselftest: Remove RUN_FROM_BUILD_FARM env variable
Tim Beale [Mon, 11 Mar 2019 03:28:16 +0000 (16:28 +1300)]
selftest: Remove RUN_FROM_BUILD_FARM env variable

The build farm is no longer used, so we can remove checks for this
environment variable in the selftest code.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agos4/scripting: Remove legacy selftest-vars.sh script
Tim Beale [Mon, 11 Mar 2019 02:37:45 +0000 (15:37 +1300)]
s4/scripting: Remove legacy selftest-vars.sh script

This script was added in 2010 and has only been sporadically kept
up-to-date since. It doesn't appear to work (I think that selftest
and the testenvs have perhaps grown in complexity since 2010 and it's no
longer possible to try to access a testenv from a different
process-space, due to how we use the cwrap libraries).

There's now an alternative (export_envvars_to_file()) in the selftest
code to regenerate a similar file, if anyone actually needs it.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoselftest: Add helper function to create exports file for a testenv
Tim Beale [Tue, 26 Feb 2019 02:52:28 +0000 (15:52 +1300)]
selftest: Add helper function to create exports file for a testenv

This writes out the environment variables that are normally setup in the
testenv xterm to a file. This allows them to be sourced later.

This function is currently unused. However, it provides an alternative
replacement for the selftest-vars.sh script (which is really out of
date). I do plan to make use of this function in a subsequent patch-set.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoselftest: Move @exported_envvars into Samba.pm
Tim Beale [Tue, 26 Feb 2019 00:26:25 +0000 (13:26 +1300)]
selftest: Move @exported_envvars into Samba.pm

This brings it closer to the code that actually sets these variables
(i.e. Samba3/4.pm).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoselftest: Remove unused SELFTEST_INTERFACES
Tim Beale [Mon, 25 Feb 2019 23:11:45 +0000 (12:11 +1300)]
selftest: Remove unused SELFTEST_INTERFACES

This doesn't appear to be used anywhere and dates back to 2008.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agosamba-tool domain provision: Fix --interactive module in python3
Andrew Bartlett [Sun, 10 Mar 2019 23:38:27 +0000 (23:38 +0000)]
samba-tool domain provision: Fix --interactive module in python3

The prompts were not being printed to the screen because the stream
was not being flushed.

As reported on the samba mailing list by Adam Xu:
https://lists.samba.org/archive/samba/2019-March/221753.html

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
7 days agogpo: Backup a policy folder containing GPE.INI
Garming Sam [Thu, 7 Mar 2019 22:22:55 +0000 (11:22 +1300)]
gpo: Backup a policy folder containing GPE.INI

The GPE.INI file does not appear to be documented anywhere in the
protocol specifications and seems to be due to legacy code. It appears
that it used to be how the gPCUserExtensionNames and
gPCMachineExtensionNames were maintained without the requirement for
LDAP.

All we do is ignore the parsing of this file and copy it over as binary.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 12 01:41:32 UTC 2019 on sn-devel-144

7 days agogpo: During restore clobber GPT.INI with a blank version
Garming Sam [Tue, 26 Feb 2019 04:01:19 +0000 (17:01 +1300)]
gpo: During restore clobber GPT.INI with a blank version

Generally speaking, there is not much value to keeping this file. The
display name does not ever seem to be used and the version only applies
to the original domain or DC it was on. The command line option to
revert this behaviour is mostly for the tests or for having a straight
1:1 backup-restore for pure restoration.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agogpo: Parse GPT.INI with Latin-1
Garming Sam [Tue, 26 Feb 2019 02:35:44 +0000 (15:35 +1300)]
gpo: Parse GPT.INI with Latin-1

For some reason the French version of RSAT turns accents into ISO-8859-1.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agogpo: Add test for saving gPCXXXExtensionNames in backup
Garming Sam [Thu, 21 Feb 2019 02:15:09 +0000 (15:15 +1300)]
gpo: Add test for saving gPCXXXExtensionNames in backup

The test only checks that the LDAP values are equal before and after.
The format and specifics should be up to the implementation -- and be
amenable to changes later. As long as the extension doesn't match
.SAMBABACKUP or .xml, it won't be detected by the tools.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agogpo: Restore gPCMachineExtensionNames and gPCUserExtensionNames
Garming Sam [Wed, 20 Feb 2019 03:51:04 +0000 (16:51 +1300)]
gpo: Restore gPCMachineExtensionNames and gPCUserExtensionNames

After creating a backup and calling 'gpo restore', this makes it so that
restoring a GPO will instantly enable it for use.

There might be some cases where we might not want to do this, but for now just do it.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agopy3: io.open takes a numeric buffering argument at index 2
Garming Sam [Thu, 21 Feb 2019 02:11:39 +0000 (15:11 +1300)]
py3: io.open takes a numeric buffering argument at index 2

It's unsure why this doesn't fail generically, but it fails on my machine sometimes...

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agogpo: Add tests to make sure that an empty gplink works
Garming Sam [Wed, 20 Feb 2019 01:11:13 +0000 (14:11 +1300)]
gpo: Add tests to make sure that an empty gplink works

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agogpo: Ensure that gplink works when empty
Garming Sam [Wed, 20 Feb 2019 00:43:42 +0000 (13:43 +1300)]
gpo: Ensure that gplink works when empty

It appears that RSAT can leave a space in the gPLink field, which we need to handle.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agomodules: Add dependency on tirpc to vfs_nfs4acl_xattr
Andrew Bartlett [Fri, 8 Mar 2019 04:35:39 +0000 (04:35 +0000)]
modules: Add dependency on tirpc to vfs_nfs4acl_xattr

This is done as a new subsystem (either filled or empty) rather than via string
manipulation.

This will fix compile error on fedora.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 days agolibsmb: Use sid_parse()
Volker Lendecke [Mon, 11 Mar 2019 16:16:34 +0000 (17:16 +0100)]
libsmb: Use sid_parse()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agolib: Remove "struct sid_parse_ret" again
Volker Lendecke [Mon, 11 Mar 2019 16:11:06 +0000 (17:11 +0100)]
lib: Remove "struct sid_parse_ret" again

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agolib: Make sid_parse return the parsed length
Volker Lendecke [Mon, 11 Mar 2019 15:55:57 +0000 (16:55 +0100)]
lib: Make sid_parse return the parsed length

Use a temporary struct as a return value to make the compiler catch all
callers. If we just changed bool->ssize_t, this would just generate a
warning. struct sid_parse_ret will go away in the next commit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoAvoid NULL pointer dereference in SMBsendend handler
Michael Hanselmann [Wed, 6 Mar 2019 22:44:23 +0000 (23:44 +0100)]
Avoid NULL pointer dereference in SMBsendend handler

The "reply_sendend" function wouldn't check whether the connection had
any pending message state. A client sending an out-of-order SMBsendend
message would trigger a NULL pointer dereference.

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agos4/scripting/autoidl: p3 exception syntax
Douglas Bagnall [Sat, 9 Mar 2019 01:40:50 +0000 (14:40 +1300)]
s4/scripting/autoidl: p3 exception syntax

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agotest/blackbox: py3 compatible print in documentation.
Douglas Bagnall [Sat, 9 Mar 2019 00:49:13 +0000 (13:49 +1300)]
test/blackbox: py3 compatible print in documentation.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agos4/scripting: MORE py3 compatible print functions
Douglas Bagnall [Sat, 9 Mar 2019 00:48:29 +0000 (13:48 +1300)]
s4/scripting: MORE py3 compatible print functions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoselftest/filter-subunit: use py3 print
Douglas Bagnall [Sat, 9 Mar 2019 00:27:16 +0000 (13:27 +1300)]
selftest/filter-subunit: use py3 print

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agoselftest/format-subunit-json: remove useless py2 print
Douglas Bagnall [Fri, 8 Mar 2019 08:06:26 +0000 (21:06 +1300)]
selftest/format-subunit-json: remove useless py2 print

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 days agopidl/s4/python: call export "export" in py exceptions
Douglas Bagnall [Sun, 24 Feb 2019 09:49:10 +0000 (22:49 +1300)]
pidl/s4/python: call export "export" in py exceptions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 days agolibsmb: Use tevent_req_simple_finish_ntstatus
Volker Lendecke [Sat, 2 Mar 2019 19:01:10 +0000 (20:01 +0100)]
libsmb: Use tevent_req_simple_finish_ntstatus

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): Fri Mar  8 19:16:18 UTC 2019 on sn-devel-144

10 days agolibsmb: Add "in_cblobs" to cli_smb2_unlink
Volker Lendecke [Mon, 4 Mar 2019 19:40:14 +0000 (20:40 +0100)]
libsmb: Add "in_cblobs" to cli_smb2_unlink

This reveals the fact that unlink is an open/close in smb2 through the
API. This is not nice, but it's an internal API with currently only
one user. And it enables posix semantics for the open easily.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 days agolibsmb: Add "in_cblobs" to cli_smb2_rmdir
Volker Lendecke [Mon, 4 Mar 2019 19:40:14 +0000 (20:40 +0100)]
libsmb: Add "in_cblobs" to cli_smb2_rmdir

This reveals the fact that rmdir is an open/close in smb2 through the
API. This is not nice, but it's an internal API with currently only
one user. And it enables posix semantics for the open easily.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 days agolibsmb: Make cli_smb2_unlink async
Volker Lendecke [Mon, 4 Mar 2019 19:38:24 +0000 (20:38 +0100)]
libsmb: Make cli_smb2_unlink async

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