35 |
|
#include "irc_string.h" |
36 |
|
#include "sprintf_irc.h" |
37 |
|
#include "s_bsd.h" |
38 |
– |
#include "irc_getnameinfo.h" |
38 |
|
#include "ircd.h" |
39 |
|
#include "list.h" |
40 |
|
#include "listener.h" |
43 |
|
#include "s_conf.h" |
44 |
|
#include "s_log.h" |
45 |
|
#include "s_serv.h" |
47 |
– |
#include "s_stats.h" |
46 |
|
#include "send.h" |
47 |
|
#include "supported.h" |
48 |
|
#include "whowas.h" |
285 |
|
const char *nick, const char *username) |
286 |
|
{ |
287 |
|
const struct AccessItem *aconf = NULL; |
290 |
– |
char ipaddr[HOSTIPLEN]; |
288 |
|
dlink_node *ptr = NULL; |
289 |
|
dlink_node *m = NULL; |
290 |
|
|
336 |
|
|
337 |
|
if (IsNeedIdentd(aconf)) |
338 |
|
{ |
339 |
< |
ServerStats->is_ref++; |
339 |
> |
++ServerStats.is_ref; |
340 |
|
sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You need to install " |
341 |
|
"identd to use this server", me.name, source_p->name); |
342 |
|
exit_client(source_p, &me, "Install identd"); |
365 |
|
|
366 |
|
if (!match_conf_password(pass, aconf)) |
367 |
|
{ |
368 |
< |
ServerStats->is_ref++; |
368 |
> |
++ServerStats.is_ref; |
369 |
|
sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), |
370 |
|
me.name, source_p->name); |
371 |
|
exit_client(source_p, &me, "Bad Password"); |
395 |
|
sendto_realops_flags(UMODE_FULL, L_ALL, |
396 |
|
"Too many clients, rejecting %s[%s].", |
397 |
|
nick, source_p->host); |
398 |
< |
ServerStats->is_ref++; |
398 |
> |
++ServerStats.is_ref; |
399 |
|
exit_client(source_p, &me, "Sorry, server is full - try later"); |
400 |
|
return; |
401 |
|
} |
407 |
|
|
408 |
|
sendto_realops_flags(UMODE_REJ, L_ALL, "Invalid username: %s (%s@%s)", |
409 |
|
nick, source_p->username, source_p->host); |
410 |
< |
ServerStats->is_ref++; |
410 |
> |
++ServerStats.is_ref; |
411 |
|
ircsprintf(tmpstr2, "Invalid username [%s]", source_p->username); |
412 |
|
exit_client(source_p, &me, tmpstr2); |
413 |
|
return; |
432 |
|
hash_add_id(source_p); |
433 |
|
} |
434 |
|
|
438 |
– |
irc_getnameinfo((struct sockaddr *)&source_p->localClient->ip, |
439 |
– |
source_p->localClient->ip.ss_len, ipaddr, |
440 |
– |
HOSTIPLEN, NULL, 0, NI_NUMERICHOST); |
441 |
– |
|
435 |
|
sendto_realops_flags(UMODE_CCONN, L_ALL, |
436 |
|
"Client connecting: %s (%s@%s) [%s] {%s} [%s]", |
437 |
|
nick, source_p->username, source_p->host, |
438 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
439 |
< |
"255.255.255.255" : ipaddr, get_client_class(source_p), |
439 |
> |
"255.255.255.255" : source_p->sockhost, |
440 |
> |
get_client_class(source_p), |
441 |
|
source_p->info); |
442 |
|
|
443 |
|
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, |
444 |
|
"CLICONN %s %s %s %s %s %s %s 0 %s", |
445 |
|
nick, source_p->username, source_p->host, |
446 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
447 |
< |
"255.255.255.255" : ipaddr, |
447 |
> |
"255.255.255.255" : source_p->sockhost, |
448 |
|
get_client_class(source_p), |
449 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
450 |
|
"<hidden>" : source_p->client_host, |
475 |
|
SetClient(source_p); |
476 |
|
|
477 |
|
source_p->servptr = &me; |
478 |
< |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users); |
478 |
> |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); |
479 |
|
|
480 |
|
/* Increment our total user count here */ |
481 |
|
if (++Count.total > Count.max_tot) |
565 |
|
if (++Count.total > Count.max_tot) |
566 |
|
Count.max_tot = Count.total; |
567 |
|
|
574 |
– |
++source_p->from->serv->dep_users; |
575 |
– |
|
568 |
|
SetClient(source_p); |
569 |
< |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users); |
569 |
> |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); |
570 |
|
add_user_host(source_p->username, source_p->host, 1); |
571 |
|
SetUserHost(source_p); |
572 |
|
|
601 |
|
ubuf[1] = '\0'; |
602 |
|
} |
603 |
|
|
604 |
< |
/* arghhh one could try not introducing new nicks to ll leafs |
613 |
< |
* but then you have to introduce them "on the fly" in SJOIN |
614 |
< |
* not fun. |
615 |
< |
* Its not going to cost much more bandwidth to simply let new |
616 |
< |
* nicks just ride on through. |
617 |
< |
*/ |
618 |
< |
|
619 |
< |
/* We now introduce nicks "on the fly" in SJOIN anyway -- |
620 |
< |
* you _need_ to if you aren't going to burst everyone initially. |
621 |
< |
* |
622 |
< |
* Only send to non CAP_LL servers, unless we're a lazylink leaf, |
623 |
< |
* in that case just send it to the uplink. |
624 |
< |
* -davidt |
625 |
< |
* rewritten to cope with SIDs .. eww eww eww --is |
626 |
< |
*/ |
627 |
< |
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) && |
628 |
< |
client_p != uplink) |
604 |
> |
DLINK_FOREACH(server_node, serv_list.head) |
605 |
|
{ |
606 |
< |
if (IsCapable(uplink, CAP_TS6) && HasID(source_p)) |
607 |
< |
{ |
608 |
< |
sendto_one(uplink, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
606 |
> |
struct Client *server = server_node->data; |
607 |
> |
|
608 |
> |
if (server == client_p) |
609 |
> |
continue; |
610 |
> |
|
611 |
> |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
612 |
> |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
613 |
|
source_p->servptr->id, |
614 |
|
source_p->name, source_p->hopcount+1, |
615 |
|
(unsigned long)source_p->tsinfo, |
616 |
|
ubuf, source_p->username, source_p->host, |
617 |
|
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
618 |
|
"0" : source_p->sockhost, source_p->id, source_p->info); |
639 |
– |
} |
619 |
|
else |
620 |
< |
{ |
642 |
< |
sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s", |
620 |
> |
sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", |
621 |
|
source_p->name, source_p->hopcount+1, |
622 |
|
(unsigned long)source_p->tsinfo, |
623 |
|
ubuf, source_p->username, source_p->host, |
624 |
|
source_p->servptr->name, source_p->info); |
647 |
– |
} |
648 |
– |
} |
649 |
– |
else |
650 |
– |
{ |
651 |
– |
DLINK_FOREACH(server_node, serv_list.head) |
652 |
– |
{ |
653 |
– |
struct Client *server = server_node->data; |
654 |
– |
|
655 |
– |
if (IsCapable(server, CAP_LL) || server == client_p) |
656 |
– |
continue; |
657 |
– |
|
658 |
– |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
659 |
– |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
660 |
– |
source_p->servptr->id, |
661 |
– |
source_p->name, source_p->hopcount+1, |
662 |
– |
(unsigned long)source_p->tsinfo, |
663 |
– |
ubuf, source_p->username, source_p->host, |
664 |
– |
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
665 |
– |
"0" : source_p->sockhost, source_p->id, source_p->info); |
666 |
– |
else |
667 |
– |
sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", |
668 |
– |
source_p->name, source_p->hopcount+1, |
669 |
– |
(unsigned long)source_p->tsinfo, |
670 |
– |
ubuf, source_p->username, source_p->host, |
671 |
– |
source_p->servptr->name, source_p->info); |
672 |
– |
} |
625 |
|
} |
626 |
|
} |
627 |
|
|
1107 |
|
struct Client *target_p = ptr->data; |
1108 |
|
|
1109 |
|
if ((target_p != client_p) && (target_p != source_p)) |
1110 |
< |
{ |
1111 |
< |
if ((!(ServerInfo.hub && IsCapable(target_p, CAP_LL))) || |
1112 |
< |
(target_p->localClient->serverMask & |
1161 |
< |
source_p->lazyLinkClientExists)) |
1162 |
< |
sendto_one(target_p, ":%s MODE %s :%s", |
1163 |
< |
ID_or_name(source_p, target_p), |
1164 |
< |
ID_or_name(source_p, target_p), buf); |
1165 |
< |
} |
1110 |
> |
sendto_one(target_p, ":%s MODE %s :%s", |
1111 |
> |
ID_or_name(source_p, target_p), |
1112 |
> |
ID_or_name(source_p, target_p), buf); |
1113 |
|
} |
1114 |
|
} |
1115 |
|
|
1204 |
|
get_client_name(source_p, HIDE_IP), |
1205 |
|
source_p->sockhost); |
1206 |
|
|
1207 |
< |
ServerStats->is_ref++; |
1207 |
> |
++ServerStats.is_ref; |
1208 |
|
if (REJECT_HOLD_TIME > 0) |
1209 |
|
{ |
1210 |
|
sendto_one(source_p, ":%s NOTICE %s :Bad user info", |