From f57bef4b184adf4d2c1a21c1ef7403711172737c Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 7 Oct 2002 16:27:10 +0000 Subject: [PATCH] Allow only WHOIS command reply from client. --- apps/silcd/command_reply.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.24.0