lists.barton.de
Anmelden
Registrieren
Anmelden
Registrieren
Diese Liste verwalten
×
Tastenkürzel
Thread-Ansicht
j
: Nächste ungelesene Nachricht
k
: Vorherige ungelesene Nachricht
j a
: Zu allen Threads wechseln
j l
: Zur Listenübersicht springen
2024
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2023
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2022
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2021
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2020
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2019
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2018
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2017
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2016
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2015
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2014
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2013
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2012
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2011
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2010
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2009
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2008
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2007
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2006
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Februar
Januar
2005
Dezember
November
Oktober
September
August
Juli
Juni
Mai
April
März
Listenübersicht
Herunterladen
ngIRCd GIT Updates
November 2013
----- 2024 -----
Dezember 2024
November 2024
Oktober 2024
September 2024
August 2024
Juli 2024
Juni 2024
Mai 2024
April 2024
März 2024
Februar 2024
Januar 2024
----- 2023 -----
Dezember 2023
November 2023
Oktober 2023
September 2023
August 2023
Juli 2023
Juni 2023
Mai 2023
April 2023
März 2023
Februar 2023
Januar 2023
----- 2022 -----
Dezember 2022
November 2022
Oktober 2022
September 2022
August 2022
Juli 2022
Juni 2022
Mai 2022
April 2022
März 2022
Februar 2022
Januar 2022
----- 2021 -----
Dezember 2021
November 2021
Oktober 2021
September 2021
August 2021
Juli 2021
Juni 2021
Mai 2021
April 2021
März 2021
Februar 2021
Januar 2021
----- 2020 -----
Dezember 2020
November 2020
Oktober 2020
September 2020
August 2020
Juli 2020
Juni 2020
Mai 2020
April 2020
März 2020
Februar 2020
Januar 2020
----- 2019 -----
Dezember 2019
November 2019
Oktober 2019
September 2019
August 2019
Juli 2019
Juni 2019
Mai 2019
April 2019
März 2019
Februar 2019
Januar 2019
----- 2018 -----
Dezember 2018
November 2018
Oktober 2018
September 2018
August 2018
Juli 2018
Juni 2018
Mai 2018
April 2018
März 2018
Februar 2018
Januar 2018
----- 2017 -----
Dezember 2017
November 2017
Oktober 2017
September 2017
August 2017
Juli 2017
Juni 2017
Mai 2017
April 2017
März 2017
Februar 2017
Januar 2017
----- 2016 -----
Dezember 2016
November 2016
Oktober 2016
September 2016
August 2016
Juli 2016
Juni 2016
Mai 2016
April 2016
März 2016
Februar 2016
Januar 2016
----- 2015 -----
Dezember 2015
November 2015
Oktober 2015
September 2015
August 2015
Juli 2015
Juni 2015
Mai 2015
April 2015
März 2015
Februar 2015
Januar 2015
----- 2014 -----
Dezember 2014
November 2014
Oktober 2014
September 2014
August 2014
Juli 2014
Juni 2014
Mai 2014
April 2014
März 2014
Februar 2014
Januar 2014
----- 2013 -----
Dezember 2013
November 2013
Oktober 2013
September 2013
August 2013
Juli 2013
Juni 2013
Mai 2013
April 2013
März 2013
Februar 2013
Januar 2013
----- 2012 -----
Dezember 2012
November 2012
Oktober 2012
September 2012
August 2012
Juli 2012
Juni 2012
Mai 2012
April 2012
März 2012
Februar 2012
Januar 2012
----- 2011 -----
Dezember 2011
November 2011
Oktober 2011
September 2011
August 2011
Juli 2011
Juni 2011
Mai 2011
April 2011
März 2011
Februar 2011
Januar 2011
----- 2010 -----
Dezember 2010
November 2010
Oktober 2010
September 2010
August 2010
Juli 2010
Juni 2010
Mai 2010
April 2010
März 2010
Februar 2010
Januar 2010
----- 2009 -----
Dezember 2009
November 2009
Oktober 2009
September 2009
August 2009
Juli 2009
Juni 2009
Mai 2009
April 2009
März 2009
Februar 2009
Januar 2009
----- 2008 -----
Dezember 2008
November 2008
Oktober 2008
September 2008
August 2008
Juli 2008
Juni 2008
Mai 2008
April 2008
März 2008
Februar 2008
Januar 2008
----- 2007 -----
Dezember 2007
November 2007
Oktober 2007
September 2007
August 2007
Juli 2007
Juni 2007
Mai 2007
April 2007
März 2007
Februar 2007
Januar 2007
----- 2006 -----
Dezember 2006
November 2006
Oktober 2006
September 2006
August 2006
Juli 2006
Juni 2006
Mai 2006
April 2006
März 2006
Februar 2006
Januar 2006
----- 2005 -----
Dezember 2005
November 2005
Oktober 2005
September 2005
August 2005
Juli 2005
Juni 2005
Mai 2005
April 2005
März 2005
ngircd-commits@lists.barton.de
1 Teilnehmer
17 Diskussionen
Einen n
N
euen Thread beginnen
Federico G. Schwindt : Move IRC_SetPenalty() to Handle_Request() when possible
by alex@arthur.barton.de
09 Nov '13
09 Nov '13
Module: ngircd.git Branch: master Commit: fcf61e9e0264d081e72eedddbd4a45b619e82b01 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=fcf61e9e…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Thu Nov 7 16:29:21 2013 +0000 Move IRC_SetPenalty() to Handle_Request() when possible This centralizes the penalty handling. It also exposes some commands that lack it for our attention. --- src/ngircd/irc-channel.c | 4 -- src/ngircd/irc-info.c | 25 --------- src/ngircd/irc.c | 4 -- src/ngircd/parse.c | 129 ++++++++++++++++++++++++---------------------- src/ngircd/parse.h | 1 + 5 files changed, 67 insertions(+), 96 deletions(-) Diff:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commitdiff;h=fcf6…
1
0
0
0
Federico G. Schwindt : Introduce a macro to define the command list
by alex@arthur.barton.de
09 Nov '13
09 Nov '13
Module: ngircd.git Branch: master Commit: 9f236c4b9155f3d4f1c7f1bf3b22e8a106e29df3 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=9f236c4b…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Thu Nov 7 13:20:08 2013 +0000 Introduce a macro to define the command list This will pave the way to other changes and simplifies the entries somewhat. --- src/ngircd/parse.c | 125 +++++++++++++++++++++++++++------------------------- 1 file changed, 64 insertions(+), 61 deletions(-) diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 5295440..ae6f4d2 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -60,78 +60,81 @@ struct _NUMERIC { static COMMAND My_Commands[] = { - { "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 }, +#define _CMD(name, func, type, min, max) \ + { (name), (func), (type), (min), (max), 0, 0, 0 } + _CMD("ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("AWAY", IRC_AWAY, CLIENT_USER, 0, 1), + _CMD("CAP", IRC_CAP, CLIENT_ANY, 1, 2), + _CMD("CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, -1), #ifdef STRICT_RFC - { "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0, 0, 0 }, + _CMD("DIE", IRC_DIE, CLIENT_USER, 0, 0), #else - { "DIE", IRC_DIE, CLIENT_USER, 0, 1, 0, 0, 0 }, + _CMD("DIE", IRC_DIE, CLIENT_USER, 0, 1), #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 }, + _CMD("DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 1, 1), + _CMD("ERROR", IRC_ERROR, CLIENT_ANY, 0, -1), + _CMD("GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("HELP", IRC_HELP, CLIENT_USER, 0, 1), + _CMD("INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 2, 2), + _CMD("ISON", IRC_ISON, CLIENT_USER, 1, -1), + _CMD("JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 1, 2), + _CMD("KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 2, 3), + _CMD("KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 2, 2), + _CMD("KLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("METADATA", IRC_METADATA, CLIENT_SERVER, 3, 3), + _CMD("MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 1, -1), + _CMD("MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("NICK", IRC_NICK, CLIENT_ANY, 0, -1), + _CMD("NJOIN", IRC_NJOIN, CLIENT_SERVER, 2, 2), + _CMD("NOTICE", IRC_NOTICE, CLIENT_ANY, 0, -1), + _CMD("OPER", IRC_OPER, CLIENT_USER, 2, 2), + _CMD("PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 1, 2), + _CMD("PASS", IRC_PASS, CLIENT_ANY, 0, -1), + _CMD("PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("PONG", IRC_PONG, CLIENT_ANY, 0, -1), + _CMD("PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("QUIT", IRC_QUIT, CLIENT_ANY, 0, 1), + _CMD("REHASH", IRC_REHASH, CLIENT_USER, 0, 0), + _CMD("RESTART", IRC_RESTART, CLIENT_USER, 0, 0), + _CMD("SERVER", IRC_SERVER, CLIENT_ANY, 0, -1), + _CMD("SERVICE", IRC_SERVICE, CLIENT_ANY, 6, 6), + _CMD("SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 2), + _CMD("SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 2, 2), + _CMD("STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 2), + _CMD("SVSNICK", IRC_SVSNICK, CLIENT_SERVER, 2, 2), + _CMD("SUMMON", IRC_SUMMON, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 1, 2), + _CMD("TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("USER", IRC_USER, CLIENT_ANY, 0, -1), + _CMD("USERHOST", IRC_USERHOST, CLIENT_USER, 1, -1), + _CMD("USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 1), + _CMD("WALLOPS", IRC_WALLOPS, CLIENT_USER|CLIENT_SERVER, 1, 1), + _CMD("WEBIRC", IRC_WEBIRC, CLIENT_UNKNOWN, 4, 4), + _CMD("WHO", IRC_WHO, CLIENT_USER, 0, 2), + _CMD("WHOIS", IRC_WHOIS, CLIENT_USER|CLIENT_SERVER, 0, -1), + _CMD("WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, -1), #ifdef IRCPLUS - { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, -1, 0, 0, 0 }, + _CMD("CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, -1), # ifdef ICONV - { "CHARCONV", IRC_CHARCONV, CLIENT_USER, 1, 1, 0, 0, 0 }, + _CMD("CHARCONV", IRC_CHARCONV, CLIENT_USER, 1, 1), # endif #endif #ifndef STRICT_RFC - { "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 }, - { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1, 0, 0, 0 }, + _CMD("GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1), + _CMD("POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, -1), #endif - { NULL, NULL, 0x0, 0, 0, 0, 0, 0 } /* End-Mark */ + _CMD(NULL, NULL, 0, 0, 0) /* End-Mark */ +#undef _CMD }; static void Init_Request PARAMS(( REQUEST *Req ));
1
0
0
0
Federico G. Schwindt : When sending an error use the IRC_WriteErrClient() variant
by alex@arthur.barton.de
09 Nov '13
09 Nov '13
Module: ngircd.git Branch: master Commit: 00249f3c805ec0b4564901dce0f3a7b0c20ce439 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=00249f3c…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Thu Nov 7 10:45:34 2013 +0000 When sending an error use the IRC_WriteErrClient() variant This ensures that all errors have a 2 second penalty. --- src/ngircd/irc-macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngircd/irc-macros.h b/src/ngircd/irc-macros.h index 5a7ec63..dc18641 100644 --- a/src/ngircd/irc-macros.h +++ b/src/ngircd/irc-macros.h @@ -78,7 +78,7 @@ if (Req->argc < Min || Req->argc > Max) { \ else \ Sender = Client; \ if (!Sender) \ - return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, \ + return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, \ Client_ID(Client), Req->prefix); /** @@ -97,7 +97,7 @@ if (Req->argc < Min || Req->argc > Max) { \ if (!Target) \ Target = Client_SearchServer(Req->argv[Argc]); \ if (!Target) \ - return IRC_WriteStrClient(From, ERR_NOSUCHSERVER_MSG, \ + return IRC_WriteErrClient(From, ERR_NOSUCHSERVER_MSG, \ Client_ID(From), Req->argv[Argc]); \ if (Client_Type(Target) != CLIENT_SERVER) \ Target = Client_Introducer(Target); \
1
0
0
0
Federico G. Schwindt : On bad /oper set the penalty to 10 seconds
by alex@arthur.barton.de
07 Nov '13
07 Nov '13
Module: ngircd.git Branch: master Commit: 925b4de2981b55a279f28368446f0a862c621d5e URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=925b4de2…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Wed Nov 6 21:46:53 2013 +0000 On bad /oper set the penalty to 10 seconds This helps against brute-force attempts. --- src/ngircd/irc-oper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 260346c..0b50bca 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -50,7 +50,8 @@ Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg) { Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s", Client_Mask(Client), errtoken, errmsg); - return IRC_WriteErrClient(Client, ERR_PASSWDMISMATCH_MSG, + IRC_SetPenalty(Client, 10); + return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG, Client_ID(Client)); } /* Bad_OperPass */
1
0
0
0
Federico G. Schwindt : Remove unneded IRC_SetPenalty() calls
by alex@arthur.barton.de
07 Nov '13
07 Nov '13
Module: ngircd.git Branch: master Commit: 48ea69d778279e7256a167e6f4147eb5766bbdda URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=48ea69d7…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Wed Nov 6 18:28:09 2013 +0000 Remove unneded IRC_SetPenalty() calls IRC_WriteErrClient() already calls IRC_SetPenalty(). While here convert some IRC_SetPenalty() + IRC_WriteStrClient() to IRC_WriteErrClient(). --- src/ngircd/irc-channel.c | 12 +++--------- src/ngircd/irc-login.c | 8 ++------ src/ngircd/irc-macros.h | 12 ++++-------- src/ngircd/irc-mode.c | 3 --- src/ngircd/irc-op.c | 1 - src/ngircd/irc-oper.c | 12 +++--------- src/ngircd/irc-server.c | 12 +++--------- src/ngircd/irc.c | 1 - src/ngircd/parse.c | 6 ++---- 9 files changed, 17 insertions(+), 50 deletions(-) diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index b286b5a..0421d91 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -323,11 +323,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) 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; @@ -447,11 +445,9 @@ IRC_PART(CLIENT * Client, REQUEST * Req) 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, @@ -669,11 +665,9 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req ) 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) diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 4695272..9e7e2d7 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -80,7 +80,6 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) } 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 { @@ -274,11 +273,9 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) /* 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 */ @@ -375,10 +372,9 @@ IRC_SVSNICK(CLIENT *Client, REQUEST *Req) /* 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 diff --git a/src/ngircd/irc-macros.h b/src/ngircd/irc-macros.h index 07ccfd2..5a7ec63 100644 --- a/src/ngircd/irc-macros.h +++ b/src/ngircd/irc-macros.h @@ -25,8 +25,7 @@ */ #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); \ } @@ -38,8 +37,7 @@ if (Req->argc != Count) { \ */ #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); \ } @@ -51,8 +49,7 @@ if (Req->argc > Max) { \ */ #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); \ } @@ -64,8 +61,7 @@ if (Req->argc < Min) { \ */ #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); \ } diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index af59683..8e76db1 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -613,7 +613,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) #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); @@ -658,7 +657,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) #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); @@ -760,7 +758,6 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) * 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); diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 5212687..23db579 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -122,7 +122,6 @@ IRC_KICK(CLIENT *Client, REQUEST *Req) nickCount--; } } else { - IRC_SetPenalty(Client, 2); return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); } diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 4ccc76a..260346c 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -208,18 +208,14 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) /* 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')) @@ -395,11 +391,9 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req) 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) diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index b0abb7c..7dbaba8 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -72,12 +72,10 @@ 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) { - 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++) @@ -185,11 +183,9 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) { /* 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])) @@ -235,11 +231,9 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) 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 */ /* diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index b2d865f..35f1a59 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -526,7 +526,6 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) if (Req->argc > 2) { if (!SendErrors) return CONNECTED; - IRC_SetPenalty(Client, 2); return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); } diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 2c7ba94..5295440 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -531,11 +531,9 @@ Handle_Request( CONN_ID Idx, REQUEST *Req ) } 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 */
1
0
0
0
Federico G. Schwindt : Use sizeof() intead of the explicit size
by alex@arthur.barton.de
07 Nov '13
07 Nov '13
Module: ngircd.git Branch: master Commit: 80d0613bf256f48b1dd20bface4c52b57cff8d28 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=80d0613b…
Author: Federico G. Schwindt <fgsch(a)lodoss.net> Date: Wed Nov 6 18:16:05 2013 +0000 Use sizeof() intead of the explicit size --- src/ngircd/irc-write.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index 25cecaf..5503344 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -70,7 +70,7 @@ va_dcl #else va_start(ap); #endif - vsnprintf(buffer, 1000, Format, ap); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end(ap); IRC_SetPenalty(Client, 2); @@ -107,7 +107,7 @@ va_dcl #else va_start(ap); #endif - vsnprintf(buffer, 1000, Format, ap); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end(ap); return IRC_WriteStrClientPrefix(Client, Client_ThisServer(), @@ -148,7 +148,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); return Conn_WriteStr(Client_Conn(Client_NextHop(Client)), ":%s %s", @@ -190,7 +190,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); IRC_WriteStrChannelPrefix(Client, Chan, Client_ThisServer(), @@ -239,7 +239,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); Conn_ClearFlags( ); @@ -296,7 +296,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); IRC_WriteStrServersPrefix(ExceptOf, Client_ThisServer(), "%s", buffer); @@ -333,7 +333,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, '\0', "%s", buffer ); @@ -373,7 +373,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); IRC_WriteStrServersPrefixFlag_CB(ExceptOf, Prefix, Flag, @@ -451,7 +451,7 @@ va_dcl #else va_start( ap ); #endif - vsnprintf( buffer, 1000, Format, ap ); + vsnprintf(buffer, sizeof(buffer), Format, ap); va_end( ap ); Conn_ClearFlags( ); @@ -513,7 +513,7 @@ va_dcl #else va_start(ap); #endif - vsnprintf(msg, 1000, Format, ap); + vsnprintf(msg, sizeof(msg), Format, ap); va_end(ap); for (to=Client_First(); to != NULL; to=Client_Next(to)) {
1
0
0
0
Alexander Barton : Remove wrong #ifdef in Option_String()
by alex@arthur.barton.de
01 Nov '13
01 Nov '13
Module: ngircd.git Branch: master Commit: 4ab688c5e82281c4d9ad2a4498523b1722c1f738 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=4ab688c5…
Author: Alexander Barton <alex(a)barton.de> Date: Fri Nov 1 19:12:35 2013 +0100 Remove wrong #ifdef in Option_String() This fixes the following error when compiling without zlib support: irc.c: In function ‘Option_String’: irc.c:487: error: ‘options’ undeclared (first use in this function) Reported by "der_baer" on #ngircd. --- src/ngircd/irc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index ee7972c..b2d865f 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -478,9 +478,7 @@ Option_String(UNUSED CONN_ID Idx) #endif { static char option_txt[8]; -#ifdef ZLIB UINT16 options; -#endif assert(Idx != NONE);
1
0
0
0
← Neuer
1
2
Älter →
Springe zur Seite:
1
2
Ergebnisse pro Seite:
10
25
50
100
200