commit - 37609d6a4f036b175fdc304d0ee466bd8ad57bf9
commit + 08f9d31d60220e8a389a2d24f42625be7749f090
blob - 7fcba73fea9bbd14b3f8ec596b98a12c3276a291
blob + 42b0e4da9aa112b464d9754bb2f2632a5f41fedf
--- src/ngircd/irc-cap.c
+++ src/ngircd/irc-cap.c
{
assert(Client != NULL);
assert(Req != NULL);
-
- _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
LogDebug("Got \"%s %s\" command from \"%s\" ...",
Req->command, Req->argv[0], Client_ID(Client));
blob - 4bd5a9d1ff30fb4a7e2cb7c909c68d21b93b06a5
blob + ce042043ebe0b3eedc087635e50fc30a6b51610c
--- src/ngircd/irc-channel.c
+++ src/ngircd/irc-channel.c
assert (Client != NULL);
assert (Req != NULL);
- _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
_IRC_GET_SENDER_OR_RETURN_(target, Req, Client)
/* Is argument "0"? */
assert(Client != NULL);
assert(Req != NULL);
- _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
_IRC_GET_SENDER_OR_RETURN_(target, Req, Client)
/* Loop over all the given channel names */
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 1, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
chan = Channel_Search(Req->argv[0]);
IRC_SetPenalty(Client, 2);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
if (Req->argc > 0)
blob - 0bbe310a6b29183dd1f803915f9b17de88039ebe
blob + 97b518a063b7adbf124d3760faabaa6fc840c712
--- src/ngircd/irc-encoding.c
+++ src/ngircd/irc-encoding.c
assert (Client != NULL);
assert (Req != NULL);
- if (Req->argc != 1)
- return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
- Client_ID(Client), Req->command);
-
strlcpy(encoding, Req->argv[0], sizeof(encoding));
ngt_UpperStr(encoding);
blob - 9b7dfdaca4917f18b8a1cf7d40c130a1552b0351
blob + 88455c74d9e85c770442aea1aa6f0c54e2e0ab9c
--- src/ngircd/irc-info.c
+++ src/ngircd/irc-info.c
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
IRC_SetPenalty(Client, 2);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
assert(Client != NULL);
assert(Req != NULL);
- _IRC_ARGC_GE_OR_RETURN_(Client, Req, 1)
-
strlcpy(rpl, RPL_ISON_MSG, sizeof rpl);
for (i = 0; i < Req->argc; i++) {
/* "All" ircd even parse ":<x> <y> ..." arguments and split
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
/* Get pointer to server mask or "*", if none given */
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
-
if (Req->argc < 2 || strcmp(Req->argv[1], "0") == 0) {
for (c = Client_First(); c!= NULL; c = Client_Next(c)) {
if (Client_Type(c) != CLIENT_SERVICE)
IRC_SetPenalty(Client, 3);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
IRC_SetPenalty(Client, 2);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 1, from)
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
assert(Req != NULL);
IRC_SetPenalty(Client, 1);
-
- _IRC_ARGC_GE_OR_RETURN_(Client, Req, 1)
if (Req->argc > 5)
max = 5;
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(prefix, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, prefix)
IRC_SetPenalty(Client, 1);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
-
only_ops = false;
if (Req->argc == 2) {
if (strcmp(Req->argv[1], "o") == 0)
blob - 88804ef2b8b7dd1f95b71522ebc2ff3b84496827
blob + 67a0fbfd803603befe536bc7e61e94eb06ced5a0
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
assert(Client != NULL);
assert(Req != NULL);
-
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
/* Search the originator */
from = Client_Search(Req->prefix);
Client_Type(Client) != CLIENT_SERVER)
return IRC_WriteErrClient(Client, ERR_ALREADYREGISTRED_MSG,
Client_ID(Client));
-
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 6)
if (Client_Type(Client) != CLIENT_SERVER)
return IRC_WriteErrClient(Client, ERR_ERRONEUSNICKNAME_MSG,
GLOBAL bool
IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
{
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 4)
-
if (!Conf_WebircPwd[0] || strcmp(Req->argv[0], Conf_WebircPwd) != 0)
return IRC_WriteErrClient(Client, ERR_PASSWDMISMATCH_MSG,
Client_ID(Client));
assert(Client != NULL);
assert(Req != NULL);
-
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
if (Req->argc == 1)
strlcpy(quitmsg, Req->argv[0], sizeof quitmsg);
blob - b52512ab92afe5d08a47ff16777f04f774bb3b0a
blob + f7948e6a0d42cbabcdcd1f2a5e0db6731720884e
--- src/ngircd/irc-metadata.c
+++ src/ngircd/irc-metadata.c
assert(Client != NULL);
assert(Req != NULL);
- if (Req->argc != 3)
- return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
- Client_ID(Client), Req->command);
-
prefix = Client_Search(Req->prefix);
if (!prefix)
return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
blob - 88d2294bad203efe377820bc8f9aaee822056544
blob + 38fec0d028b5761bcf2bd432a2633cae9871f7fc
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
assert(Client != NULL);
assert(Req != NULL);
- _IRC_ARGC_GE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
/* Channel or user mode? */
assert (Client != NULL);
assert (Req != NULL);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
-
if (Req->argc == 1 && Req->argv[0][0]) {
Client_SetAway(Client, Req->argv[0]);
Client_ModeAdd(Client, 'a');
blob - 4cd4236eefd55cfe64a3cd7a72ce615eeee996c0
blob + 23db579e725e1e54ef01faf4bfdd10616843ac76
--- src/ngircd/irc-op.c
+++ src/ngircd/irc-op.c
assert( Client != NULL );
assert( Req != NULL );
- _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 2, 3)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
while (*itemList) {
assert( Client != NULL );
assert( Req != NULL );
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
/* Search user */
blob - dd408a6fa8bd8c77869397ff8655efcee881bdf6
blob + 40633177a51babbe3d8971453f9b62818bec8a50
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
assert( Client != NULL );
assert( Req != NULL );
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
-
len = array_length(&Conf_Opers, sizeof(*op));
op = array_start(&Conf_Opers);
for (i = 0; i < len && strcmp(op[i].name, Req->argv[0]); i++)
assert(Client != NULL);
assert(Req != NULL);
-#ifdef STRICT_RFC
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 0)
-#else
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
-#endif
-
if (!Op_Check(Client, Req))
return Op_NoPrivileges(Client, Req);
assert( Client != NULL );
assert( Req != NULL );
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 0)
-
if (!Op_Check(Client, Req))
return Op_NoPrivileges(Client, Req);
assert( Client != NULL );
assert( Req != NULL );
-
- /* Bad number of parameters? */
- if (Req->argc != 0)
- return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
- Client_ID(Client), Req->command);
if (!Op_Check(Client, Req))
return Op_NoPrivileges(Client, Req);
assert(Client != NULL);
assert(Req != NULL);
-
- /* Bad number of parameters? */
- if (Req->argc != 1)
- return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
- Client_ID(Client), Req->command);
if (!Op_Check(Client, Req))
return Op_NoPrivileges(Client, Req);
assert( Client != NULL );
assert( Req != NULL );
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 1)
-
switch (Client_Type(Client)) {
case CLIENT_USER:
if (!Client_OperByMe(Client))
blob - 107c44a8122d5153d32d696435a0d370890bcabc
blob + 80bb6a6141169fe0b03b18063496a2b9d0494800
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
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, "" );
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);
blob - 968bcea6e58998a7d4d56096f727fa887bc7b37a
blob + 7dafaf0539b005bdf808dcefb870838dfae8dfcc
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
if (Client_Type(Client) != CLIENT_SERVER && !Client_OperByMe(Client))
return IRC_WriteErrClient(Client, ERR_NOPRIVILEGES_MSG,
Client_ID(Client));
-
- _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
/* Get prefix (origin); use the client if no prefix is given. */
if (Req->prefix)
assert(Req != NULL);
IRC_SetPenalty(Client, 2);
-
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
if ((Req->argc == 0 && array_bytes(&Conf_Helptext) > 0)
|| (Req->argc >= 1 && strcasecmp(Req->argv[0], "Commands") != 0)) {
blob - 68aa945fa3eb8be1cfb28afcf8832f23ed3772a8
blob + 7172f411b64c3dbf810c0052eb3ed2ed86a04987
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
static COMMAND My_Commands[] =
{
- { "ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "AWAY", IRC_AWAY, CLIENT_USER, 0, 0, 0 },
- { "CAP", IRC_CAP, CLIENT_ANY, 0, 0, 0 },
- { "CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0 },
- { "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 0, 0, 0 },
- { "ERROR", IRC_ERROR, CLIENT_ANY, 0, 0, 0 },
- { "GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "HELP", IRC_HELP, CLIENT_USER, 0, 0, 0 },
- { "INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "ISON", IRC_ISON, CLIENT_USER, 0, 0, 0 },
- { "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "KLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "METADATA", IRC_METADATA, CLIENT_SERVER, 0, 0, 0 },
- { "MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "NICK", IRC_NICK, CLIENT_ANY, 0, 0, 0 },
- { "NJOIN", IRC_NJOIN, CLIENT_SERVER, 0, 0, 0 },
- { "NOTICE", IRC_NOTICE, CLIENT_ANY, 0, 0, 0 },
- { "OPER", IRC_OPER, CLIENT_USER, 0, 0, 0 },
- { "PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "PASS", IRC_PASS, CLIENT_ANY, 0, 0, 0 },
- { "PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "PONG", IRC_PONG, CLIENT_ANY, 0, 0, 0 },
- { "PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "QUIT", IRC_QUIT, CLIENT_ANY, 0, 0, 0 },
- { "REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0 },
- { "RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0 },
- { "SERVER", IRC_SERVER, CLIENT_ANY, 0, 0, 0 },
- { "SERVICE", IRC_SERVICE, CLIENT_ANY, 0, 0, 0 },
- { "SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 0, 0 },
- { "SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "SVSNICK", IRC_SVSNICK, CLIENT_SERVER, 0, 0, 0 },
- { "SUMMON", IRC_SUMMON, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "USER", IRC_USER, CLIENT_ANY, 0, 0, 0 },
- { "USERHOST", IRC_USERHOST, CLIENT_USER, 0, 0, 0 },
- { "USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "WALLOPS", IRC_WALLOPS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "WEBIRC", IRC_WEBIRC, CLIENT_UNKNOWN, 0, 0, 0 },
- { "WHO", IRC_WHO, CLIENT_USER, 0, 0, 0 },
- { "WHOIS", IRC_WHOIS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
- { "WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
+ { "ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
+ { "AWAY", IRC_AWAY, CLIENT_USER, 0, 1, 0, 0, 0 },
+ { "CAP", IRC_CAP, CLIENT_ANY, 1, 2, 0, 0, 0 },
+ { "CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+#ifdef STRICT_RFC
+ { "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0, 0, 0 },
+#else
+ { "DIE", IRC_DIE, CLIENT_USER, 0, 1, 0, 0, 0 },
+#endif
+ { "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 1, 1, 0, 0, 0 },
+ { "ERROR", IRC_ERROR, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "HELP", IRC_HELP, CLIENT_USER, 0, 1, 0, 0, 0 },
+ { "INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
+ { "INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
+ { "ISON", IRC_ISON, CLIENT_USER, 1, -1, 0, 0, 0 },
+ { "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
+ { "KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 2, 3, 0, 0, 0 },
+ { "KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
+ { "KLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "METADATA", IRC_METADATA, CLIENT_SERVER, 3, 3, 0, 0, 0 },
+ { "MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 1, -1, 0, 0, 0 },
+ { "MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
+ { "NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "NICK", IRC_NICK, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "NJOIN", IRC_NJOIN, CLIENT_SERVER, 2, 2, 0, 0, 0 },
+ { "NOTICE", IRC_NOTICE, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "OPER", IRC_OPER, CLIENT_USER, 2, 2, 0, 0, 0 },
+ { "PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
+ { "PASS", IRC_PASS, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "PONG", IRC_PONG, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "QUIT", IRC_QUIT, CLIENT_ANY, 0, 1, 0, 0, 0 },
+ { "REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0, 0, 0 },
+ { "RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0, 0, 0 },
+ { "SERVER", IRC_SERVER, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "SERVICE", IRC_SERVICE, CLIENT_ANY, 6, 6, 0, 0, 0 },
+ { "SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 2, 0, 0, 0 },
+ { "SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 2, 2, 0, 0, 0 },
+ { "STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 2, 0, 0, 0 },
+ { "SVSNICK", IRC_SVSNICK, CLIENT_SERVER, 2, 2, 0, 0, 0 },
+ { "SUMMON", IRC_SUMMON, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
+ { "TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 1, 2, 0, 0, 0 },
+ { "TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "USER", IRC_USER, CLIENT_ANY, 0, -1, 0, 0, 0 },
+ { "USERHOST", IRC_USERHOST, CLIENT_USER, 1, -1, 0, 0, 0 },
+ { "USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 1, 0, 0, 0 },
+ { "WALLOPS", IRC_WALLOPS, CLIENT_USER|CLIENT_SERVER, 1, 1, 0, 0, 0 },
+ { "WEBIRC", IRC_WEBIRC, CLIENT_UNKNOWN, 4, 4, 0, 0, 0 },
+ { "WHO", IRC_WHO, CLIENT_USER, 0, 2, 0, 0, 0 },
+ { "WHOIS", IRC_WHOIS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
+ { "WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, -1, 0, 0, 0 },
#ifdef IRCPLUS
- { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, 0, 0 },
+ { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, -1, 0, 0, 0 },
# ifdef ICONV
- { "CHARCONV", IRC_CHARCONV, CLIENT_USER, 0, 0, 0 },
+ { "CHARCONV", IRC_CHARCONV, CLIENT_USER, 1, 1, 0, 0, 0 },
# endif
#endif
#ifndef STRICT_RFC
- { "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
- { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
+ { "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 },
+ { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 },
#endif
- { NULL, NULL, 0x0, 0, 0, 0 } /* End-Mark */
+ { NULL, NULL, 0x0, 0, 0, 0, 0, 0 } /* End-Mark */
};
static void Init_Request PARAMS(( REQUEST *Req ));
Client_ID(client));
}
+ 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,
+ Client_ID(client), Req->command);
+ }
+
/* Command is allowed for this client: call it and count
* generated bytes in output */
Conn_ResetWCounter();
blob - 0c6f8a66d07e4d299f4bb66025c3aec3fae7ee6b
blob + beac227521b6d1d677df721b617f795b7e44bd62
--- src/ngircd/parse.h
+++ src/ngircd/parse.h
bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
/**< Function to handle this command */
CLIENT_TYPE type; /**< Valid client types (bit mask) */
+ int min_argc; /**< Min parameters */
+ int max_argc; /**< Max parameters */
long lcount, rcount; /**< Number of local and remote calls */
long bytes; /**< Number of bytes created */
} COMMAND;