summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/serverid.h2
-rw-r--r--source3/lib/serverid.c5
-rw-r--r--source3/smbd/server.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/source3/include/serverid.h b/source3/include/serverid.h
index 3fcb5548d6..62bf638214 100644
--- a/source3/include/serverid.h
+++ b/source3/include/serverid.h
@@ -62,6 +62,6 @@ bool serverid_traverse_read(int (*fn)(const struct server_id *id,
/*
* Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
*/
-bool serverid_parent_init(void);
+bool serverid_parent_init(TALLOC_CTX *mem_ctx);
#endif
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index fefcc5df7c..3c86701596 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -33,7 +33,7 @@ struct serverid_data {
uint32_t msg_flags;
};
-bool serverid_parent_init(void)
+bool serverid_parent_init(TALLOC_CTX *mem_ctx)
{
struct tdb_wrap *db;
@@ -43,8 +43,7 @@ bool serverid_parent_init(void)
* work.
*/
- db = tdb_wrap_open(talloc_autofree_context(),
- lock_path("serverid.tdb"),
+ db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT,
0644);
if (db == NULL) {
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 6ae678dbde..2322d1fb4e 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1134,7 +1134,7 @@ extern void build_options(bool screen);
exit(1);
}
- if (!serverid_parent_init()) {
+ if (!serverid_parent_init(smbd_event_context())) {
exit(1);
}