summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c4
-rw-r--r--source4/param/secrets.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 93d9d79ece..98724a107d 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -107,6 +107,7 @@ typedef struct
char *szConfigFile;
char *szShareBackend;
char *szSAM_URL;
+ char *szSECRETS_URL;
char *szSPOOLSS_URL;
char *szWINS_CONFIG_URL;
char *szWINS_URL;
@@ -403,6 +404,7 @@ static struct parm_struct parm_table[] = {
{"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"password server", P_LIST, P_GLOBAL, &Globals.szPasswordServers, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER},
{"sam database", P_STRING, P_GLOBAL, &Globals.szSAM_URL, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
+ {"secrets database", P_STRING, P_GLOBAL, &Globals.szSECRETS_URL, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"spoolss database", P_STRING, P_GLOBAL, &Globals.szSPOOLSS_URL, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"wins config database", P_STRING, P_GLOBAL, &Globals.szWINS_CONFIG_URL, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{"wins database", P_STRING, P_GLOBAL, &Globals.szWINS_URL, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
@@ -610,6 +612,7 @@ static void init_globals(void)
do_parameter("auth methods", "anonymous sam_ignoredomain", NULL);
do_parameter("private dir", dyn_PRIVATE_DIR, NULL);
do_parameter("sam database", "sam.ldb", NULL);
+ do_parameter("secrets database", "secrets.ldb", NULL);
do_parameter("spoolss database", "spoolss.ldb", NULL);
do_parameter("wins config database", "wins_config.ldb", NULL);
do_parameter("wins database", "wins.ldb", NULL);
@@ -833,6 +836,7 @@ _PUBLIC_ FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset)
_PUBLIC_ FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
_PUBLIC_ FN_GLOBAL_STRING(lp_share_backend, &Globals.szShareBackend)
_PUBLIC_ FN_GLOBAL_STRING(lp_sam_url, &Globals.szSAM_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_secrets_url, &Globals.szSECRETS_URL)
_PUBLIC_ FN_GLOBAL_STRING(lp_spoolss_url, &Globals.szSPOOLSS_URL)
_PUBLIC_ FN_GLOBAL_STRING(lp_wins_config_url, &Globals.szWINS_CONFIG_URL)
_PUBLIC_ FN_GLOBAL_STRING(lp_wins_url, &Globals.szWINS_URL)
diff --git a/source4/param/secrets.c b/source4/param/secrets.c
index a7eb9607de..4189f2182c 100644
--- a/source4/param/secrets.c
+++ b/source4/param/secrets.c
@@ -96,6 +96,7 @@ BOOL secrets_init(void)
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
{
char *path;
+ const char *url;
struct ldb_context *ldb;
BOOL existed;
const char *init_ldif =
@@ -103,11 +104,16 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
"computerName: CASE_INSENSITIVE\n" \
"flatname: CASE_INSENSITIVE\n";
- path = private_path(mem_ctx, "secrets.ldb");
+ url = lp_secrets_url();
+ if (!url || !url[0]) {
+ return NULL;
+ }
+
+ path = private_path(mem_ctx, url);
if (!path) {
return NULL;
}
-
+
existed = file_exist(path);
/* Secrets.ldb *must* always be local. If we call for a