/* Run before the parent forks */
bool printing_subsystem_init(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx,
bool start_daemons,
bool background_queue)
{
/* start as a separate daemon only if enabled */
if (start_daemons && rpc_spoolss_daemon() == RPC_DAEMON_FORK) {
- pid = start_spoolssd(ev_ctx, msg_ctx);
+ pid = start_spoolssd(ev_ctx, msg_ctx, dce_ctx);
} else if (start_daemons && background_queue) {
#ifndef _SOURCE3_PRINTING_QUEUE_PROCESS_H_
#define _SOURCE3_PRINTING_QUEUE_PROCESS_H_
+struct dcesrv_context;
+
bool printing_subsystem_init(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx,
bool start_daemons,
bool background_queue);
void printing_subsystem_update(struct tevent_context *ev_ctx,
}
pid_t start_spoolssd(struct tevent_context *ev_ctx,
- struct messaging_context *msg_ctx)
+ struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx)
{
struct rpc_srv_callbacks spoolss_cb;
pid_t pid;
exit(1);
}
+ DBG_INFO("Reinitializing DCE/RPC server context\n");
+
+ status = dcesrv_reinit_context(dce_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ DBG_ERR("Failed to reinit DCE/RPC context: %s\n",
+ nt_errstr(status));
+ exit(1);
+ }
+
/* the listening fd must be created before the children are actually
* forked out. */
status = spoolssd_create_sockets(ev_ctx, msg_ctx, listen_fds,
#include "replace.h"
#include "messages.h"
+struct dcesrv_context;
+
pid_t start_spoolssd(struct tevent_context *ev_ctx,
- struct messaging_context *msg_ctx);
+ struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx);
#endif /* _SOURCE3_PRINTING_SPOOLSSD_H_ */
if (!lp__disable_spoolss() &&
(rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {
bool bgq = lp_parm_bool(-1, "smbd", "backgroundqueue", true);
-
- if (!printing_subsystem_init(ev_ctx, msg_ctx, true, bgq)) {
+ bool ok = printing_subsystem_init(ev_ctx,
+ msg_ctx,
+ dce_ctx,
+ true,
+ bgq);
+ if (!ok) {
exit_daemon("Samba failed to init printing subsystem", EACCES);
}
}
#endif
} else if (!lp__disable_spoolss() &&
(rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {
- if (!printing_subsystem_init(ev_ctx, msg_ctx, false, false)) {
+ bool ok = printing_subsystem_init(ev_ctx,
+ msg_ctx,
+ dce_ctx,
+ false,
+ false);
+ if (!ok) {
exit(1);
}
}