updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 17 Jun 2001 12:29:40 +0000 (12:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 17 Jun 2001 12:29:40 +0000 (12:29 +0000)
CHANGES
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index 5fbb25e7a0ae3f9aee9a0dd463ea5360b0730b21..5da26cd76a99f9d65f6f4af60c230ff75489fc7d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Sun Jun 17 15:26:05 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Fixed the GETKEY command in the server to check also the
+         global list.  Otherwise the GETKEY would not work correctly
+         in normal SILC server.  Affected file silcd/command.c.
+
 Sat Jun 16 18:00:00 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Fixed GETKEY crash, it crashed if the command did not succseed.
index bca269c1f953f7d0599ab708a17a01a8727910c4..6bf0d8be079b05d05596e2edb9d7926a445b9f2a 100644 (file)
@@ -4757,6 +4757,8 @@ SILC_SERVER_CMD_FUNC(getkey)
   SilcBuffer pk;
   SilcIdType id_type;
 
+  SILC_LOG_DEBUG(("Start"));
+
   tmp = silc_argument_get_arg_type(cmd->args, 1, &tmp_len);
   if (!tmp) {
     silc_server_command_send_status_reply(cmd, SILC_COMMAND_GETKEY,
@@ -4778,9 +4780,15 @@ SILC_SERVER_CMD_FUNC(getkey)
        would be locally connected client so send the command further. */
     client = silc_idlist_find_client_by_id(server->local_list, 
                                           client_id, NULL);
+    if (!client)
+      client = silc_idlist_find_client_by_id(server->global_list, 
+                                            client_id, NULL);
     
     if ((!client && !cmd->pending && !server->standalone) ||
-       (client && !client->connection)) {
+       (client && !client->connection && !cmd->pending && 
+        !server->standalone) ||
+       (client && !client->data.public_key && !cmd->pending &&
+        !server->standalone)) {
       SilcBuffer tmpbuf;
       uint16 old_ident;
       SilcSocketConnection dest_sock;
@@ -4836,9 +4844,15 @@ SILC_SERVER_CMD_FUNC(getkey)
        would be locally connected server so send the command further. */
     server_entry = silc_idlist_find_server_by_id(server->local_list, 
                                                 server_id, NULL);
+    if (!server_entry)
+      server_entry = silc_idlist_find_server_by_id(server->global_list, 
+                                                  server_id, NULL);
     
     if ((!server_entry && !cmd->pending && !server->standalone) ||
-       (server_entry && !server_entry->connection)) {
+       (server_entry && !server_entry->connection && !cmd->pending &&
+        !server->standalone) ||
+       (server_entry && !server_entry->data.public_key && !cmd->pending &&
+        !server->standalone)) {
       SilcBuffer tmpbuf;
       uint16 old_ident;