#include "ntdomain.h"
#include "librpc/gen_ndr/srv_winreg.h"
#include "librpc/gen_ndr/srv_spoolss.h"
+#include "librpc/gen_ndr/srv_winspool.h"
#include "rpc_server/rpc_server.h"
#include "rpc_server/rpc_ep_register.h"
#include "rpc_server/rpc_config.h"
#include "librpc/rpc/dcerpc_ep.h"
#include "lib/server_prefork.h"
#include "lib/server_prefork_util.h"
+#include "rpc_server/rpc_sock_helper.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
return false;
}
+ status = rpc_iremotewinspool_init(NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to register iremotewinspool rpc interface! (%s)\n",
+ nt_errstr(status)));
+ return false;
+ }
+
return true;
}
nt_errstr(status));
goto done;
}
+ }
- status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v);
- if (!NT_STATUS_IS_OK(status)) {
- DBG_ERR("Failed to register spoolss endpoint! (%s)\n",
- nt_errstr(status));
- goto done;
- }
+ status = dcesrv_setup_ncacn_ip_tcp_sockets(ev_ctx,
+ msg_ctx,
+ &ndr_table_iremotewinspool,
+ v,
+ 0);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to open iremotewinspool tcpip sockets!\n"));
+ goto done;
+ }
+
+ status = rpc_ep_register(ev_ctx,
+ msg_ctx,
+ &ndr_table_iremotewinspool,
+ v);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to register with endpoint mapper! Error was: %s\n",
+ nt_errstr(status)));
+ goto done;
}
status = NT_STATUS_OK;
exit(1);
}
+ status = rpc_iremotewinspool_init(NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Failed to register iremotewinspool rpc interface! (%s)\n",
+ nt_errstr(status)));
+ exit(1);
+ }
+
ok = spoolssd_setup_children_monitor(ev_ctx, msg_ctx);
if (!ok) {
DEBUG(0, ("Failed to setup children monitoring!\n"));
#include "../librpc/gen_ndr/srv_ntsvcs.h"
#include "../librpc/gen_ndr/srv_samr.h"
#include "../librpc/gen_ndr/srv_spoolss.h"
+#include "../librpc/gen_ndr/srv_winspool.h"
#include "../librpc/gen_ndr/srv_svcctl.h"
#include "../librpc/gen_ndr/srv_wkssvc.h"
return NT_STATUS_OK;
}
+static NTSTATUS rpc_setup_iremotewinspool(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx)
+{
+ enum rpc_daemon_type_e spoolss_type = rpc_spoolss_daemon();
+ NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+
+ if (lp__disable_spoolss()) {
+ return NT_STATUS_OK;
+ }
+
+ if (spoolss_type != RPC_DAEMON_EMBEDDED) {
+ return NT_STATUS_OK;
+ }
+
+ status = rpc_iremotewinspool_init(NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;;
+ }
+
+ return NT_STATUS_OK;
+}
+
static bool svcctl_init_cb(void *ptr)
{
struct messaging_context *msg_ctx =
goto done;
}
+ status = rpc_setup_iremotewinspool(ev_ctx, msg_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+
status = rpc_setup_svcctl(ev_ctx, msg_ctx);
if (!NT_STATUS_IS_OK(status)) {
goto done;