commit - 80d0613bf256f48b1dd20bface4c52b57cff8d28
commit + 48ea69d778279e7256a167e6f4147eb5766bbdda
blob - b286b5ac3df4cf705b18dc63b695209268083d5d
blob + 0421d9170201b9d7d81f26d6b61feea4ee584c2d
--- src/ngircd/irc-channel.c
+++ src/ngircd/irc-channel.c
channame = strtok_r(channame, ",", &lastchan);
/* Make sure that "channame" is not the empty string ("JOIN :") */
- if (!channame) {
- IRC_SetPenalty(Client, 2);
+ if (!channame)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
while (channame) {
flags = NULL;
chan = strtok(Req->argv[0], ",");
/* Make sure that "chan" is not the empty string ("PART :") */
- if (!chan) {
- IRC_SetPenalty(Client, 2);
+ if (!chan)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
while (chan) {
Channel_Part(target, Client, chan,
assert( Req != NULL );
/* Bad number of parameters? */
- if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
/* Compatibility kludge */
if (Req->argc == 5)
blob - 469527209ac2dfdf423014c26fc3d4b0a116104a
blob + 9e7e2d7a9a9a21a9beb4584748f6cd05628966b4
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
} else if (Client_Type(Client) == CLIENT_UNKNOWN ||
Client_Type(Client) == CLIENT_UNKNOWNSERVER) {
/* Unregistered connection, but wrong number of arguments: */
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
} else {
/* Server or service introduces new client */
/* Bad number of parameters? */
- if (Req->argc != 2 && Req->argc != 7) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 2 && Req->argc != 7)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
if (Req->argc >= 7) {
/* RFC 2813 compatible syntax */
/* Search the target */
target = Client_Search(Req->argv[0]);
- if (!target || Client_Type(target) != CLIENT_USER) {
+ if (!target || Client_Type(target) != CLIENT_USER)
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->argv[0]);
- }
if (Client_Conn(target) <= NONE) {
/* We have to forward the message to the server handling
blob - 07ccfd284323760cade3616a9a53f8f7aa40426c
blob + 5a7ec639ba4a935b5281a5a9181d66feeb8ac250
--- src/ngircd/irc-macros.h
+++ src/ngircd/irc-macros.h
*/
#define _IRC_ARGC_EQ_OR_RETURN_(Client, Req, Count) \
if (Req->argc != Count) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_LE_OR_RETURN_(Client, Req, Max) \
if (Req->argc > Max) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_GE_OR_RETURN_(Client, Req, Min) \
if (Req->argc < Min) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
*/
#define _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, Min, Max) \
if (Req->argc < Min || Req->argc > Max) { \
- IRC_SetPenalty(Client, 2); \
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
Client_ID(Client), Req->command); \
}
blob - af59683a744740baae7cae3ebec1dd3b22ef91c9
blob + 8e76db17084461f8c6c971bbd79b9858cd0c8c3e
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
* mode, because most other servers don't do
* it as well and some clients send "wired"
* MODE commands like "MODE #chan -ooo nick". */
- IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
blob - 52126877dc1a6f27bc804b3a968499251d36e980
blob + 23db579e725e1e54ef01faf4bfdd10616843ac76
--- src/ngircd/irc-op.c
+++ src/ngircd/irc-op.c
nickCount--;
}
} else {
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
blob - 4ccc76a6d830fdc66ead9139ad316687ea2b050e
blob + 260346c7ce6aec547731b8a0b36440f004270e8d
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
/* Bad number of parameters? */
if (Req->argc != 1 && Req->argc != 2 && Req->argc != 3 &&
- Req->argc != 5 && Req->argc != 6) {
- IRC_SetPenalty(Client, 2);
+ Req->argc != 5 && Req->argc != 6)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
/* Invalid port number? */
- if ((Req->argc > 1) && atoi(Req->argv[1]) < 1) {
- IRC_SetPenalty(Client, 2);
+ if ((Req->argc > 1) && atoi(Req->argv[1]) < 1)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
if (Client_Type(Client) != CLIENT_SERVER
&& !Client_HasMode(Client, 'o'))
assert(Req != NULL);
/* Bad number of parameters? */
- if (Req->argc != 1 && Req->argc != 3) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 1 && Req->argc != 3)
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
from = Op_Check(Client, Req);
if (!from)
blob - b0abb7cdf2622cac13792c4a2c708baeeaa12e48
blob + 7dbaba86a6bc20bc70d0d59b6db9969653b234b0
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
LogDebug("Connection %d: got SERVER command (new server link) ...",
Client_Conn(Client));
- if (Req->argc != 2 && Req->argc != 3) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 2 && Req->argc != 3)
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++)
{
/* New server is being introduced to the network */
- if (Req->argc != 4) {
- IRC_SetPenalty(Client, 2);
+ if (Req->argc != 4)
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]))
Client_MyToken(c), Client_Info(c));
return CONNECTED;
- } else {
- IRC_SetPenalty(Client, 2);
+ } else
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
- }
} /* IRC_SERVER */
/*
blob - b2d865fc7fa381c0b8062ad6bfcde58468f8460d
blob + 35f1a59a8a06b4a6fe516948be098ea312374646
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
if (Req->argc > 2) {
if (!SendErrors)
return CONNECTED;
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
blob - 2c7ba94d5a1e793cf37b25d8c25f3e36185c96d4
blob + 52954402d9d036acc898f9a1737d9cc5c2acf691
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
}
if (Req->argc < cmd->min_argc ||
- (cmd->max_argc != -1 && Req->argc > cmd->max_argc)) {
- IRC_SetPenalty(client, 2);
- return IRC_WriteStrClient(client, ERR_NEEDMOREPARAMS_MSG,
+ (cmd->max_argc != -1 && Req->argc > cmd->max_argc))
+ return IRC_WriteErrClient(client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(client), Req->command);
- }
/* Command is allowed for this client: call it and count
* generated bytes in output */