From b8c3bfa55b574633bed10925d35dc23bc9e3853c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 29 Aug 2011 09:49:22 +0200 Subject: s3-lib: If we create a pipe socket, don't start to listen. The create_pipe_sock() function should only create the socket as the name states and not start to listen on it too. We should start to listen on in the individual places as we need different backlog values. Autobuild-User: Andreas Schneider Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104 --- source3/rpc_server/rpc_server.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/rpc_server/rpc_server.c') diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index c995e22ea0..6b95419172 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -209,6 +209,7 @@ bool setup_named_pipe_socket(const char *pipe_name, { struct dcerpc_ncacn_listen_state *state; struct tevent_fd *fde; + int rc; state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state); if (!state) { @@ -225,6 +226,13 @@ bool setup_named_pipe_socket(const char *pipe_name, goto out; } + rc = listen(state->fd, 5); + if (rc < 0) { + DEBUG(0, ("Failed to listen on pipe socket %s: %s\n", + pipe_name, strerror(errno))); + goto out; + } + state->ev_ctx = ev_ctx; state->msg_ctx = msg_ctx; @@ -852,6 +860,7 @@ bool setup_dcerpc_ncalrpc_socket(struct tevent_context *ev_ctx, { struct dcerpc_ncacn_listen_state *state; struct tevent_fd *fde; + int rc; state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state); if (state == NULL) { @@ -878,6 +887,13 @@ bool setup_dcerpc_ncalrpc_socket(struct tevent_context *ev_ctx, goto out; } + rc = listen(state->fd, 5); + if (rc < 0) { + DEBUG(0, ("Failed to listen on ncalrpc socket %s: %s\n", + name, strerror(errno))); + goto out; + } + state->ev_ctx = ev_ctx; state->msg_ctx = msg_ctx; -- cgit