mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
r11308: Correctly return status code in case of js error or libnet
function execution error. rafal (This used to be commit a50a5bef6e4c0051d13ed59fe5ddade709a98ba7)
This commit is contained in:
parent
b89c019824
commit
b22bda7533
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user