summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-08-29 09:49:22 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-29 13:21:43 +0200
commitb8c3bfa55b574633bed10925d35dc23bc9e3853c (patch)
tree29968828c6dae2f0c0f59fb806e36b9792f093cf /source3/libsmb
parent92b7e3ee58d4c37d81103fcdab79184a84b084dc (diff)
downloadsamba-b8c3bfa55b574633bed10925d35dc23bc9e3853c.tar.gz
samba-b8c3bfa55b574633bed10925d35dc23bc9e3853c.tar.bz2
samba-b8c3bfa55b574633bed10925d35dc23bc9e3853c.zip
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 <asn@cryptomilk.org> Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/unexpected.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c
index 483d325d67..f537b3d0a7 100644
--- a/source3/libsmb/unexpected.c
+++ b/source3/libsmb/unexpected.c
@@ -72,6 +72,7 @@ NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
struct nb_packet_server *result;
struct tevent_fd *fde;
NTSTATUS status;
+ int rc;
result = talloc_zero(mem_ctx, struct nb_packet_server);
if (result == NULL) {
@@ -87,6 +88,11 @@ NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
status = map_nt_error_from_unix(errno);
goto fail;
}
+ rc = listen(result->listen_sock, 5);
+ if (rc < 0) {
+ status = map_nt_error_from_unix(errno);
+ goto fail;
+ }
talloc_set_destructor(result, nb_packet_server_destructor);
fde = tevent_add_fd(ev, result, result->listen_sock, TEVENT_FD_READ,