From 02e13326cf736d24542544f673580e689f377bb8 Mon Sep 17 00:00:00 2001 From: Valery Yatsko Date: Sun, 8 Jun 2008 12:23:04 +0430 Subject: [PATCH 1/5] We've done ssl stuff generation tool, 'module engine rework' marked for current trunk --- TODO | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index c1aa49b..b2ef04d 100644 --- a/TODO +++ b/TODO @@ -18,19 +18,19 @@ [x] ssl usermode (+Z) [x] ssl channelmode (done by extban and chm_compat) [ ] acknowledgement message for SSL users like '* *** You are connected using SSL cipher "DHE RSA-AES 128 CBC-SHA"' - [ ] ssl stuff files generator in ./configure time + [x] tool for generating ssl certificates and other stuff [x] merge some stuff from ircd-seven directly (to be determined what) [x] remote d:lines support [F] kline/xline/resv sync [F] make an ability of using bandb instead of .conf files as bans storage [/] drop non-TS6 (legacy protocol) support [F] Doxygen code documentation -[F] module engine rework - [F] more beautiful way of adding new channel modes by module - [F] make nick/user/host validation functions/match tables able to work in separated modules, +[ ] module engine rework + [ ] more beautiful way of adding new channel modes by module + [ ] make nick/user/host validation functions/match tables able to work in separated modules, this will help us making support for native characters sets/slashes in host etc - [F] auth checker module - [F] resolver module + [ ] auth checker module + [ ] resolver module [x] Remove glines entirely --- other stuff [?] PASS selector:password for auth{} from ircd-seven? (useful for dynamic IPs) From 6d18bf1a12bfc8c49579f818c7b9c43301a2817d Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 11 Jun 2008 00:28:08 +0200 Subject: [PATCH 2/5] Some const stuff for m_set. --- include/s_newconf.h | 2 +- modules/m_set.c | 8 ++++---- src/s_newconf.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/s_newconf.h b/include/s_newconf.h index 5d8b7e9..402887e 100644 --- a/include/s_newconf.h +++ b/include/s_newconf.h @@ -236,7 +236,7 @@ extern struct server_conf *find_server_conf(const char *name); extern void attach_server_conf(struct Client *, struct server_conf *); extern void detach_server_conf(struct Client *); -extern void set_server_conf_autoconn(struct Client *source_p, char *name, +extern void set_server_conf_autoconn(struct Client *source_p, const char *name, int newval); diff --git a/modules/m_set.c b/modules/m_set.c index dfa7a8e..9a4bf64 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -65,7 +65,7 @@ struct SetStruct static void quote_adminstring(struct Client *, const char *); -static void quote_autoconn(struct Client *, char *, int); +static void quote_autoconn(struct Client *, const char *, int); static void quote_autoconnall(struct Client *, int); static void quote_floodcount(struct Client *, int); static void quote_identtimeout(struct Client *, int); @@ -73,7 +73,7 @@ static void quote_max(struct Client *, int); static void quote_operstring(struct Client *, const char *); static void quote_spamnum(struct Client *, int); static void quote_spamtime(struct Client *, int); -static void quote_splitmode(struct Client *, char *); +static void quote_splitmode(struct Client *, const char *); static void quote_splitnum(struct Client *, int); static void quote_splitusers(struct Client *, int); static void list_quote_commands(struct Client *); @@ -143,7 +143,7 @@ list_quote_commands(struct Client *source_p) /* SET AUTOCONN */ static void -quote_autoconn(struct Client *source_p, char *arg, int newval) +quote_autoconn(struct Client *source_p, const char *arg, int newval) { set_server_conf_autoconn(source_p, arg, newval); } @@ -356,7 +356,7 @@ static const char *splitmode_status[] = { /* SET SPLITMODE */ static void -quote_splitmode(struct Client *source_p, char *charval) +quote_splitmode(struct Client *source_p, const char *charval) { if(charval) { diff --git a/src/s_newconf.c b/src/s_newconf.c index fa51336..1c3c019 100644 --- a/src/s_newconf.c +++ b/src/s_newconf.c @@ -488,7 +488,7 @@ detach_server_conf(struct Client *client_p) } void -set_server_conf_autoconn(struct Client *source_p, char *name, int newval) +set_server_conf_autoconn(struct Client *source_p, const char *name, int newval) { struct server_conf *server_p; From 4cb8529c19d31b2a5a8e1dae529b6492a0dda6b5 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 11 Jun 2008 00:39:01 +0200 Subject: [PATCH 3/5] m_set: get rid of function pointers with unspecified parameter lists --- modules/m_set.c | 69 +++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/modules/m_set.c b/modules/m_set.c index 9a4bf64..88e079a 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -55,7 +55,7 @@ DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 3406 $"); struct SetStruct { const char *name; - void (*handler) (); + void (*handler)(struct Client *source_p, const char *chararg, int intarg); int wants_char; /* 1 if it expects (char *, [int]) */ int wants_int; /* 1 if it expects ([char *], int) */ @@ -64,18 +64,19 @@ struct SetStruct }; -static void quote_adminstring(struct Client *, const char *); +static void quote_adminstring(struct Client *, const char *, int); static void quote_autoconn(struct Client *, const char *, int); -static void quote_autoconnall(struct Client *, int); -static void quote_floodcount(struct Client *, int); -static void quote_identtimeout(struct Client *, int); -static void quote_max(struct Client *, int); -static void quote_operstring(struct Client *, const char *); -static void quote_spamnum(struct Client *, int); -static void quote_spamtime(struct Client *, int); -static void quote_splitmode(struct Client *, const char *); -static void quote_splitnum(struct Client *, int); -static void quote_splitusers(struct Client *, int); +static void quote_autoconnall(struct Client *, const char *, int); +static void quote_floodcount(struct Client *, const char *, int); +static void quote_identtimeout(struct Client *, const char *, int); +static void quote_max(struct Client *, const char *, int); +static void quote_operstring(struct Client *, const char *, int); +static void quote_spamnum(struct Client *, const char *, int); +static void quote_spamtime(struct Client *, const char *, int); +static void quote_splitmode(struct Client *, const char *, int); +static void quote_splitnum(struct Client *, const char *, int); +static void quote_splitusers(struct Client *, const char *, int); + static void list_quote_commands(struct Client *); @@ -104,7 +105,7 @@ static struct SetStruct set_cmd_table[] = { {"SPLITNUM", quote_splitnum, 0, 1 }, {"SPLITUSERS", quote_splitusers, 0, 1 }, /* -------------------------------------------------------- */ - {(char *) 0, (void (*)()) 0, 0, 0} + {(char *) 0, (void (*)(struct Client *, const char *, int)) 0, 0, 0} }; @@ -150,7 +151,7 @@ quote_autoconn(struct Client *source_p, const char *arg, int newval) /* SET AUTOCONNALL */ static void -quote_autoconnall(struct Client *source_p, int newval) +quote_autoconnall(struct Client *source_p, const char *arg, int newval) { if(newval >= 0) { @@ -169,7 +170,7 @@ quote_autoconnall(struct Client *source_p, int newval) /* SET FLOODCOUNT */ static void -quote_floodcount(struct Client *source_p, int newval) +quote_floodcount(struct Client *source_p, const char *arg, int newval) { if(newval >= 0) { @@ -187,7 +188,7 @@ quote_floodcount(struct Client *source_p, int newval) /* SET IDENTTIMEOUT */ static void -quote_identtimeout(struct Client *source_p, int newval) +quote_identtimeout(struct Client *source_p, const char *arg, int newval) { if(!IsOperAdmin(source_p)) { @@ -210,7 +211,7 @@ quote_identtimeout(struct Client *source_p, int newval) /* SET MAX */ static void -quote_max(struct Client *source_p, int newval) +quote_max(struct Client *source_p, const char *arg, int newval) { if(newval > 0) { @@ -248,7 +249,7 @@ quote_max(struct Client *source_p, int newval) /* SET OPERSTRING */ static void -quote_operstring(struct Client *source_p, const char *arg) +quote_operstring(struct Client *source_p, const char *arg, int newval) { if(EmptyString(arg)) { @@ -267,7 +268,7 @@ quote_operstring(struct Client *source_p, const char *arg) /* SET ADMINSTRING */ static void -quote_adminstring(struct Client *source_p, const char *arg) +quote_adminstring(struct Client *source_p, const char *arg, int newval) { if(EmptyString(arg)) { @@ -286,7 +287,7 @@ quote_adminstring(struct Client *source_p, const char *arg) /* SET SPAMNUM */ static void -quote_spamnum(struct Client *source_p, int newval) +quote_spamnum(struct Client *source_p, const char *arg, int newval) { if(newval > 0) { @@ -316,7 +317,7 @@ quote_spamnum(struct Client *source_p, int newval) /* SET SPAMTIME */ static void -quote_spamtime(struct Client *source_p, int newval) +quote_spamtime(struct Client *source_p, const char *arg, int newval) { if(newval > 0) { @@ -356,7 +357,7 @@ static const char *splitmode_status[] = { /* SET SPLITMODE */ static void -quote_splitmode(struct Client *source_p, const char *charval) +quote_splitmode(struct Client *source_p, const char *charval, int intval) { if(charval) { @@ -416,7 +417,7 @@ quote_splitmode(struct Client *source_p, const char *charval) /* SET SPLITNUM */ static void -quote_splitnum(struct Client *source_p, int newval) +quote_splitnum(struct Client *source_p, const char *arg, int newval) { if(newval >= 0) { @@ -433,7 +434,7 @@ quote_splitnum(struct Client *source_p, int newval) /* SET SPLITUSERS */ static void -quote_splitusers(struct Client *source_p, int newval) +quote_splitusers(struct Client *source_p, const char *arg, int newval) { if(newval >= 0) { @@ -534,24 +535,8 @@ mo_set(struct Client *client_p, struct Client *source_p, int parc, const char *p else newval = -1; - if(set_cmd_table[i].wants_char) - { - if(set_cmd_table[i].wants_int) - set_cmd_table[i].handler(source_p, arg, newval); - else - set_cmd_table[i].handler(source_p, arg); - return 0; - } - else - { - if(set_cmd_table[i].wants_int) - set_cmd_table[i].handler(source_p, newval); - else - /* Just in case someone actually wants a - * set function that takes no args.. *shrug* */ - set_cmd_table[i].handler(source_p); - return 0; - } + set_cmd_table[i].handler(source_p, arg, newval); + return 0; } } From 4a4ea261b210895cedcc183ab9e07cf1fdcd20d1 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 11 Jun 2008 00:53:21 +0200 Subject: [PATCH 4/5] m_stats: get rid of function pointers with unspecified parameter lists stats l/L is now more a special case than before --- modules/m_stats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/m_stats.c b/modules/m_stats.c index 45b9b38..c013c99 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -81,12 +81,12 @@ static void stats_p_spy(struct Client *); struct StatsStruct { char letter; - void (*handler) (); + void (*handler) (struct Client *source_p); int need_oper; int need_admin; }; -static void stats_dns_servers (struct Client *); +static void stats_dns_servers(struct Client *); static void stats_delay(struct Client *); static void stats_hash(struct Client *); static void stats_connect(struct Client *); @@ -142,8 +142,8 @@ static struct StatsStruct stats_cmd_table[] = { {'I', stats_auth, 0, 0, }, {'k', stats_tklines, 0, 0, }, {'K', stats_klines, 0, 0, }, - {'l', stats_ltrace, 0, 0, }, - {'L', stats_ltrace, 0, 0, }, + {'l', NULL /* special */, 0, 0, }, + {'L', NULL /* special */, 0, 0, }, {'m', stats_messages, 0, 0, }, {'M', stats_messages, 0, 0, }, {'n', stats_dnsbl, 0, 0, }, @@ -211,7 +211,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char * if((statchar != 'L') && (statchar != 'l')) stats_spy(source_p, statchar, NULL); - for (i = 0; stats_cmd_table[i].handler; i++) + for (i = 0; stats_cmd_table[i].letter; i++) { if(stats_cmd_table[i].letter == statchar) { @@ -234,7 +234,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char * /* Blah, stats L needs the parameters, none of the others do.. */ if(statchar == 'L' || statchar == 'l') - stats_cmd_table[i].handler (source_p, parc, parv); + stats_ltrace (source_p, parc, parv); else stats_cmd_table[i].handler (source_p); } From b9f46fc5fac60ea483eb487568fc47cc6a02bc63 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 11 Jun 2008 00:54:02 +0200 Subject: [PATCH 5/5] Get rid of some K&R style function declarations for conf parser. --- src/ircd_parser.y | 4 ++-- src/s_conf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ircd_parser.y b/src/ircd_parser.y index dbb834f..1da9398 100644 --- a/src/ircd_parser.y +++ b/src/ircd_parser.y @@ -25,9 +25,9 @@ #define YY_NO_UNPUT -int yyparse(); +int yyparse(void); int yyerror(const char *); -int yylex(); +int yylex(void); static time_t conf_find_time(char*); diff --git a/src/s_conf.c b/src/s_conf.c index 19f9f3e..a0060d2 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -50,7 +50,7 @@ struct config_server_hide ConfigServerHide; -extern int yyparse(); /* defined in y.tab.c */ +extern int yyparse(void); /* defined in y.tab.c */ extern char linebuf[]; #ifndef INADDR_NONE