bbaumbach/samba-autobuild/.git
4 years agos3:rpc_server: Use new debug macros in dcesrv_setup_ncacn_ip_tcp_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:50:38 +0000 (16:50 +0200)]
s3:rpc_server: Use new debug macros in dcesrv_setup_ncacn_ip_tcp_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_ip_tcp_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:45:07 +0000 (16:45 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_ip_tcp_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename setup_dcerpc_ncacn_tcpip_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:39:36 +0000 (16:39 +0200)]
s3:rpc_server: Rename setup_dcerpc_ncacn_tcpip_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename rpc_create_tcpip_sockets
Samuel Cabrero [Tue, 22 Jan 2019 15:32:51 +0000 (16:32 +0100)]
s3:rpc_server: Rename rpc_create_tcpip_sockets

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename dcerpc_ncacn_tcpip_listener
Samuel Cabrero [Tue, 22 Jan 2019 15:20:38 +0000 (16:20 +0100)]
s3:rpc_server: Rename dcerpc_ncacn_tcpip_listener

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Use new debug macros for dcesrv_create_ncacn_ip_tcp_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:20:52 +0000 (16:20 +0200)]
s3:rpc_server: Use new debug macros for dcesrv_create_ncacn_ip_tcp_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_ip_tcp_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:16:36 +0000 (16:16 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_ip_tcp_socket

Additionally to the fd number, check the port number has been correctly
assigned. This check was performed by the callers of this function.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename create_tcpip_socket
Samuel Cabrero [Tue, 4 Jun 2019 14:02:54 +0000 (16:02 +0200)]
s3:rpc_server: Rename create_tcpip_socket

Additionally move function declaration from proto.h to rpc_server.h

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: simplify the error checking of create_tcpip_socket() callers
Stefan Metzmacher [Tue, 4 Jun 2019 12:12:56 +0000 (14:12 +0200)]
s3:rpc_server: simplify the error checking of create_tcpip_socket() callers

create_tcpip_socket() never returns a valid fd and left port as 0.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:rpc_server: Rename named_pipe_listener
Samuel Cabrero [Tue, 22 Jan 2019 14:50:38 +0000 (15:50 +0100)]
s3:rpc_server: Rename named_pipe_listener

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Switch to new debug macros for dcesrv_setup_ncacn_np_socket
Samuel Cabrero [Tue, 4 Jun 2019 13:48:27 +0000 (15:48 +0200)]
s3:rpc_server: Switch to new debug macros for dcesrv_setup_ncacn_np_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_np_socket
Samuel Cabrero [Tue, 4 Jun 2019 13:46:03 +0000 (15:46 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_np_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename setup_named_pipe_socket
Samuel Cabrero [Tue, 4 Jun 2019 13:34:11 +0000 (15:34 +0200)]
s3:rpc_server: Rename setup_named_pipe_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Switch to new debug macros for dcesrv_create_ncacn_np_socket
Samuel Cabrero [Tue, 4 Jun 2019 13:23:22 +0000 (15:23 +0200)]
s3:rpc_server: Switch to new debug macros for dcesrv_create_ncacn_np_socket

Additionally messages are improved.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_np_socket
Samuel Cabrero [Tue, 4 Jun 2019 13:15:11 +0000 (15:15 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_np_socket

The 'fd' state struct member is initialized after allocation because it
is checked in the error path.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename create_named_pipe_socket
Samuel Cabrero [Tue, 4 Jun 2019 12:39:03 +0000 (14:39 +0200)]
s3:rpc_server: Rename create_named_pipe_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename dcerpc_ncalrpc_listener
Samuel Cabrero [Tue, 22 Jan 2019 13:34:17 +0000 (14:34 +0100)]
s3:rpc_server: Rename dcerpc_ncalrpc_listener

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Switch to new debug macros for dcesrv_create_ncalrpc_socket
Samuel Cabrero [Tue, 4 Jun 2019 12:21:11 +0000 (14:21 +0200)]
s3:rpc_server: Switch to new debug macros for dcesrv_create_ncalrpc_socket

Additionally new debug messages are added and the existing ones improved.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Return NTSTATUS for dcesrv_create_ncalrpc_socket
Samuel Cabrero [Tue, 4 Jun 2019 12:17:03 +0000 (14:17 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_create_ncalrpc_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Rename create_dcerpc_ncalrpc_socket
Samuel Cabrero [Tue, 4 Jun 2019 11:59:23 +0000 (13:59 +0200)]
s3:rpc_server: Rename create_dcerpc_ncalrpc_socket

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agogp_inf: Read/write files with a UTF-16LE BOM in GptTmpl.inf
Garming Sam [Thu, 18 Jul 2019 02:50:57 +0000 (14:50 +1200)]
gp_inf: Read/write files with a UTF-16LE BOM in GptTmpl.inf

Regression caused by 16596842a62bec0a9d974c48d64000e3c079254e

[MS-GPSB] 2.2 Message Syntax says that you have to write a BOM which I
didn't do up until this patch. UTF-16 as input encoding was marked much
higher up in the inheritance tree, which got overriden with the Python 3
fixes. I've now marked the encoding much more obviously for this file.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Fri Jul 19 02:20:47 UTC 2019 on sn-devel-184

4 years agolib: Fix the 32-bit build
Volker Lendecke [Wed, 17 Jul 2019 19:52:55 +0000 (21:52 +0200)]
lib: Fix the 32-bit build

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 18 12:55:30 UTC 2019 on sn-devel-184

4 years agolib:util: Use GnuTLS random number generator in genrand.c
Andreas Schneider [Mon, 18 Mar 2019 16:03:30 +0000 (17:03 +0100)]
lib:util: Use GnuTLS random number generator in genrand.c

FIPS requires that a random number generator from a certified crypto
library is used.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 18 01:30:20 UTC 2019 on sn-devel-184

4 years agolib: Optimize file_compare
Volker Lendecke [Wed, 1 May 2019 13:34:22 +0000 (15:34 +0200)]
lib: Optimize file_compare

Triggered by two coverity false positives. Loading both files into
talloc'ed memory seems inefficient to me. Rely on stdio to do proper
buffering. This removes the restriction from ae95d611: "It is meant for
small files".

This is more lines, but to me it has less implicit complexity.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Jul 17 12:45:51 UTC 2019 on sn-devel-184

4 years agosmbd: Increase a debug level
Volker Lendecke [Tue, 9 Jul 2019 18:04:03 +0000 (20:04 +0200)]
smbd: Increase a debug level

This is not a real error, it happens when the share mode record is not
around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agodrepl: memory leak fix
Aaron Haslett [Mon, 26 Nov 2018 22:07:44 +0000 (11:07 +1300)]
drepl: memory leak fix

Fixes a memory leak where schema reference attached to ldb
instance is lost before it can be freed.

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Jul 17 06:17:10 UTC 2019 on sn-devel-184

4 years agos3/lib/smbconf: clang: 'Value stored during its initialization is never read'
Noel Power [Wed, 10 Jul 2019 11:50:18 +0000 (11:50 +0000)]
s3/lib/smbconf: clang: 'Value stored during its initialization is never read'

Fixes:

source3/lib/smbconf/smbconf_reg.c:123:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:178:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:444:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:583:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:712:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:995:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:1103:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
7 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Jul 17 00:07:48 UTC 2019 on sn-devel-184

4 years agos3/lib: clang: 'Value stored to 'rta' is never read'
Noel Power [Wed, 10 Jul 2019 11:45:01 +0000 (11:45 +0000)]
s3/lib: clang: 'Value stored to 'rta' is never read'

Fixes:
source3/lib/addrchange.c:217:2: warning: Value stored to 'rta' is never read <--[clang]
        rta = IFA_RTA(ifa);
        ^     ~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/registry: clang: Fix 'initialization value is never read'
Noel Power [Wed, 10 Jul 2019 11:35:35 +0000 (11:35 +0000)]
s3/registry: clang: Fix 'initialization value is never read'

Fixes:

source3/registry/reg_backend_db.c:853:9: warning: Value stored to 'result' during its initialization is never read <--[clang]
        WERROR result = WERR_OK;
               ^~~~~~   ~~~~~~~

source3/registry/reg_backend_db.c:1677:2: warning: Value stored to 'len' is never read <--[clang]
        len = 0;
        ^     ~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/registry: clang: Fix 'initialization value is never read'
Noel Power [Wed, 10 Jul 2019 11:26:06 +0000 (11:26 +0000)]
s3/registry: clang: Fix 'initialization value is never read'

Fixes:

source3/registry/reg_api.c:139:14: warning: Value stored to 'result' during its initialization is never read <--[clang]
        WERROR          result = WERR_OK;
                        ^~~~~~   ~~~~~~~
ource3/registry/reg_api.c:958:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/lib: clang: Fix 'passed-by-value struct argument contains uninit-ed data'
Noel Power [Wed, 10 Jul 2019 11:22:43 +0000 (11:22 +0000)]
s3/lib: clang: Fix 'passed-by-value struct argument contains uninit-ed data'

Fixed:

g_lock.c:358:21: warning: Passed-by-value struct argument contains uninitialized data (e.g., field: 'pid') <--[clang]
        state->watch_req = dbwrap_watched_watch_send(
                           ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/smb: clang: Fix ' 2nd function call argument is an uninitialized value'
Noel Power [Wed, 10 Jul 2019 10:46:44 +0000 (10:46 +0000)]
libcli/smb: clang: Fix ' 2nd function call argument is an uninitialized value'

Fixes:

/home/samba/samba/libcli/smb/smbXcli_base.c:5120:8: warning: 2nd function call argument is an uninitialized value <--[clang]
                rc = gnutls_hash(hash_hnd,

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/smb: clang: Fix 'Dereference of null pointer'
Noel Power [Wed, 10 Jul 2019 10:41:29 +0000 (10:41 +0000)]
libcli/smb: clang: Fix 'Dereference of null pointer'

Fixes:

smbXcli_base.c:4885:20: warning: Dereference of null pointer <--[clang]
        body = (uint8_t *)iov[1].iov_base;
                          ^~~~~~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/smb: clang: Fix 'Array access results in a null pointer deref'
Noel Power [Wed, 10 Jul 2019 10:37:34 +0000 (10:37 +0000)]
libcli/smb: clang: Fix 'Array access results in a null pointer deref'

Fixes:

smbXcli_base.c:4393:10: warning: Array access (from variable 'inhdr') results in a null pointer dereference <--[clang]
        flags = CVAL(inhdr, HDR_FLG);

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/smb: clang: Fix 'array access results in a null pointer deref'
Noel Power [Wed, 10 Jul 2019 10:22:49 +0000 (10:22 +0000)]
libcli/smb: clang: Fix 'array access results in a null pointer deref'

Fixes:

smbXcli_base.c:1239:9: warning: Array access (via field 'pending') results in a null pointer dereference <--[clang]
                req = conn->pending[0];
                      ^

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/libcli/raw: Fix 'Value stored to 'p' is never read'
Noel Power [Thu, 11 Jul 2019 12:00:27 +0000 (12:00 +0000)]
s4/libcli/raw: Fix 'Value stored to 'p' is never read'

Fixes:

source4/libcli/raw/clitree.c:138:3: warning: Value stored to 'p' is never read <--[clang]
                p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->tconx.out.fs_type,
                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/param: clang: Fix 'Value stored to 'bRetval' is never read'
Noel Power [Thu, 11 Jul 2019 11:36:46 +0000 (11:36 +0000)]
s3/param: clang: Fix 'Value stored to 'bRetval' is never read'

Fixes:

source3/param/loadparm.c:2770:2: warning: Value stored to 'bRetval' is never read <--[clang]
        bRetval = false;
        ^         ~~~~~
source3/param/loadparm.c:3868:2: warning: Value stored to 'bRetval' is never read <--[clang]
        bRetval = false;
        ^         ~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/libcli/raw: clang: Fix 'initialization value is never read'
Noel Power [Thu, 11 Jul 2019 11:33:18 +0000 (11:33 +0000)]
s4/libcli/raw: clang: Fix 'initialization value is never read'

Fixes:

source4/libcli/raw/rawnegotiate.c:157:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/libcli: clang: Fix 'initialization value is never read'
Noel Power [Thu, 11 Jul 2019 11:31:03 +0000 (11:31 +0000)]
s4/libcli: clang: Fix 'initialization value is never read'

Fixes:

source4/libcli/smb_composite/fetchfile.c:91:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/cldap: clang: Fix 'Dereference of null pointer'
Noel Power [Thu, 11 Jul 2019 11:28:58 +0000 (11:28 +0000)]
libcli/cldap: clang: Fix 'Dereference of null pointer'

Fixes:

libcli/cldap/cldap.c:144:8: warning: Dereference of null pointer <--[clang]
                ev = c->searches.list->caller.ev;
                     ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcls/netlogon: clang: Fix 'initialization value is never read'
Noel Power [Wed, 10 Jul 2019 15:34:56 +0000 (16:34 +0100)]
libcls/netlogon: clang: Fix 'initialization value is never read'

Fixes:

libcli/netlogon/netlogon.c:183:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcli/netlogon/netlogon.c:224:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

Note: although use of default seems unecessary but gcc
(with --picky-developer) detects the possibiliy still that status
may be undefined (presumably by a non enum value leaking
into the switch)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/libcli/ldab: clang: Fix 'Access results in a deref of a null pointer'
Noel Power [Wed, 10 Jul 2019 15:13:38 +0000 (16:13 +0100)]
s4/libcli/ldab: clang: Fix 'Access results in a deref of a null pointer'

Fixes:

source4/libcli/ldap/ldap_client.c:1023:6: warning: Access to field 'type' results in a dereference of a null pointer <--[clang]
        if ((*msg)->type != type) {
            ^~~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/lib: clang: Fix 'Value stored to 'b' is never read'
Noel Power [Wed, 10 Jul 2019 15:07:35 +0000 (16:07 +0100)]
s3/lib: clang: Fix 'Value stored to 'b' is never read'

Fixes:

source3/lib/substitute.c:516:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
source3/lib/substitute.c:709:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
source3/lib/substitute.c:811:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
3 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/lib/dwrap: clang: Fix 'Array access results in a null pointer dereference'
Noel Power [Wed, 10 Jul 2019 14:55:48 +0000 (15:55 +0100)]
s3/lib/dwrap: clang: Fix 'Array access results in a null pointer dereference'

Fixes:

source3/lib/dbwrap/dbwrap_watch.c:55:3: warning: Array access (from variable 'wkey') results in a null pointer dereference <--[clang]
                SIVAL(wkey, 0, db_id_len);
                ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3/lib: clang: Fix 'Value stored during its initialization is never read'
Noel Power [Wed, 10 Jul 2019 14:49:11 +0000 (15:49 +0100)]
s3/lib: clang: Fix 'Value stored during its initialization is never read'

Fixes:

source3/lib/messages.c:483:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agothird_party: Update uid_wrapper to version 1.2.7
Andreas Schneider [Mon, 15 Jul 2019 08:32:49 +0000 (10:32 +0200)]
third_party: Update uid_wrapper to version 1.2.7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 16 17:20:31 UTC 2019 on sn-devel-184

4 years agoprefork tests: re-enable restart tests for MIT Kerberos
Gary Lockyer [Wed, 10 Jul 2019 21:31:31 +0000 (09:31 +1200)]
prefork tests: re-enable restart tests for MIT Kerberos

Previously the restart back off tests were disabled for MIT Kerberos, as
they used the kdc, which is not run in that case.  Tests now use the
echo server.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 16 10:10:23 UTC 2019 on sn-devel-184

4 years agoprefork restart tests: Use echo server for back off
Gary Lockyer [Wed, 10 Jul 2019 21:28:30 +0000 (09:28 +1200)]
prefork restart tests: Use echo server for back off

Use the echo server for the restart back off tests in the
samba.tests.prefork_restart tests instead of the kdc.  The kdc is not enabled
when the ADDC is built to run MIT Kerberos.  Changing the test to use
the echo server means it can be run when MIT Kerberos is enabled.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4 echo_server: Enable prefork process model
Gary Lockyer [Wed, 10 Jul 2019 21:29:28 +0000 (09:29 +1200)]
s4 echo_server: Enable prefork process model

Enable the prefork process model, for the echo server.  This is allows
it to be used in the prefork_restart tests.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agovfs:glusterfs_fuse: ensure fileids are constant across nodes
Michael Adam [Sat, 18 May 2019 09:28:54 +0000 (11:28 +0200)]
vfs:glusterfs_fuse: ensure fileids are constant across nodes

Instead of adding a new gluster-specific mode to the fileid module,
this patches provides a fileid algorithm as part of the glusterfs_fuse
vfs module. This can not be configured further, simply adding the
glusterfs_fuse vfs module to the vfs objects configuration will enable
the new fileid mode.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Sat Jul 13 22:54:56 UTC 2019 on sn-devel-184

4 years agos3:net: add 'net vfs getntacl' command
Ralph Boehme [Thu, 11 Jul 2019 14:23:53 +0000 (16:23 +0200)]
s3:net: add 'net vfs getntacl' command

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 Jul 12 22:59:58 UTC 2019 on sn-devel-184

4 years agos4/torture: add a vfs_fruit unconversion test
Ralph Boehme [Fri, 5 Jul 2019 15:35:50 +0000 (17:35 +0200)]
s4/torture: add a vfs_fruit unconversion test

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:net: add 'vfs' hierarchy with 'stream2adouble' command
Ralph Boehme [Wed, 10 Jul 2019 14:03:17 +0000 (16:03 +0200)]
s3:net: add 'vfs' hierarchy with 'stream2adouble' command

This adds a new top-level command hierarchy 'vfs' that can be used to add
commands that access the smbd VFS stack.

The first command to be implemented is 'stream2adouble' which can be used to
convert stream metadata to AppleDouble files.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: add ad_unconvert()
Ralph Boehme [Thu, 4 Jul 2019 09:43:34 +0000 (11:43 +0200)]
adouble: add ad_unconvert()

This collects a file's stream data and packs it into a AppleDouble file.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: move fruit catia string replace mappings to s3/lib/
Ralph Boehme [Tue, 9 Jul 2019 17:26:01 +0000 (19:26 +0200)]
s3: move fruit catia string replace mappings to s3/lib/

This will be needed by another component soonish.

Signed-off-by: Ralph Boehme <slow@samba.org>
4 years agos3:{modules => lib}/string_replace.[c|h]
Ralph Boehme [Tue, 9 Jul 2019 17:10:14 +0000 (19:10 +0200)]
s3:{modules => lib}/string_replace.[c|h]

This is now also consumed by something outside source3/modules/.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: remove duplicate catia mappings
Ralph Boehme [Tue, 9 Jul 2019 17:07:30 +0000 (19:07 +0200)]
vfs_fruit: remove duplicate catia mappings

0x0d:0xf00d is already given a few lines above.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:modules: pass a TALLOC_CTX to string_replace_init_map()
Ralph Boehme [Tue, 9 Jul 2019 16:05:09 +0000 (18:05 +0200)]
s3:modules: pass a TALLOC_CTX to string_replace_init_map()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: ensure stat info is marked invalid on new path
Ralph Boehme [Sun, 7 Jul 2019 11:50:49 +0000 (13:50 +0200)]
adouble: ensure stat info is marked invalid on new path

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: remove xattrs after successfull conversion
Ralph Boehme [Fri, 5 Jul 2019 09:42:11 +0000 (11:42 +0200)]
adouble: remove xattrs after successfull conversion

This ensure the subsequent ad_fset() does not attempt to put back the xattrs on
disk in the AppleDouble file. It's not yet a problem as we don't have the code
that would do that, but that will be added in the next commit...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: add some ASCII art
Ralph Boehme [Thu, 4 Jul 2019 09:43:01 +0000 (11:43 +0200)]
adouble: add some ASCII art

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: use runtime size when writing out AppleDouble header
Ralph Boehme [Thu, 4 Jul 2019 09:37:10 +0000 (11:37 +0200)]
adouble: use runtime size when writing out AppleDouble header

We're calling SMB_VFS_NEXT_PWRITE() to write out the AppleDouble header
data. Until now this header always had a fixed sizeof AD_DATASZ_DOT_UND bytes,
but a subsequent commit will change that. Use the correct size which is the
offset of the begining of the resource fork data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: pass VFS handle and fsp to ad_pack()
Ralph Boehme [Thu, 4 Jul 2019 09:35:19 +0000 (11:35 +0200)]
adouble: pass VFS handle and fsp to ad_pack()

Unused for now, that comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoadouble: remove redundant calls to ad_pack()
Ralph Boehme [Thu, 4 Jul 2019 08:46:46 +0000 (10:46 +0200)]
adouble: remove redundant calls to ad_pack()

ad_fset() calls ad_pack() anyway...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: move Mac streams util functions to s3/lib
Ralph Boehme [Mon, 1 Jul 2019 13:53:36 +0000 (15:53 +0200)]
s3:lib: move Mac streams util functions to s3/lib

While at it, change the functions to work on the stream name directly instead of
struct smb_filename. A later commit wants to use the function on the resulting
stream names coming from vfs_streaminfo().

Also use the simple string compare version, not the multibyte ones, as the afp*
stream names are simple ASCII string, so there's no need to become fancy.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: move AppleDouble functionality to a dedicated subsystem
Ralph Boehme [Tue, 9 Jul 2019 11:10:00 +0000 (13:10 +0200)]
vfs_fruit: move AppleDouble functionality to a dedicated subsystem

It's still tied to the VFS, therefor it lives in source3/modules/. Reduces code
bloat in vfs_fruit and makes it possible to use it from other parts of the
codebase in future.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: pass catia mappings as argument to ad_convert()
Ralph Boehme [Mon, 27 May 2019 15:55:07 +0000 (17:55 +0200)]
vfs_fruit: pass catia mappings as argument to ad_convert()

This removes the direct use of fruit_catia_maps from ad_convert(), to make it
possible to move the whole AppleDouble functionality to a dedicated subsystem.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: add flags to ad_convert()
Ralph Boehme [Mon, 27 May 2019 14:57:51 +0000 (16:57 +0200)]
vfs_fruit: add flags to ad_convert()

A subsequent commmit will move all AppleDouble related functionality, including
ad_convert(), to a different compilation unit. We must therefor remove the
dependency on struct fruit_config_data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: convert adouble accessor macros to functions
Ralph Boehme [Fri, 24 May 2019 15:50:52 +0000 (17:50 +0200)]
vfs_fruit: convert adouble accessor macros to functions

The functions will be moved to a different compilation unit in a subsequent
commit and struct adouble will become a private struct so callers can't access
it directly.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoldap_server: Regression in 0559430ab6e5c48d6e853fda0d8b63f2e149015c
Garming Sam [Mon, 8 Jul 2019 04:59:33 +0000 (16:59 +1200)]
ldap_server: Regression in 0559430ab6e5c48d6e853fda0d8b63f2e149015c

Extended DN requests seem to have been incorrectly handled.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Thu Jul 11 05:25:26 UTC 2019 on sn-devel-184

4 years agolibcl/smb: clang: Fix 'Value stored to 'next_offset' is never read'
Noel Power [Mon, 8 Jul 2019 15:19:51 +0000 (15:19 +0000)]
libcl/smb: clang: Fix 'Value stored to 'next_offset' is never read'

Fixes:

 libcli/smb/smb2_create_blob.c:146:3: warning: Value stored to 'next_offset' is never read <--[clang]
                next_offset += next_pad;
                ^              ~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolibcli/smb: clang: Fix 'value stored to 'p' is never read'
Noel Power [Mon, 8 Jul 2019 15:16:57 +0000 (15:16 +0000)]
libcli/smb: clang: Fix 'value stored to 'p' is never read'

Fixes:

libcli/smb/smb1cli_session.c:226:2: warning: Value stored to 'p' is never read <--[clang]
        p += ret;
        ^    ~~~
libcli/smb/smb1cli_session.c:517:2: warning: Value stored to 'p' is never read <--[clang]
        p += ret;
        ^    ~~~
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoauth/gensec: clang: Fix 'Value stored to 'status' is never read'
Noel Power [Mon, 8 Jul 2019 13:52:26 +0000 (13:52 +0000)]
auth/gensec: clang: Fix 'Value stored to 'status' is never read'

Fixes:

auth/gensec/spnego.c:877:2: warning: Value stored to 'status' is never read <--[clang]
        status = sub_status;
        ^        ~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/auth/gensec: clang: Fix 'initialization value is never read'
Noel Power [Mon, 8 Jul 2019 13:49:30 +0000 (13:49 +0000)]
s4/auth/gensec: clang: Fix 'initialization value is never read'

Fixes:

source4/auth/gensec/gensec_gssapi.c:431:11: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
        NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
                 ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agonsswitch/libwbclient: clang: Fix Value stored to 'wbc_status' is never read
Noel Power [Mon, 8 Jul 2019 13:46:39 +0000 (13:46 +0000)]
nsswitch/libwbclient: clang: Fix Value stored to 'wbc_status' is never read

Fixes:

nsswitch/libwbclient/wbc_util.c:123:3: warning: Value stored to 'wbc_status' is never read <--[clang]
                wbc_status = WBC_ERR_SUCCESS;
                ^            ~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos4/dsdb/common: clang: Fix access results in null pointer deref.
Noel Power [Mon, 8 Jul 2019 13:43:20 +0000 (13:43 +0000)]
s4/dsdb/common: clang: Fix access results in null pointer deref.

Fixes:

source4/dsdb/common/util_trusts.c:2915:21: warning: Access to field 'sid' results in a dereference of a null pointer (loaded from field 'tdo') <--[clang]
        d->di.domain_sid = d->tdo->sid;
                           ^  ~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agonsswitch/libwbclient: clang Fix Potential leak of memory
Noel Power [Mon, 8 Jul 2019 12:12:59 +0000 (12:12 +0000)]
nsswitch/libwbclient: clang Fix Potential leak of memory

Fixes:

nsswitch/libwbclient/wbc_sid.c:848:2: warning: Potential leak of memory pointed to by 'extra_data'
        free(extra_data);
        ^
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb ABI bump for pyldb_Ldb_AsLdbContext change
Douglas Bagnall [Sun, 7 Jul 2019 00:49:57 +0000 (12:49 +1200)]
ldb ABI bump for pyldb_Ldb_AsLdbContext change

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 10 05:48:52 UTC 2019 on sn-devel-184

4 years agopyldb: ldb.register_module() checks arguments a little bit
Douglas Bagnall [Thu, 4 Jul 2019 04:43:12 +0000 (16:43 +1200)]
pyldb: ldb.register_module() checks arguments a little bit

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopyldb: remove ldb.open, which was never survivable
Douglas Bagnall [Thu, 4 Jul 2019 04:29:56 +0000 (16:29 +1200)]
pyldb: remove ldb.open, which was never survivable

There was no way to call ldb.open without evoking signal 11, so it is
unlikely anyone was using it.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopy segfault test: ldb.open
Douglas Bagnall [Thu, 4 Jul 2019 03:59:42 +0000 (03:59 +0000)]
py segfault test: ldb.open

There seems to be no way of using ldb.open without causing a segfault

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopy segfault test: ldb.register_module
Douglas Bagnall [Thu, 4 Jul 2019 03:59:11 +0000 (03:59 +0000)]
py segfault test: ldb.register_module

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopyldb: rename pyldb_Dn_AsDn() to pyldb_Dn_AS_DN()
Douglas Bagnall [Fri, 27 Apr 2018 01:15:01 +0000 (13:15 +1200)]
pyldb: rename pyldb_Dn_AsDn() to pyldb_Dn_AS_DN()

Following the python/C convention for checking vs non-checking
convertors.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopyldb: check for errors in PyLdb_GetPyType()
Douglas Bagnall [Wed, 2 May 2018 23:17:55 +0000 (11:17 +1200)]
pyldb: check for errors in PyLdb_GetPyType()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopyldb: fork pyldb_Ldb_AsLdbContext macro to reflect unsafeness
Douglas Bagnall [Fri, 20 Apr 2018 04:23:42 +0000 (16:23 +1200)]
pyldb: fork pyldb_Ldb_AsLdbContext macro to reflect unsafeness

In the Python/C API, conversion functions which check the types of their arguments
have names like:

double PyFloat_AsDouble(PyObject *pyfloat);

while conversion macros that don't check have names like:

PyFloat_AS_DOUBLE(pyfloat)

The pyldb_Ldb_AsLdbContext() macro looks like one of the checking functions
but it actually isn't. This has fooled us more than once. Here we fork
the macro into two -- one which performs checks and keeps the camel
case, and one with a shouty name that keeps the check-free behaviour.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agopyldb: add pyldb_check_type()
Douglas Bagnall [Thu, 3 May 2018 00:10:21 +0000 (12:10 +1200)]
pyldb: add pyldb_check_type()

This will be used by pyldb_Ldb_AsLdbContext().

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: do not allow adding a DN as a base to itself
Douglas Bagnall [Sat, 6 Jul 2019 11:24:43 +0000 (23:24 +1200)]
ldb: do not allow adding a DN as a base to itself

If you try to add a dn to itself, it expands as it goes. The resulting
loop cannot end well.

It looks like this in Python:

    dn = ldb.Dn(ldb.Ldb(), 'CN=y,DC=x')
    dn.add_base(dn)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agos3: smbd: Remove ifdef'ed out dptr_close_oldest().
Jeremy Allison [Mon, 8 Jul 2019 22:28:51 +0000 (15:28 -0700)]
s3: smbd: Remove ifdef'ed out dptr_close_oldest().

No longer used.

Signed-off-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 Jul 10 00:28:51 UTC 2019 on sn-devel-184

4 years agos3: smbd: Remove the 'close oldest' logic in SMB1 trans2 search processing.
Jeremy Allison [Mon, 8 Jul 2019 22:26:59 +0000 (15:26 -0700)]
s3: smbd: Remove the 'close oldest' logic in SMB1 trans2 search processing.

Will be removed in next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove the 'close oldest' logic in SMB1search processing.
Jeremy Allison [Mon, 8 Jul 2019 22:23:57 +0000 (15:23 -0700)]
s3: smbd: Remove the 'close oldest' logic in SMB1search processing.

Expect the client to manage their handles properly.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove now unused parameter 'forclose' to dptr_get().
Jeremy Allison [Mon, 8 Jul 2019 22:20:42 +0000 (15:20 -0700)]
s3: smbd: Remove now unused parameter 'forclose' to dptr_get().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: globals - remove dirhandles_open from internal search struct.
Jeremy Allison [Mon, 8 Jul 2019 22:16:21 +0000 (15:16 -0700)]
s3: smbd: globals - remove dirhandles_open from internal search struct.

It wasn't used for SMB2 anyway, and isn't useful for anything.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: We no longer need to keep a count of dirhandles open.
Jeremy Allison [Mon, 8 Jul 2019 22:15:24 +0000 (15:15 -0700)]
s3: smbd: We no longer need to keep a count of dirhandles open.

It's not per-connection struct anyway, so doesn't
help for anything.

Remove now unused variable struct smbd_server_connection *sconn
otherwise we get compile errors.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.
Jeremy Allison [Mon, 8 Jul 2019 22:06:30 +0000 (15:06 -0700)]
s3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.
Jeremy Allison [Mon, 8 Jul 2019 22:06:07 +0000 (15:06 -0700)]
s3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove unused dptr_idleoldest() and dptr_idle() functions.
Jeremy Allison [Mon, 8 Jul 2019 22:35:20 +0000 (15:35 -0700)]
s3: smbd: Remove unused dptr_idleoldest() and dptr_idle() functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove SMB1 idle unused directory handles code.
Jeremy Allison [Mon, 8 Jul 2019 22:34:41 +0000 (15:34 -0700)]
s3: smbd: Remove SMB1 idle unused directory handles code.

This is only needed for broken SMB1 DOS clients, and
we're a long way from needing this anymore.

ifdef out dptr_idleoldest() and dptr_idle()
functions as otherwise we get "unused function"
compile errors. Remove in next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove MAX_OPEN_DIRECTORIES check in dptr_create().
Jeremy Allison [Mon, 8 Jul 2019 22:01:43 +0000 (15:01 -0700)]
s3: smbd: Remove MAX_OPEN_DIRECTORIES check in dptr_create().

This is a bug in that it's artificially limiting the number
of open directories an SMB2 client can have. If this code
was needed it should by SMB1 specific.

However we should allow the clients to decide for themselves
how many directory handles they need, not limit to MAX_OPEN_DIRECTORIES.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove now unused dptr_idlecnum().
Jeremy Allison [Mon, 8 Jul 2019 21:58:44 +0000 (14:58 -0700)]
s3: smbd: Remove now unused dptr_idlecnum().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: smbd: Remove unused DPTR_IDLE_TIMEOUT.
Jeremy Allison [Mon, 8 Jul 2019 21:57:17 +0000 (14:57 -0700)]
s3: smbd: Remove unused DPTR_IDLE_TIMEOUT.

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