+Tue Jan 22 18:19:36 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Removed assert()'s from the lib/silcclient/client_keyagr.c.
+
+ * Fixed the NICK command to always give the unformatted
+ nickname to the one giving the NICK command. If unformatted
+ nickname is cached already it will be formatted and the
+ local entry will always get the unformatted nickname.
+ Affected file lib/silcclient/idlist.c.
+
+ * Fixed some double frees from client library commands.
+ Affected file is lib/silcclient/command.c.
+
+ * Fixed CUMODE command in server to assure that no one can
+ change founder's mode than the founder itself, there was a
+ little bug. Affected file silcd/command.c.
+
Mon Jan 21 19:07:53 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Removed the SilcClientCommandDestructor from the client
TODO/bugs In SILC Client Library
================================
- o Remove the assert from silc_client_file_send.
-
o The PRIVATE_MESSAGE_KEY packet is not handled (it is implemented
though). This should be added and perhaps new client operation
should be added to notify application that it was received and
set the key only if application wishes to set (accept the key) it.
- o When changing own nickname and there exists a same nickname the library
- can give the client now nickname in format nick@host. This is new
- behaviour and maybe should be removed. The changer should always
- get the one it wants and not have the formatted nickname.
-
o Additions to do after protocol version 1.1:
o Fix the NICK_CHANGE notify handling not to create new entry
TODO/bugs In SILC Server
========================
- o removing other's modes on channel seems to be possible due to some
- cumode bug.
-
o Add hashed passwords to silcd.conf file.
o Backup router related issues
should be analyzed too how slow the task registering process
actually is, and find out ways to optimize it.
+ o Add SilcAsyncOperation to utility library.
+
o Cipher optimizations (asm, that this) at least for i386 would be nice.
o Add builtin SOCKS and HTTP Proxy support, well the SOCKS at least.
signal_emit("event connected", 1, server);
} else {
server->connection_lost = TRUE;
- server->conn->context = NULL;
+ if (server->conn)
+ server->conn->context = NULL;
server_disconnect(SERVER(server));
}
}
/* If the target client is founder, no one else can change their mode
but themselves. */
- if (chl->mode & SILC_CHANNEL_UMODE_CHANFO && chl->client != target_client) {
+ if (chl->mode & SILC_CHANNEL_UMODE_CHANFO && client != target_client) {
silc_server_command_send_status_reply(cmd, SILC_COMMAND_CUMODE,
- SILC_STATUS_ERR_NOT_YOU);
+ SILC_STATUS_ERR_NO_CHANNEL_PRIV);
goto out;
}
SilcProtocol protocol;
SilcClientKEInternalContext *proto_ctx;
+ SILC_LOG_DEBUG(("Start"));
+
if (!conn->sock->hostname)
conn->sock->hostname = strdup(conn->remote_host);
if (!conn->sock->ip)
SilcClientKeyAgreement ke = NULL;
SilcBuffer buffer;
- assert(client_entry);
-
- if (client_entry->ke)
+ if (!client_entry || client_entry->ke)
return;
/* Create the listener if hostname and port was provided.
SILC_LOG_DEBUG(("Start"));
- assert(client_entry && hostname && port);
+ if (!client_entry || !hostname || !port)
+ return;
ke = silc_calloc(1, sizeof(*ke));
ke->client = client;
SILC_LOG_DEBUG(("Start"));
- assert(client_entry);
+ if (!client_entry)
+ return;
ke = silc_calloc(1, sizeof(*ke));
ke->client = client;
SilcClientConnection conn,
SilcClientEntry client_entry)
{
- assert(client_entry);
+ if (!client_entry)
+ return;
if (client_entry->ke) {
SilcClientKeyAgreement ke;
COMMAND_ERROR;
goto out;
}
- silc_free(nickname);
/* Client entry not found, it was requested thus mark this to be
pending command. */
goto out;
}
- silc_free(nickname);
-
/* Client entry not found, it was requested thus mark this to be
pending command. */
silc_client_command_pending(conn, SILC_COMMAND_IDENTIFY,
goto out;
}
- silc_free(nickname);
-
/* Client entry not found, it was requested thus mark this to be
pending command. */
silc_client_command_pending(conn, SILC_COMMAND_IDENTIFY,
int i, off = 0, len;
SilcClientEntry *clients;
uint32 clients_count = 0;
+ SilcClientEntry unformatted = NULL;
SILC_LOG_DEBUG(("Start"));
char tmp[6];
int num, max = 1;
- if (clients_count == 1)
+ if (clients_count == 1) {
+ unformatted = clients[0];
break;
+ }
for (i = 0; i < clients_count; i++) {
+ if (!strncasecmp(clients[i]->nickname, client_entry->nickname,
+ strlen(clients[i]->nickname)))
+ unformatted = clients[i];
if (strncasecmp(clients[i]->nickname, newnick, off))
continue;
if (strlen(clients[i]->nickname) <= off)
if (num > max)
max = num;
}
-
+
memset(tmp, 0, sizeof(tmp));
snprintf(tmp, sizeof(tmp) - 1, "%d", ++max);
len = strlen(tmp);
newnick = silc_realloc(newnick, sizeof(*newnick) * (off + 1));
newnick[off] = 0;
+ /* If we are changing nickname of our local entry we'll enforce
+ that we will always get the unformatted nickname. Give our
+ format number to the one that is not formatted now. */
+ if (unformatted && client_entry == conn->local_entry)
+ client_entry = unformatted;
+
silc_free(client_entry->nickname);
client_entry->nickname = newnick;
silc_free(clients);