outsourcing DCE/RPC to alternate programs - runtime config option

Anthony Liguori aliguori at us.ibm.com
Thu Dec 9 21:26:36 GMT 2004


On Tue, 2004-12-07 at 18:05, Jeremy Allison wrote:

> Yep - very true. The code in the current SVN reads :
> 
>         /* add a dso mechanism instead of this, here */
>                                                                                                                   
>         p->namedpipe_create = make_internal_rpc_pipe_p;
>         p->namedpipe_read = read_from_internal_pipe;
>         p->namedpipe_write = write_to_internal_pipe;
>         p->namedpipe_close = close_internal_rpc_pipe_hnd;
> 
> So it just needs a decent patch to be submitted to load a shared 
> library to fill in these function pointers based on a pipe name.
> 
> I think all we need, rather than an smb.conf option, is for the
> current code to explicitly look in an explicit directory such
> as $SAMBA/lib/named_pipes/ and load a libsmbnp_${PIPENAME}.so
> shared library found there.
> 
> I'd suggest the function names to be exported from the .so be :
> 
> pipe_create, pipe_read, pipe_write, pipe_close.

Attached is a patch that's at least a start.  It does exactly what you
describe.  It's a little different from the other modules so Metze may
have some input...

Couple things to note.

1) namedpipe_read and namedpipe_write's semantics aren't universally
obeyed.  While testing, I found that Samba does not handle partial reads
or partial writes.  

2) If any of the functions are not function in the module it falls back
to using Samba's pipe code.

3) pipe_create gets passed a connection_struct and a vuid.  These fields
are meaningless to an external library without a lot of Samba
knowledge.  Thoughts?

I tested it and it seems to work.  It executes the pipe as the
appropriate user, reads and writes correctly.

This patch was made against 3.0.9.  It applies to trunk and should
work.  I did my testing against 3.0.9.

Haven't tried on a system without dlopen but it should work on those
too.

I didn't write a header file either which I imagine is necessary because
I was unsure of how such a thing should be licensed..  Could these
modules be non-GPL?

Regards,

> Sound good ? I can probably get to this, but I have to work on
> the scalable directory problem first - so if anyone wants to
> donate a suitable patch I'll integrate it.
> 
> Cheers,
> 
> 	Jeremy.
-- 
Anthony Liguori
Samba, Linux/Windows Interoperability
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguori at us.ibm.com
Phone: (512) 838-1208
Tie Line: 678-1208
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smbd_np_module.diff
Type: text/x-patch
Size: 1963 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20041209/64d02aa9/smbd_np_module.bin


More information about the samba-technical mailing list