summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-21 12:29:22 -0400
committerStefan Metzmacher <metze@samba.org>2010-05-26 09:24:05 +0200
commit3c8dc5cd214c58747bfbbd72a8d05fc50454585a (patch)
tree6e986e55f324709228d76ab2604e3db825e45975 /source4/rpc_server
parent2e171239f9abbadae0363818ce730df8f0eaada2 (diff)
downloadsamba-3c8dc5cd214c58747bfbbd72a8d05fc50454585a.tar.gz
samba-3c8dc5cd214c58747bfbbd72a8d05fc50454585a.tar.bz2
samba-3c8dc5cd214c58747bfbbd72a8d05fc50454585a.zip
s4:smbd: Use tstream_npa_accept_existing to accept named pipe connections
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/service_rpc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c
index 05e45d8529..87c38fd2ed 100644
--- a/source4/rpc_server/service_rpc.c
+++ b/source4/rpc_server/service_rpc.c
@@ -361,21 +361,20 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn)
if (dcesrv_sock->endpoint->ep_description->transport == NCACN_NP) {
dcesrv_conn->auth_state.session_key = dcesrv_inherited_session_key;
- ret = tstream_npa_existing_socket(dcesrv_conn,
- socket_get_fd(srv_conn->socket),
- FILE_TYPE_MESSAGE_MODE_PIPE,
- &dcesrv_conn->stream);
+ dcesrv_conn->stream = talloc_move(dcesrv_conn,
+ &srv_conn->tstream);
} else {
ret = tstream_bsd_existing_socket(dcesrv_conn,
socket_get_fd(srv_conn->socket),
&dcesrv_conn->stream);
- }
- if (ret == -1) {
- status = map_nt_error_from_unix(errno);
- DEBUG(0,("dcesrv_sock_accept: failed to setup tstream: %s\n",
- nt_errstr(status)));
- stream_terminate_connection(srv_conn, nt_errstr(status));
- return;
+ if (ret == -1) {
+ status = map_nt_error_from_unix(errno);
+ DEBUG(0, ("dcesrv_sock_accept: "
+ "failed to setup tstream: %s\n",
+ nt_errstr(status)));
+ stream_terminate_connection(srv_conn, nt_errstr(status));
+ return;
+ }
}
dcesrv_conn->local_address = srv_conn->local_address;
@@ -545,9 +544,10 @@ static NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx,
dcesrv_sock->endpoint = e;
dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx);
- status = stream_setup_named_pipe(event_ctx, lp_ctx,
- model_ops, &dcesrv_stream_ops,
- e->ep_description->endpoint, dcesrv_sock);
+ status = tstream_setup_named_pipe(event_ctx, lp_ctx,
+ model_ops, &dcesrv_stream_ops,
+ e->ep_description->endpoint,
+ dcesrv_sock);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("stream_setup_named_pipe(pipe=%s) failed - %s\n",
e->ep_description->endpoint, nt_errstr(status)));