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
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
----- 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
2442 Diskussionen
Einen n
N
euen Thread beginnen
Alexander Barton : Code cleanup of IRC_SQUIT() in preparation to deal with bug #73.
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: bce16c2864309d5fc7da8d0591120466303aa966 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=bce16c28…
Author: Alexander Barton <alex(a)barton.de> Date: Wed Apr 9 19:49:34 2008 +0200 Code cleanup of IRC_SQUIT() in preparation to deal with bug #73. --- src/ngircd/irc-server.c | 63 +++++++++++++++++++++++++++------------------- 1 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index 3c34c20..b75a34f 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -266,44 +266,55 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req ) } /* IRC_NJOIN */ +/** + * Handler for the IRC command "SQUIT". + * See RFC 2813 section 4.1.2 and RFC 2812 section 3.1.8. + */ GLOBAL bool -IRC_SQUIT( CLIENT *Client, REQUEST *Req ) +IRC_SQUIT(CLIENT * Client, REQUEST * Req) { CLIENT *target; char msg[LINE_LEN + 64]; - assert( Client != NULL ); - assert( Req != NULL ); + assert(Client != NULL); + assert(Req != NULL); - if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + /* Bad number of arguments? */ + if (Req->argc != 2) + return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, + Client_ID(Client), Req->command); - Log( LOG_DEBUG, "Got SQUIT from %s for \"%s\": \"%s\" ...", Client_ID( Client ), Req->argv[0], Req->argv[1] ); + Log(LOG_DEBUG, "Got SQUIT from %s for \"%s\": \"%s\" ...", + Client_ID(Client), Req->argv[0], Req->argv[1]); - target = Client_Search( Req->argv[0] ); - if( ! target ) - { - Log( LOG_WARNING, "Got SQUIT from %s for unknown server \"%s\"!?", Client_ID( Client ), Req->argv[0] ); + target = Client_Search(Req->argv[0]); + if (!target) { + /* The server is (already) unknown */ + Log(LOG_WARNING, + "Got SQUIT from %s for unknown server \"%s\"!?", + Client_ID(Client), Req->argv[0]); return CONNECTED; } - if( Req->argv[1][0] ) - { - if( strlen( Req->argv[1] ) > LINE_LEN ) Req->argv[1][LINE_LEN] = '\0'; - snprintf( msg, sizeof( msg ), "%s (SQUIT from %s).", Req->argv[1], Client_ID( Client )); - } - else snprintf( msg, sizeof( msg ), "Got SQUIT from %s.", Client_ID( Client )); - - if( Client_Conn( target ) > NONE ) - { - /* This server has the connection */ - if( Req->argv[1][0] ) Conn_Close( Client_Conn( target ), msg, Req->argv[1], true); - else Conn_Close( Client_Conn( target ), msg, NULL, true); + if (Req->argv[1][0]) { + if (strlen(Req->argv[1]) > LINE_LEN) + Req->argv[1][LINE_LEN] = '\0'; + snprintf(msg, sizeof(msg), "%s (SQUIT from %s).", Req->argv[1], + Client_ID(Client)); + } else + snprintf(msg, sizeof(msg), "Got SQUIT from %s.", + Client_ID(Client)); + + if (Client_Conn(target) > NONE) { + /* We are directly connected to this server */ + if (Req->argv[1][0]) + Conn_Close(Client_Conn(target), msg, Req->argv[1], + true); + else + Conn_Close(Client_Conn(target), msg, NULL, true); return DISCONNECTED; - } - else - { - /* connection was on another server */ - Client_Destroy( target, msg, Req->argv[1], false ); + } else { + Client_Destroy(target, msg, Req->argv[1], false); return CONNECTED; } } /* IRC_SQUIT */
1
0
0
0
Alexander Barton : Code cleanup of IRC_DISCONNECT().
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 9a7499af8bb3c4b781492fef216c86cf7ab04134 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=9a7499af…
Author: Alexander Barton <alex(a)barton.de> Date: Sun Apr 13 03:19:29 2008 +0200 Code cleanup of IRC_DISCONNECT(). --- src/ngircd/irc-oper.c | 37 +++++++++++++++++++++++-------------- 1 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 7033031..868d0ad 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex(a)barton.de) + * Copyright (c)2001-2008 Alexander Barton (alex(a)barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -256,34 +256,43 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) } /* IRC_CONNECT */ +/** + * Disconnect (and disable) configured server. + */ GLOBAL bool -IRC_DISCONNECT(CLIENT *Client, REQUEST *Req ) +IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) { - /* Disconnect and disable configured server */ - CONN_ID my_conn; - assert( Client != NULL ); - assert( Req != NULL ); + assert(Client != NULL); + assert(Req != NULL); if (!Check_Oper(Client)) return No_Privileges(Client, Req); /* Bad number of parameters? */ - if( Req->argc != 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + if (Req->argc != 1) + return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, + Client_ID(Client), Req->command); - Log( LOG_NOTICE|LOG_snotice, "Got DISCONNECT command from \"%s\" for0 \"%s\".", Client_Mask( Client ), Req->argv[0]); + Log(LOG_NOTICE | LOG_snotice, + "Got DISCONNECT command from \"%s\" for \"%s\".", + Client_Mask(Client), Req->argv[0]); /* Save ID of this connection */ - my_conn = Client_Conn( Client ); + my_conn = Client_Conn(Client); - /* Connect configured server */ - if( ! Conf_DisableServer( Req->argv[0] )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] ); + /* Disconnect configured server */ + if (!Conf_DisableServer(Req->argv[0])) + return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, + Client_ID(Client), Req->argv[0]); /* Are we still connected or were we killed, too? */ - if( Conn_GetClient( my_conn )) return CONNECTED; - else return DISCONNECTED; -} /* IRC_CONNECT */ + if (Conn_GetClient(my_conn)) + return CONNECTED; + else + return DISCONNECTED; +} /* IRC_DISCONNECT */ GLOBAL bool
1
0
0
0
Alexander Barton : New function IRC_SendWallops().
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: eaaf0c3bd5ce4f48205ca928fba994d0c44e59b2 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=eaaf0c3b…
Author: Alexander Barton <alex(a)barton.de> Date: Tue May 6 15:30:29 2008 +0200 New function IRC_SendWallops(). Implement new global function IRC_SendWallops() that can be called by other functions to generate WALLOPS messages to users with +w mode. --- src/ngircd/irc-oper.c | 26 ++++---------------------- src/ngircd/irc-write.c | 30 +++++++++++++++++++++++++++++- src/ngircd/irc-write.h | 3 +++ 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 868d0ad..aae071b 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -298,8 +298,7 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) GLOBAL bool IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) { - CLIENT *to, *from; - int client_type; + CLIENT *from; assert( Client != NULL ); assert( Req != NULL ); @@ -307,8 +306,7 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) if (Req->argc != 1) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); - client_type = Client_Type(Client); - switch (client_type) { + switch (Client_Type(Client)) { case CLIENT_USER: if (!Client_OperByMe(Client)) return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG, Client_ID(Client)); @@ -324,25 +322,9 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) if (!from) return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix); - for (to=Client_First(); to != NULL; to=Client_Next(to)) { - if (Client_Conn(to) < 0) /* no local connection or WALLOPS origin */ - continue; - - client_type = Client_Type(to); - switch (client_type) { - case CLIENT_USER: - if (Client_HasMode(to, 'w')) - IRC_WriteStrClientPrefix(to, from, "WALLOPS :%s", Req->argv[0]); - break; - case CLIENT_SERVER: - if (to != Client) - IRC_WriteStrClientPrefix(to, from, "WALLOPS :%s", Req->argv[0]); - break; - } - } + IRC_SendWallops(Client, from, Req->argv[0]); return CONNECTED; -} - +} /* IRC_WALLOPS */ /* -eof- */ diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index ea0f5f8..dae78e5 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2005 by Alexander Barton (alex(a)barton.de) + * Copyright (c)2001-2008 Alexander Barton (alex(a)barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -405,6 +405,34 @@ va_dcl } /* IRC_WriteStrRelatedPrefix */ +/** + * Send WALLOPS message. + */ +GLOBAL void +IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Message) +{ + CLIENT *to; + + for (to=Client_First(); to != NULL; to=Client_Next(to)) { + if (Client_Conn(to) == NONE) /* no local connection */ + continue; + + switch (Client_Type(to)) { + case CLIENT_USER: + if (Client_HasMode(to, 'w')) + IRC_WriteStrClientPrefix(to, From, + "WALLOPS :%s", Message); + break; + case CLIENT_SERVER: + if (to != Client) + IRC_WriteStrClientPrefix(to, From, + "WALLOPS :%s", Message); + break; + } + } +} /* IRC_SendWallops */ + + GLOBAL void IRC_SetPenalty( CLIENT *Client, time_t Seconds ) { diff --git a/src/ngircd/irc-write.h b/src/ngircd/irc-write.h index 51c8f0c..5bac0de 100644 --- a/src/ngircd/irc-write.h +++ b/src/ngircd/irc-write.h @@ -35,6 +35,9 @@ GLOBAL void IRC_WriteStrServersPrefixFlag_CB PARAMS((CLIENT *ExceptOf, GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, bool Remote, char *Format, ...)); +GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From, + const char *Message)); + GLOBAL void IRC_SetPenalty PARAMS((CLIENT *Client, time_t Seconds)); #endif
1
0
0
0
Alexander Barton : CONNECT, DISCONNECT: generate WALLOPS messages
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 30b584c2e8632f94312dc9575fccc510a2b437c0 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=30b584c2…
Author: Alexander Barton <alex(a)barton.de> Date: Tue May 6 17:51:45 2008 +0200 CONNECT, DISCONNECT: generate WALLOPS messages --- src/ngircd/irc-oper.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index aae071b..0824149 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -16,6 +16,7 @@ #include "imp.h" #include <assert.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -206,6 +207,7 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) GLOBAL bool IRC_CONNECT(CLIENT * Client, REQUEST * Req) { + char msg[LINE_LEN + 64]; assert(Client != NULL); assert(Req != NULL); @@ -223,6 +225,10 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); + snprintf(msg, sizeof(msg), "Received CONNECT %s from %s", + Req->argv[0], Client_ID(Client)); + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), msg); + Log(LOG_NOTICE | LOG_snotice, "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask(Client), Req->argv[0]); @@ -263,6 +269,7 @@ GLOBAL bool IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) { CONN_ID my_conn; + char msg[LINE_LEN + 64]; assert(Client != NULL); assert(Req != NULL); @@ -275,6 +282,10 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); + snprintf(msg, sizeof(msg), "Received DISCONNECT %s from %s", + Req->argv[0], Client_ID(Client)); + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), msg); + Log(LOG_NOTICE | LOG_snotice, "Got DISCONNECT command from \"%s\" for \"%s\".", Client_Mask(Client), Req->argv[0]);
1
0
0
0
Alexander Barton : IRC_SendWallops(): support format string and variable parameter lists.
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 7d6de7c352f7b91b396cbdb6f2d194e2422b35b3 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=7d6de7c3…
Author: Alexander Barton <alex(a)barton.de> Date: Tue Jul 22 16:54:12 2008 +0200 IRC_SendWallops(): support format string and variable parameter lists. --- src/ngircd/irc-oper.c | 17 +++++++---------- src/ngircd/irc-write.c | 25 ++++++++++++++++++++++--- src/ngircd/irc-write.h | 2 +- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 0824149..544fe67 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -207,8 +207,6 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) GLOBAL bool IRC_CONNECT(CLIENT * Client, REQUEST * Req) { - char msg[LINE_LEN + 64]; - assert(Client != NULL); assert(Req != NULL); @@ -225,9 +223,9 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); - snprintf(msg, sizeof(msg), "Received CONNECT %s from %s", - Req->argv[0], Client_ID(Client)); - IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), msg); + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), + "Received CONNECT %s from %s", + Req->argv[0], Client_ID(Client)); Log(LOG_NOTICE | LOG_snotice, "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask(Client), @@ -269,7 +267,6 @@ GLOBAL bool IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) { CONN_ID my_conn; - char msg[LINE_LEN + 64]; assert(Client != NULL); assert(Req != NULL); @@ -282,9 +279,9 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); - snprintf(msg, sizeof(msg), "Received DISCONNECT %s from %s", - Req->argv[0], Client_ID(Client)); - IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), msg); + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), + "Received DISCONNECT %s from %s", + Req->argv[0], Client_ID(Client)); Log(LOG_NOTICE | LOG_snotice, "Got DISCONNECT command from \"%s\" for \"%s\".", @@ -333,7 +330,7 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) if (!from) return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix); - IRC_SendWallops(Client, from, Req->argv[0]); + IRC_SendWallops(Client, from, "%s", Req->argv[0]); return CONNECTED; } /* IRC_WALLOPS */ diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index dae78e5..9b5b5e2 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -408,11 +408,30 @@ va_dcl /** * Send WALLOPS message. */ +#ifdef PROTOTYPES +GLOBAL void +IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Format, ...) +#else GLOBAL void -IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Message) +IRC_SendWallops(Client, From, Format, va_alist ) +CLIENT *Client; +CLIENT *From; +char *Format; +va_dcl +#endif { + va_list ap; + char msg[1000]; CLIENT *to; +#ifdef PROTOTYPES + va_start(ap, Format); +#else + va_start(ap); +#endif + vsnprintf(msg, 1000, Format, ap); + va_end(ap); + for (to=Client_First(); to != NULL; to=Client_Next(to)) { if (Client_Conn(to) == NONE) /* no local connection */ continue; @@ -421,12 +440,12 @@ IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Message) case CLIENT_USER: if (Client_HasMode(to, 'w')) IRC_WriteStrClientPrefix(to, From, - "WALLOPS :%s", Message); + "WALLOPS :%s", msg); break; case CLIENT_SERVER: if (to != Client) IRC_WriteStrClientPrefix(to, From, - "WALLOPS :%s", Message); + "WALLOPS :%s", msg); break; } } diff --git a/src/ngircd/irc-write.h b/src/ngircd/irc-write.h index 5bac0de..a984997 100644 --- a/src/ngircd/irc-write.h +++ b/src/ngircd/irc-write.h @@ -36,7 +36,7 @@ GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, bool Remote, char *Format, ...)); GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From, - const char *Message)); + const char *Format, ...)); GLOBAL void IRC_SetPenalty PARAMS((CLIENT *Client, time_t Seconds));
1
0
0
0
Alexander Barton : No_Privileges(): handle forwarded messages.
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 45b1a45c979d0418591a1c62204d5a607cf86cde URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=45b1a45c…
Author: Alexander Barton <alex(a)barton.de> Date: Tue Jul 22 18:33:44 2008 +0200 No_Privileges(): handle forwarded messages. --- src/ngircd/irc-oper.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 544fe67..e7dfee6 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -73,10 +73,22 @@ Check_Oper(CLIENT * Client) static bool No_Privileges(CLIENT * Client, REQUEST * Req) { - Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"", - Client_Mask(Client), Req->command); - return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG, - Client_ID(Client)); + CLIENT *from = NULL; + + if (Req->prefix) + from = Client_Search(Req->prefix); + + if (from) { + Log(LOG_NOTICE, "No privileges: client \"%s\" (%s), command \"%s\"", + Req->prefix, Client_Mask(Client), Req->command); + return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG, + Client_ID(from)); + } else { + Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"", + Client_Mask(Client), Req->command); + return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG, + Client_ID(Client)); + } } /* PermissionDenied */
1
0
0
0
Alexander Barton : Check_Oper(): check origin of forwarded messages instead of server.
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 4a3e40bc95e783145855da611fa5944401a9c2c9 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=4a3e40bc…
Author: Alexander Barton <alex(a)barton.de> Date: Tue Jul 22 18:35:35 2008 +0200 Check_Oper(): check origin of forwarded messages instead of server. --- src/ngircd/irc-oper.c | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index e7dfee6..656e959 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -55,11 +55,22 @@ Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg) * Check that the client is an IRC operator allowed to administer this server. */ static bool -Check_Oper(CLIENT * Client) +Check_Oper(CLIENT * Client, REQUEST * Req) { - if (!Client_HasMode(Client, 'o')) + CLIENT *c; + + assert(Client != NULL); + assert(Req != NULL); + + if (Client_Type(Client) == CLIENT_SERVER && Req->prefix) + c = Client_Search(Req->prefix); + else + c = Client; + if (!c) + return false; + if (!Client_HasMode(c, 'o')) return false; - if (!Client_OperByMe(Client) && !Conf_AllowRemoteOper) + if (!Client_OperByMe(c) && !Conf_AllowRemoteOper) return false; /* The client is an local IRC operator, or this server is configured * to trust remote operators. */ @@ -140,7 +151,7 @@ IRC_DIE(CLIENT * Client, REQUEST * Req) assert(Client != NULL); assert(Req != NULL); - if (!Check_Oper(Client)) + if (!Check_Oper(Client, Req)) return No_Privileges(Client, Req); /* Bad number of parameters? */ @@ -180,7 +191,7 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if (!Check_Oper(Client)) + if (!Check_Oper(Client, Req)) return No_Privileges(Client, Req); /* Bad number of parameters? */ @@ -201,7 +212,7 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if (!Check_Oper(Client)) + if (!Check_Oper(Client, Req)) return No_Privileges(Client, Req); /* Bad number of parameters? */ @@ -222,7 +233,7 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) assert(Client != NULL); assert(Req != NULL); - if (!Check_Oper(Client)) + if (!Check_Oper(Client, Req)) return No_Privileges(Client, Req); /* Bad number of parameters? */ @@ -283,7 +294,7 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) assert(Client != NULL); assert(Req != NULL); - if (!Check_Oper(Client)) + if (!Check_Oper(Client, Req)) return No_Privileges(Client, Req); /* Bad number of parameters? */
1
0
0
0
Alexander Barton : Allow forwarding of CONNECT commands.
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: 113bd34878c17f730d8fb878157b0dbba9380326 URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=113bd348…
Author: Alexander Barton <alex(a)barton.de> Date: Tue Jul 22 18:38:05 2008 +0200 Allow forwarding of CONNECT commands. The syntax of the CONNECT command now is: - CONNECT <server-id> - CONNECT <server-id> <port> - CONNECT <server-id> <port> <target> - CONNECT <server-id> <port> <host> <my-pwd> <peer-pwd> - CONNECT <server-id> <port> <host> <my-pwd> <peer-pwd> <target> Note: the configuration option "AllowRemoteOper" mus be enabled on the target server to allow forwarding of CONNECT commands. --- src/ngircd/irc-oper.c | 61 ++++++++++++++++++++++++++++++++++++++---------- src/ngircd/parse.c | 2 +- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 656e959..f67e947 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -230,6 +230,8 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) GLOBAL bool IRC_CONNECT(CLIENT * Client, REQUEST * Req) { + CLIENT *from, *target; + assert(Client != NULL); assert(Req != NULL); @@ -237,7 +239,8 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) return No_Privileges(Client, Req); /* Bad number of parameters? */ - if ((Req->argc != 1) && (Req->argc != 2) && (Req->argc != 5)) + if (Req->argc != 1 && Req->argc != 2 && Req->argc != 3 && + Req->argc != 5 && Req->argc != 6) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); @@ -246,36 +249,68 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command); - IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), - "Received CONNECT %s from %s", - Req->argv[0], Client_ID(Client)); + from = Client; + target = Client_ThisServer(); + + if (Req->argc == 3 || Req->argc == 6) { + /* This CONNECT has a target parameter */ + if (Client_Type(Client) == CLIENT_SERVER) + from = Client_Search(Req->prefix); + if (! from) + return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, + Client_ID(Client), Req->prefix); + + target = (Req->argc == 3) ? Client_Search(Req->argv[2]) + : Client_Search(Req->argv[5]); + if (! target || Client_Type(target) != CLIENT_SERVER) + return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, + Client_ID(from), Req->argv[0]); + } + + if (target != Client_ThisServer()) { + /* Forward CONNECT command ... */ + if (Req->argc == 3) + IRC_WriteStrClientPrefix(target, from, + "CONNECT %s %s :%s", Req->argv[0], + Req->argv[1], Req->argv[2]); + else + IRC_WriteStrClientPrefix(target, from, + "CONNECT %s %s %s %s %s :%s", Req->argv[0], + Req->argv[1], Req->argv[2], Req->argv[3], + Req->argv[4], Req->argv[5]); + return CONNECTED; + } Log(LOG_NOTICE | LOG_snotice, - "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask(Client), + "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)); switch (Req->argc) { case 1: if (!Conf_EnablePassiveServer(Req->argv[0])) - return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, - Client_ID(Client), + return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, + Client_ID(from), Req->argv[0]); - break; + break; case 2: + case 3: /* Connect configured server */ if (!Conf_EnableServer (Req->argv[0], (UINT16) atoi(Req->argv[1]))) - return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, - Client_ID(Client), + return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, + Client_ID(from), Req->argv[0]); - break; + break; default: /* Add server */ if (!Conf_AddServer (Req->argv[0], (UINT16) atoi(Req->argv[1]), Req->argv[2], Req->argv[3], Req->argv[4])) - return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, - Client_ID(Client), + return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, + Client_ID(from), Req->argv[0]); } diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 5e3f08d..6d53525 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -59,7 +59,7 @@ static COMMAND My_Commands[] = { { "ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 }, { "AWAY", IRC_AWAY, CLIENT_USER, 0, 0, 0 }, - { "CONNECT", IRC_CONNECT, CLIENT_USER, 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, 0xFFFF, 0, 0, 0 },
1
0
0
0
Alexander Barton : New configuration option "AllowRemoteOper"
by alex@arthur.barton.de
30 Sep '09
30 Sep '09
Module: ngircd.git Branch: master Commit: f78b0c61e967c66386803a3dc77069c66bd664de URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=f78b0c61…
Author: Alexander Barton <alex(a)barton.de> Date: Sun Apr 13 16:39:08 2008 +0200 New configuration option "AllowRemoteOper" Added new configuration option "AllowRemoteOper" to control whether remote IRC operators are allowed to use administrative commands that affect this server or not This commit introduces the configuration variable, but actually no function is using it. That's up for the next patches to come ... --- doc/sample-ngircd.conf | 4 ++ man/ngircd.conf.5.tmpl | 5 +++ src/ngircd/conf.c | 94 +++++++++++++++++++++++++++--------------------- src/ngircd/conf.h | 13 ++++--- 4 files changed, 70 insertions(+), 46 deletions(-) diff --git a/doc/sample-ngircd.conf b/doc/sample-ngircd.conf index 0d0061b..b945224 100644 --- a/doc/sample-ngircd.conf +++ b/doc/sample-ngircd.conf @@ -115,6 +115,10 @@ # server? (This is a compatibility hack for ircd-irc2 servers) ;OperServerMode = no + # Are remote IRC operators allowed to control this server, e. g. + # use commands like CONNECT, SQUIT, DIE, ...? + ;AllowRemoteOper = no + # Allow Pre-Defined Channels only (see Section [Channels]) ;PredefChannelsOnly = no diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl index a725af6..d9e6f46 100644 --- a/man/ngircd.conf.5.tmpl +++ b/man/ngircd.conf.5.tmpl @@ -179,6 +179,11 @@ If \fBOperCanUseMode\fR is enabled, this may lead the compatibility problems wit Servers that run the ircd-irc2 Software. This Option "masks" mode requests by non-chanops as if they were coming from the server. Default: no. .TP +\fBAllowRemoteOper\fR +Are IRC operators connected to remote servers allowed to control this server, +e. g. are they allowed to use administrative commands like CONNECT, DIE, +SQUIT, ... that affect this server? Default: no. +.TP \fBPredefChannelsOnly\fR If enabled, no new channels can be created. Useful if you do not want to have channels other than those defined in diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index c50f8f9..c728d55 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -263,7 +263,6 @@ Conf_Test( void ) printf( " PidFile = %s\n", Conf_PidFile); printf(" Listen = %s\n", Conf_ListenAddress); fputs(" Ports = ", stdout); - ports_puts(&Conf_ListenPorts); #ifdef SSL_SUPPORT fputs(" SSLPorts = ", stdout); @@ -272,29 +271,34 @@ Conf_Test( void ) config_valid = false; #endif - pwd = getpwuid( Conf_UID ); - if( pwd ) printf( " ServerUID = %s\n", pwd->pw_name ); - else printf( " ServerUID = %ld\n", (long)Conf_UID ); - grp = getgrgid( Conf_GID ); - if( grp ) printf( " ServerGID = %s\n", grp->gr_name ); - else printf( " ServerGID = %ld\n", (long)Conf_GID ); - printf( " PingTimeout = %d\n", Conf_PingTimeout ); - printf( " PongTimeout = %d\n", Conf_PongTimeout ); - printf( " ConnectRetry = %d\n", Conf_ConnectRetry ); - printf( " OperCanUseMode = %s\n", yesno_to_str(Conf_OperCanMode)); - printf( " OperServerMode = %s\n", yesno_to_str(Conf_OperServerMode)); - printf( " PredefChannelsOnly = %s\n", yesno_to_str(Conf_PredefChannelsOnly)); - printf( " NoDNS = %s\n", yesno_to_str(Conf_NoDNS)); - printf( " NoIdent = %s\n", yesno_to_str(Conf_NoIdent)); + pwd = getpwuid(Conf_UID); + if (pwd) + printf(" ServerUID = %s\n", pwd->pw_name); + else + printf(" ServerUID = %ld\n", (long)Conf_UID); + grp = getgrgid(Conf_GID); + if (grp) + printf(" ServerGID = %s\n", grp->gr_name); + else + printf(" ServerGID = %ld\n", (long)Conf_GID); + printf(" PingTimeout = %d\n", Conf_PingTimeout); + printf(" PongTimeout = %d\n", Conf_PongTimeout); + printf(" ConnectRetry = %d\n", Conf_ConnectRetry); + printf(" OperCanUseMode = %s\n", yesno_to_str(Conf_OperCanMode)); + printf(" OperServerMode = %s\n", yesno_to_str(Conf_OperServerMode)); + printf(" AllowRemoteOper = %s\n", yesno_to_str(Conf_AllowRemoteOper)); + printf(" PredefChannelsOnly = %s\n", yesno_to_str(Conf_PredefChannelsOnly)); + printf(" NoDNS = %s\n", yesno_to_str(Conf_NoDNS)); + printf(" NoIdent = %s\n", yesno_to_str(Conf_NoIdent)); #ifdef WANT_IPV6 printf(" ConnectIPv4 = %s\n", yesno_to_str(Conf_ConnectIPv6)); printf(" ConnectIPv6 = %s\n", yesno_to_str(Conf_ConnectIPv4)); #endif - printf( " MaxConnections = %ld\n", Conf_MaxConnections); - printf( " MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP); - printf( " MaxJoins = %d\n", Conf_MaxJoins>0 ? Conf_MaxJoins : -1); - printf( " MaxNickLength = %u\n\n", Conf_MaxNickLength - 1); + printf(" MaxConnections = %ld\n", Conf_MaxConnections); + printf(" MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP); + printf(" MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1); + printf(" MaxNickLength = %u\n\n", Conf_MaxNickLength - 1); for( i = 0; i < Conf_Oper_Count; i++ ) { if( ! Conf_Oper[i].name[0] ) continue; @@ -511,47 +515,47 @@ Conf_IsService(int ConfServer, const char *Nick) } /* Conf_IsService */ +/** + * Initialize configuration settings with their default values. + */ static void -Set_Defaults( bool InitServers ) +Set_Defaults(bool InitServers) { - /* Initialize configuration variables with default values. */ - int i; - strcpy( Conf_ServerName, "" ); - snprintf( Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s", PACKAGE_NAME, PACKAGE_VERSION ); - strcpy( Conf_ServerPwd, "" ); - - strcpy( Conf_ServerAdmin1, "" ); - strcpy( Conf_ServerAdmin2, "" ); - strcpy( Conf_ServerAdminMail, "" ); - - strlcpy( Conf_MotdFile, SYSCONFDIR, sizeof( Conf_MotdFile )); - strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile )); + strcpy(Conf_ServerName, ""); + snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s", + PACKAGE_NAME, PACKAGE_VERSION); + strcpy(Conf_ServerPwd, ""); - strlcpy( Conf_MotdPhrase, MOTD_PHRASE, sizeof( Conf_MotdPhrase )); + strcpy(Conf_ServerAdmin1, ""); + strcpy(Conf_ServerAdmin2, ""); + strcpy(Conf_ServerAdminMail, ""); - strlcpy( Conf_Chroot, CHROOT_DIR, sizeof( Conf_Chroot )); + strlcpy(Conf_MotdFile, SYSCONFDIR, sizeof(Conf_MotdFile)); + strlcat(Conf_MotdFile, MOTD_FILE, sizeof(Conf_MotdFile)); + strlcpy(Conf_MotdPhrase, MOTD_PHRASE, sizeof(Conf_MotdPhrase)); - strlcpy( Conf_PidFile, PID_FILE, sizeof( Conf_PidFile )); + Conf_UID = Conf_GID = 0; + strlcpy(Conf_Chroot, CHROOT_DIR, sizeof(Conf_Chroot)); + strlcpy(Conf_PidFile, PID_FILE, sizeof(Conf_PidFile)); free(Conf_ListenAddress); Conf_ListenAddress = NULL; - Conf_UID = Conf_GID = 0; Conf_PingTimeout = 120; Conf_PongTimeout = 20; - Conf_ConnectRetry = 60; + Conf_NoDNS = false; + Conf_NoIdent = false; Conf_Oper_Count = 0; Conf_Channel_Count = 0; Conf_OperCanMode = false; - Conf_NoDNS = false; - Conf_NoIdent = false; - Conf_PredefChannelsOnly = false; Conf_OperServerMode = false; + Conf_AllowRemoteOper = false; + Conf_PredefChannelsOnly = false; Conf_ConnectIPv4 = true; Conf_ConnectIPv6 = true; @@ -562,7 +566,10 @@ Set_Defaults( bool InitServers ) Conf_MaxNickLength = CLIENT_NICK_LEN_DEFAULT; /* Initialize server configuration structures */ - if( InitServers ) for( i = 0; i < MAX_SERVERS; Init_Server_Struct( &Conf_Server[i++] )); + if (InitServers) { + for (i = 0; i < MAX_SERVERS; + Init_Server_Struct(&Conf_Server[i++])); + } } /* Set_Defaults */ @@ -974,6 +981,11 @@ Handle_GLOBAL( int Line, char *Var, char *Arg ) Conf_OperServerMode = Check_ArgIsTrue( Arg ); return; } + if(strcasecmp(Var, "AllowRemoteOper") == 0) { + /* Are remote IRC operators allowed to control this server? */ + Conf_AllowRemoteOper = Check_ArgIsTrue(Arg); + return; + } if( strcasecmp( Var, "MaxConnections" ) == 0 ) { /* Maximum number of connections. 0 -> "no limit". */ #ifdef HAVE_ISDIGIT diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h index 9bdecde..2308e4c 100644 --- a/src/ngircd/conf.h +++ b/src/ngircd/conf.h @@ -140,6 +140,14 @@ GLOBAL bool Conf_PredefChannelsOnly; /* Are IRC operators allowed to always use MODE? */ GLOBAL bool Conf_OperCanMode; +/* If an IRC op gives chanop privileges without being a chanop, + * ircd2 will ignore the command. This enables a workaround: + * It masks the command as coming from the server */ +GLOBAL bool Conf_OperServerMode; + +/* Are remote IRC operators allowed to manage this server? */ +GLOBAL bool Conf_AllowRemoteOper; + /* Disable all DNS functions? */ GLOBAL bool Conf_NoDNS; @@ -155,11 +163,6 @@ GLOBAL bool Conf_ConnectIPv6; /* same as above, but for ipv4 hosts, default: yes */ GLOBAL bool Conf_ConnectIPv4; -/* If an IRC op gives chanop privileges without being a chanop, - * ircd2 will ignore the command. This enables a workaround: - * It masks the command as coming from the server */ -GLOBAL bool Conf_OperServerMode; - /* Maximum number of connections to this server */ GLOBAL long Conf_MaxConnections;
1
0
0
0
Florian Westphal : fix assertion failure in ng_ipaddr.c
by fw@arthur.barton.de
26 Sep '09
26 Sep '09
Module: ngircd.git Branch: master Commit: fa09883c72855768a0f827a330097bf3dc5c839e URL:
http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=fa09883c…
Author: Florian Westphal <fw(a)strlen.de> Date: Sat Sep 26 11:12:47 2009 +0200 fix assertion failure in ng_ipaddr.c when building with debugging enabled, but without ipv6 support, ngircd dumped core when loading a config file that specified an ipv6 listen address. ngircd: ng_ipaddr.c:45: ng_ipaddr_init: Assertion `sizeof(*addr) >= res0->ai_addrlen' failed. --- src/ipaddr/ng_ipaddr.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/ipaddr/ng_ipaddr.c b/src/ipaddr/ng_ipaddr.c index 4f1d4ca..af524d0 100644 --- a/src/ipaddr/ng_ipaddr.c +++ b/src/ipaddr/ng_ipaddr.c @@ -30,6 +30,9 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; +#ifndef WANT_IPV6 /* do not convert ipv6 addresses */ + hints.ai_family = AF_INET; +#endif /* some getaddrinfo implementations require that ai_socktype is set. */ hints.ai_socktype = SOCK_STREAM; @@ -38,7 +41,6 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) snprintf(portstr, sizeof(portstr), "%u", (unsigned int) port); ret = getaddrinfo(ip_str, portstr, &hints, &res0); - assert(ret == 0); if (ret != 0) return false;
1
0
0
0
← Neuer
1
...
153
154
155
156
157
158
159
...
245
Älter →
Springe zur Seite:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
Ergebnisse pro Seite:
10
25
50
100
200