DCESRV stuff v3

tridge at samba.org tridge at samba.org
Wed Jan 7 00:47:11 GMT 2004


Metze,

 > I have a new patch :-)

thanks!

I like the approach in your patch, except for the remoteserver.pl
code. 

I don't think we need a code generator at all for the remote rpc
server backend (ie. we don't need any pidl changes at all). Instead I
think we can write a fairly simple single C file that uses the table
in librpc/gen_ndr/tables.c to do all of the remote rpc server. This
should be easier to maintain. The reason this is possible is that we
have the "struct_size" element in struct dcerpc_interface_call. That
element allows us to allocate the buffer to hold the rpc structure for
each call with the right size. See dcerpc_ndr_validate_in() for an
example of how this can be done.

 > The problem which remains is that didn't now about the TCP ports of
 > TCP-0 endpoints in the epmapper (btw: the current implementation
 > fails here too! when you ask the smb pipe epmapper!!)

hmm, I hadn't noticed that. The reason this happens is that
dcesrv_init() is called twice - once when the tcp listen sockets are
setup and again when a SMB connect is accepted. The second call is the
problem, we need some way to share the "struct dcesrv_context *"
between the SMB and RPC/TCP server contexts. A global would make this
simple, but doesn't feel right. I think the layering I've setup is the
real problem.

 > I think to explicite register the endpoints in the to the epmapper,
 > so that it's also possible for an external application to register
 > a TCP endpoint which is directly handled by this application and
 > not by the smbd!

yes, I'd like to be able to do that. The simplest is probably to do
this:


1) implement RPC over unix domain sockets. Create a unix domain socket
   at startup that has only root rw privileges.

2) implement epm_Insert() in epmapper.c. Only allow it to be called
   when on the privileged unix domain socket

3) we'll need some way to communicate the insert to the top level
   dcesrv context. That means either our tdb messaging system to the
   top level process or instead store the epmapper info in a tdb.

 > the following patch also implements the remote rpc endpoint server.

yep, as I said above, I like the patch except for that bit.

do you have time for a quick chat on IRC this afternoon? (thats
wednesday morning your time).

Cheers, Tridge


More information about the samba-technical mailing list