* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: m_connect.c 254 2005-09-21 23:35:12Z nenolod $
+ * $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 "commio.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 **);
};
mapi_clist_av1 connect_clist[] = { &connect_msgtab, NULL };
-DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 254 $");
+DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 3161 $");
/*
* mo_connect - CONNECT command handler
if((target_p = find_server(source_p, parv[1])))
{
- sendto_one(source_p, ":%s NOTICE %s :Connect: Server %s already exists from %s.",
- me.name, parv[0], parv[1], target_p->from->name);
+ sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
+ target_p->from->name);
return 0;
}
*/
if((server_p = find_server_conf(parv[1])) == NULL)
{
- sendto_one(source_p,
- "NOTICE %s :Connect: Host %s not listed in ircd.conf",
- parv[0], parv[1]);
+ sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf", parv[1]);
+ 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;
}
{
if((port = atoi(parv[2])) <= 0)
{
- sendto_one(source_p, "NOTICE %s :Connect: Illegal port number", parv[0]);
+ sendto_one_notice(source_p, ":Connect: Illegal port number");
return 0;
}
}
else if(port <= 0 && (port = PORTNUM) <= 0)
{
- sendto_one(source_p, ":%s NOTICE %s :Connect: missing port number",
- me.name, parv[0]);
+ sendto_one_notice(source_p, ":Connect: missing port number");
return 0;
}
/*
*/
if(serv_connect(server_p, source_p))
{
-#ifndef HIDE_SERVERS_IPS
- sendto_one(source_p, ":%s NOTICE %s :*** Connecting to %s[%s].%d",
- me.name, parv[0], server_p->host, server_p->name, server_p->port);
-#else
- sendto_one(source_p, ":%s NOTICE %s :*** Connecting to %s.%d",
- me.name, parv[0], server_p->name, server_p->port);
-#endif
-
+ sendto_one_notice(source_p, ":*** Connecting to %s.%d",
+ server_p->name, server_p->port);
}
else
{
- sendto_one(source_p, ":%s NOTICE %s :*** Couldn't connect to %s.%d",
- me.name, parv[0], server_p->name, server_p->port);
-
+ sendto_one_notice(source_p, ":*** Couldn't connect to %s.%d",
+ server_p->name, server_p->port);
}
/*
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
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);