diff options
Diffstat (limited to 'source4/smbd/service_stream.c')
-rw-r--r-- | source4/smbd/service_stream.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index 08c323fc0a..ad72f907bb 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -28,6 +28,7 @@ #include "smbd/service_stream.h" #include "lib/messaging/irpc.h" #include "cluster/cluster.h" +#include "param/param.h" /* the range of ports to try for dcerpc over tcp endpoints */ #define SERVER_TCP_LOW_PORT 1024 @@ -83,13 +84,13 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char */ static void stream_io_handler(struct stream_connection *conn, uint16_t flags) { - conn->processing = True; + conn->processing = true; if (flags & EVENT_FD_WRITE) { conn->ops->send_handler(conn, flags); } else if (flags & EVENT_FD_READ) { conn->ops->recv_handler(conn, flags); } - conn->processing = False; + conn->processing = false; if (conn->terminate) { stream_terminate_connection(conn, conn->terminate); @@ -174,13 +175,15 @@ static void stream_new_connection(struct event_context *ev, srv_conn->event.fde = event_add_fd(ev, srv_conn, socket_get_fd(sock), 0, stream_io_handler_fde, srv_conn); - if (!socket_check_access(sock, "smbd", lp_hostsallow(-1), lp_hostsdeny(-1))) { + if (!socket_check_access(sock, "smbd", lp_hostsallow(NULL), lp_hostsdeny(NULL))) { stream_terminate_connection(srv_conn, "denied by access rules"); return; } /* setup to receive internal messages on this connection */ - srv_conn->msg_ctx = messaging_init(srv_conn, srv_conn->server_id, ev); + srv_conn->msg_ctx = messaging_init(srv_conn, + lp_messaging_path(srv_conn, global_loadparm), + srv_conn->server_id, ev); if (!srv_conn->msg_ctx) { stream_terminate_connection(srv_conn, "messaging_init() failed"); return; @@ -224,11 +227,13 @@ static void stream_accept_handler(struct event_context *ev, struct fd_event *fde stream_new_connection, stream_socket); } - - /* setup a listen stream socket if you pass *port == 0, then a port > 1024 is used + + FIXME: This function is TCP/IP specific - uses an int rather than + a string for the port. Should leave allocating a port nr + to the socket implementation - JRV20070903 */ NTSTATUS stream_setup_socket(struct event_context *event_context, const struct model_ops *model_ops, @@ -255,7 +260,8 @@ NTSTATUS stream_setup_socket(struct event_context *event_context, status = socket_set_option(stream_socket->sock, "SO_KEEPALIVE", NULL); NT_STATUS_NOT_OK_RETURN(status); - status = socket_set_option(stream_socket->sock, lp_socket_options(), NULL); + status = socket_set_option(stream_socket->sock, lp_socket_options(global_loadparm), + NULL); NT_STATUS_NOT_OK_RETURN(status); /* TODO: set socket ACL's here when they're implemented */ |