X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/cc200171d7c40be3b204460f9c14d5d37e771866..0a2e2a35c89156ee5fc1ad2a65d0e6251bacc70f:/modules/m_connect.c?ds=sidebyside diff --git a/modules/m_connect.c b/modules/m_connect.c index 22fb7f2..f5a9675 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -21,23 +21,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_connect.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "client.h" #include "ircd.h" -#include "irc_string.h" +#include "match.h" #include "numeric.h" #include "s_conf.h" #include "s_newconf.h" -#include "s_log.h" +#include "logger.h" #include "s_serv.h" #include "send.h" #include "msg.h" #include "parse.h" #include "hash.h" #include "modules.h" +#include "sslproc.h" static int mo_connect(struct Client *, struct Client *, int, const char **); static int ms_connect(struct Client *, struct Client *, int, const char **); @@ -56,7 +56,6 @@ DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 3 * Added by Jto 11 Feb 1989 * * m_connect - * parv[0] = sender prefix * parv[1] = servername * parv[2] = port number * parv[3] = remote server @@ -97,6 +96,14 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha return 0; } + if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count())) + { + sendto_one_notice(source_p, + ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.", + parv[1]); + return 0; + } + /* * Get port number from user, if given. If not specified, * use the default form configuration structure. If missing @@ -120,7 +127,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha * Notify all operators about remote connect requests */ - ilog(L_SERVER, "CONNECT From %s : %s %s", parv[0], parv[1], parc > 2 ? parv[2] : ""); + ilog(L_SERVER, "CONNECT From %s : %s %s", source_p->name, parv[1], parc > 2 ? parv[2] : ""); server_p->port = port; /* @@ -129,14 +136,8 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha */ if(serv_connect(server_p, source_p)) { -#ifndef HIDE_SERVERS_IPS - sendto_one_notice(source_p, ":*** Connecting to %s[%s].%d", - server_p->host, server_p->name, server_p->port); -#else sendto_one_notice(source_p, ":*** Connecting to %s.%d", server_p->name, server_p->port); -#endif - } else { @@ -158,7 +159,6 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha * Added by Jto 11 Feb 1989 * * m_connect - * parv[0] = sender prefix * parv[1] = servername * parv[2] = port number * parv[3] = remote server @@ -191,6 +191,14 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha return 0; } + if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count())) + { + sendto_one_notice(source_p, + ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.", + parv[1]); + return 0; + } + /* * Get port number from user, if given. If not specified, * use the default form configuration structure. If missing @@ -218,9 +226,6 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha sendto_server(NULL, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :Remote CONNECT %s %d from %s", me.id, parv[1], port, source_p->name); - sendto_server(NULL, NULL, NOCAPS, CAP_TS6, - ":%s WALLOPS :Remote CONNECT %s %d from %s", - me.name, parv[1], port, source_p->name); ilog(L_SERVER, "CONNECT From %s : %s %d", source_p->name, parv[1], port);