From 76b7ee3f00af9e90def0495f950fb12871dfe6a4 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 9 May 2007 06:03:33 +0000 Subject: [PATCH] Added support for NO_SUCH_PUBLIC_KEY status. --- apps/silcd/server_query.c | 9 ++++++--- apps/silcd/server_util.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/silcd/server_query.c b/apps/silcd/server_query.c index b64183d8..166db3af 100644 --- a/apps/silcd/server_query.c +++ b/apps/silcd/server_query.c @@ -221,7 +221,7 @@ void silc_server_query_add_error_id(SilcServer server, TRUE if the query is being processed or FALSE on error. */ SilcBool silc_server_query_command(SilcServer server, SilcCommand querycmd, - SilcServerCommandContext cmd) + SilcServerCommandContext cmd) { SilcServerQuery query; @@ -703,7 +703,7 @@ void silc_server_query_check_attributes(SilcServer server, SilcAttributeObjPk pk; SilcPublicKey publickey, cmp_pubkey; SilcPKCSType type; - SilcBool found = FALSE, no_clients = FALSE; + SilcBool found = FALSE, no_clients = FALSE, search_pubkey = FALSE; int i; /* If no clients were found, we only check the attributes @@ -742,6 +742,7 @@ void silc_server_query_check_attributes(SilcServer server, silc_free(pk.data); continue; } + search_pubkey = TRUE; /* If no clients were set on calling this function, we just search for clients, otherwise we try to limit the clients. */ @@ -791,7 +792,9 @@ void silc_server_query_check_attributes(SilcServer server, if (!found && !query->nickname[0] && !query->ids) silc_server_query_add_error(server, query, 2, 0, - SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); + search_pubkey ? + SILC_STATUS_ERR_NO_SUCH_PUBLIC_KEY : + SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); } /* Processes the parsed query. This does the actual finding of the diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index 2f96514f..3086aef4 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -1357,8 +1357,8 @@ SilcBool silc_server_check_cmode_rights(SilcServer server, FALSE if setting some mode is not allowed. */ SilcBool silc_server_check_umode_rights(SilcServer server, - SilcClientEntry client, - SilcUInt32 mode) + SilcClientEntry client, + SilcUInt32 mode) { SilcBool server_op = FALSE, router_op = FALSE; -- 2.24.0