diff --git a/.gitignore b/.gitignore index 5166a02e..9fd416b3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ bandb/bantool autom4te.cache aclocal.m4 compile +confdefs.h config.guess config.sub depcomp @@ -54,6 +55,7 @@ ircd/version.c ircd/version.c.last ssld/ssld wsockd/wsockd +testsuite/ircd.pid.* tools/charybdis-mkpasswd tools/genssl tools/mkpasswd 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 5c9bd0b5..4eb00363 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 @@ -95,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"; 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, 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/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/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/ircd/ircd.c b/ircd/ircd.c index 5c576fc8..460b4009 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -94,9 +94,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; 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; 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) 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