diff options
-rw-r--r-- | source3/lib/serverid.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index ee479b4e68..f5e0937224 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -42,14 +42,22 @@ struct serverid_data { static struct db_context *serverid_db(void) { static struct db_context *db; + char *db_path; if (db != NULL) { return db; } - db = db_open(NULL, lock_path("serverid.tdb"), 0, + + db_path = lock_path("serverid.tdb"); + if (db_path == NULL) { + return NULL; + } + + db = db_open(NULL, db_path, 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2, DBWRAP_FLAG_NONE); + TALLOC_FREE(db_path); return db; } |