diff options
Diffstat (limited to 'source4/passdb')
-rw-r--r-- | source4/passdb/secrets.c | 11 |
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; } |