summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2007-03-14 23:25:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:36 -0500
commit449afe04f8f65c56883d81f3155a321c36dc4f02 (patch)
tree0c7ba3d91c6ace70dea78b7ac2463c86a9250c97 /services
parent41c545350748f79fd543e2ac914f63139cf0b9e7 (diff)
downloadsamba-449afe04f8f65c56883d81f3155a321c36dc4f02.tar.gz
samba-449afe04f8f65c56883d81f3155a321c36dc4f02.tar.bz2
samba-449afe04f8f65c56883d81f3155a321c36dc4f02.zip
r21841: Rename the method and check parameters more strictly.
rafal (This used to be commit 6824172940e175f2af6ab2c9c25a1495f024de42)
Diffstat (limited to 'services')
-rw-r--r--services/samba/ejsnet.esp19
1 files changed, 11 insertions, 8 deletions
diff --git a/services/samba/ejsnet.esp b/services/samba/ejsnet.esp
index 9584becac6..7ab0e02912 100644
--- a/services/samba/ejsnet.esp
+++ b/services/samba/ejsnet.esp
@@ -9,7 +9,7 @@
jsonrpc_include("resources.esp");
-function _init_ctx(params, error)
+function _NetContext(params, error)
{
if (params.length < 1)
{
@@ -26,24 +26,27 @@ function _init_ctx(params, error)
return error;
}
- if (creds.domain == undefined)
+ if (creds.domain == undefined ||
+ typeof(creds.domain) != "string")
{
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
- "credentials.domain is undefined");
+ "a valid string is expected in credentials.domain");
return error;
}
- if (creds.username == undefined)
+ if (creds.username == undefined ||
+ typeof(creds.username) != "string")
{
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
- "credentials.username is undefined");
+ "a valid string is expected in credentials.username");
return error;
}
- if (creds.password == undefined)
+ if (creds.password == undefined ||
+ typeof(creds.username) != "string")
{
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
- "credentials.password is undefined");
+ "a valid string is expected in credentials.password");
return error;
}
@@ -56,7 +59,7 @@ function _init_ctx(params, error)
return session.resources.set(netCtx, "netCtx", error);
}
-jsonrpc.method.init_ctx = _init_ctx;
+jsonrpc.method.NetContext = _NetContext;
/*