From 78a685fa2293b7797906d3225f7a302ed58ce79e Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sat, 26 Oct 2019 16:38:36 -0400 Subject: Require PASS before USER Prevent creating a ring consumer without authentication. --- client.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index f7fff33..198f1f6 100644 --- a/client.c +++ b/client.c @@ -114,9 +114,13 @@ static void handleUser(struct Client *client, struct Message *msg) { client->error = true; return; } - client->consumer = ringConsumer(msg->params[0]); - client->need &= ~NeedUser; - sync(client); + if (client->need & NeedPass) { + passRequired(client); + } else { + client->need &= ~NeedUser; + client->consumer = ringConsumer(msg->params[0]); + sync(client); + } } static void handlePass(struct Client *client, struct Message *msg) { -- cgit 1.4.1