Added support for NO_SUCH_PUBLIC_KEY status.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 9 May 2007 06:03:33 +0000 (06:03 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 9 May 2007 06:03:33 +0000 (06:03 +0000)
apps/silcd/server_query.c
apps/silcd/server_util.c

index b64183d8e900e71916772e3e2224baa355b0b76b..166db3af25b8efd350e61b5c4350c92a30b4522e 100644 (file)
@@ -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
index 2f96514fecc6b1718a3c8b85f6ffe5f337f9d583..3086aef444e2d77a4e4cec4cd46cf344e934ec2a 100644 (file)
@@ -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;