Florian Westphal : channel: always reject zero-length channel key
Module: ngircd.git Branch: master Commit: 5417a72536954927371d597e9a4e0453e70620e3 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=5417a7253... Author: Florian Westphal <fw@strlen.de> Date: Mon Feb 28 21:09:47 2011 +0100 channel: always reject zero-length channel key previously, any client could join in this configuration: [Channel] Name = #test Modes = tnk KeyFile = /tmp/foobar fix this by checking for zero-length key before comparing key to channel key. --- src/ngircd/channel.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index d1f9c6c..6e8851b 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -1082,10 +1082,10 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key) if (!strchr(Chan->modes, 'k')) return true; - if (strcmp(Chan->key, Key) == 0) - return true; if (*Key == '\0') return false; + if (strcmp(Chan->key, Key) == 0) + return true; file_name = array_start(&Chan->keyfile); if (!file_name)
Teilnehmer (1)
- 
                
fw@arthur.barton.de