diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-10-18 11:33:33 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-10-18 05:39:54 +0200 |
commit | 5954a37997a786a8808ee2544b594a0c90f1c893 (patch) | |
tree | 5e3749df18bb4249c218d1c40889300a29465770 /source4/nbt_server | |
parent | 9d49945ff037e46f5083dc88816acafc2343a77c (diff) | |
download | samba-5954a37997a786a8808ee2544b594a0c90f1c893.tar.gz samba-5954a37997a786a8808ee2544b594a0c90f1c893.tar.bz2 samba-5954a37997a786a8808ee2544b594a0c90f1c893.zip |
lib/param: Remove parameters for wins and spoolss databases
This removes the smb.conf parameters per-database, replacing these
with hard-coded database names in well known (and configurable)
directories.
The wins.ldb is now always in the "state dir", rather than being in
both state and lock dir (ie, a bug).
Less smb.conf parameters means less parameters to try and sync up
between the loadparm subsystems.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 18 05:39:54 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index 6727445437..18c1b725be 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -929,7 +929,8 @@ failed: } static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx, - struct loadparm_context *lp_ctx, struct winsdb_handle *h) + struct loadparm_context *lp_ctx, struct winsdb_handle *h, + const char *wins_path) { int trans; int ret; @@ -975,7 +976,7 @@ static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx, flags |= LDB_FLG_NOSYNC; } - h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lpcfg_state_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), + h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, wins_path, NULL, NULL, flags); if (!h->ldb) goto failed; @@ -1003,15 +1004,18 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, unsigned int flags = 0; bool ret; int ldb_err; + char *wins_path; h = talloc_zero(mem_ctx, struct winsdb_handle); if (!h) return NULL; + wins_path = lpcfg_state_path(h, lp_ctx, "wins.ldb"); + if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { flags |= LDB_FLG_NOSYNC; } - h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lpcfg_lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)), + h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, wins_path, NULL, NULL, flags); if (!h->ldb) goto failed; @@ -1022,7 +1026,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, if (!h->local_owner) goto failed; /* make sure the module list is available and used */ - ret = winsdb_check_or_add_module_list(ev_ctx, lp_ctx, h); + ret = winsdb_check_or_add_module_list(ev_ctx, lp_ctx, h, wins_path); if (!ret) goto failed; ldb_err = ldb_set_opaque(h->ldb, "winsdb_handle", h); |