summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-10-07 20:33:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:47 -0500
commit7bdfbd608c86b89ab6c7e98f8a01285acec53efb (patch)
treed9a228c261cafd1a7122299b2ed3e2329a1a0698
parent1c681891b2d00a21efa02488d80bc48c3ddab783 (diff)
downloadsamba-7bdfbd608c86b89ab6c7e98f8a01285acec53efb.tar.gz
samba-7bdfbd608c86b89ab6c7e98f8a01285acec53efb.tar.bz2
samba-7bdfbd608c86b89ab6c7e98f8a01285acec53efb.zip
r19166: better bug and reporting and proper authentication tracking
(This used to be commit 9eba44bf16e1f5b6c9dc29d9917bc3b7754da54c)
-rw-r--r--services/request.esp17
1 files changed, 13 insertions, 4 deletions
diff --git a/services/request.esp b/services/request.esp
index 1cd22a71a8..982f39fcaa 100644
--- a/services/request.esp
+++ b/services/request.esp
@@ -13,6 +13,7 @@
* This is a simple JSON-RPC server.
*/
+
/* Bring in the json format/parse functions */
jsonrpc_include("json.esp");
@@ -46,7 +47,6 @@ jsonrpc.Constant.ErrorOrigin = new Object(); /* error origins */
jsonrpc.Constant.ErrorCode = new Object(); /* server-generated error codes */
jsonrpc.method = new Object(); /* methods available in requested class */
-
/*
* ScriptTransport constants
*/
@@ -108,12 +108,15 @@ jsonrpc.Constant.ErrorCode.ClassNotFound = 3; // not used in this implem
*/
jsonrpc.Constant.ErrorCode.MethodNotFound = 4;
-/**
+/*
* Error code, value 5: Parameter Mismatch
*
* If a method discovers that the parameters (arguments) provided to it do not
* match the requisite types for the method's parameters, it should return
* this error code to indicate so to the caller.
+ *
+ * This error is also used to indicate an illegal parameter value, in server
+ * scripts.
*/
jsonrpc.Constant.ErrorCode.PaameterMismatch = 5;
@@ -136,7 +139,13 @@ jsonrpc.Constant.ErrorCode.PermissionDenied = 6;
*/
jsonrpc.Constant.ErrorCode.UnexpectedOutput = 7;
-
+/*
+ * Error code, value 8: Resource Error
+ *
+ * Too many resources were requested, a system limitation on the total number
+ * of resources has been reached, or a resource or resource id was misused.
+ */
+jsonrpc.Constant.ErrorCode.ResourceError = 8;
@@ -447,7 +456,7 @@ if (! valid)
}
/* Ensure the logged-in user is allowed to issue the requested method */
-if (! json_authenticate(serviceComponents, method))
+if (! json_authenticate(serviceComponents, jsonInput.method))
{
error.setError(jsonrpc.Constant.ErrorCode.PermissionDenied,
"Permission denied");