svn commit: samba r21841 - in branches/SAMBA_4_0/services/samba: .

mimir at samba.org mimir at samba.org
Wed Mar 14 23:25:55 GMT 2007


Author: mimir
Date: 2007-03-14 23:25:54 +0000 (Wed, 14 Mar 2007)
New Revision: 21841

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21841

Log:
Rename the method and check parameters more strictly.


rafal


Modified:
   branches/SAMBA_4_0/services/samba/ejsnet.esp


Changeset:
Modified: branches/SAMBA_4_0/services/samba/ejsnet.esp
===================================================================
--- branches/SAMBA_4_0/services/samba/ejsnet.esp	2007-03-14 22:15:21 UTC (rev 21840)
+++ branches/SAMBA_4_0/services/samba/ejsnet.esp	2007-03-14 23:25:54 UTC (rev 21841)
@@ -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 @@
     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 @@
 
   return session.resources.set(netCtx, "netCtx", error);
 }
-jsonrpc.method.init_ctx = _init_ctx;
+jsonrpc.method.NetContext = _NetContext;
 
 
 /*



More information about the samba-cvs mailing list