/* Check all Client ID's received in the command packet */
for (i = 0; i < client_id_count; i++) {
entry = silc_idlist_find_client_by_id(server->local_list,
- client_id[i], NULL);
+ client_id[i], TRUE, NULL);
if (!entry && check_global)
entry = silc_idlist_find_client_by_id(server->global_list,
- client_id[i], NULL);
+ client_id[i], TRUE, NULL);
if (entry) {
clients = silc_realloc(clients, sizeof(*clients) *
(clients_count + 1));
tmp = silc_argument_get_arg_type(cmd->args, 2, NULL);
if (tmp) {
entry = silc_idlist_find_server_by_name(server->local_list,
- tmp, NULL);
+ tmp, TRUE, NULL);
if (!entry && check_global)
entry = silc_idlist_find_server_by_name(server->local_list,
- tmp, NULL);
+ tmp, TRUE, NULL);
if (entry) {
*servers = silc_realloc(*servers, sizeof(**servers) *
(*servers_count + 1));
case SILC_ID_CLIENT:
entry = (void *)silc_idlist_find_client_by_id(server->local_list,
- id, NULL);
+ id, TRUE, NULL);
if (!entry && check_global)
entry = (void *)silc_idlist_find_client_by_id(server->global_list,
- id, NULL);
+ id, TRUE, NULL);
if (entry) {
*clients = silc_realloc(*clients, sizeof(**clients) *
(*clients_count + 1));
case SILC_ID_SERVER:
entry = (void *)silc_idlist_find_server_by_id(server->local_list,
- id, NULL);
+ id, TRUE, NULL);
if (!entry && check_global)
entry = (void *)silc_idlist_find_server_by_id(server->global_list,
- id, NULL);
+ id, TRUE, NULL);
if (entry) {
*servers = silc_realloc(*servers, sizeof(**servers) *
(*servers_count + 1));
/* Get the client entry */
remote_client = silc_idlist_find_client_by_id(server->local_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if (!remote_client) {
remote_client = silc_idlist_find_client_by_id(server->global_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if (!remote_client) {
silc_server_command_send_status_reply(cmd, SILC_COMMAND_KILL,
SILC_STATUS_ERR_NO_SUCH_CLIENT_ID);
}
}
- if (remote_client->data.registered == FALSE) {
- silc_server_command_send_status_reply(cmd, SILC_COMMAND_KILL,
- SILC_STATUS_ERR_NO_SUCH_CLIENT_ID);
- goto out;
- }
-
/* Get comment */
comment = silc_argument_get_arg_type(cmd->args, 2, &tmp_len2);
if (tmp_len2 > 128)
if (server_id) {
/* Check whether we have this server cached */
entry = silc_idlist_find_server_by_id(server->local_list,
- server_id, NULL);
+ server_id, TRUE, NULL);
if (!entry) {
entry = silc_idlist_find_server_by_id(server->global_list,
- server_id, NULL);
+ server_id, TRUE, NULL);
if (!entry && server->server_type == SILC_ROUTER) {
silc_server_command_send_status_reply(cmd, SILC_COMMAND_INFO,
SILC_STATUS_ERR_NO_SUCH_SERVER);
/* Check whether we have this server cached */
if (!entry && dest_server) {
entry = silc_idlist_find_server_by_name(server->global_list,
- dest_server, NULL);
+ dest_server, TRUE, NULL);
if (!entry) {
entry = silc_idlist_find_server_by_name(server->local_list,
- dest_server, NULL);
+ dest_server, TRUE, NULL);
}
}
/* Check whether we have this server cached */
entry = silc_idlist_find_server_by_name(server->global_list,
- dest_server, NULL);
+ dest_server, TRUE, NULL);
if (!entry) {
entry = silc_idlist_find_server_by_name(server->local_list,
- dest_server, NULL);
+ dest_server, TRUE, NULL);
}
if (server->server_type == SILC_ROUTER && !cmd->pending &&
/* Get target client's entry */
target_client = silc_idlist_find_client_by_id(server->local_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if (!target_client) {
target_client = silc_idlist_find_client_by_id(server->global_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
}
if (target_client != client &&
/* Get target client's entry */
target_client = silc_idlist_find_client_by_id(server->local_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if (!target_client) {
target_client = silc_idlist_find_client_by_id(server->global_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
}
/* Check that the target client is not channel founder. Channel founder
SILC_GET32_MSB(port, tmp);
server_entry = silc_idlist_find_server_by_conn(server->local_list,
- name, port, NULL);
+ name, port, FALSE, NULL);
if (!server_entry) {
silc_server_command_send_status_reply(cmd, SILC_COMMAND_CLOSE,
SILC_STATUS_ERR_NO_SERVER_ID);
/* Close the connection to the server */
sock = (SilcSocketConnection)server_entry->connection;
- silc_server_free_sock_user_data(server, sock);
+ if (sock->user_data)
+ silc_server_free_sock_user_data(server, sock);
silc_server_close_connection(server, sock);
out:
/* If the client is not found from local list there is no chance it
would be locally connected client so send the command further. */
client = silc_idlist_find_client_by_id(server->local_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if (!client)
client = silc_idlist_find_client_by_id(server->global_list,
- client_id, NULL);
+ client_id, TRUE, NULL);
if ((!client && !cmd->pending && !server->standalone) ||
(client && !client->connection && !cmd->pending &&
/* If the server is not found from local list there is no chance it
would be locally connected server so send the command further. */
server_entry = silc_idlist_find_server_by_id(server->local_list,
- server_id, NULL);
+ server_id, TRUE, NULL);
if (!server_entry)
server_entry = silc_idlist_find_server_by_id(server->global_list,
- server_id, NULL);
+ server_id, TRUE, NULL);
if ((!server_entry && !cmd->pending && !server->standalone) ||
(server_entry && !server_entry->connection && !cmd->pending &&