diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/ejs/smbcalls.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c index 5d4c61b04b..93496bd9c9 100644 --- a/source4/scripting/ejs/smbcalls.c +++ b/source4/scripting/ejs/smbcalls.c @@ -271,6 +271,11 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv) goto done; } + if (argv[0]->type != MPR_TYPE_OBJECT) { + ejsSetErrorMsg(eid, "resolvename invalid arguments"); + goto done; + } + if (argv[1]->type != MPR_TYPE_STRING) { ejsSetErrorMsg(eid, "resolveName invalid arguments"); goto done; @@ -291,8 +296,8 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv) nt_status = resolve_name(&name, tmp_ctx, &reply_addr); if (NT_STATUS_IS_OK(nt_status)) { - mprDestroyAllVars(argv[0]); - *argv[0] = mprCreateStringVar(reply_addr, True); + mprSetPropertyValue(argv[0], "value", + mprCreateStringVar(reply_addr, 1)); } ejsSetReturnValue(eid, mprNTSTATUS(nt_status)); |