diff options
| author | Alexander Barton <alex@barton.de> | 2009-09-09 23:00:45 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2009-09-30 16:00:06 +0200 |
| commit | 55c04e691d2e069eebf1f2cc7d9992d2510f681f (patch) | |
| tree | 36c1d8c05c4cbde86da7f9242c26b10bbfc9f296 | |
| parent | 881b9af2512a9707cdd599f84628a03c4e22cf2b (diff) | |
| download | ngircd-55c04e691d2e069eebf1f2cc7d9992d2510f681f.tar.gz ngircd-55c04e691d2e069eebf1f2cc7d9992d2510f681f.zip | |
Make sure forwarded CONNECT commands are handled correctly
| -rw-r--r-- | src/ngircd/irc-oper.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 68b5eb6f..17b60446 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -184,7 +184,8 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) assert(Client != NULL); assert(Req != NULL); - if (!Op_Check(Client, Req)) + if (Client_Type(Client) != CLIENT_SERVER + && !Client_HasMode(Client, 'o')) return Op_NoPrivileges(Client, Req); /* Bad number of parameters? */ @@ -203,7 +204,7 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) if (Req->argc == 3 || Req->argc == 6) { /* This CONNECT has a target parameter */ - if (Client_Type(Client) == CLIENT_SERVER) + if (Client_Type(Client) == CLIENT_SERVER && Req->prefix) from = Client_Search(Req->prefix); if (! from) return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, @@ -230,12 +231,8 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) return CONNECTED; } - Log(LOG_NOTICE | LOG_snotice, - "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask(from), - Req->argv[0]); - IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), - "Received CONNECT %s from %s", - Req->argv[0], Client_ID(from)); + if (!Op_Check(from, Req)) + return Op_NoPrivileges(Client, Req); switch (Req->argc) { case 1: @@ -263,6 +260,13 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) Req->argv[0]); } + Log(LOG_NOTICE | LOG_snotice, + "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask(from), + Req->argv[0]); + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), + "Received CONNECT %s from %s", + Req->argv[0], Client_ID(from)); + return CONNECTED; } /* IRC_CONNECT */ |