summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-26 16:38:36 -0400
committerJune McEnroe <june@causal.agency>2019-10-26 16:38:36 -0400
commit78a685fa2293b7797906d3225f7a302ed58ce79e (patch)
treef67c3fdedef853b69412c4c284f0a95f510c1d44
parentTrack channel topics (diff)
downloadpounce-78a685fa2293b7797906d3225f7a302ed58ce79e.tar.gz
pounce-78a685fa2293b7797906d3225f7a302ed58ce79e.zip
Require PASS before USER
Prevent creating a ring consumer without authentication.
-rw-r--r--client.c10
1 files changed, 7 insertions, 3 deletions
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) {
ass='nohover-highlight'> I was really sick at the start of the week, okay? 2017-12-09Day 8, part 2June McEnroe 2017-12-09Day 8June McEnroe 2017-12-09Day 7, part 2June McEnroe I don't even know what this is. Don't look at it. 2017-12-08Day 7June McEnroe 2017-12-06Day 6, part 2June McEnroe 2017-12-06Day 6June McEnroe 2017-12-05Day 5, part 2June McEnroe 2017-12-05Day 5June McEnroe 2017-12-04Day 4, part 2June McEnroe That ugly sort map though. 2017-12-04Day 4June McEnroe 2017-12-03Day 3, part 2June McEnroe I am super surprised that worked on the first try. 2017-12-03Day 3, clean upJune McEnroe 2017-12-03Day 3June McEnroe This is fucking awful and I'm angry. 2017-12-02Day 2, part 2June McEnroe 2017-12-02Day 2June McEnroe 2017-12-01Day 1, part 2June McEnroe 2017-12-01Day 1June McEnroe 2017-11-27Move to 2016 directoryJune McEnroe