diff --git a/help/opers/die b/help/opers/die index b81cce9..3854e0e 100644 --- a/help/opers/die +++ b/help/opers/die @@ -1,5 +1,7 @@ -DIE server.name +DIE server.name [server.name] -Terminates the IRC server +Terminatess the IRC server. If a second server name +is provided, remotely terminate that server. In this +case, both server names must match. - Requires Oper Priv: D diff --git a/help/opers/restart b/help/opers/restart index 868a470..74eb237 100644 --- a/help/opers/restart +++ b/help/opers/restart @@ -1,5 +1,7 @@ -RESTART server.name +RESTART server.name [server.name] -Restarts the IRC server. +Restarts the IRC server. If a second server name +is provided, remotely restart that server. In this +case, both server names must match. - Requires Oper Priv: D diff --git a/modules/core/m_die.c b/modules/core/m_die.c index b8b13bb..5052121 100644 --- a/modules/core/m_die.c +++ b/modules/core/m_die.c @@ -104,6 +104,13 @@ me_die(struct Client *client_p __unused, struct Client *source_p, int parc, cons static int do_die(struct Client *source_p, const char *servername) { + /* this makes sure both servernames match otherwise weirdness will occur */ + if(irccmp(servername, me.name)) + { + sendto_one_notice(source_p, ":Mismatch on /die %s", me.name); + return 0; + } + ircd_shutdown(get_client_name(source_p, HIDE_IP)); return 0; diff --git a/modules/m_restart.c b/modules/m_restart.c index 71388fe..2802880 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -111,6 +111,13 @@ do_restart(struct Client *source_p, const char *servername) rb_dlink_node *ptr; struct Client *target_p; + /* this makes sure both servernames match otherwise weirdness will occur */ + if(irccmp(servername, me.name)) + { + sendto_one_notice(source_p, ":Mismatch on /restart %s", me.name); + return 0; + } + RB_DLINK_FOREACH(ptr, lclient_list.head) { target_p = ptr->data;