uint32_t msg_flags;
};
-bool serverid_parent_init(TALLOC_CTX *mem_ctx)
-{
- struct tdb_wrap *db;
- struct loadparm_context *lp_ctx;
- const char *fname;
-
- lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
- if (lp_ctx == NULL) {
- DEBUG(0, ("loadparm_init_s3 failed\n"));
- return false;
- }
-
- /*
- * Open the tdb in the parent process (smbd) so that our
- * CLEAR_IF_FIRST optimization in tdb_reopen_all can properly
- * work.
- */
-
- fname = lock_path("serverid.tdb");
-
- db = tdb_wrap_open(mem_ctx, fname,
- lpcfg_tdb_hash_size(lp_ctx, fname),
- lpcfg_tdb_flags(lp_ctx,
- TDB_DEFAULT|TDB_CLEAR_IF_FIRST|
- TDB_INCOMPATIBLE_HASH),
- O_RDWR|O_CREAT, 0644);
- talloc_unlink(mem_ctx, lp_ctx);
- if (db == NULL) {
- DEBUG(1, ("could not open serverid.tdb: %s\n",
- strerror(errno)));
- return false;
- }
- return true;
-}
-
static struct db_context *serverid_db(void)
{
static struct db_context *db;
return db;
}
+bool serverid_parent_init(TALLOC_CTX *mem_ctx)
+{
+ struct tdb_wrap *db;
+
+ db = serverid_db();
+ if (db == NULL) {
+ DEBUG(1, ("could not open serverid.tdb: %s\n",
+ strerror(errno)));
+ return false;
+ }
+
+ return true;
+}
+
static void serverid_fill_key(const struct server_id *id,
struct serverid_key *key)
{