summaryrefslogtreecommitdiff
path: root/source4/lib/gendb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-04-14 08:24:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:33 -0500
commit9bf2c694010ae9b2773bfe738a1f88c4b6693e48 (patch)
treee1040979d65276e88f0f126cf48017bf607c9a0f /source4/lib/gendb.c
parent0ab612f69ea273731aedb6766c7a4033f51e1f95 (diff)
downloadsamba-9bf2c694010ae9b2773bfe738a1f88c4b6693e48.tar.gz
samba-9bf2c694010ae9b2773bfe738a1f88c4b6693e48.tar.bz2
samba-9bf2c694010ae9b2773bfe738a1f88c4b6693e48.zip
r6340: - added an easy to use function to initialise a temporary ldb with some ldif
- init the schannel.ldb with some CASE_INSENSITIVE attributes (This used to be commit e6376b24303dc513e15c7e640c8c1c8d8ca11091)
Diffstat (limited to 'source4/lib/gendb.c')
-rw-r--r--source4/lib/gendb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/gendb.c b/source4/lib/gendb.c
index befdd63c9e..5b4f7b251e 100644
--- a/source4/lib/gendb.c
+++ b/source4/lib/gendb.c
@@ -78,3 +78,16 @@ int gendb_search(struct ldb_context *sam_ldb,
return count;
}
+/*
+ setup some initial ldif in a ldb
+*/
+int gendb_add_ldif(struct ldb_context *ldb, const char *ldif_string)
+{
+ struct ldb_ldif *ldif;
+ int ret;
+ ldif = ldb_ldif_read_string(ldb, ldif_string);
+ if (ldif == NULL) return -1;
+ ret = ldb_add(ldb, ldif->msg);
+ talloc_free(ldif);
+ return ret;
+}