[REVIEW REQUEST] recvmsg in socket_wrapper

Stefan (metze) Metzmacher metze at samba.org
Mon Jan 20 13:10:48 MST 2014

Hi Andreas,

>>> http://git.cryptomilk.org/projects/socket_wrapper.git/log/?h=recvmsg
>> Thanks! It's nice to see that my work is finally finished:-)
>> However I don't see were you transfer the 'struct socket_info' transparently
>> while doing fd-passing. Otherwise it's not possible to pass socket fds
>> across to another process.
> Well, the fd-passing is handled in the kernel. I can't fake the kernel 
> internals here :) That's why you can only pass fds on the local system over 
> unix sockets.

We need be able to test fd-passing of AF_INET/AF_INET6 sockets
from one process to another process on the same system, while
passing it over a AF_UNIX socket between the two processes.
and getpeername() and getsockname() need to return the same
in both processes.

We may need to pass more additional stuff via the socket
and hide it from the caller.

We need that for 2 things:

- dcerpc association group support with a prefork process model
  any process accepts an incoming connection and looks at
  the assoc_group_id field in the dcerpc bind request,
  if it's not 0, it indicates the wish to join an existing
  association. Then we need to hand over the connection
  to the process that already handles the association.

- smb 3.0 multi-channel uses a similar model, there we need to
  look at the client_guid in the negprot request and hand over
  the connection to the smbd process that already handles that
  client (if there's already such a process).

>> Otherwise I think it looks good, can you also backport this
>> to the current samba socket_wrapper code, I'd like to have that
>> also more or less complete before we remove/replace it with your
>> new code.
> I can take a look.



More information about the samba-technical mailing list