+Mon Oct 28 21:23:39 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * In IDENTIFY command parsing, send all other IDs except
+ Client IDs explicitly to router for resolving on normal
+ server. Also check that ID received in WHOIS command is
+ always Client ID, others are not allowed. Affected file
+ silcd/server_query.c.
+
Sun Oct 27 11:44:32 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Merged c0ffee's /set heartbeat patch to Irssi SILC client.
if (!tmp)
continue;
- id = silc_id_payload_parse_id(tmp, tmp_len, NULL);
- if (!id) {
+ id = silc_id_payload_parse_id(tmp, tmp_len, &id_type);
+ if (!id || id_type != SILC_ID_CLIENT) {
silc_server_query_add_error(server, query, TRUE, i + 4,
SILC_STATUS_ERR_BAD_CLIENT_ID);
continue;
/* Normal server must check whether this ID exist, and if not then
send the query to router, unless done so already */
if (server->server_type == SILC_SERVER && !query->resolved) {
- if (!silc_idlist_find_client_by_id(server->local_list,
- id, TRUE, NULL)) {
- if (cmd->sock->type != SILC_SOCKET_TYPE_CLIENT ||
- !silc_idlist_find_client_by_id(server->global_list,
+ if (id_type == SILC_ID_CLIENT) {
+ if (!silc_idlist_find_client_by_id(server->local_list,
id, TRUE, NULL)) {
- silc_server_query_send_router(server, query);
- for (i = 0; i < query->ids_count; i++)
- silc_free(query->ids[i].id);
- silc_free(query->ids);
- silc_free(id);
- return;
+ if (cmd->sock->type != SILC_SOCKET_TYPE_CLIENT ||
+ !silc_idlist_find_client_by_id(server->global_list,
+ id, TRUE, NULL)) {
+ silc_server_query_send_router(server, query);
+ for (i = 0; i < query->ids_count; i++)
+ silc_free(query->ids[i].id);
+ silc_free(query->ids);
+ silc_free(id);
+ return;
+ }
}
+ } else {
+ /* For now all other ID's except Client ID's are explicitly
+ sent to router for resolving. */
+ silc_server_query_send_router(server, query);
+ for (i = 0; i < query->ids_count; i++)
+ silc_free(query->ids[i].id);
+ silc_free(query->ids);
+ silc_free(id);
+ return;
}
}