From 338e5a1d35574dbd96bbbcf2a74fe33adc95cb8c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 Apr 2012 13:37:39 +1000 Subject: s3-dbwrap: push lp_ctx up another layer in the stack This will allow db_open_tdb() to be called from common code, which may already have a loadparm context loaded. It also slowly moves the lp_ctx up the stack, as required to remove the library loop between smbconf and the registry. Andrew Bartlett --- source3/smbd/notify_internal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/smbd/notify_internal.c') diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 6e6bdf7b03..4d78743687 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -123,6 +123,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct messaging_context *msg, struct event_context *ev) { + struct loadparm_context *lp_ctx; struct notify_context *notify; notify = talloc(mem_ctx, struct notify_context); @@ -132,10 +133,12 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, notify->msg = msg; notify->list = NULL; + lp_ctx = loadparm_init_s3(notify, loadparm_s3_context()); notify->db_notify = db_open_tdb( - notify, lock_path("notify.tdb"), + notify, lp_ctx, lock_path("notify.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2); + talloc_unlink(notify, lp_ctx); if (notify->db_notify == NULL) { goto fail; } -- cgit