Douglas Bagnall [Thu, 4 Jul 2019 10:21:36 +0000 (22:21 +1200)]
s4/py_dsdb: avoid NULL deref in set_domain_sid()
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Tue, 9 Jul 2019 09:45:03 +0000 (09:45 +0000)]
libcli/pysecurity: use pytalloc_get_name to avoid NULL deref
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andrew Bartlett [Mon, 22 Jul 2019 01:42:37 +0000 (13:42 +1200)]
talloc: Release talloc 2.3.0
* add pytalloc_get_name() to safely access te talloc name in Python bindings
* Use a new minor version to allow talloc updates in the 4.11 release stream
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz
Douglas Bagnall [Sun, 7 Jul 2019 00:34:37 +0000 (12:34 +1200)]
talloc/py_util: remove tautologically dead code
Being careful is good and all, but if we don't trust the
static PyTypeObject *type = NULL;
two lines up, we need to reconsider our entire software universe.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Tue, 9 Jul 2019 09:44:12 +0000 (09:44 +0000)]
talloc: pytalloc_get_checked_type: survive non-talloc objects
If the python object is not a talloc object, we will end up
with a NULL pointer. We weren't checking for that properly
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Tue, 9 Jul 2019 08:59:19 +0000 (08:59 +0000)]
talloc: add pytalloc_get_name() helper
In several places we go
talloc_get_name(pytalloc_get_ptr(py_obj))
which is a certain NULL derefernce if py_obj is not a talloc object.
This is a helper function that chooses to say "non-talloc object"
rather than crash.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Thu, 4 Jul 2019 21:37:13 +0000 (09:37 +1200)]
tests/py-segfault: add messaging.deregister()
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall [Thu, 4 Jul 2019 10:19:55 +0000 (22:19 +1200)]
py segfault test: registry.open_hive
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Samuel Cabrero [Tue, 26 Feb 2019 12:38:40 +0000 (13:38 +0100)]
s3:rpc_server: Call server exit routines in sigterm handler
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 22 18:04:53 UTC 2019 on sn-devel-184
Samuel Cabrero [Tue, 26 Feb 2019 12:35:09 +0000 (13:35 +0100)]
s3:rpc_server: Call epmapper RPC shutdown function from server exit routines
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 26 Feb 2019 12:33:12 +0000 (13:33 +0100)]
s3:rpc_server: Call fsrvp RPC shutdown function from server exit routines
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 26 Feb 2019 12:24:33 +0000 (13:24 +0100)]
s3:rpc_server: Call server exit routines in sigterm handler
The exit server routines already call rpc shutdown functions
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 26 Feb 2019 12:59:54 +0000 (13:59 +0100)]
s3:rpc_server: Improve debug messages
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Wed, 27 Feb 2019 15:52:20 +0000 (16:52 +0100)]
s3:rpc_server:spoolssd: Move socket creation to its own function
The function also handles the registration in the endpoint mapper.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 20:06:02 +0000 (21:06 +0100)]
s3:rpc_server: Return NTSTATUS in is_known_pipename function
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 20:04:00 +0000 (21:04 +0100)]
s3:rpc_server: Make make_external_rpc_pipe_p and np_proxy_state private
This function and struct is not used outside rpc_ncacn_np.c
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Thu, 14 Feb 2019 13:22:49 +0000 (14:22 +0100)]
s3:rpc_server: Check pointer before dereference
The debug message dereference the pointer, but as close_policy_by_pipe
is called from pipes_struct destructor it may be not initialized yet if
an error occur in the initialization code.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 11 Feb 2019 10:47:56 +0000 (11:47 +0100)]
s3:rpc_server: Rename dcesrv_handle struct
The name conflicts with the S4 name.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 19:28:05 +0000 (20:28 +0100)]
s3:rpc_server: Unify RPC client disconnect and termination functions
These functions are used by endpoint mapper to delete the endpoints
when a NCALRPC connection from an external daemon is lost and by
preforked childs to accept the next client as soon as the current
connection terminates. We can use the same function for both purposes.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 19:27:31 +0000 (20:27 +0100)]
s3:spoolss: Set remote and local address for accepted connections
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Wed, 13 Feb 2019 09:48:54 +0000 (10:48 +0100)]
s3:rpc_server: Return NTSTATUS in make_internal_rpc_pipe_p
Also make it static as it is not used outside rpc_ncacn_np.c
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 5 Feb 2019 18:27:58 +0000 (19:27 +0100)]
s3:rpc_server: Set debug class in all rpc server related files
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Wed, 27 Feb 2019 15:54:49 +0000 (16:54 +0100)]
s3:rpc_server: Initialize auxiliary variable checked in error path
The auxiliary variable is checked in the function's exit code so reset
it after each usage.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 28 Jan 2019 09:57:53 +0000 (10:57 +0100)]
s3:prefork: Allow to associate private data with listening socket
Prepare for merger RPC server codebase, where it will be necessary to
stablish an association between the listening socket and the
dcesrv_endpoint that the socket is serving.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 18:38:08 +0000 (19:38 +0100)]
s3:rpc_server: Remove named_pipe_client struct and use dcerpc_ncacn_conn
Now NCACN_NP connections run the same loop as NCACN_IP_TCP and NCALRPC
connections.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 18:34:38 +0000 (19:34 +0100)]
s3:rpc_server: Check remote address supplied to dcerpc_ncacn_accept
Check if the supplied tsocket_address is valid before changing the
talloc chunk parent to the ncacn_conn struct.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 18:33:29 +0000 (19:33 +0100)]
s3:rpc_server: Make dcerpc_ncacn_packet_process public
In preparation to remove the named_pipe_client struct, this function
will be set as tevent callback from rpc_ncacn_np.c
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 18:31:04 +0000 (19:31 +0100)]
s3:rpc_server: Add a function to initialize the dcerpc_ncacn_conn struct
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 18:24:54 +0000 (19:24 +0100)]
s3:rpc_server: Split dcerpc_ncacn_accept to deal with tstream_npa
In preparation to remove the named_pipe_client struct split the function
if two parts and build the tstream context as soon as possible, as it
will take care of closing the socket when the tstream_context is freed.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 17:48:57 +0000 (18:48 +0100)]
s3:rpc_server: Add termination function and data to dcerpc_ncacn_conn
In preparation to remove the named_pipe_client structure, this function
will be called from ncacn_conn destructor passing the private data pointer
as argument. It is mainly used by preforked childs in "process model" to
attend the next client as soon as the previous client ends the connection.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 17:25:48 +0000 (18:25 +0100)]
s3:rpc_server: Move dcerpc_ncanc_conn to header file
Next commits will remove named_pipe_client and dcerpc_ncacn_connection
will be used in its place. It has to be moved to a header file as it
will be used by functions in rpc_server.c and rpc_ncacn_np.c.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Samuel Cabrero [Tue, 5 Feb 2019 12:34:39 +0000 (13:34 +0100)]
s3:rpc_server: Set dcerpc_ncacn_connection destructor
And call disconnection callback from there if it is set.
Additionally change named_pipe_termination_fn to have * in typedef.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Thu, 31 Jan 2019 20:57:04 +0000 (21:57 +0100)]
s3:epmapper: Rename conflicting struct
Rename an epmapper internal struct which will conflict when merging s3
and s4 rpc servers.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Sun, 3 Feb 2019 21:33:53 +0000 (22:33 +0100)]
s3-prefork: Add header inclusion guards
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Samuel Cabrero [Thu, 31 Jan 2019 15:42:35 +0000 (16:42 +0100)]
s3:rpc_server: Return NTSTATUS in rpc_ep_setup and setup functions
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 16:28:34 +0000 (17:28 +0100)]
s3:rpc_server: Fix hidden strict aliasing issues
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 16:27:46 +0000 (17:27 +0100)]
lib:tsocket: New function to build a tsocket_context from samba_address
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 16:09:14 +0000 (17:09 +0100)]
s3:utils: New struct to fix strict aliasing issues with sockets API
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Samuel Cabrero [Mon, 18 Feb 2019 16:05:54 +0000 (17:05 +0100)]
s3:rpc_server: Fix code formatting and improve debug messages
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Wed, 20 Feb 2019 08:28:55 +0000 (09:28 +0100)]
s3:rpc_server: Set the endpoint name to "IP" on ncacn_ip_tcp listener
This matchs what lsasd and mdssd does.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Wed, 6 Feb 2019 08:11:47 +0000 (09:11 +0100)]
s3:spoolss: Exit if fork call fails
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 4 Jun 2019 15:04:32 +0000 (17:04 +0200)]
s3:rpc_server: Use talloc_zero for dcerpc_ncacn_listen_state
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 4 Jun 2019 15:02:18 +0000 (17:02 +0200)]
s3:rpc_server: Use new debug macros in dcesrv_setup_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 4 Jun 2019 15:00:30 +0000 (17:00 +0200)]
s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Samuel Cabrero [Tue, 4 Jun 2019 14:56:17 +0000 (16:56 +0200)]
s3:rpc_server: Rename setup_dcerpc_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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
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
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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>
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
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
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>
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>
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>
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>