summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/py_passdb.c2
-rw-r--r--source3/passdb/secrets.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 6984061714..3fd14cdc41 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -3638,7 +3638,7 @@ static PyObject *py_set_secrets_dir(PyObject *self, PyObject *args)
}
/* Initialize secrets database */
- if (!secrets_init_path(private_dir)) {
+ if (!secrets_init_path(private_dir, lp_use_ntdb())) {
PyErr_Format(py_pdb_error, "Cannot open secrets file database in '%s'",
private_dir);
talloc_free(frame);
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 8f314a76cf..f97510db21 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -55,7 +55,7 @@ static void get_rand_seed(void *userdata, int *new_seed)
}
/* open up the secrets database with specified private_dir path */
-bool secrets_init_path(const char *private_dir)
+bool secrets_init_path(const char *private_dir, bool use_ntdb)
{
char *fname = NULL;
unsigned char dummy;
@@ -70,8 +70,8 @@ bool secrets_init_path(const char *private_dir)
}
frame = talloc_stackframe();
- fname = talloc_asprintf(frame, "%s/secrets.tdb",
- private_dir);
+ fname = talloc_asprintf(frame, "%s/secrets.%s",
+ private_dir, use_ntdb ? "ntdb" : "tdb");
if (fname == NULL) {
TALLOC_FREE(frame);
return False;
@@ -105,7 +105,7 @@ bool secrets_init_path(const char *private_dir)
/* open up the secrets database */
bool secrets_init(void)
{
- return secrets_init_path(lp_private_dir());
+ return secrets_init_path(lp_private_dir(), lp_use_ntdb());
}
struct db_context *secrets_db_ctx(void)