Author: mimir Date: 2005-10-26 21:04:53 +0000 (Wed, 26 Oct 2005) New Revision: 11308
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11308 Log: Correctly return status code in case of js error or libnet function execution error. rafal Modified: branches/SAMBA_4_0/source/scripting/ejs/ejsnet.c Changeset: Modified: branches/SAMBA_4_0/source/scripting/ejs/ejsnet.c =================================================================== --- branches/SAMBA_4_0/source/scripting/ejs/ejsnet.c 2005-10-26 20:06:26 UTC (rev 11307) +++ branches/SAMBA_4_0/source/scripting/ejs/ejsnet.c 2005-10-26 21:04:53 UTC (rev 11308) @@ -106,10 +106,17 @@ 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; }
