Call silc_server_command_[whois/identify]_check on normal
authorPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 21:35:31 +0000 (21:35 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 21:35:31 +0000 (21:35 +0000)
server as well.

CHANGES
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index 42d244452a05879a754f59bb2fbf9fa14cbbb998..e08794bb60a2effec273f54a4e3101ccf7c85092 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -47,6 +47,10 @@ Wed Feb 14 16:03:25 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
          and WHOIS command.  At least, this was a clear bug and a cause
          of one type of [<unknown>] buglet.
 
+       * WHOIS and IDENTIFY commands call the function
+         silc_server_command_[whois/identify]_check function even if
+         we are not router server.
+
 Tue Feb 13 19:55:59 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added --with-gmp configuration option.  If set the GMP
index b1cc5c1e32d019f30a5239c0197df24b9532c9e3..ce9e60435fee009a72f8d2144005c16a0472081d 100644 (file)
@@ -403,7 +403,7 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
 
-    if (!entry->nickname || !entry->username || !entry->userinfo) {
+    if (!entry->nickname || !entry->username) {
       SilcBuffer tmpbuf;
       unsigned short old_ident;
 
@@ -464,6 +464,11 @@ silc_server_command_whois_send_reply(SilcServerCommandContext cmd,
     if (clients_count > 1 && i == clients_count - 1)
       status = SILC_STATUS_LIST_END;
 
+    /* Sanity check, however these should never fail. However, as
+       this sanity check has been added here they have failed. */
+    if (!entry->nickname || !entry->username)
+      continue;
+      
     /* Send WHOIS reply */
     idp = silc_id_payload_encode(entry->id, SILC_ID_CLIENT);
     tmp = silc_argument_get_first_arg(cmd->args, NULL);
@@ -476,7 +481,7 @@ silc_server_command_whois_send_reply(SilcServerCommandContext cmd,
 
       memset(uh, 0, sizeof(uh));
       memset(nh, 0, sizeof(nh));
-      
+
       strncat(nh, entry->nickname, strlen(entry->nickname));
       if (!strchr(entry->nickname, '@')) {
        strncat(nh, "@", 1);
@@ -636,8 +641,7 @@ silc_server_command_whois_from_client(SilcServerCommandContext cmd)
      mandatory fields that WHOIS command reply requires. Check for these and
      make query from the server who owns the client if some fields are 
      missing. */
-  if (server->server_type == SILC_ROUTER &&
-      !silc_server_command_whois_check(cmd, clients, clients_count)) {
+  if (!silc_server_command_whois_check(cmd, clients, clients_count)) {
     ret = -1;
     goto out;
   }
@@ -747,8 +751,7 @@ silc_server_command_whois_from_server(SilcServerCommandContext cmd)
      mandatory fields that WHOIS command reply requires. Check for these and
      make query from the server who owns the client if some fields are 
      missing. */
-  if (server->server_type == SILC_ROUTER &&
-      !silc_server_command_whois_check(cmd, clients, clients_count)) {
+  if (!silc_server_command_whois_check(cmd, clients, clients_count)) {
     ret = -1;
     goto out;
   }
@@ -1041,7 +1044,7 @@ silc_server_command_identify_from_client(SilcServerCommandContext cmd)
 
   /* Check that all mandatory fields are present and request those data
      from the server who owns the client if necessary. */
-  if (!cmd->pending && server->server_type == SILC_ROUTER &&
+  if (!cmd->pending && 
       !silc_server_command_identify_check(cmd, clients, clients_count)) {
     ret = -1;
     goto out;
@@ -1149,7 +1152,7 @@ silc_server_command_identify_from_server(SilcServerCommandContext cmd)
 
   /* Check that all mandatory fields are present and request those data
      from the server who owns the client if necessary. */
-  if (!cmd->pending && server->server_type == SILC_ROUTER &&
+  if (!cmd->pending && 
       !silc_server_command_identify_check(cmd, clients, clients_count)) {
     ret = -1;
     goto out;