status = messaging_tdb_init(ctx, ctx, &ctx->local);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("messaging_tdb_init failed: %s\n",
+ DEBUG(2, ("messaging_tdb_init failed: %s\n",
nt_errstr(status)));
TALLOC_FREE(ctx);
return NULL;
status = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("messaging_ctdb_init failed: %s\n",
+ DEBUG(2, ("messaging_ctdb_init failed: %s\n",
nt_errstr(status)));
TALLOC_FREE(ctx);
return NULL;
if (!ctx->tdb) {
NTSTATUS status = map_nt_error_from_unix(errno);
- DEBUG(0, ("ERROR: Failed to initialise messages database: "
+ DEBUG(2, ("ERROR: Failed to initialise messages database: "
"%s\n", strerror(errno)));
TALLOC_FREE(result);
return status;
procid_self(),
server_event_context());
}
- if (server_msg_ctx == NULL) {
- DEBUG(0, ("Could not init server's messaging context.\n"));
- }
return server_msg_ctx;
}
struct event_context *nmbd_event_context(void)
{
- static struct event_context *ctx;
-
- if (!ctx && !(ctx = event_context_init(NULL))) {
- smb_panic("Could not init nmbd event context");
- }
- return ctx;
+ return server_event_context();
}
struct messaging_context *nmbd_messaging_context(void)
{
- static struct messaging_context *ctx;
-
- if (ctx == NULL) {
- ctx = messaging_init(NULL, procid_self(),
- nmbd_event_context());
- }
- if (ctx == NULL) {
- DEBUG(0, ("Could not init nmbd messaging context.\n"));
+ struct messaging_context *msg_ctx = server_messaging_context();
+ if (likely(msg_ctx != NULL)) {
+ return msg_ctx;
}
- return ctx;
+ smb_panic("Could not init nmbd's messaging context.\n");
+ return NULL;
}
/**************************************************************************** **
struct messaging_context *smbd_messaging_context(void)
{
- return server_messaging_context();
+ struct messaging_context *msg_ctx = server_messaging_context();
+ if (likely(msg_ctx != NULL)) {
+ return msg_ctx;
+ }
+ smb_panic("Could not init smbd's messaging context.\n");
}
struct memcache *smbd_memcache(void)
extern bool override_logfile;
+struct messaging_context *winbind_messaging_context(void)
+{
+ struct messaging_context *msg_ctx = server_messaging_context();
+ if (likely(msg_ctx != NULL)) {
+ return msg_ctx;
+ }
+ smb_panic("Could not init winbindd's messaging context.\n");
+ return NULL;
+}
+
/* Reload configuration */
static bool reload_services_file(const char *lfile)
#define DOM_SEQUENCE_NONE ((uint32)-1)
#define winbind_event_context server_event_context
-#define winbind_messaging_context server_messaging_context
#endif /* _WINBINDD_H */