error was sent if no nickname and client id but the attributes were
given to whois.
+Sat Dec 20 00:44:47 CET 2003 Patrik Weiskircher <pat@icore.at>
+
+ * fixed a bug in the whois using attributes function where no
+ error was sent if no nickname and client id but the attributes were
+ given to whois. Affected file silcd/server_query.c
+
Tue Dec 16 21:34:59 CET 2003 Patrik Weiskircher <pat@icore.at>
* remove public key from public key hashtable on detach. Affected
Tue Dec 16 21:34:59 CET 2003 Patrik Weiskircher <pat@icore.at>
* remove public key from public key hashtable on detach. Affected
typedef struct {
SilcClientEntry **clients;
SilcUInt32 *clients_count;
typedef struct {
SilcClientEntry **clients;
SilcUInt32 *clients_count;
} *SilcServerPublicKeyUser, SilcServerPublicKeyUserStruct;
void silc_server_public_key_hash_foreach(void *key, void *context,
} *SilcServerPublicKeyUser, SilcServerPublicKeyUserStruct;
void silc_server_public_key_hash_foreach(void *key, void *context,
(*uc->clients) = silc_realloc((*uc->clients),
sizeof((**uc->clients)) *
((*uc->clients_count) + 1));
(*uc->clients) = silc_realloc((*uc->clients),
sizeof((**uc->clients)) *
((*uc->clients_count) + 1));
switch (attribute) {
case SILC_ATTRIBUTE_USER_PUBLIC_KEY:
switch (attribute) {
case SILC_ATTRIBUTE_USER_PUBLIC_KEY:
SILC_LOG_DEBUG(("Finding clients by public key attribute"));
if (!silc_attribute_get_object(attr, &pk, sizeof(pk)))
SILC_LOG_DEBUG(("Finding clients by public key attribute"));
if (!silc_attribute_get_object(attr, &pk, sizeof(pk)))
usercontext.clients = clients;
usercontext.clients_count = clients_count;
usercontext.clients = clients;
usercontext.clients_count = clients_count;
+ usercontext.found = FALSE;
silc_hash_table_find_foreach(server->pk_hash, publickey,
silc_server_public_key_hash_foreach,
&usercontext);
silc_hash_table_find_foreach(server->pk_hash, publickey,
silc_server_public_key_hash_foreach,
&usercontext);
+
+ if (usercontext.found == TRUE)
+ found = TRUE;
} else {
for (i = 0; i < *clients_count; i++) {
entry = (*clients)[i];
} else {
for (i = 0; i < *clients_count; i++) {
entry = (*clients)[i];
if (!silc_hash_table_find_by_context(server->pk_hash, publickey,
entry, NULL))
(*clients)[i] = NULL;
if (!silc_hash_table_find_by_context(server->pk_hash, publickey,
entry, NULL))
(*clients)[i] = NULL;
if (!found && !query->nickname && !query->ids) {
silc_server_query_send_error(server, query,
SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, 0);
if (!found && !query->nickname && !query->ids) {
silc_server_query_send_error(server, query,
SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, 0);
- silc_server_query_free(query);