to not use freed memory. Affected file is
lib/silcclient/client_notify.c.
+ * Fixed CUMODE_CHANGE notify handling in server. Affected
+ file silcd/packet_receive.c.
+
Sat May 18 11:35:19 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Allow multiple identical pending commands to be registered
if (!silc_server_client_on_channel(client, channel, &chl))
goto out;
- if (client != client2) {
+ if (client != client2 && server->server_type == SILC_ROUTER) {
/* Sender must be operator */
if (!(chl->mode & SILC_CHANNEL_UMODE_CHANOP) &&
!(chl->mode & SILC_CHANNEL_UMODE_CHANFO)) {
goto out;
}
- /* Check that target is on channel */
if (!silc_server_client_on_channel(client2, channel, &chl))
goto out;
}
}
+ /* Get target channel entry */
+ if (!silc_server_client_on_channel(client2, channel, &chl))
+ goto out;
+
if (mode & SILC_CHANNEL_UMODE_CHANFO &&
+ !(channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) && !client &&
+ server->server_type == SILC_ROUTER) {
+ /* Get the founder of the channel and if found then this client
+ cannot be the founder since there already is one. */
+ silc_hash_table_list(channel->user_list, &htl);
+ while (silc_hash_table_get(&htl, NULL, (void *)&chl2))
+ if (chl2->mode & SILC_CHANNEL_UMODE_CHANFO) {
+ mode &= ~SILC_CHANNEL_UMODE_CHANFO;
+ silc_server_force_cumode_change(server, sock, channel, chl, mode);
+ notify_sent = TRUE;
+ break;
+ }
+ silc_hash_table_list_reset(&htl);
+ if (!(mode & SILC_CHANNEL_UMODE_CHANFO))
+ break;
+ }
+
+ if (client && mode & SILC_CHANNEL_UMODE_CHANFO &&
!(chl->mode & SILC_CHANNEL_UMODE_CHANFO) &&
server->server_type == SILC_ROUTER) {
/* Check whether this client is allowed to be channel founder on
/* Now match the public key we have cached and public key sent.
They must match. */
- if (client && client->data.public_key &&
+ if (client->data.public_key &&
!silc_pkcs_public_key_compare(channel->founder_key,
client->data.public_key)) {
mode &= ~SILC_CHANNEL_UMODE_CHANFO;
SilcIDCacheEntry id_cache = NULL;
SilcChannelEntry channel = NULL;
- SILC_LOG_DEBUG(("Start"));
+ SILC_LOG_DEBUG(("Removing channels by server"));
if (silc_idcache_get_all(server->global_list->channels, &list)) {
if (silc_idcache_list_first(list, &id_cache)) {
SilcIDCacheEntry id_cache = NULL;
SilcChannelEntry channel = NULL;
- SILC_LOG_DEBUG(("Start"));
+ SILC_LOG_DEBUG(("Updating channels by server"));
if (silc_idcache_get_all(server->global_list->channels, &list)) {
if (silc_idcache_list_first(list, &id_cache)) {
/* Find target Client entry */
client_entry2 =
silc_client_get_client_by_id(client, conn, client_id);
- if (!client_entry2)
+ if (!client_entry2) {
+ silc_client_notify_by_server_resolve(client, conn, packet,
+ SILC_ID_CLIENT, client_id);
goto out;
+ }
/* Get channel entry */
channel_id = silc_id_str2id(packet->dst_id, packet->dst_id_len,