s3-lsasd: Add missing ncalrpc listeners.
authorAndreas Schneider <asn@samba.org>
Thu, 18 Aug 2011 17:05:27 +0000 (19:05 +0200)
committerSimo Sorce <idra@samba.org>
Sun, 21 Aug 2011 13:05:07 +0000 (09:05 -0400)
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
source3/rpc_server/lsasd.c

index 9855641036a4fdd9aefd9f0d324bb32ab7783115..5eb0fe56173e32adff7f2b5342de9eaa44f08674 100644 (file)
@@ -644,6 +644,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
                goto done;
        }
 
+       fd = create_dcerpc_ncalrpc_socket("lsarpc");
+       if (fd < 0) {
+               ok = false;
+               goto done;
+       }
+       listen_fd[*listen_fd_size] = fd;
+       (*listen_fd_size)++;
+
+       rc = listen(fd, pf_lsasd_cfg.max_allowed_clients);
+       if (rc == -1) {
+               DEBUG(0, ("Failed to listen on lsarpc ncalrpc - %s\n",
+                         strerror(errno)));
+               ok = false;
+               goto done;
+       }
+
        v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
        if (v == NULL) {
                ok = false;
@@ -661,6 +677,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
                goto done;
        }
 
+       status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "lsarpc");
+       if (!NT_STATUS_IS_OK(status)) {
+               ok = false;
+               goto done;
+       }
+
        status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_lsarpc, v);
        if (!NT_STATUS_IS_OK(status)) {
                ok = false;
@@ -684,6 +706,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
        listen_fd[*listen_fd_size] = fd;
        (*listen_fd_size)++;
 
+       fd = create_dcerpc_ncalrpc_socket("samr");
+       if (fd < 0) {
+               ok = false;
+               goto done;
+       }
+       listen_fd[*listen_fd_size] = fd;
+       (*listen_fd_size)++;
+
+       rc = listen(fd, pf_lsasd_cfg.max_allowed_clients);
+       if (rc == -1) {
+               DEBUG(0, ("Failed to listen on samr ncalrpc - %s\n",
+                         strerror(errno)));
+               ok = false;
+               goto done;
+       }
+
        v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
        if (v == NULL) {
                ok = false;
@@ -701,6 +739,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
                goto done;
        }
 
+       status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "samr");
+       if (!NT_STATUS_IS_OK(status)) {
+               ok = false;
+               goto done;
+       }
+
        status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_samr, v);
        if (!NT_STATUS_IS_OK(status)) {
                ok = false;
@@ -724,6 +768,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
        listen_fd[*listen_fd_size] = fd;
        (*listen_fd_size)++;
 
+       fd = create_dcerpc_ncalrpc_socket("netlogon");
+       if (fd < 0) {
+               ok = false;
+               goto done;
+       }
+       listen_fd[*listen_fd_size] = fd;
+       (*listen_fd_size)++;
+
+       rc = listen(fd, pf_lsasd_cfg.max_allowed_clients);
+       if (rc == -1) {
+               DEBUG(0, ("Failed to listen on netlogon ncalrpc - %s\n",
+                         strerror(errno)));
+               ok = false;
+               goto done;
+       }
+
        v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
        if (v == NULL) {
                ok = false;
@@ -741,6 +801,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
                goto done;
        }
 
+       status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "netlogon");
+       if (!NT_STATUS_IS_OK(status)) {
+               ok = false;
+               goto done;
+       }
+
        status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_netlogon, v);
        if (!NT_STATUS_IS_OK(status)) {
                ok = false;