From 3f7039934ff24cb8683a127df36935eca4070880 Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Sat, 26 Mar 2016 19:21:16 -0500 Subject: [PATCH 01/10] s_auth: remove trailing whitespace at end of usernames. --- ircd/s_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ircd/s_auth.c b/ircd/s_auth.c index c30b9e14..eb4578f2 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -545,7 +545,7 @@ read_auth_reply(rb_fde_t *F, void *data) for (count = USERLEN; *s && count; s++) { - if(*s == '@') + if(*s == '@' || *s == '\r' || *s == '\n') { break; } From 909346edb743113184be4ea48930a1ab635df43a Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Sun, 27 Mar 2016 06:13:11 -0400 Subject: [PATCH 02/10] ssld: Remove left over function --- ssld/ssld.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/ssld/ssld.c b/ssld/ssld.c index 6eb942c2..226ee8fa 100644 --- a/ssld/ssld.c +++ b/ssld/ssld.c @@ -824,31 +824,6 @@ process_stats(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb) mod_cmd_write_queue(ctl, outstat, strlen(outstat) + 1); /* +1 is so we send the \0 as well */ } -static void -change_connid(mod_ctl_t *ctl, mod_ctl_buf_t *ctlb) -{ - uint32_t id = buf_to_uint32(&ctlb->buf[1]); - uint32_t newid = buf_to_uint32(&ctlb->buf[5]); - conn_t *conn = conn_find_by_id(id); - lrb_assert(conn != NULL); - if(conn == NULL) - { - uint8_t buf[256]; - int len; - - buf[0] = 'D'; - uint32_to_buf(&buf[1], newid); - sprintf((char *) &buf[5], "connid %d does not exist", id); - len = (strlen((char *) &buf[5]) + 1) + 5; - mod_cmd_write_queue(ctl, buf, len); - - return; - } - rb_dlinkDelete(&conn->node, connid_hash(conn->id)); - SetZipSSL(conn); - conn->id = newid; -} - #ifdef HAVE_LIBZ static void zlib_process(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb) From aa7eff28f2a3e767dd0679d4fe7f99dc5e94c6b2 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Sun, 27 Mar 2016 06:29:10 -0400 Subject: [PATCH 03/10] hash.c: Save some more bytes --- include/hash.h | 2 +- ircd/hash.c | 6 +++--- modules/core/m_join.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hash.h b/include/hash.h index aa0ef79e..88bf7a54 100644 --- a/include/hash.h +++ b/include/hash.h @@ -82,7 +82,7 @@ extern void add_to_id_hash(const char *, struct Client *); extern void del_from_id_hash(const char *name, struct Client *client); extern struct Client *find_id(const char *name); -extern struct Channel *get_or_create_channel(struct Client *client_p, const char *chname, int *isnew); +extern struct Channel *get_or_create_channel(struct Client *client_p, const char *chname, bool *isnew); extern void del_from_channel_hash(const char *name, struct Channel *chan); extern struct Channel *find_channel(const char *name); diff --git a/ircd/hash.c b/ircd/hash.c index 0d3fb128..4341dbbd 100644 --- a/ircd/hash.c +++ b/ircd/hash.c @@ -405,7 +405,7 @@ find_channel(const char *name) * block, if it didn't exist before). */ struct Channel * -get_or_create_channel(struct Client *client_p, const char *chname, int *isnew) +get_or_create_channel(struct Client *client_p, const char *chname, bool *isnew) { struct Channel *chptr; int len; @@ -434,12 +434,12 @@ get_or_create_channel(struct Client *client_p, const char *chname, int *isnew) if (chptr != NULL) { if (isnew != NULL) - *isnew = 0; + *isnew = false; return chptr; } if(isnew != NULL) - *isnew = 1; + *isnew = true; chptr = allocate_channel(s); chptr->channelts = rb_current_time(); /* doesn't hurt to set it here */ diff --git a/modules/core/m_join.c b/modules/core/m_join.c index 4018ff82..e83b564b 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -395,7 +395,7 @@ ms_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ static struct Mode mode; time_t oldts; time_t newts; - int isnew; + bool isnew; bool keep_our_modes = true; rb_dlink_node *ptr, *next_ptr; @@ -512,7 +512,7 @@ ms_sjoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source bool keep_our_modes = true; bool keep_new_modes = true; int fl; - int isnew; + bool isnew; int mlen_uid; int len_uid; int len; From 33d43d4fa4baf6e1e9089e4d281e27198f3bba84 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Sun, 27 Mar 2016 20:05:38 -0400 Subject: [PATCH 04/10] ircd: Move signaled variables to volatile sig_atomic_t --- include/ircd.h | 6 +++--- ircd/ircd.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ircd.h b/include/ircd.h index d268efe6..f61afeef 100644 --- a/include/ircd.h +++ b/include/ircd.h @@ -65,9 +65,9 @@ extern const unsigned long int datecode; extern const char *ircd_version; extern const char *logFileName; extern const char *pidFileName; -extern bool dorehash; -extern bool dorehashbans; -extern bool doremotd; +extern volatile sig_atomic_t dorehash; +extern volatile sig_atomic_t dorehashbans; +extern volatile sig_atomic_t doremotd; extern bool kline_queued; extern bool server_state_foreground; extern bool opers_see_all_users; /* sno_farconnect.so loaded, operspy without diff --git a/ircd/ircd.c b/ircd/ircd.c index 8a16ffa4..0a89121f 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -95,9 +95,9 @@ rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */ rb_dlink_list oper_list; /* network opers */ char **myargv; -bool dorehash = false; -bool dorehashbans = false; -bool doremotd = false; +volatile sig_atomic_t dorehash = false; +volatile sig_atomic_t dorehashbans = false; +volatile sig_atomic_t doremotd = false; bool kline_queued = false; bool server_state_foreground = false; bool opers_see_all_users = false; From fef6857e3f2e63af00d9716af14cc78afdf71eff Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Mon, 28 Mar 2016 03:05:16 +0100 Subject: [PATCH 05/10] extensions: Fix duplicate extban character usage extb_usermode and extb_hostmask both use the same extban character ('m'), resulting in only one of the modules being usable (depending on module load order) and neither one functioning if one of them is unloaded. This changes the character for extb_usermode from 'm' to 'u'. [ci skip] --- extensions/extb_usermode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/extb_usermode.c b/extensions/extb_usermode.c index a8acc0a2..87cba51e 100644 --- a/extensions/extb_usermode.c +++ b/extensions/extb_usermode.c @@ -26,7 +26,7 @@ DECLARE_MODULE_AV2(extb_usermode, _modinit, _moddeinit, NULL, NULL, NULL, NULL, static int _modinit(void) { - extban_table['m'] = eb_usermode; + extban_table['u'] = eb_usermode; return 0; } @@ -34,7 +34,7 @@ _modinit(void) static void _moddeinit(void) { - extban_table['m'] = NULL; + extban_table['u'] = NULL; } static int eb_usermode(const char *data, struct Client *client_p, From 6c5fa2f6b3de54e98ed054c58e572782758027c5 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Mon, 28 Mar 2016 03:28:07 +0100 Subject: [PATCH 06/10] Document extb_usermode module [ci skip] --- doc/reference.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/reference.conf b/doc/reference.conf index 5c9bd0b5..3526c739 100644 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -61,6 +61,7 @@ * Realname (gecos) bans (+b $r:mask) -- extb_realname * Server bans (+b $s:mask) -- extb_server * SSL bans (+b $z) -- extb_ssl + * User mode bans (+b $u:modes) -- extb_usermode * Helpops system (umode +H) -- helpops * HURT system -- hurt * New host mangling (umode +x) -- ip_cloaking_4.0 From ed2efe76645ea497a04d852581b98a39dedef7c3 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Mon, 28 Mar 2016 03:29:57 +0100 Subject: [PATCH 07/10] Add extb_usermode module to example configuration files [ci skip] --- doc/ircd.conf.example | 1 + doc/reference.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/ircd.conf.example b/doc/ircd.conf.example index d7525a7a..ceebe003 100644 --- a/doc/ircd.conf.example +++ b/doc/ircd.conf.example @@ -23,6 +23,7 @@ #loadmodule "extensions/extb_realname"; #loadmodule "extensions/extb_server"; #loadmodule "extensions/extb_ssl"; +#loadmodule "extensions/extb_usermode"; #loadmodule "extensions/hurt"; #loadmodule "extensions/m_extendchans"; #loadmodule "extensions/m_findforwards"; diff --git a/doc/reference.conf b/doc/reference.conf index 3526c739..4eb00363 100644 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -96,6 +96,7 @@ #loadmodule "extensions/extb_realname"; #loadmodule "extensions/extb_server"; #loadmodule "extensions/extb_ssl"; +#loadmodule "extensions/extb_usermode"; #loadmodule "extensions/helpops"; #loadmodule "extensions/hurt"; #loadmodule "extensions/ip_cloaking_4.0"; From a90f87eae4152d073ad45f0d89ce67262b2f2320 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Mon, 28 Mar 2016 00:08:05 -0400 Subject: [PATCH 08/10] gitignore: Ignore confdefs.h --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5166a02e..5e3b1471 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ bandb/bantool autom4te.cache aclocal.m4 compile +confdefs.h config.guess config.sub depcomp From 6d2abf1973f685b2a15915fb65ad94c2397ef716 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Mon, 28 Mar 2016 00:09:01 -0400 Subject: [PATCH 09/10] testsuite: Update startall.sh --- testsuite/startall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/startall.sh b/testsuite/startall.sh index 6f00e8c7..df1c558e 100755 --- a/testsuite/startall.sh +++ b/testsuite/startall.sh @@ -3,6 +3,6 @@ testdir=`pwd` prefix=`sed -n -e 's/^#define IRCD_PREFIX "\(.*\)"/\1/p' "$testdir/../include/setup.h"` [ -d $prefix ] || { echo Unable to find installation prefix; exit 1; } -$prefix/bin/ircd -configfile $testdir/ircd.conf.1 -pidfile $testdir/ircd.pid.1 -$prefix/bin/ircd -configfile $testdir/ircd.conf.2 -pidfile $testdir/ircd.pid.2 -$prefix/bin/ircd -configfile $testdir/ircd.conf.3 -pidfile $testdir/ircd.pid.3 +$prefix/bin/charybdis -configfile $testdir/ircd.conf.1 -pidfile $testdir/ircd.pid.1 +$prefix/bin/charybdis -configfile $testdir/ircd.conf.2 -pidfile $testdir/ircd.pid.2 +$prefix/bin/charybdis -configfile $testdir/ircd.conf.3 -pidfile $testdir/ircd.pid.3 From 673f2cda1c1020e636722480bcad2676a9b3fbeb Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Mon, 28 Mar 2016 00:09:51 -0400 Subject: [PATCH 10/10] gitignore: Ignore pid files from startall.sh --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5e3b1471..9fd416b3 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ ircd/version.c ircd/version.c.last ssld/ssld wsockd/wsockd +testsuite/ircd.pid.* tools/charybdis-mkpasswd tools/genssl tools/mkpasswd