From: Pekka Riikonen Date: Thu, 23 May 2002 12:31:21 +0000 (+0000) Subject: updates X-Git-Tag: silc.toolkit.0.9.1~4 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=6ce4a03edae150222863775faa3ec2199162b861;p=silc.git updates --- diff --git a/CHANGES b/CHANGES index a147cec3..020616a6 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,10 @@ Thu May 23 12:00:14 CEST 2002 Pekka Riikonen * When resuming client, remove the old client entry from the watcher list too. Affected file silcd/packet_receive.c. + * Do not allow normal server to force founder mode away + from router if the founder mode is already set. Affected + file silcd/packet_receive.c. + Sun May 19 18:59:00 EEST 2002 Pekka Riikonen * Fixed the CHANNEL_CHANGE notify handling in client libary diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index fdd00237..b20af01c 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -554,6 +554,20 @@ void silc_server_notify(SilcServer server, SILC_LOG_DEBUG(("CMODE change is not allowed")); goto out; } + } else { + if (server->server_type == SILC_ROUTER && + channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH && + !(mode & SILC_CHANNEL_MODE_FOUNDER_AUTH)) { + SILC_LOG_DEBUG(("Enforcing sender to change channel mode")); + silc_server_send_notify_cmode(server, sock, FALSE, channel, + channel->mode, server->id, + SILC_ID_SERVER, + channel->cipher, + channel->hmac_name, + channel->passphrase, + channel->founder_key); + goto out; + } } /* Send the same notify to the channel */ diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index 64ad2658..de788f44 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -44,6 +44,21 @@ SILC_TASK_CALLBACK(silc_client_notify_check_client) silc_free(res); } +SILC_TASK_CALLBACK(silc_client_notify_del_client_cb) +{ + SilcClientNotifyResolve res = (SilcClientNotifyResolve)context; + SilcClient client = res->context; + SilcClientConnection conn = res->sock->user_data; + SilcClientID *client_id = res->packet; + SilcClientEntry client_entry; + client_entry = silc_client_get_client_by_id(client, conn, client_id); + if (client_entry) + silc_client_del_client(client, conn, client_entry); + silc_free(client_id); + silc_socket_free(res->sock); + silc_free(res); +} + /* Called when notify is received and some async operation (such as command) is required before processing the notify message. This calls again the silc_client_notify_by_server and reprocesses the original notify packet. */ @@ -1086,6 +1101,7 @@ void silc_client_notify_by_server(SilcClient client, * Received notify about some client we are watching */ SilcNotifyType notify = 0; + bool del_client = FALSE; SILC_LOG_DEBUG(("Notify: WATCH")); @@ -1147,11 +1163,22 @@ void silc_client_notify_by_server(SilcClient client, client is on some channel */ if (tmp && notify == SILC_NOTIFY_TYPE_NICK_CHANGE && !silc_hash_table_count(client_entry->channels)) - silc_client_del_client(client, conn, client_entry); + del_client = TRUE; else if (notify == SILC_NOTIFY_TYPE_SIGNOFF || notify == SILC_NOTIFY_TYPE_SERVER_SIGNOFF || notify == SILC_NOTIFY_TYPE_KILLED) - silc_client_del_client(client, conn, client_entry); + del_client = TRUE; + + if (del_client) { + SilcClientNotifyResolve res = silc_calloc(1, sizeof(*res)); + res->context = client; + res->sock = silc_socket_dup(conn->sock); + res->packet = client_id; + client_id = NULL; + silc_schedule_task_add(client->schedule, conn->sock->sock, + silc_client_notify_del_client_cb, res, + 1, 0, SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL); + } } break;