1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

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
This commit is contained in:
Andrew Bartlett
2011-10-18 11:33:33 +11:00
parent 9d49945ff0
commit 5954a37997
4 changed files with 10 additions and 36 deletions

View File

@ -375,30 +375,6 @@ static struct parm_struct parm_table[] = {
.special = NULL, .special = NULL,
.enum_list = NULL .enum_list = NULL
}, },
{
.label = "spoolss database",
.type = P_STRING,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(szSPOOLSS_URL),
.special = NULL,
.enum_list = NULL
},
{
.label = "wins config database",
.type = P_STRING,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(szWINS_CONFIG_URL),
.special = NULL,
.enum_list = NULL
},
{
.label = "wins database",
.type = P_STRING,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(szWINS_URL),
.special = NULL,
.enum_list = NULL
},
{ {
.label = "private dir", .label = "private dir",
.type = P_STRING, .type = P_STRING,
@ -1493,9 +1469,6 @@ FN_GLOBAL_INTEGER(web_port, web_port)
FN_GLOBAL_BOOL(tls_enabled, tls_enabled) FN_GLOBAL_BOOL(tls_enabled, tls_enabled)
FN_GLOBAL_STRING(logfile, logfile) FN_GLOBAL_STRING(logfile, logfile)
FN_GLOBAL_STRING(share_backend, szShareBackend) FN_GLOBAL_STRING(share_backend, szShareBackend)
FN_GLOBAL_STRING(spoolss_url, szSPOOLSS_URL)
FN_GLOBAL_STRING(wins_config_url, szWINS_CONFIG_URL)
FN_GLOBAL_STRING(wins_url, szWINS_URL)
FN_GLOBAL_CONST_STRING(winbind_separator, szWinbindSeparator) FN_GLOBAL_CONST_STRING(winbind_separator, szWinbindSeparator)
FN_GLOBAL_CONST_STRING(winbindd_socket_directory, szWinbinddSocketDirectory) FN_GLOBAL_CONST_STRING(winbindd_socket_directory, szWinbinddSocketDirectory)
FN_GLOBAL_CONST_STRING(winbindd_privileged_socket_directory, szWinbinddPrivilegedSocketDirectory) FN_GLOBAL_CONST_STRING(winbindd_privileged_socket_directory, szWinbinddPrivilegedSocketDirectory)
@ -3331,9 +3304,6 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
/* the winbind method for domain controllers is for both RODC /* the winbind method for domain controllers is for both RODC
auth forwarding and for trusted domains */ auth forwarding and for trusted domains */
lpcfg_do_global_parameter(lp_ctx, "private dir", dyn_PRIVATE_DIR); lpcfg_do_global_parameter(lp_ctx, "private dir", dyn_PRIVATE_DIR);
lpcfg_do_global_parameter(lp_ctx, "spoolss database", "spoolss.ldb");
lpcfg_do_global_parameter(lp_ctx, "wins config database", "wins_config.ldb");
lpcfg_do_global_parameter(lp_ctx, "wins database", "wins.ldb");
lpcfg_do_global_parameter(lp_ctx, "registry:HKEY_LOCAL_MACHINE", "hklm.ldb"); lpcfg_do_global_parameter(lp_ctx, "registry:HKEY_LOCAL_MACHINE", "hklm.ldb");
/* This hive should be dynamically generated by Samba using /* This hive should be dynamically generated by Samba using

View File

@ -929,7 +929,8 @@ failed:
} }
static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx, 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 trans;
int ret; int ret;
@ -975,7 +976,7 @@ static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx,
flags |= LDB_FLG_NOSYNC; 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); NULL, NULL, flags);
if (!h->ldb) goto failed; if (!h->ldb) goto failed;
@ -1003,15 +1004,18 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
unsigned int flags = 0; unsigned int flags = 0;
bool ret; bool ret;
int ldb_err; int ldb_err;
char *wins_path;
h = talloc_zero(mem_ctx, struct winsdb_handle); h = talloc_zero(mem_ctx, struct winsdb_handle);
if (!h) return NULL; if (!h) return NULL;
wins_path = lpcfg_state_path(h, lp_ctx, "wins.ldb");
if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) { if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {
flags |= LDB_FLG_NOSYNC; 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); NULL, NULL, flags);
if (!h->ldb) goto failed; if (!h->ldb) goto failed;
@ -1022,7 +1026,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
if (!h->local_owner) goto failed; if (!h->local_owner) goto failed;
/* make sure the module list is available and used */ /* 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; if (!ret) goto failed;
ldb_err = ldb_set_opaque(h->ldb, "winsdb_handle", h); ldb_err = ldb_set_opaque(h->ldb, "winsdb_handle", h);

View File

@ -48,7 +48,7 @@ NTSTATUS ntptr_simple_ldb_init(void);
*/ */
static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx, struct loadparm_context *lp_ctx) static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx, struct loadparm_context *lp_ctx)
{ {
return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_spoolss_url(lp_ctx), system_session(lp_ctx), return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, "spoolss.ldb", system_session(lp_ctx),
NULL, 0); NULL, 0);
} }

View File

@ -39,7 +39,7 @@ static struct ldb_context *wins_config_db_connect(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx) struct loadparm_context *lp_ctx)
{ {
return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_private_path(mem_ctx, return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_private_path(mem_ctx,
lp_ctx, lpcfg_wins_config_url(lp_ctx)), lp_ctx, "wins_config.ldb"),
system_session(lp_ctx), NULL, 0); system_session(lp_ctx), NULL, 0);
} }