ctx->msg_ctx = msg_ctx;
ctx->tdb = tdb_wrap_open(ctx, lock_path("messages.tdb"),
- 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
+ 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_DEFAULT,
O_RDWR|O_CREAT,0600);
if (!ctx->tdb) {
return NT_STATUS_OK;
}
+bool messaging_tdb_parent_init(void)
+{
+ struct tdb_wrap *db;
+
+ /*
+ * Open the tdb in the parent process (smbd) so that our
+ * CLEAR_IF_FIRST optimization in tdb_reopen_all can properly
+ * work.
+ */
+
+ db = tdb_wrap_open(talloc_autofree_context(),
+ lock_path("messages.tdb"), 0,
+ TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_DEFAULT|TDB_VOLATILE,
+ O_RDWR|O_CREAT,0600);
+ if (db == NULL) {
+ DEBUG(1, ("could not open messaging.tdb: %s\n",
+ strerror(errno)));
+ return false;
+ }
+ return true;
+}
+
/*******************************************************************
Form a static tdb key from a pid.
******************************************************************/