X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-server.c;h=030c3cd1fc043c00f3c99633eb1e33620b2be838;hp=107c44a8122d5153d32d696435a0d370890bcabc;hb=b5faf3055b61afaef73ac49a448cac1a5b063127;hpb=37609d6a4f036b175fdc304d0ee466bd8ad57bf9 diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index 107c44a8..030c3cd1 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -72,10 +72,12 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) LogDebug("Connection %d: got SERVER command (new server link) ...", Client_Conn(Client)); - if (Req->argc != 2 && Req->argc != 3) + if (Req->argc != 2 && Req->argc != 3) { + IRC_SetPenalty(Client, 2); return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); + } /* Get configuration index of new remote server ... */ for (i = 0; i < MAX_SERVERS; i++) @@ -183,9 +185,11 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) { /* New server is being introduced to the network */ - if (Req->argc != 4) + if (Req->argc != 4) { + IRC_SetPenalty(Client, 2); return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); + } /* check for existing server with same ID */ if (!Client_CheckID(Client, Req->argv[0])) @@ -231,9 +235,11 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) Client_MyToken(c), Client_Info(c)); return CONNECTED; - } else + } else { + IRC_SetPenalty(Client, 2); return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); + } } /* IRC_SERVER */ /* @@ -254,8 +260,6 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2) - strlcpy( nick_in, Req->argv[1], sizeof( nick_in )); strcpy( nick_out, "" ); @@ -341,8 +345,6 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) assert(Client != NULL); assert(Req != NULL); - _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2) - if (Client_Type(Client) != CLIENT_SERVER && !Client_HasMode(Client, 'o')) return Op_NoPrivileges(Client, Req);