summaryrefslogtreecommitdiff
path: root/source3/printing/spoolssd.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-07-01 18:40:38 +0200
committerAndreas Schneider <asn@samba.org>2011-08-01 08:50:35 +0200
commit0fef6766b9e4c8612b2ad547720ec47463917192 (patch)
treed5be238102a2ca1d9855bc8f6803fa0dbdc1cf5c /source3/printing/spoolssd.c
parent498e53c22008c918e2ae5ca8126a8b1b2e8322df (diff)
downloadsamba-0fef6766b9e4c8612b2ad547720ec47463917192.tar.gz
samba-0fef6766b9e4c8612b2ad547720ec47463917192.tar.bz2
samba-0fef6766b9e4c8612b2ad547720ec47463917192.zip
s3-rpc_server: Use binding vector in rpc_ep_try_register().
Diffstat (limited to 'source3/printing/spoolssd.c')
-rw-r--r--source3/printing/spoolssd.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index bd8a62fb33..48509b3967 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -29,6 +29,7 @@
#include "rpc_server/rpc_server.h"
#include "rpc_server/rpc_ep_register.h"
#include "rpc_server/spoolss/srv_spoolss_nt.h"
+#include "librpc/rpc/dcerpc_ep.h"
#define SPOOLSS_PIPE_NAME "spoolss"
#define DAEMON_NAME "spoolssd"
@@ -149,6 +150,8 @@ void start_spoolssd(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx)
{
struct rpc_srv_callbacks spoolss_cb;
+ struct dcerpc_binding_vector *v;
+ TALLOC_CTX *mem_ctx;
pid_t pid;
NTSTATUS status;
int ret;
@@ -199,6 +202,11 @@ void start_spoolssd(struct tevent_context *ev_ctx,
messaging_register(msg_ctx, ev_ctx,
MSG_SMB_CONF_UPDATED, smb_conf_updated);
+ mem_ctx = talloc_new(NULL);
+ if (mem_ctx == NULL) {
+ exit(1);
+ }
+
/*
* Initialize spoolss with an init function to convert printers first.
* static_init_rpc will try to initialize the spoolss server too but you
@@ -222,17 +230,29 @@ void start_spoolssd(struct tevent_context *ev_ctx,
exit(1);
}
- if (!setup_named_pipe_socket(SPOOLSS_PIPE_NAME, ev_ctx, msg_ctx)) {
+ status = dcerpc_binding_vector_new(mem_ctx, &v);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to create binding vector (%s)\n",
+ nt_errstr(status)));
exit(1);
}
- status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, NULL, 0);
+ status = dcerpc_binding_vector_add_np_default(&ndr_table_spoolss, v);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to add np to binding vector (%s)\n",
+ nt_errstr(status)));
+ exit(1);
+ }
+
+ status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to register spoolss endpoint! (%s)\n",
nt_errstr(status)));
exit(1);
}
+ talloc_free(mem_ctx);
+
DEBUG(1, ("SPOOLSS Daemon Started (%d)\n", getpid()));
/* loop forever */