mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
r21344: ensure that the full range of error values is available to applications. parameter errors are really server errors.
(This used to be commit 62fcd13da1c9738393781ff55eb3f4dbdf7357fc)
This commit is contained in:
parent
be852780b4
commit
6d18b574e5
@ -285,6 +285,7 @@ function _search(params, error)
|
||||
{
|
||||
if (params.length < 2 || params.length > 5)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: " +
|
||||
"<resource_id> <expr> [<baseDN> [<scope> [<attrs>]]]");
|
||||
@ -327,6 +328,7 @@ function _search(params, error)
|
||||
}
|
||||
else
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"invalid scope: " + scope);
|
||||
return error;
|
||||
@ -357,6 +359,7 @@ function _add(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <ldif>");
|
||||
return error;
|
||||
@ -393,6 +396,7 @@ function _modify(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <ldif>");
|
||||
return error;
|
||||
@ -429,6 +433,7 @@ function _del(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <dn>");
|
||||
return error;
|
||||
@ -468,6 +473,7 @@ function _rename(params, error)
|
||||
{
|
||||
if (params.length != 3)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <old_dn> <new_dn>");
|
||||
return error;
|
||||
@ -504,6 +510,7 @@ function _base64encode(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <string_to_be_encoded>");
|
||||
return error;
|
||||
@ -540,6 +547,7 @@ function _base64decode(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <string_to_be_decoded>");
|
||||
return error;
|
||||
@ -576,6 +584,7 @@ function _base64decode(params, error)
|
||||
{
|
||||
if (params.length != 2)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id> <string_to_be_decoded>");
|
||||
return error;
|
||||
@ -608,6 +617,7 @@ function _errstring(params, error)
|
||||
{
|
||||
if (params.length != 1)
|
||||
{
|
||||
error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server);
|
||||
error.setError(jsonrpc.Constant.ServerError.ParameterMismatch,
|
||||
"usage: <resource_id>");
|
||||
return error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user