updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 2 Dec 2001 21:30:13 +0000 (21:30 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 2 Dec 2001 21:30:13 +0000 (21:30 +0000)
CHANGES
TODO
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index bb563c34e2123bf2f80e78b8769f9569bc929c57..4f5bba2bdc15985d1e04a8a569874a69f524f9a2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+Sun Dec  2 23:29:07 EET 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * If we are normal server, and we've not resolved client info
+         in WHOIS or IDENTIFY from router, and it is global client,
+         we'll check whether it is on some channel.  If it is not
+         then we cannot be sure about its validity and will resolve it
+         from router.  Fixes a bug in WHOIS and IDENTIFY.  Affected 
+         file silcd/command.c.
+
 Sun Dec  2 13:48:46 EET 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Distribute to the channel passphrase in CMODE_CHANGE notify.
 Sun Dec  2 13:48:46 EET 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Distribute to the channel passphrase in CMODE_CHANGE notify.
diff --git a/TODO b/TODO
index d080e0cac1d8426f06505625013b1f5704c6b1d5..81f10492f27bf40ddef56b30771bd99671cb6e73 100644 (file)
--- a/TODO
+++ b/TODO
@@ -41,10 +41,6 @@ TODO/bugs In SILC Server
        o Channel user mode changes are notified unnecessarely when
          switching to backup router on router crash.
 
        o Channel user mode changes are notified unnecessarely when
          switching to backup router on router crash.
 
- o If client's public key is saved in the server (and doing public key
-   authentication) then the hostname and the username information could
-   be taken from the public key.  Should be a configuration option!
-
  o Add a timeout to handling incoming JOIN commands.  It should be 
    enforced that JOIN command is executed only once in a second or two
    seconds.  Now it is possible to accept n incoming JOIN commands
  o Add a timeout to handling incoming JOIN commands.  It should be 
    enforced that JOIN command is executed only once in a second or two
    seconds.  Now it is possible to accept n incoming JOIN commands
@@ -71,6 +67,10 @@ TODO/bugs In SILC Server
          serverconfig.c.  They can be defined but they are totally
          ignored currently.  And they should be redefined also.
 
          serverconfig.c.  They can be defined but they are totally
          ignored currently.  And they should be redefined also.
 
+ o If client's public key is saved in the server (and doing public key
+   authentication) then the hostname and the username information could
+   be taken from the public key.  Should be a configuration option!
+
 
 TODO/bugs In SILC Libraries
 ===========================
 
 TODO/bugs In SILC Libraries
 ===========================
index d523172c351657c9b1a68729f589a4197e0fe98d..ae85305af7b0f85f6dcc622633f16ba7ed430c1f 100644 (file)
@@ -547,12 +547,23 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
-
-    if (!entry || (entry->nickname && entry->username && entry->userinfo) ||
-       !(entry->data.status & SILC_IDLIST_STATUS_REGISTERED) ||
-       !entry->router)
+    if (!entry)
       continue;
 
       continue;
 
+    if ((entry->nickname && entry->username && entry->userinfo) ||
+       !(entry->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
+      if (!entry->router)
+       continue;
+
+      /* If we are normal server, and we've not resolved this client from
+        router and it is global client, we'll check whether it is on some
+        channel.  If not then we cannot be sure about its validity, and
+        we'll resolve it from router. */
+      if (cmd->server->server_type != SILC_SERVER || cmd->pending ||
+         entry->connection || silc_hash_table_count(entry->channels))
+       continue;
+    }
+
     /* We need to resolve this entry since it is not complete */
 
     if (!cmd->pending && entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
     /* We need to resolve this entry since it is not complete */
 
     if (!cmd->pending && entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
@@ -1378,6 +1389,7 @@ silc_server_command_identify_parse(SilcServerCommandContext cmd,
   } else {
     /* Command includes ID, we must use that.  Also check whether the command
        has more than one ID set - take them all. */
   } else {
     /* Command includes ID, we must use that.  Also check whether the command
        has more than one ID set - take them all. */
+    *names = FALSE;
 
     /* Take all ID's from the command packet */
     for (i = 0; i < argc; i++) {
 
     /* Take all ID's from the command packet */
     for (i = 0; i < argc; i++) {
@@ -1496,12 +1508,23 @@ silc_server_command_identify_check_client(SilcServerCommandContext cmd,
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
-
-    if (!entry || entry->nickname || 
-       !(entry->data.status & SILC_IDLIST_STATUS_REGISTERED) ||
-       !entry->router)
+    if (!entry)
       continue;
 
       continue;
 
+    if (entry->nickname || 
+       !(entry->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
+      if (!entry->router)
+       continue;
+
+      /* If we are normal server, and we've not resolved this client from
+        router and it is global client, we'll check whether it is on some
+        channel.  If not then we cannot be sure about its validity, and
+        we'll resolve it from router. */
+      if (cmd->server->server_type != SILC_SERVER || cmd->pending ||
+         entry->connection || silc_hash_table_count(entry->channels))
+       continue;
+    }
+
     /* We need to resolve this entry since it is not complete */
 
     if (!cmd->pending && entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
     /* We need to resolve this entry since it is not complete */
 
     if (!cmd->pending && entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {