summaryrefslogtreecommitdiff
path: root/source4/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-05-02 14:17:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:27 -0500
commit8bf57cf8f57be28831023c2218d358b24b705256 (patch)
treee18e07afa72a46e9c6c94b8faf1ee21650b2cc20 /source4/passdb
parent591ff7675dfe51f30029cb864df47bc8f6266494 (diff)
downloadsamba-8bf57cf8f57be28831023c2218d358b24b705256.tar.gz
samba-8bf57cf8f57be28831023c2218d358b24b705256.tar.bz2
samba-8bf57cf8f57be28831023c2218d358b24b705256.zip
r6573: Start on my project to implement an NT4 compatible BDC in Samba4.
This brings in a compatability layer for Samba3 in Samba4 - where we will start to define file formats and similar details. The 'net samdump' command uses 'password server = ' for now, and performs a similar task to Samba3's 'net rpc samsync'. Andrew Bartlett (This used to be commit 550f17f9924fe783917318753de7d1a388423908)
Diffstat (limited to 'source4/passdb')
-rw-r--r--source4/passdb/secrets.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/passdb/secrets.c b/source4/passdb/secrets.c
index d9501b866c..7bc7183b98 100644
--- a/source4/passdb/secrets.c
+++ b/source4/passdb/secrets.c
@@ -181,17 +181,28 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
{
char *path;
struct ldb_context *ldb;
+ BOOL existed;
+ const char *init_ldif =
+ "dn: @ATTRIBUTES\n" \
+ "computerName: CASE_INSENSITIVE\n" \
+ "flatname: CASE_INSENSITIVE\n";
path = private_path(mem_ctx, "secrets.ldb");
if (!path) {
return NULL;
}
+ existed = file_exists(path);
+
ldb = ldb_wrap_connect(mem_ctx, path, 0, NULL);
talloc_free(path);
if (!ldb) {
return NULL;
}
+
+ if (!existed) {
+ gendb_add_ldif(ldb, init_ldif);
+ }
return ldb;
}