#include "handlers.h"
#endif /* 0 */
#include "client.h"
-#include "crule.h"
#include "hash.h"
#include "ircd.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
+#include "jupe.h"
#include "list.h"
#include "match.h"
#include "msg.h"
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
+ struct Jupe* ajupe = 0;
int hop;
int ret;
int active_lh_line = 0;
time_t recv_time;
time_t ghost = 0;
- if (IsUser(cptr))
- {
- sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]);
- return 0;
- }
-
if (IsUserPort(cptr))
return exit_client_msg(cptr, cptr, &me,
"Cannot connect a server to a user port");
return need_more_params(sptr, "SERVER");
return exit_client(cptr, cptr, &me, "Need more parameters");
}
- ircd_log(L_NOTICE, "SERVER: %s %s[%s]", parv[1], cptr->sockhost, cptr->sock_ip);
host = parv[1];
+
+ if ((ajupe = jupe_find(host)) && JupeIsActive(ajupe))
+ return exit_client_msg(cptr, sptr, &me, "Juped: %s", JupeReason(ajupe));
+
+ ircd_log(L_NOTICE, "SERVER: %s %s[%s]", parv[1], cptr->sockhost, cptr->sock_ip);
+
/*
* Detect protocol
*/
ircd_strncpy(info, parv[parc - 1], REALLEN);
info[REALLEN] = '\0';
if (prot < atoi(MINOR_PROTOCOL)) {
- sendto_ops("Got incompatible protocol version (%s) from %s",
- parv[5], cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Got incompatible protocol version "
+ "(%s) from %s", parv[5], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp,
"Incompatible protocol: %s", parv[5]);
}
break;
}
if (*ch || !strchr(host, '.')) {
- sendto_ops("Bogus server name (%s) from %s", host, cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
+ host, cptr->name);
return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
}
cptr->hopcount = hop;
/* check connection rules */
- for (cconf = GlobalConfList; cconf; cconf = cconf->next) {
- if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) {
- if (crule_eval(cconf->passwd)) {
- ServerStats->is_ref++;
- sendto_ops("Refused connection from %s.", cptr->name);
- return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
- }
- }
+ if (0 != conf_eval_crule(host, CRULE_ALL)) {
+ ServerStats->is_ref++;
+ sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name);
+ return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
}
+
if (conf_check_server(cptr)) {
++ServerStats->is_ref;
- sendto_ops("Received unauthorized connection from %s.", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection "
+ "from %s.", cptr->name);
return exit_client(cptr, cptr, &me, "No C:line");
}
if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
++ServerStats->is_ref;
#ifndef GODMODE
- sendto_ops("Access denied. No conf line for server %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Access denied. No conf line for "
+ "server %s", cptr->name);
return exit_client_msg(cptr, cptr, &me,
"Access denied. No conf line for server %s", cptr->name);
#else /* GODMODE */
- sendto_ops("General C: line active: No line for server %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "General C: line active: No line "
+ "for server %s", cptr->name);
aconf = find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
if (!aconf) {
- sendto_ops("Neither C lines for server %s nor "
- "\"general.undernet.org\"", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Neither C lines for server %s "
+ "nor \"general.undernet.org\"", cptr->name);
return exit_client_msg(cptr, cptr, &me, "No C lines for server %s", cptr->name);
}
#endif /* GODMODE */
#ifdef CRYPT_LINK_PASSWORD
/* passwd may be NULL. Head it off at the pass... */
if (*cptr->passwd) {
- char salt[3];
-
- salt[0] = aconf->passwd[0];
- salt[1] = aconf->passwd[1];
- salt[2] = '\0';
- encr = ircd_crypt(cptr->passwd, salt);
+ encr = ircd_crypt(cptr->passwd, aconf->passed);
}
else
encr = "";
#ifndef GODMODE
if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
++ServerStats->is_ref;
- sendto_ops("Access denied (passwd mismatch) %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Access denied (passwd mismatch) %s",
+ cptr->name);
return exit_client_msg(cptr, cptr, &me,
"No Access (passwd mismatch) %s", cptr->name);
}
* If my ircd.conf sucks, I can try to connect to myself:
*/
if (acptr == &me)
- return exit_client_msg(cptr, cptr, &me, "nick collision with me (%s)", host);
+ return exit_client_msg(cptr, cptr, &me, "nick collision with me (%s), check server number in M:?", host);
/*
* Detect wrong numeric.
*/
if (0 != ircd_strcmp(acptr->name, host)) {
- sendto_serv_butone(cptr,
- ":%s WALLOPS :SERVER Numeric Collision: %s != %s",
- me.name, acptr->name, host);
+ sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
+ ":SERVER Numeric Collision: %s != %s",
+ acptr->name, host);
return exit_client_msg(cptr, cptr, &me,
"NUMERIC collision between %s and %s."
" Is your server numeric correct ?", host, acptr->name);
{
if (!IsServer(sptr))
return exit_client(cptr, sptr, &me, acptr->info);
- sendto_one(cptr, ":%s WALLOPS :Received :%s SERVER %s from %s !?!",
- me.name, parv[0], parv[1], cptr->name);
+ sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
+ ":Received :%s SERVER %s from %s !?!", parv[0],
+ parv[1], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
}
/*
{
if (LHcptr == 0) {
return exit_new_server(cptr, sptr, host, timestamp,
- (active_lh_line == 2) ? "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
+ (active_lh_line == 2) ? "Non-Hub link %s <- %s(%s), check H:" :
+ "Leaf-only link %s <- %s(%s), check L:",
cptr->name, host,
lhconf ? (lhconf->name ? lhconf->name : "*") : "!");
}
if (active_lh_line < 3)
{
if (exit_client_msg(cptr, LHcptr, &me,
- (active_lh_line == 2) ? "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
+ (active_lh_line == 2) ? "Non-Hub link %s <- %s(%s), check H:" :
+ "Leaf-only link %s <- %s(%s), check L:",
cptr->name, host,
lhconf ? (lhconf->name ? lhconf->name : "*") : "!") == CPTR_KILLED)
return CPTR_KILLED;
else
{
ServerStats->is_ref++;
- if (exit_client(cptr, LHcptr, &me, "I'm a leaf") == CPTR_KILLED)
+ if (exit_client(cptr, LHcptr, &me, "I'm a leaf, define HUB") == CPTR_KILLED)
return CPTR_KILLED;
}
/*
if (*parv[5] == 'J')
{
SetBurst(acptr);
- sendto_op_mask(SNO_NETWORK, "Net junction: %s %s",
+ sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
sptr->name, acptr->name);
SetJunction(acptr);
}
/*
* Old sendto_serv_but_one() call removed because we now need to send
* different names to different servers (domain name matching).
+ *
+ * Personally, I think this is bogus; it's a feature we don't use here.
+ * -Kev
*/
for (i = 0; i <= HighestFd; i++)
{
continue;
if (0 == match(me.name, acptr->name))
continue;
- sendto_one(bcptr, "%s " TOK_SERVER " %s %d 0 %s %s %s%s 0 :%s",
- NumServ(sptr), acptr->name, hop + 1, parv[4], parv[5],
- NumServCap(acptr), acptr->info);
+ sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s 0 :%s",
+ acptr->name, hop + 1, parv[4], parv[5], NumServCap(acptr),
+ acptr->info);
}
return 0;
}
{
#ifndef RELIABLE_CLOCK
#ifdef TESTNET
- sendto_ops("Debug: my start time: " TIME_T_FMT " ; others start time: "
- TIME_T_FMT, me.serv->timestamp, start_timestamp);
- sendto_ops("Debug: receive time: " TIME_T_FMT " ; received timestamp: "
- TIME_T_FMT " ; difference %ld",
- recv_time, timestamp, timestamp - recv_time);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
+ "others start time: %Tu", me.serv->timestamp,
+ start_timestamp);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
+ "received timestamp: %Tu ; difference %ld",
+ recv_time, timestamp, timestamp - recv_time);
#endif
if (start_timestamp < me.serv->timestamp)
{
- sendto_ops("got earlier start time: " TIME_T_FMT " < " TIME_T_FMT,
- start_timestamp, me.serv->timestamp);
+ sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
+ "%Tu < %Tu", start_timestamp, me.serv->timestamp);
me.serv->timestamp = start_timestamp;
TSoffset += timestamp - recv_time;
- sendto_ops("clock adjusted by adding %d", (int)(timestamp - recv_time));
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
}
else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
cptr->serv->timestamp = TStime();
cptr->serv->timestamp = TStime();
else if (IsHandshake(cptr))
{
- sendto_ops("clock adjusted by adding %d",
- (int)(timestamp - recv_time));
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
TSoffset += timestamp - recv_time;
}
}
#endif
}
- ret = server_estab(cptr, aconf);
+ ret = server_estab(cptr, aconf, ajupe);
}
else
ret = 0;
#ifdef RELIABLE_CLOCK
if (abs(cptr->serv->timestamp - recv_time) > 30)
{
- sendto_ops("Connected to a net with a timestamp-clock"
- " difference of " STIME_T_FMT " seconds! Used SETTIME to correct"
- " this.", timestamp - recv_time);
- sendto_one(cptr, ":%s SETTIME " TIME_T_FMT " :%s",
- me.name, TStime(), me.name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
+ "timestamp-clock difference of %Td seconds! "
+ "Used SETTIME to correct this.",
+ timestamp - recv_time);
+ sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), me.name);
}
#endif
* parv[6] = "YMM", where 'Y' is the server numeric and "MM" is the
* numeric nick mask of this server.
* parv[7] = 0 (not used yet, mandatory unsigned int after u2.10.06)
+ * parv[8] = %<lastmod> - optional parameter only present if there's an
+ * outstanding JUPE; specifies the JUPE's lastmod field
*/
int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
+ struct Jupe* ajupe = 0;
int hop;
int ret;
int active_lh_line = 0;
time_t timestamp = 0;
time_t recv_time;
time_t ghost = 0;
-
- if (IsUser(cptr))
- {
- sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]);
- return 0;
- }
+ time_t lastmod = 0;
if (IsUserPort(cptr))
return exit_client_msg(cptr, cptr, &me,
return exit_client(cptr, cptr, &me, "Need more parameters");
}
host = parv[1];
+
/*
* Detect protocol
*/
ircd_strncpy(info, parv[parc - 1], REALLEN);
info[REALLEN] = '\0';
if (prot < atoi(MINOR_PROTOCOL)) {
- sendto_ops("Got incompatible protocol version (%s) from %s",
- parv[5], cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Got incompatible protocol version "
+ "(%s) from %s", parv[5], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp,
"Incompatible protocol: %s", parv[5]);
}
+ if (parc > 9 && *parv[8] == '%')
+ lastmod = atoi(parv[8] + 1);
+ /* If there's a jupe that matches, and it's a global jupe, and the
+ * introducer didn't indicate it knew of the jupe or has an older
+ * version of the jupe, and the connection isn't in a BURST, resynch
+ * the jupe.
+ */
+ if ((ajupe = jupe_find(host)) && !JupeIsLocal(ajupe) &&
+ JupeLastMod(ajupe) > lastmod && !IsBurstOrBurstAck(cptr))
+ jupe_resend(cptr, ajupe);
/*
* Check for "FRENCH " infection ;-) (actually this should
* be replaced with routine to check the hostname syntax in
if (*ch <= ' ' || *ch > '~')
break;
if (*ch || !strchr(host, '.')) {
- sendto_ops("Bogus server name (%s) from %s", host, cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
+ host, cptr->name);
return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
}
cptr->hopcount = hop;
/* check connection rules */
- for (cconf = GlobalConfList; cconf; cconf = cconf->next) {
- if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) {
- if (crule_eval(cconf->passwd))
- {
- ServerStats->is_ref++;
- sendto_ops("Refused connection from %s.", cptr->name);
- return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
- }
- }
+ if (0 != conf_eval_crule(host, CRULE_ALL)) {
+ ServerStats->is_ref++;
+ sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name);
+ return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
}
if (conf_check_server(cptr)) {
++ServerStats->is_ref;
- sendto_ops("Received unauthorized connection from %s.", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection "
+ "from %s.", cptr->name);
return exit_client(cptr, cptr, &me, "No C conf lines");
}
if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
++ServerStats->is_ref;
#ifndef GODMODE
- sendto_ops("Access denied. No conf line for server %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Access denied. No conf line for "
+ "server %s", cptr->name);
return exit_client_msg(cptr, cptr, &me,
"Access denied. No conf line for server %s", cptr->name);
#else /* GODMODE */
- sendto_ops("General C line active: No line for server %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "General C line active: No line "
+ "for server %s", cptr->name);
aconf =
find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
if (!aconf) {
- sendto_ops("Neither C lines for server %s nor "
- "\"general.undernet.org\"", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Neither C lines for server %s "
+ "nor \"general.undernet.org\"", cptr->name);
return exit_client_msg(cptr, cptr, &me,
"No C lines for server %s", cptr->name);
}
/* passwd may be NULL. Head it off at the pass... */
if (*cptr->passwd)
{
- char salt[3];
-
- salt[0] = aconf->passwd[0];
- salt[1] = aconf->passwd[1];
- salt[2] = '\0';
- encr = ircd_crypt(cptr->passwd, salt);
+ encr = ircd_crypt(cptr->passwd, aconf->passwd);
}
else
encr = "";
#ifndef GODMODE
if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
++ServerStats->is_ref;
- sendto_ops("Access denied (passwd mismatch) %s", cptr->name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Access denied (passwd mismatch) %s",
+ cptr->name);
return exit_client_msg(cptr, cptr, &me,
"No Access (passwd mismatch) %s", cptr->name);
}
*/
if (acptr == &me)
return exit_client_msg(cptr, cptr, &me,
- "nick collision with me (%s)", host);
+ "nick collision with me, check server number in M:? (%s)", host);
/*
* Detect wrong numeric.
*/
if (0 != ircd_strcmp(acptr->name, host))
{
- sendto_serv_butone(cptr,
- ":%s WALLOPS :SERVER Numeric Collision: %s != %s",
- me.name, acptr->name, host);
+ sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
+ ":SERVER Numeric Collision: %s != %s", acptr->name,
+ host);
return exit_client_msg(cptr, cptr, &me,
"NUMERIC collision between %s and %s."
" Is your server numeric correct ?", host, acptr->name);
{
if (!IsServer(sptr))
return exit_client(cptr, sptr, &me, acptr->info);
- sendto_one(cptr, ":%s WALLOPS :Received :%s SERVER %s from %s !?!",
- me.name, parv[0], parv[1], cptr->name);
+ sendcmdto_one(&me, CMD_WALLOPS, cptr, ":Received :%s SERVER %s "
+ "from %s !?!", parv[0], parv[1], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
}
/*
if (*parv[5] == 'J')
{
SetBurst(acptr);
- sendto_op_mask(SNO_NETWORK, "Net junction: %s %s",
- sptr->name, acptr->name);
+ sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
+ sptr->name, acptr->name);
SetJunction(acptr);
}
/*
continue;
if (0 == match(me.name, acptr->name))
continue;
- sendto_one(bcptr, "%s " TOK_SERVER " %s %d 0 %s %s %s%s 0 :%s",
- NumServ(sptr), acptr->name, hop + 1, parv[4], parv[5],
- NumServCap(acptr), acptr->info);
+ sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s 0 :%s",
+ acptr->name, hop + 1, parv[4], parv[5], NumServCap(acptr),
+ acptr->info);
}
return 0;
}
{
#ifndef RELIABLE_CLOCK
#ifdef TESTNET
- sendto_ops("Debug: my start time: " TIME_T_FMT " ; others start time: "
- TIME_T_FMT, me.serv->timestamp, start_timestamp);
- sendto_ops("Debug: receive time: " TIME_T_FMT " ; received timestamp: "
- TIME_T_FMT " ; difference %ld",
- recv_time, timestamp, timestamp - recv_time);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
+ "others start time: %Tu", me.serv->timestamp,
+ start_timestamp);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
+ "received timestamp: %Tu ; difference %ld",
+ recv_time, timestamp, timestamp - recv_time);
#endif
if (start_timestamp < me.serv->timestamp)
{
- sendto_ops("got earlier start time: " TIME_T_FMT " < " TIME_T_FMT,
- start_timestamp, me.serv->timestamp);
+ sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
+ "%Tu < %Tu", start_timestamp, me.serv->timestamp);
me.serv->timestamp = start_timestamp;
TSoffset += timestamp - recv_time;
- sendto_ops("clock adjusted by adding %d", (int)(timestamp - recv_time));
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
}
else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
cptr->serv->timestamp = TStime();
cptr->serv->timestamp = TStime();
else if (IsHandshake(cptr))
{
- sendto_ops("clock adjusted by adding %d",
- (int)(timestamp - recv_time));
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
TSoffset += timestamp - recv_time;
}
}
#endif
}
- ret = server_estab(cptr, aconf);
+ ret = server_estab(cptr, aconf, ajupe);
}
else
ret = 0;
#ifdef RELIABLE_CLOCK
if (abs(cptr->serv->timestamp - recv_time) > 30)
{
- sendto_ops("Connected to a net with a timestamp-clock"
- " difference of " STIME_T_FMT " seconds! Used SETTIME to correct"
- " this.", timestamp - recv_time);
- sendto_one(cptr, ":%s SETTIME " TIME_T_FMT " :%s",
- me.name, TStime(), me.name);
+ sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
+ "timestamp-clock difference of %Td seconds! Used "
+ "SETTIME to correct this.", timestamp - recv_time);
+ sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), me.name);
}
#endif
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
+ struct Jupe* ajupe = 0;
int hop;
int ret;
int active_lh_line = 0;
if (IsUser(cptr))
{
- sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]);
+ sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
return 0;
}
ircd_strncpy(info, parv[parc - 1], REALLEN);
info[REALLEN] = '\0';
if (prot < atoi(MINOR_PROTOCOL)) {
- sendto_ops("Got incompatible protocol version (%s) from %s",
+ sendto_ops("Got incompatible protocol version (%s) from %s", /* XXX DEAD */
parv[5], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp,
"Incompatible protocol: %s", parv[5]);
break;
if (*ch || !strchr(host, '.'))
{
- sendto_ops("Bogus server name (%s) from %s", host, cptr->name);
+ sendto_ops("Bogus server name (%s) from %s", host, cptr->name); /* XXX DEAD */
return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
}
cptr->hopcount = hop;
/* check connection rules */
- for (cconf = GlobalConfList; cconf; cconf = cconf->next) {
- if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) {
- if (crule_eval(cconf->passwd))
- {
- ServerStats->is_ref++;
- sendto_ops("Refused connection from %s.", cptr->name);
- return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
- }
- }
+ if (0 != conf_eval_crule(host, CRULE_ALL)) {
+ ServerStats->is_ref++;
+ sendto_ops("Refused connection from %s.", cptr->name); /* XXX DEAD */
+ return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
}
if (conf_check_server(cptr)) {
++ServerStats->is_ref;
- sendto_ops("Received unauthorized connection from %s.", cptr->name);
+ sendto_ops("Received unauthorized connection from %s.", cptr->name); /* XXX DEAD */
return exit_client(cptr, cptr, &me, "No C/N conf lines");
}
if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
++ServerStats->is_ref;
#ifndef GODMODE
- sendto_ops("Access denied. No conf line for server %s", cptr->name);
+ sendto_ops("Access denied. No conf line for server %s", cptr->name); /* XXX DEAD */
return exit_client_msg(cptr, cptr, &me,
"Access denied. No conf line for server %s", cptr->name);
#else /* GODMODE */
- sendto_ops("General C/N: line active: No line for server %s", cptr->name);
+ sendto_ops("General C/N: line active: No line for server %s", cptr->name); /* XXX DEAD */
aconf =
find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
if (!aconf) {
- sendto_ops("Neither C/N lines for server %s nor "
+ sendto_ops("Neither C/N lines for server %s nor " /* XXX DEAD */
"\"general.undernet.org\"", cptr->name);
return exit_client_msg(cptr, cptr, &me,
"No C/N lines for server %s", cptr->name);
/* passwd may be NULL. Head it off at the pass... */
if (*cptr->passwd)
{
- char salt[3];
-
- salt[0] = aconf->passwd[0];
- salt[1] = aconf->passwd[1];
- salt[2] = '\0';
- encr = ircd_crypt(cptr->passwd, salt);
+ encr = ircd_crypt(cptr->passwd, aconf->passwd);
}
else
encr = "";
#ifndef GODMODE
if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
++ServerStats->is_ref;
- sendto_ops("Access denied (passwd mismatch) %s", cptr->name);
+ sendto_ops("Access denied (passwd mismatch) %s", cptr->name); /* XXX DEAD */
return exit_client_msg(cptr, cptr, &me,
"No Access (passwd mismatch) %s", cptr->name);
}
*/
if (acptr == &me)
return exit_client_msg(cptr, cptr, &me,
- "nick collision with me (%s)", host);
+ "nick collision with me, check server number in M:? (%s)", host);
/*
* Detect wrong numeric.
*/
if (0 != ircd_strcmp(acptr->name, host))
{
- sendto_serv_butone(cptr,
+ sendto_serv_butone(cptr, /* XXX DEAD */
":%s WALLOPS :SERVER Numeric Collision: %s != %s",
me.name, acptr->name, host);
return exit_client_msg(cptr, cptr, &me,
{
if (!IsServer(sptr))
return exit_client(cptr, sptr, &me, acptr->info);
- sendto_one(cptr, ":%s WALLOPS :Received :%s SERVER %s from %s !?!",
+ sendto_one(cptr, ":%s WALLOPS :Received :%s SERVER %s from %s !?!", /* XXX DEAD */
me.name, parv[0], parv[1], cptr->name);
return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
}
if (*parv[5] == 'J')
{
SetBurst(acptr);
- sendto_op_mask(SNO_NETWORK, "Net junction: %s %s",
+ sendto_op_mask(SNO_NETWORK, "Net junction: %s %s", /* XXX DEAD */
sptr->name, acptr->name);
SetJunction(acptr);
}
continue;
if (0 == match(me.name, acptr->name))
continue;
- sendto_one(bcptr, "%s " TOK_SERVER " %s %d 0 %s %s %s%s 0 :%s",
+ sendto_one(bcptr, "%s " TOK_SERVER " %s %d 0 %s %s %s%s 0 :%s", /* XXX DEAD */
NumServ(sptr), acptr->name, hop + 1, parv[4], parv[5],
NumServCap(acptr), acptr->info);
}
{
#ifndef RELIABLE_CLOCK
#ifdef TESTNET
- sendto_ops("Debug: my start time: " TIME_T_FMT " ; others start time: "
+ sendto_ops("Debug: my start time: " TIME_T_FMT " ; others start time: " /* XXX DEAD */
TIME_T_FMT, me.serv->timestamp, start_timestamp);
- sendto_ops("Debug: receive time: " TIME_T_FMT " ; received timestamp: "
+ sendto_ops("Debug: receive time: " TIME_T_FMT " ; received timestamp: " /* XXX DEAD */
TIME_T_FMT " ; difference %ld",
recv_time, timestamp, timestamp - recv_time);
#endif
if (start_timestamp < me.serv->timestamp)
{
- sendto_ops("got earlier start time: " TIME_T_FMT " < " TIME_T_FMT,
+ sendto_ops("got earlier start time: " TIME_T_FMT " < " TIME_T_FMT, /* XXX DEAD */
start_timestamp, me.serv->timestamp);
me.serv->timestamp = start_timestamp;
TSoffset += timestamp - recv_time;
- sendto_ops("clock adjusted by adding %d", (int)(timestamp - recv_time));
+ sendto_ops("clock adjusted by adding %d", (int)(timestamp - recv_time)); /* XXX DEAD */
}
else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
cptr->serv->timestamp = TStime();
cptr->serv->timestamp = TStime();
else if (IsHandshake(cptr))
{
- sendto_ops("clock adjusted by adding %d",
+ sendto_ops("clock adjusted by adding %d", /* XXX DEAD */
(int)(timestamp - recv_time));
TSoffset += timestamp - recv_time;
}
#endif
}
- ret = server_estab(cptr, aconf);
+ ret = server_estab(cptr, aconf); /* XXX DEAD */
}
else
ret = 0;
#ifdef RELIABLE_CLOCK
if (abs(cptr->serv->timestamp - recv_time) > 30)
{
- sendto_ops("Connected to a net with a timestamp-clock"
+ sendto_ops("Connected to a net with a timestamp-clock" /* XXX DEAD */
" difference of " STIME_T_FMT " seconds! Used SETTIME to correct"
" this.", timestamp - recv_time);
- sendto_one(cptr, ":%s SETTIME " TIME_T_FMT " :%s",
+ sendto_one(cptr, ":%s SETTIME " TIME_T_FMT " :%s", /* XXX DEAD */
me.name, TStime(), me.name);
}
#endif