struct ndr_interface_table;
struct rpc_srv_callbacks;
+struct dcesrv_context;
-NTSTATUS dcesrv_ep_setup(struct tevent_context *ev_ctx,
- struct messaging_context *msg_ctx);
+NTSTATUS dcesrv_init(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx);
NTSTATUS rpc_setup_embedded(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
/* The following definitions come from smbd/signing.c */
struct smbXsrv_connection;
+struct dcesrv_context;
bool srv_check_sign_mac(struct smbXsrv_connection *conn,
const char *inbuf, uint32_t *seqnum, bool trusted_channel);
bool req_is_in_chain(const struct smb_request *req);
void smbd_process(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
+ struct dcesrv_context *dce_ctx,
int sock_fd,
bool interactive);
bool fork_echo_handler(struct smbXsrv_connection *xconn);
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
+ struct dcesrv_context *dce_ctx;
/* the list of listening sockets */
struct smbd_open_socket *sockets;
struct smbd_open_socket *s = talloc_get_type_abort(private_data,
struct smbd_open_socket);
struct messaging_context *msg_ctx = s->parent->msg_ctx;
+ struct dcesrv_context *dce_ctx = s->parent->dce_ctx;
struct sockaddr_storage addr;
socklen_t in_addrlen = sizeof(addr);
int fd;
if (s->parent->interactive) {
reinit_after_fork(msg_ctx, ev, true, NULL);
- smbd_process(ev, msg_ctx, fd, true);
+ smbd_process(ev, msg_ctx, dce_ctx, fd, true);
exit_server_cleanly("end of interactive mode");
return;
}
smb_panic("reinit_after_fork() failed");
}
- smbd_process(ev, msg_ctx, fd, false);
+ smbd_process(ev, msg_ctx, dce_ctx, fd, false);
exit:
exit_server_cleanly("end of child");
return;
NTSTATUS status;
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
+ struct dcesrv_context *dce_ctx = NULL;
struct server_id server_id;
struct tevent_signal *se;
int profiling_level;
exit(1);
}
+ dce_ctx = global_dcesrv_context();
+ if (dce_ctx == NULL) {
+ exit(1);
+ }
+
/*
* Reloading of the printers will not work here as we don't have a
* server info and rpc services set up. It will be called later.
parent->interactive = interactive;
parent->ev_ctx = ev_ctx;
parent->msg_ctx = msg_ctx;
+ parent->dce_ctx = dce_ctx;
am_parent = parent;
se = tevent_add_signal(parent->ev_ctx,
}
}
- status = dcesrv_ep_setup(ev_ctx, msg_ctx);
+ status = dcesrv_init(ev_ctx, ev_ctx, msg_ctx, dce_ctx);
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("Failed to setup RPC server: %s\n", nt_errstr(status));
exit_daemon("Samba cannot setup ep pipe", EACCES);
/* Stop zombies */
smbd_setup_sig_chld_handler(parent);
- smbd_process(ev_ctx, msg_ctx, sock, true);
+ smbd_process(ev_ctx, msg_ctx, dce_ctx, sock, true);
exit_server_cleanly(NULL);
return(0);