DCESRV stuff v3

Stefan Metzmacher metze at metzemix.de
Sun Jan 4 13:06:55 GMT 2004

Hit tridge,

I have a new patch :-)

1.) At startup every module registers an struct dcesrv_endpoint_server with register_backend()
	this struct have a const char* name, an init_server fn and funtions to get a
	struct dcesrv_interface(details later) by name or by uuid, that means that one endpoint server can ask other
	for an interface implementation and can use this.
     dcesrv_init_context() is called to set up the server context.
	we use the 'dcerpc endpoint servers' parameter (P_LIST), for each ep server we run the init_server() hook
	the ep server then registers each interface it want to provide and each endpoint where the interface should be available.
	optinaly a security descriptor can be set on the enpoint, but the first wins!
	the dcesrv_endpoint structs are created automaticly by the dcesrv_register_interface() function.

struct dcesrv_interface {
	/* this function is called when the client binds to this interface  */
	NTSTATUS (*bind)(struct dcesrv_call_state *, const struct dcesrv_interface *);

	/* this function is called when the client disconnects the endpoint */
	void (*unbind)(struct dcesrv_connection *, const struct dcesrv_interface *);

	/* the ndr function table for the chosen interface */
	const struct dcerpc_interface_table *ndr;

	/* the dispatch table for the chosen interface. Must contain
	   enough entries for all entries in the ndr table */
	const dcesrv_dispatch_fn_t *dispatch;

	/* this security descriptor can be reigstered by the endpoint server
	   init_server() hook a for a smb named pipe endpoint.
	   Note: this is optional, so this can be NULL
		 and this is not used directly the pointer
		 in the dcesrv_endpoint is used */
	const struct security_descriptor *sd;

4.) when a connection to an endpoint is requested
	1.) for tcp endpoint we now the endpoint exists :-)
	2.) for smb endpoint the find_endpoint() fn searches for the endpoint then connects to it (
		the dcesrv_connection struct is initialized here)
	        then the endpoint security descriptor is checked if available (this is currently not implemented)
5.) when the client binds to an interface find_interface() searches for the interface on the connected endpoint,
	then the interface bind() hook is called.

6.) on dcesrv_endpoint_disconnect the unbind() hook is called.

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!!)

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! so we need ONE place in a global context where all epmapper instances can get the information.
another problem is reloading the configuration with out kill connected clients, we need to share the epmapper information
between the smbd's for process_model_fork.

the following patch also implements the remote rpc endpoint server.



Stefan (metze) Metzmacher <metze at metzemix.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4_0-dcesrv-03.patch.gz
Type: application/gzip
Size: 19292 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040104/942d0368/4_0-dcesrv-03.patch.bin

More information about the samba-technical mailing list