summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/util_ldb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/util/util_ldb.c b/lib/util/util_ldb.c
index ac1e11566e..e92e3a2dff 100644
--- a/lib/util/util_ldb.c
+++ b/lib/util/util_ldb.c
@@ -116,11 +116,14 @@ int gendb_search_dn(struct ldb_context *ldb,
int gendb_add_ldif(struct ldb_context *ldb, const char *ldif_string)
{
struct ldb_ldif *ldif;
+ const char *s = ldif_string;
int ret;
- ldif = ldb_ldif_read_string(ldb, &ldif_string);
- if (ldif == NULL) return -1;
- ret = ldb_add(ldb, ldif->msg);
- talloc_free(ldif);
+ while (s && *s != '\0') {
+ ldif = ldb_ldif_read_string(ldb, &s);
+ if (ldif == NULL) return -1;
+ ret = ldb_add(ldb, ldif->msg);
+ talloc_free(ldif);
+ }
return ret;
}