1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/source4/smbd
Gary Lockyer 099df25f56 source4 smbd: remove global control pipe from process_standard.
The standard model uses a pipe to signal the worker processes spawned on
accept that the controlling process has terminated and that they should
shut down.  This pipe is currently a static global variable in
process_standard.c.

This patch replaces that global pipe with a file descriptor passed into
the process model init functions, giving  a single mechanism across all process
models.  This paves the way for the addition of a pre-fork process model.

Ensuring that the correct file descriptors are closed, is difficult so
it is best do this only once rather than require the process models to
do this individually.

Notes on debugging pipe ownership:

Add code to log the process id and the file descriptor of the writeable
pipe.

run:
   lsof | grep FIFO | grep samba | grep <process id>
   this will produce lines like:

   samba 25624 him 4w FIFO 0,10 0t0 472206 pipe

   where: 4w is the file descriptor and mode and the number to the left
          of "pipe" is the pipe id.
then:
   lsof | grep FIFO | grep samba | grep <pipe id>

   This will display all the processes with the pipe open and the mode
   only the smbd master process should have it open in write mode.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Sep 28 02:08:34 CEST 2017 on sn-devel-144
2017-09-28 02:08:34 +02:00
..
process_model.c lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *) 2017-04-22 01:17:00 +02:00
process_model.h source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
process_single.c source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
process_standard.c source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
server.c source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
service_named_pipe.c s4-named_pipe_auth: Rename client -> remote_client and server -> local_server 2017-03-29 02:37:28 +02:00
service_stream.c stream_terminate_connection: Prevent use-after-free 2017-06-15 01:24:25 +02:00
service_stream.h smbd/service_stream: connection processing flag is not really bool 2016-12-01 00:28:05 +01:00
service_task.c source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
service_task.h server_id.idl: Bring server_id.idl in common 2011-06-09 12:40:08 +02:00
service.c source4 smbd: remove global control pipe from process_standard. 2017-09-28 02:08:34 +02:00
service.h
wscript_build process_standard: clean up messaging for children after exit() 2017-04-25 23:08:11 +02:00