diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-11-10 05:48:38 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:45:03 +0100 |
commit | b45b8fa9c3fd3490db8115dafc43d132f8658cd4 (patch) | |
tree | 36d568d4c294f69412448f333cef4f29582fae47 /source4/smbd | |
parent | 716391f10679e82835f42490e1d8a69af2acad82 (diff) | |
download | samba-b45b8fa9c3fd3490db8115dafc43d132f8658cd4.tar.gz samba-b45b8fa9c3fd3490db8115dafc43d132f8658cd4.tar.bz2 samba-b45b8fa9c3fd3490db8115dafc43d132f8658cd4.zip |
r25922: Make it easier to bind to a unix domain socket, without messing with
ports...
Andrew Bartlett
(This used to be commit 70de473980e99eeeb719bf9f63d23a399847b23b)
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/service_stream.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index ad72f907bb..e939bda8f5 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -266,7 +266,15 @@ NTSTATUS stream_setup_socket(struct event_context *event_context, /* TODO: set socket ACL's here when they're implemented */ - if (*port == 0) { + if (!port) { + socket_address = socket_address_from_strings(stream_socket, + stream_socket->sock->backend_name, + sock_addr, 0); + NT_STATUS_HAVE_NO_MEMORY(socket_address); + status = socket_listen(stream_socket->sock, socket_address, SERVER_LISTEN_BACKLOG, 0); + talloc_free(socket_address); + + } else if (*port == 0) { for (i=SERVER_TCP_LOW_PORT;i<= SERVER_TCP_HIGH_PORT;i++) { socket_address = socket_address_from_strings(stream_socket, stream_socket->sock->backend_name, |