562 |
|
} |
563 |
|
|
564 |
|
int |
565 |
+ |
valid_servname(const char *name) |
566 |
+ |
{ |
567 |
+ |
unsigned int length = 0; |
568 |
+ |
unsigned int dots = 0; |
569 |
+ |
const char *p = name; |
570 |
+ |
|
571 |
+ |
for (; *p; ++p) |
572 |
+ |
{ |
573 |
+ |
if (!IsServChar(*p)) |
574 |
+ |
return 1; |
575 |
+ |
|
576 |
+ |
++length; |
577 |
+ |
|
578 |
+ |
if (*p == '.') |
579 |
+ |
++dots; |
580 |
+ |
} |
581 |
+ |
|
582 |
+ |
return !dots || length > HOSTLEN; |
583 |
+ |
} |
584 |
+ |
|
585 |
+ |
int |
586 |
|
check_server(const char *name, struct Client *client_p, int cryptlink) |
587 |
|
{ |
588 |
|
dlink_node *ptr; |
1017 |
|
} |
1018 |
|
} |
1019 |
|
|
1020 |
< |
aconf = (struct AccessItem *)map_to_conf(conf); |
1020 |
> |
aconf = map_to_conf(conf); |
1021 |
|
|
1022 |
|
if (IsUnknown(client_p) && !IsConfCryptLink(aconf)) |
1023 |
|
{ |
1025 |
|
* 2. Check aconf->spasswd, not aconf->passwd. |
1026 |
|
*/ |
1027 |
|
if (!EmptyString(aconf->spasswd)) |
1028 |
< |
{ |
1029 |
< |
/* only send ts6 format PASS if we have ts6 enabled */ |
1009 |
< |
if (me.id[0] != '\0') /* Send TS 6 form only if id */ |
1010 |
< |
sendto_one(client_p, "PASS %s TS %d %s", |
1011 |
< |
aconf->spasswd, TS_CURRENT, me.id); |
1012 |
< |
else |
1013 |
< |
sendto_one(client_p, "PASS %s TS 5", |
1014 |
< |
aconf->spasswd); |
1015 |
< |
} |
1028 |
> |
sendto_one(client_p, "PASS %s TS %d %s", |
1029 |
> |
aconf->spasswd, TS_CURRENT, me.id); |
1030 |
|
|
1031 |
|
/* Pass my info to the new server |
1032 |
|
* |
1052 |
|
*/ |
1053 |
|
sendto_one(client_p, "SERVER %s 1 :%s%s", |
1054 |
|
my_name_for_link(conf), |
1055 |
< |
ConfigServerHide.hidden ? "(H) " : "", |
1042 |
< |
(me.info[0]) ? (me.info) : "IRCers United"); |
1055 |
> |
ConfigServerHide.hidden ? "(H) " : "", me.info); |
1056 |
|
send_queued_write(client_p); |
1057 |
|
} |
1058 |
|
|
1076 |
|
SetServlink(client_p); |
1077 |
|
} |
1078 |
|
|
1079 |
< |
/* only send ts6 format SVINFO if we have ts6 enabled */ |
1067 |
< |
sendto_one(client_p, "SVINFO %d %d 0 :%lu", |
1068 |
< |
(me.id[0] ? TS_CURRENT : 5), TS_MIN, |
1079 |
> |
sendto_one(client_p, "SVINFO %d %d 0 :%lu", TS_CURRENT, TS_MIN, |
1080 |
|
(unsigned long)CurrentTime); |
1081 |
|
|
1082 |
|
/* assumption here is if they passed the correct TS version, they also passed an SID */ |
1647 |
|
strlcpy(client_p->host, aconf->host, sizeof(client_p->host)); |
1648 |
|
|
1649 |
|
/* We already converted the ip once, so lets use it - stu */ |
1650 |
< |
strlcpy(client_p->sockhost, buf, HOSTIPLEN); |
1650 |
> |
strlcpy(client_p->sockhost, buf, sizeof(client_p->sockhost)); |
1651 |
|
|
1652 |
|
/* create a socket for the server connection */ |
1653 |
|
if (comm_open(&client_p->localClient->fd, aconf->ipnum.ss.ss_family, |
1857 |
|
#endif |
1858 |
|
|
1859 |
|
/* jdc -- Check and send spasswd, not passwd. */ |
1860 |
< |
if (!EmptyString(aconf->spasswd) && (me.id[0] != '\0')) |
1860 |
> |
if (!EmptyString(aconf->spasswd)) |
1861 |
|
/* Send TS 6 form only if id */ |
1862 |
|
sendto_one(client_p, "PASS %s TS %d %s", |
1863 |
|
aconf->spasswd, TS_CURRENT, me.id); |
1853 |
– |
else |
1854 |
– |
sendto_one(client_p, "PASS %s TS 5", |
1855 |
– |
aconf->spasswd); |
1864 |
|
|
1865 |
|
/* Pass my info to the new server |
1866 |
|
* |
1983 |
|
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1984 |
|
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK); |
1985 |
|
|
1986 |
< |
if (me.id[0]) |
1979 |
< |
sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id); |
1980 |
< |
|
1986 |
> |
sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id); |
1987 |
|
sendto_one(client_p, "CRYPTLINK SERV %s %s :%s%s", |
1988 |
|
my_name_for_link(conf), key_to_send, |
1989 |
|
ConfigServerHide.hidden ? "(H) " : "", me.info); |