git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5b86d2
)
util:ldb Allow multiple entries to be added in one LDIF snippit
author
Andrew Bartlett
<abartlet@samba.org>
Thu, 22 Oct 2009 07:20:07 +0000
(18:20 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Fri, 23 Oct 2009 04:41:25 +0000
(15:41 +1100)
lib/util/util_ldb.c
patch
|
blob
|
history
diff --git
a/lib/util/util_ldb.c
b/lib/util/util_ldb.c
index ac1e11566e89fb989fa2ad294ec0d7a5e009c441..e92e3a2dffc98edaee1146ec2fe3b1d8c36315e5 100644
(file)
--- 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;
}