Moved the server->sockets freeing to silc_server_stop.
* Fixed memory leaks from libraries and server. Affected
files around the tree.
+ * Reverted back a fix made to CUMODE which broke it.
+ Affected file silcd/command.c.
+
Sun Jun 16 11:49:45 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Added SILC_MESSAGE_FLAG_UTF8 to the protocol specs and the
if (target_mask & SILC_CHANNEL_UMODE_CHANOP) {
/* Promote to operator */
if (!(chl->mode & SILC_CHANNEL_UMODE_CHANOP)) {
+ if (!(sender_mask & SILC_CHANNEL_UMODE_CHANOP) &&
+ !(sender_mask & SILC_CHANNEL_UMODE_CHANFO)) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_CUMODE,
+ SILC_STATUS_ERR_NO_CHANNEL_PRIV,
+ 0);
+ goto out;
+ }
+
chl->mode |= SILC_CHANNEL_UMODE_CHANOP;
notify = TRUE;
}
} else {
if (chl->mode & SILC_CHANNEL_UMODE_CHANOP) {
+ if (!(sender_mask & SILC_CHANNEL_UMODE_CHANOP) &&
+ !(sender_mask & SILC_CHANNEL_UMODE_CHANFO)) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_CUMODE,
+ SILC_STATUS_ERR_NO_CHANNEL_PRIV,
+ 0);
+ goto out;
+ }
+
/* Demote to normal user */
chl->mode &= ~SILC_CHANNEL_UMODE_CHANOP;
notify = TRUE;
void silc_server_free(SilcServer server)
{
- int i;
-
if (!server)
return;
}
#endif
- for (i = 0; i < server->config->param.connections_max; i++) {
- if (!server->sockets[i])
- continue;
- silc_socket_free(server->sockets[i]);
- }
- silc_free(server->sockets);
-
silc_server_config_unref(&server->config_ref);
if (server->rng)
silc_rng_free(server->rng);
SILC_LOG_DEBUG(("Stopping server"));
if (server->schedule) {
+ int i;
+
+ for (i = 0; i < server->config->param.connections_max; i++) {
+ if (!server->sockets[i])
+ continue;
+ silc_socket_free(server->sockets[i]);
+ }
+ silc_free(server->sockets);
+ server->sockets = NULL;
+
silc_schedule_stop(server->schedule);
silc_schedule_uninit(server->schedule);
server->schedule = NULL;