updates.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 4 Sep 2001 14:24:47 +0000 (14:24 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 4 Sep 2001 14:24:47 +0000 (14:24 +0000)
CHANGES
TODO
apps/silcd/command.c
doc/example_silcd.conf
lib/silcclient/command.c
lib/silcclient/idlist.c

diff --git a/CHANGES b/CHANGES
index 839d642492ccc40b5c4231d38575721fe1c63e8a..91c309f0f50deb3bb5586aa140274a3a0518184e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -35,6 +35,14 @@ Tue Sep  4 12:39:17 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
          not check anymore for the mlock().  Affected file is
          configure.in.pre.
 
+       * Fixed USERS command in server to allow the execution of the
+         command for private and secret channels if the client sending
+         the command is on the channel.  Affected file silcd/command.c.
+
+       * Fixed silc_client_get_clients_local to return the clients
+         count correctly.  It could return wrong value.  Affected file
+         lib/silcclient/idlist.c.
+
 Mon Sep  3 20:09:59 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed the lib/silcmath/mpi/mpi.h to always use 32-bit data
diff --git a/TODO b/TODO
index ce43e4d3592ca7b18bd753198153a23ab37b72e8..34524f2247d849de2bac5b6d01707a30dee61914 100644 (file)
--- a/TODO
+++ b/TODO
@@ -30,9 +30,6 @@ TODO/bugs in Irssi SILC client
 TODO/bugs In SILC Client Library
 ================================
 
- o The public key authentication is missing for example in OPER and SILCOPER
-   commands.  See the XXX's in the lib/silcclient/command.c.
-
  o The client library must manage somehow when receiving client that has
    same nickname, same server, same username but different Client ID than
    what we have in the cache.  It is now assumed that they are different
@@ -41,6 +38,9 @@ TODO/bugs In SILC Client Library
    interface separately or it could just remove the old client unless
    it is on some channels.
 
+ o The public key authentication is missing for example in OPER and SILCOPER
+   commands.  See the XXX's in the lib/silcclient/command.c.
+
 
 TODO/bugs In SILC Server
 ========================
index 128f95af9c212b7363ad9467889367d6b21e0914..1aba7a0c07820575dbda1241457a49dba1e69f2a 100644 (file)
@@ -4832,11 +4832,22 @@ SILC_SERVER_CMD_FUNC(users)
     }
   }
 
-  /* If the channel is private or secret do not send anything */
-  if (channel->mode & (SILC_CHANNEL_MODE_PRIVATE | SILC_CHANNEL_MODE_SECRET)) {
-    silc_server_command_send_status_reply(cmd, SILC_COMMAND_USERS,
-                                         SILC_STATUS_ERR_NO_SUCH_CHANNEL);
-    goto out;
+  /* If the channel is private or secret do not send anything, unless the
+     user requesting this command is on the channel. */
+  if (cmd->sock->type == SILC_SOCKET_TYPE_CLIENT) {
+    if (channel->mode & (SILC_CHANNEL_MODE_PRIVATE | SILC_CHANNEL_MODE_SECRET)
+       && !silc_server_client_on_channel(cmd->sock->user_data, channel)) {
+      silc_server_command_send_status_reply(cmd, SILC_COMMAND_USERS,
+                                           SILC_STATUS_ERR_NO_SUCH_CHANNEL);
+      goto out;
+    }
+  } else {
+    if (channel->mode & 
+       (SILC_CHANNEL_MODE_PRIVATE | SILC_CHANNEL_MODE_SECRET)) {
+      silc_server_command_send_status_reply(cmd, SILC_COMMAND_USERS,
+                                           SILC_STATUS_ERR_NO_SUCH_CHANNEL);
+      goto out;
+    }
   }
 
   /* Get the users list */
index e34d43317c1ef571980233dc45de7aeed549f9f3..a07e16bafc9d2736b41467bd268de7e57ef1720f 100644 (file)
@@ -173,6 +173,7 @@ infologfile:/usr/local/silc/logs/silcd.log:10000
 #
 [RouterConnection]
 #10.2.1.100:passwd:veryverysecret:706:1:1:1
+#10.2.100.131:pubkey:/path/to/the/publickey:706:1:1:1
 
 #
 # Denied connections.
index 6a8335fe7ab5da1cf710c3b6d45e37d33f0c03ff..c4cf398c43a62036263786f62acc564a4c596498 100644 (file)
@@ -320,8 +320,6 @@ SILC_CLIENT_CMD_FUNC(identify)
   }
 
   if (cmd->argc < 2 || cmd->argc > 3) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
-            "Usage: /IDENTIFY <nickname>[@<server>] [<count>]");
     COMMAND_ERROR;
     goto out;
   }
index 5085c39202ae56a3c2339e6ebf80bc94534dfc17..66270cdc3010f5efed85d399551a16cd1b02bbeb 100644 (file)
@@ -124,6 +124,7 @@ SilcClientEntry *silc_client_get_clients_local(SilcClient client,
   SilcIDCacheList list = NULL;
   SilcClientEntry entry, *clients;
   int i = 0;
+  bool found = FALSE;
 
   /* Find ID from cache */
   if (!silc_idcache_find_by_name(conn->client_cache, nickname, &list))
@@ -142,6 +143,7 @@ SilcClientEntry *silc_client_get_clients_local(SilcClient client,
     silc_idcache_list_first(list, &id_cache);
     while (id_cache) {
       clients[i++] = id_cache->context;
+      found = TRUE;
       if (!silc_idcache_list_next(list, &id_cache))
        break;
     }
@@ -161,6 +163,7 @@ SilcClientEntry *silc_client_get_clients_local(SilcClient client,
       }
       
       clients[i++] = id_cache->context;
+      found = TRUE;
       if (!silc_idcache_list_next(list, &id_cache))
        break;
     }
@@ -169,6 +172,13 @@ SilcClientEntry *silc_client_get_clients_local(SilcClient client,
   if (list)
     silc_idcache_list_free(list);
 
+  if (!found) {
+    *clients_count = 0;
+    if (clients)
+      silc_free(clients);
+    return NULL;
+  }
+
   return clients;
 }