RFC rawpipe

Andreas Schneider asn at samba.org
Mon May 30 08:04:30 UTC 2016


On Monday, 30 May 2016 08:33:31 CEST Volker Lendecke wrote:
> On Thu, May 26, 2016 at 11:45:55AM +0100, Noel Power wrote:
> > Hi,
> > I'm trying once again to get my head around the WSP stuff, one of the
> > prerequisites for that is working with rawpipes, some time ago I posted
> > some patches around dealing with such rawpipes that was too heavy weight
> > (see
> > https://lists.samba.org/archive/samba-technical/2014-July/100884.html)
> > See attached patches that attempt to rework this,
> 
> First of all -- it's great that you start working on this again, trying
> to get it upstream! If my comments below turn out to be too hard to work
> upon, I'd much prefer to get WSP in ignoring my whining than to delay
> it indefinitely!
> 
> Question -- do we really want "internal" raw pipes? My preference would
> be to move as much as possible out of the core smbd blob. Would it be
> possible to have two backends for named pipes only in smbd? One for
> the existing RPC infrastructure (that eventually needs to move out to
> pure transport too), and the other one for a pure unix domain socket
> transport. I know that there's more to named pipes than just a stream
> of bytes, named pipes can be message-boundary preserving, so we need to
> define a protocol on that unix domain socket. Also, we need to solve the
> problem of authentication tokens passed to the named pipe server, so it
> might not be just as simple as it first looks. But I would prefer not
> to add another name_pipe_server_details VFS-like structure, if possible.
> 
> I'm absolutely not against putting more code into Samba, but if possible
> I would really prefer separate small binaries that provide services over
> wellknown IPC mechanisms. Privilege separation, better crash resiliency,
> much easier to make async etc. Samba does have quite an elaborate set
> of infrastructure to build upon, so that's handy, but smbd is already
> overloaded and needs to be put on a diet.

For IPC communication we have rpcint_binding_handle() for internal 
communication (connections inside the same daemon). Then we have 
rpc_pipe_open_ncalrpc() local rpc over unix sockets to communicate between 
daemons. ncalrpc is used by samba (ad dc) to talk to smbd. If epmd is started 
then smbd uses ncalrpc to talk to it.

See e.g. https://git.samba.org/?p=samba.git;a=blob;f=source3/librpc/rpc/
dcerpc_ep.c;h=0502557a6621178fe4cf2e381cb278cd85d71d42;hb=refs/heads/
master#l333


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list