mirror of
https://github.com/samba-team/samba.git
synced 2025-11-16 20:23:50 +03:00
r8557: expose ldb_errstring() in ldb ejs code
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
cc61a0ba33
commit
21ca972d06
@@ -215,6 +215,24 @@ static int ejs_ldbRename(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
get last error message
|
||||
usage:
|
||||
ok = ldb.errstring();
|
||||
*/
|
||||
static int ejs_ldbErrstring(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
{
|
||||
struct ldb_context *ldb;
|
||||
|
||||
ldb = ejs_get_ldb_context(eid);
|
||||
if (ldb == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
mpr_Return(eid, mprString(ldb_errstring(ldb)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
perform an ldb modify
|
||||
|
||||
@@ -281,6 +299,7 @@ static int ejs_ldb_init(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
mprSetCFunction(ldb, "modify", ejs_ldbModify);
|
||||
mprSetCFunction(ldb, "delete", ejs_ldbDelete);
|
||||
mprSetCFunction(ldb, "rename", ejs_ldbRename);
|
||||
mprSetCFunction(ldb, "errstring", ejs_ldbErrstring);
|
||||
mprSetVar(ldb, "SCOPE_BASE", mprCreateNumberVar(LDB_SCOPE_BASE));
|
||||
mprSetVar(ldb, "SCOPE_ONE", mprCreateNumberVar(LDB_SCOPE_ONELEVEL));
|
||||
mprSetVar(ldb, "SCOPE_SUBTREE", mprCreateNumberVar(LDB_SCOPE_SUBTREE));
|
||||
|
||||
Reference in New Issue
Block a user