X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_connect.c;h=ca4856d9d829bef15145e423787fb49ebaf0dbf0;hb=refs%2Fheads%2Fupstream-ssl;hp=5e372d42ec9d1ebfabdb0f2df28ec4cd37fcb39f;hpb=1b4e637606464f9af948a6e87879565f9fc1b726;p=ircu2.10.12-pk.git diff --git a/ircd/m_connect.c b/ircd/m_connect.c index 5e372d4..ca4856d 100644 --- a/ircd/m_connect.c +++ b/ircd/m_connect.c @@ -81,14 +81,6 @@ */ #include "config.h" -#if 0 -/* - * No need to include handlers.h here the signatures must match - * and we don't need to force a rebuild of all the handlers everytime - * we add a new one to the list. --Bleep - */ -#include "handlers.h" -#endif /* 0 */ #include "client.h" #include "crule.h" #include "hash.h" @@ -107,7 +99,7 @@ #include "s_user.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include /* @@ -193,24 +185,23 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* * save the old port */ - tmpport = aconf->port; - if (port) { - aconf->port = port; - } - else { - port = aconf->port; - } + tmpport = aconf->address.port; + if (port) + aconf->address.port = port; + else + port = aconf->address.port; + /* * Notify all operators about remote connect requests */ - sendcmdto_flag_butone(&me, CMD_WALLOPS, 0, FLAGS_WALLOP, - ":Remote CONNECT %s %s from %s", parv[1], + sendwallto_group_butone(&me, WALL_WALLOPS, 0, + "Remote CONNECT %s %s from %s", parv[1], parv[2] ? parv[2] : "", get_client_name(sptr, HIDE_IP)); log_write(LS_NETWORK, L_INFO, 0, "CONNECT From %C : %s %s", sptr, parv[1], parv[2] ? parv[2] : ""); - if (connect_server(aconf, sptr, 0)) { + if (connect_server(aconf, sptr)) { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connecting to %s.", sptr, aconf->name); } @@ -218,7 +209,7 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connection to %s failed", sptr, aconf->name); } - aconf->port = tmpport; + aconf->address.port = tmpport; return 0; } @@ -256,15 +247,14 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* * Only allow LocOps to make local CONNECTS --SRB */ - return 0; + return send_reply(cptr, ERR_NOPRIVILEGES); } else { struct Client* acptr2; struct Client* acptr3; if (!(acptr3 = find_match_server(parv[3]))) { - send_reply(sptr, ERR_NOSUCHSERVER, parv[3]); - return 0; + return send_reply(sptr, ERR_NOSUCHSERVER, parv[3]); } /* @@ -322,7 +312,7 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * use the default from configuration structure. If missing * from there, then use the precompiled default. */ - port = aconf->port; + port = aconf->address.port; if (parc > 2) { assert(0 != parv[2]); if (0 == (port = atoi(parv[2]))) { @@ -337,10 +327,10 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return 0; } - tmpport = aconf->port; - aconf->port = port; + tmpport = aconf->address.port; + aconf->address.port = port; - if (connect_server(aconf, sptr, 0)) { + if (connect_server(aconf, sptr)) { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connecting to %s.", sptr, aconf->name); } @@ -348,6 +338,6 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connection to %s failed", sptr, aconf->name); } - aconf->port = tmpport; + aconf->address.port = tmpport; return 0; }