summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-10-26 21:04:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:17 -0500
commitb22bda753390b19e85296cf547ce3f7abaf7fb1a (patch)
tree480712a8e7a966a9a200741d11fe7ef27d3dfea7
parentb89c019824cb14621da6a8dd8b016063945cfecf (diff)
downloadsamba-b22bda753390b19e85296cf547ce3f7abaf7fb1a.tar.gz
samba-b22bda753390b19e85296cf547ce3f7abaf7fb1a.tar.bz2
samba-b22bda753390b19e85296cf547ce3f7abaf7fb1a.zip
r11308: Correctly return status code in case of js error or libnet
function execution error. rafal (This used to be commit a50a5bef6e4c0051d13ed59fe5ddade709a98ba7)
-rw-r--r--source4/scripting/ejs/ejsnet.c9
1 files changed, 8 insertions, 1 deletions
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;
}