From: Pekka Riikonen Date: Mon, 7 Oct 2002 16:27:10 +0000 (+0000) Subject: Allow only WHOIS command reply from client. X-Git-Tag: 1.2.beta1~1122 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=f57bef4b184adf4d2c1a21c1ef7403711172737c;p=crypto.git Allow only WHOIS command reply from client. --- diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index 65056586..6d427ca9 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -85,14 +85,21 @@ void silc_server_command_reply_process(SilcServer server, ctx->payload = payload; ctx->args = silc_command_get_args(ctx->payload); ctx->ident = silc_command_get_ident(ctx->payload); + command = silc_command_get(ctx->payload); + + /* Client is not allowed to send reply to all commands */ + if (sock->type == SILC_SOCKET_TYPE_CLIENT && + command != SILC_COMMAND_WHOIS) { + silc_server_command_reply_free(ctx); + return; + } /* Check for pending commands and mark to be exeucted */ ctx->callbacks = - silc_server_command_pending_check(server, silc_command_get(ctx->payload), + silc_server_command_pending_check(server, command, ctx->ident, &ctx->callbacks_count); /* Execute command reply */ - command = silc_command_get(ctx->payload); for (cmd = silc_command_reply_list; cmd->cb; cmd++) if (cmd->cmd == command) break;