diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-03-21 17:05:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:38 -0500 |
commit | ab652246b9b456db30dfb9517a6f96edee5d0dc0 (patch) | |
tree | 2205edbaf2cca783d5ce4756d0d31507cb84bee7 | |
parent | 86d77746dbaa3570fb6e23538b52ba3bb19f0b07 (diff) | |
download | samba-ab652246b9b456db30dfb9517a6f96edee5d0dc0.tar.gz samba-ab652246b9b456db30dfb9517a6f96edee5d0dc0.tar.bz2 samba-ab652246b9b456db30dfb9517a6f96edee5d0dc0.zip |
r21911: Some more work on making the ncacn_np handling in smbd be less special.
(This used to be commit 52f32b7330ee1a2dd5850fd0e412279777edc00d)
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_sock.c | 48 |
2 files changed, 48 insertions, 4 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 9c7f6dfa28..fddbc6076a 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1409,9 +1409,9 @@ static void dcesrv_task_init(struct task_server *task) break; case NCACN_NP: -/* FIXME: status = dcesrv_add_ep_np(dce_ctx, e, task->event_ctx, task->model_ops); + status = dcesrv_add_ep_np(dce_ctx, e, task->event_ctx, task->model_ops); if (!NT_STATUS_IS_OK(status)) goto failed; -*/ break; + break; default: status = NT_STATUS_NOT_SUPPORTED; diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c index 3808cc0130..929c5c162d 100644 --- a/source4/rpc_server/dcerpc_sock.c +++ b/source4/rpc_server/dcerpc_sock.c @@ -267,6 +267,52 @@ NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dcesrv_end return status; } + +/* + add a socket address to the list of events, one event per dcerpc endpoint +*/ +static NTSTATUS add_socket_rpc_pipe_iface(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, + struct event_context *event_ctx, const struct model_ops *model_ops) +{ + struct dcesrv_socket_context *dcesrv_sock; + NTSTATUS status; + + if (e->ep_description->endpoint == NULL) { + DEBUG(0, ("Endpoint mandatory for named pipes\n")); + return NT_STATUS_INVALID_PARAMETER; + } + + dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context); + NT_STATUS_HAVE_NO_MEMORY(dcesrv_sock); + + /* remember the endpoint of this socket */ + dcesrv_sock->endpoint = e; + dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx); + + status = NT_STATUS_OK; +#if 0 + + status = stream_setup_smb_pipe(event_ctx, model_ops, &dcesrv_stream_ops, + e->ep_description->endpoint, dcesrv_sock); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("service_setup_stream_socket(path=%s) failed - %s\n", + e->ep_description->endpoint, nt_errstr(status))); + } +#endif + return status; +} + +NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, + struct event_context *event_ctx, const struct model_ops *model_ops) +{ + NTSTATUS status; + + status = add_socket_rpc_pipe_iface(dce_ctx, e, event_ctx, model_ops); + NT_STATUS_NOT_OK_RETURN(status); + + return status; +} + /* add a socket address to the list of events, one event per dcerpc endpoint */ @@ -324,5 +370,3 @@ NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoin return NT_STATUS_OK; } - - |