commit 5417a72536954927371d597e9a4e0453e70620e3 from: Florian Westphal date: Mon Feb 28 22:28:24 2011 UTC 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. commit - 94e4562c1c732f7bf67bed2f77cc7b3b0aeaeafe commit + 5417a72536954927371d597e9a4e0453e70620e3 blob - d1f9c6c9790a17748b1a37dbed6ae3bb24e69a84 blob + 6e8851b64113b44c4b5dd7e47faf370dba0f6675 --- src/ngircd/channel.c +++ src/ngircd/channel.c @@ -1081,11 +1081,11 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const assert(Key != NULL); 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)