From: Pekka Riikonen Date: Tue, 4 Sep 2001 14:24:47 +0000 (+0000) Subject: updates. X-Git-Tag: 1.2.beta1~1920 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=791a6c603c06e51aeccb1f740e392426c92791c2;p=crypto.git updates. --- diff --git a/CHANGES b/CHANGES index 839d6424..91c309f0 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,14 @@ Tue Sep 4 12:39:17 EEST 2001 Pekka Riikonen 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 * Fixed the lib/silcmath/mpi/mpi.h to always use 32-bit data diff --git a/TODO b/TODO index ce43e4d3..34524f22 100644 --- 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 ======================== diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 128f95af..1aba7a0c 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -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 */ diff --git a/doc/example_silcd.conf b/doc/example_silcd.conf index e34d4331..a07e16ba 100644 --- a/doc/example_silcd.conf +++ b/doc/example_silcd.conf @@ -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. diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index 6a8335fe..c4cf398c 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -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 [@] []"); COMMAND_ERROR; goto out; } diff --git a/lib/silcclient/idlist.c b/lib/silcclient/idlist.c index 5085c392..66270cdc 100644 --- a/lib/silcclient/idlist.c +++ b/lib/silcclient/idlist.c @@ -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; }