summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs/smbcalls_ldb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-12 05:53:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:20:08 -0500
commit9f86e202865807ed898eff684d7cf3be7daae0fc (patch)
tree3f00468ba059e780c51b611ae7ebf5dd0d608648 /source4/scripting/ejs/smbcalls_ldb.c
parent1bb2b0603126188e639d7adb6309166c64b5e9df (diff)
downloadsamba-9f86e202865807ed898eff684d7cf3be7daae0fc.tar.gz
samba-9f86e202865807ed898eff684d7cf3be7daae0fc.tar.bz2
samba-9f86e202865807ed898eff684d7cf3be7daae0fc.zip
r8340: - added sys_gmtime()
- added sys_unlink() - added sys_file_load() and sys_file_save() - use mprString() instead of mprCreateStringVar() to cope with NULL strings - removed smbcalls_irpc.c as its not needed any more - allow ldbAdd() and ldbModify() to take multiple ldif records - added a sprintf() function to ejs. Quite complex, but very useful! (This used to be commit 625628a3f6e78349d2240ebcc79081f350672070)
Diffstat (limited to 'source4/scripting/ejs/smbcalls_ldb.c')
-rw-r--r--source4/scripting/ejs/smbcalls_ldb.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c
index 309271a29d..9876fe151f 100644
--- a/source4/scripting/ejs/smbcalls_ldb.c
+++ b/source4/scripting/ejs/smbcalls_ldb.c
@@ -111,12 +111,10 @@ static int ejs_ldbAddModify(MprVarHandle eid, int argc, char **argv,
goto failed;
}
- ldif = ldb_ldif_read_string(ldb, ldifstring);
- if (ldif == NULL) {
- ejsSetErrorMsg(eid, "ldbAddModify invalid ldif");
- goto failed;
+ while ((ldif = ldb_ldif_read_string(ldb, &ldifstring))) {
+ ret = fn(ldb, ldif->msg);
+ talloc_free(ldif);
}
- ret = fn(ldb, ldif->msg);
mpr_Return(eid, mprCreateBoolVar(ret == 0));
talloc_free(ldb);