diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-10-22 18:20:07 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-23 15:41:25 +1100 |
commit | 44a727479e54c7d12191d6752c62b12cc2f8081e (patch) | |
tree | 0a2d738c45a34af37369efa05fd4f24042a8c28d | |
parent | e5b86d267465dba57b26a74f75ddc1e778359b23 (diff) | |
download | samba-44a727479e54c7d12191d6752c62b12cc2f8081e.tar.gz samba-44a727479e54c7d12191d6752c62b12cc2f8081e.tar.bz2 samba-44a727479e54c7d12191d6752c62b12cc2f8081e.zip |
util:ldb Allow multiple entries to be added in one LDIF snippit
-rw-r--r-- | lib/util/util_ldb.c | 11 |
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; } |