+Wed Mar 27 19:43:16 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed the KICKED notify handling in client library to
+ correctly remove the channel and all entries from the
+ channel when I was kicked. This bug crashed the client.
+
+ Fixed yet another but in KICKED notify handling to remove
+ the kicked client correctly from the channel.
+
+ Affected file is lib/silcclient/client_notify.c.
+
+ * Fixed a minor bug in looking up correct client entry
+ in KICKED notify in server. Affected file is
+ silcd/packet_receive.c.
+
+ * Fixed the lib/silcmath/Makefile.am to include the MPI and GMP
+ sources correctly to distribution. Fixes --with-gmp option.
+
Wed Mar 27 00:07:11 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed a bug in the silc_client_nickname_format function that
TODO/bugs In SILC Server
========================
- o KICKing doesn't work.
-
o Configuration file additions (Do this to 0.8.x):
o Add incoming connection frequency, incoming connection frequency
o WIN32 silc_net_create_connection_async does not work the same way
than on Unix. Do it with threads on WIN32. The function works but
- is not actually async currently.
-
- o EPOC specific additions/changes required:
-
- o lib/silcutil/epoc routines missing or not completed.
+ is not actually async currently (Fix this to 1.0).
TODO in Toolkit Documentation
o EPOC specific additions/changes required:
+ o lib/silcutil/epoc routines missing or not completed.
+
o The PKCS#1 also calls global RNG (even though it is not used
currently in SILC, the interface allows its use).
if (!silc_server_client_on_channel(client, channel, &chl))
goto out;
if (chl->mode == SILC_CHANNEL_UMODE_NONE &&
- channel->mode & SILC_CHANNEL_MODE_TOPIC)
+ channel->mode & SILC_CHANNEL_MODE_TOPIC) {
+ SILC_LOG_DEBUG(("Topic change is not allowed"));
goto out;
+ }
/* Change the topic */
silc_free(channel->topic);
if (client) {
if (!silc_server_client_on_channel(client, channel, &chl))
goto out;
- if (!silc_server_check_cmode_rights(server, channel, chl, mode))
+ if (!silc_server_check_cmode_rights(server, channel, chl, mode)) {
+ SILC_LOG_DEBUG(("CMODE change is not allowed"));
goto out;
+ }
}
/* Send the same notify to the channel */
if (client != client2) {
/* Sender must be operator */
- if (chl->mode == SILC_CHANNEL_UMODE_NONE)
+ if (chl->mode == SILC_CHANNEL_UMODE_NONE) {
+ SILC_LOG_DEBUG(("CUMODE change is not allowed"));
goto out;
+ }
/* Check that target is on channel */
if (!silc_server_client_on_channel(client2, channel, &chl))
goto out;
/* If target is founder mode change is not allowed. */
- if (chl->mode & SILC_CHANNEL_UMODE_CHANFO)
+ if (chl->mode & SILC_CHANNEL_UMODE_CHANFO) {
+ SILC_LOG_DEBUG(("CUMODE change is not allowed"));
goto out;
+ }
}
}
if (!silc_server_client_on_channel(client, channel, &chl))
goto out;
if (chl->mode == SILC_CHANNEL_UMODE_NONE &&
- channel->mode & SILC_CHANNEL_MODE_INVITE)
+ channel->mode & SILC_CHANNEL_MODE_INVITE) {
+ SILC_LOG_DEBUG(("Inviting is not allowed"));
goto out;
+ }
/* Get the added invite */
tmp = silc_argument_get_arg_type(args, 4, &tmp_len);
client2 = silc_idlist_find_client_by_id(server->global_list,
client_id, TRUE, NULL);
if (!client2) {
- client = silc_idlist_find_client_by_id(server->local_list,
- client_id, TRUE, NULL);
+ client2 = silc_idlist_find_client_by_id(server->local_list,
+ client_id, TRUE, NULL);
if (!client2) {
silc_free(client_id);
goto out;
/* Kicker must be operator on channel */
if (!silc_server_client_on_channel(client2, channel, &chl))
goto out;
- if (chl->mode == SILC_CHANNEL_UMODE_NONE)
+ if (chl->mode == SILC_CHANNEL_UMODE_NONE) {
+ SILC_LOG_DEBUG(("Kicking is not allowed"));
goto out;
+ }
}
/* Send to channel */
SILC_GET32_MSB(mode, tmp);
/* Check that mode changing is allowed. */
- if (!silc_server_check_umode_rights(server, client, mode))
+ if (!silc_server_check_umode_rights(server, client, mode)) {
+ SILC_LOG_DEBUG(("UMODE change is not allowed"));
goto out;
+ }
/* Change the mode */
client->mode = mode;
client->internal->ops->notify(client, conn, type, client_entry, tmp,
client_entry2, channel);
- /* If I was kicked from channel, remove the channel */
+ /* Remove kicked client from channel */
if (client_entry == conn->local_entry) {
+ /* If I was kicked from channel, remove the channel */
if (conn->current_channel == channel)
conn->current_channel = NULL;
- silc_idcache_del_by_id(conn->channel_cache, channel->id);
- silc_free(channel->channel_name);
- silc_free(channel->id);
- silc_free(channel->key);
- silc_cipher_free(channel->channel_key);
- silc_free(channel);
+ silc_client_del_channel(client, conn, channel);
+ } else {
+ chu = silc_client_on_channel(channel, client_entry);
+ if (chu) {
+ silc_hash_table_del(client_entry->channels, channel);
+ silc_hash_table_del(channel->user_list, client_entry);
+ silc_free(chu);
+ }
}
break;
cache = silc_calloc(1, sizeof(*cache));
if (!cache)
return NULL;
- cache->id_table = silc_hash_table_alloc(count, silc_hash_id,
+ cache->id_table = silc_hash_table_alloc(count, silc_hash_id,
(void *)(SilcUInt32)id_type,
- silc_hash_id_compare,
- (void *)(SilcUInt32)id_type,
- silc_idcache_destructor, NULL,
- FALSE);
+ silc_hash_id_compare,
+ (void *)(SilcUInt32)id_type,
+ silc_idcache_destructor, NULL, TRUE);
cache->name_table = silc_hash_table_alloc(count, silc_hash_string, NULL,
- silc_hash_string_compare, NULL,
- NULL, NULL, FALSE);
+ silc_hash_string_compare, NULL,
+ NULL, NULL, TRUE);
cache->context_table = silc_hash_table_alloc(count, silc_hash_ptr, NULL,
- NULL, NULL, NULL, NULL, FALSE);
+ NULL, NULL, NULL, NULL, TRUE);
cache->destructor = destructor;
cache->type = id_type;
if (context)
silc_hash_table_add(cache->context_table, context, c);
- /* See whether we have time to rehash the tables */
- if ((silc_hash_table_count(cache->id_table) / 2) >
- silc_hash_table_size(cache->id_table)) {
- silc_hash_table_rehash(cache->id_table, 0);
- silc_hash_table_rehash(cache->name_table, 0);
- silc_hash_table_rehash(cache->context_table, 0);
- }
-
if (ret)
*ret = c;