From b22bda753390b19e85296cf547ce3f7abaf7fb1a Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Wed, 26 Oct 2005 21:04:53 +0000 Subject: r11308: Correctly return status code in case of js error or libnet function execution error. rafal (This used to be commit a50a5bef6e4c0051d13ed59fe5ddade709a98ba7) --- source4/scripting/ejs/ejsnet.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source4/scripting/ejs/ejsnet.c b/source4/scripting/ejs/ejsnet.c index fea1608170..bed660aceb 100644 --- a/source4/scripting/ejs/ejsnet.c +++ b/source4/scripting/ejs/ejsnet.c @@ -106,10 +106,17 @@ static int ejs_net_createuser(MprVarHandle eid, int argc, char **argv) req.in.user_name = argv[0]; status = libnet_CreateUser(ctx, mem_ctx, &req); + if (!NT_STATUS_IS_OK(status)) { + ejsSetErrorMsg(eid, "error when creating user: %s", nt_errstr(status)); + } talloc_free(mem_ctx); + mpr_Return(eid, mprNTSTATUS(status)); + return 0; + done: - return NT_STATUS_IS_OK(status) ? 0 : -1; + talloc_free(mem_ctx); + return -1; } -- cgit