55 |
|
#include "s_misc.h" |
56 |
|
#include "msg.h" |
57 |
|
#include "pcre.h" |
58 |
+ |
#include "watch.h" |
59 |
|
|
60 |
|
int MaxClientCount = 1; |
61 |
|
int MaxConnectionCount = 1; |
96 |
|
0, /* @ */ |
97 |
|
0, /* A */ |
98 |
|
0, /* B */ |
99 |
< |
0, /* C */ |
99 |
> |
UMODE_CCONN_FULL, /* C */ |
100 |
|
UMODE_DEAF, /* D */ |
101 |
|
0, /* E */ |
102 |
|
0, /* F */ |
446 |
|
"255.255.255.255" : ipaddr, get_client_class(source_p), |
447 |
|
source_p->info); |
448 |
|
|
449 |
+ |
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, |
450 |
+ |
"CLICONN %s %s %s %s %s %s %s 0 %s", |
451 |
+ |
nick, source_p->username, source_p->host, |
452 |
+ |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
453 |
+ |
"255.255.255.255" : ipaddr, |
454 |
+ |
get_client_class(source_p), |
455 |
+ |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
456 |
+ |
"<hidden>" : source_p->client_host, |
457 |
+ |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
458 |
+ |
"<hidden>" : source_p->client_server, |
459 |
+ |
source_p->info); |
460 |
+ |
|
461 |
+ |
|
462 |
|
/* If they have died in send_* don't do anything. */ |
463 |
|
if (IsDead(source_p)) |
464 |
|
return; |
481 |
|
SetClient(source_p); |
482 |
|
|
483 |
|
source_p->servptr = &me; |
484 |
< |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users); |
484 |
> |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); |
485 |
|
|
486 |
|
/* Increment our total user count here */ |
487 |
|
if (++Count.total > Count.max_tot) |
571 |
|
if (++Count.total > Count.max_tot) |
572 |
|
Count.max_tot = Count.total; |
573 |
|
|
560 |
– |
++source_p->from->serv->dep_users; |
561 |
– |
|
574 |
|
SetClient(source_p); |
575 |
< |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users); |
575 |
> |
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); |
576 |
|
add_user_host(source_p->username, source_p->host, 1); |
577 |
|
SetUserHost(source_p); |
578 |
|
|
599 |
|
else |
600 |
|
send_umode(NULL, source_p, 0, SEND_UMODES, ubuf); |
601 |
|
|
602 |
+ |
watch_check_hash(source_p, RPL_LOGON); |
603 |
+ |
|
604 |
|
if (*ubuf == '\0') |
605 |
|
{ |
606 |
|
ubuf[0] = '+'; |
607 |
|
ubuf[1] = '\0'; |
608 |
|
} |
609 |
|
|
610 |
< |
/* arghhh one could try not introducing new nicks to ll leafs |
597 |
< |
* but then you have to introduce them "on the fly" in SJOIN |
598 |
< |
* not fun. |
599 |
< |
* Its not going to cost much more bandwidth to simply let new |
600 |
< |
* nicks just ride on through. |
601 |
< |
*/ |
602 |
< |
|
603 |
< |
/* We now introduce nicks "on the fly" in SJOIN anyway -- |
604 |
< |
* you _need_ to if you aren't going to burst everyone initially. |
605 |
< |
* |
606 |
< |
* Only send to non CAP_LL servers, unless we're a lazylink leaf, |
607 |
< |
* in that case just send it to the uplink. |
608 |
< |
* -davidt |
609 |
< |
* rewritten to cope with SIDs .. eww eww eww --is |
610 |
< |
*/ |
611 |
< |
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) && |
612 |
< |
client_p != uplink) |
610 |
> |
DLINK_FOREACH(server_node, serv_list.head) |
611 |
|
{ |
612 |
< |
if (IsCapable(uplink, CAP_TS6) && HasID(source_p)) |
613 |
< |
{ |
614 |
< |
sendto_one(uplink, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
612 |
> |
struct Client *server = server_node->data; |
613 |
> |
|
614 |
> |
if (server == client_p) |
615 |
> |
continue; |
616 |
> |
|
617 |
> |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
618 |
> |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
619 |
|
source_p->servptr->id, |
620 |
|
source_p->name, source_p->hopcount+1, |
621 |
|
(unsigned long)source_p->tsinfo, |
622 |
|
ubuf, source_p->username, source_p->host, |
623 |
|
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
624 |
|
"0" : source_p->sockhost, source_p->id, source_p->info); |
623 |
– |
} |
625 |
|
else |
626 |
< |
{ |
626 |
< |
sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s", |
626 |
> |
sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", |
627 |
|
source_p->name, source_p->hopcount+1, |
628 |
|
(unsigned long)source_p->tsinfo, |
629 |
|
ubuf, source_p->username, source_p->host, |
630 |
|
source_p->servptr->name, source_p->info); |
631 |
– |
} |
632 |
– |
} |
633 |
– |
else |
634 |
– |
{ |
635 |
– |
DLINK_FOREACH(server_node, serv_list.head) |
636 |
– |
{ |
637 |
– |
struct Client *server = server_node->data; |
638 |
– |
|
639 |
– |
if (IsCapable(server, CAP_LL) || server == client_p) |
640 |
– |
continue; |
641 |
– |
|
642 |
– |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
643 |
– |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
644 |
– |
source_p->servptr->id, |
645 |
– |
source_p->name, source_p->hopcount+1, |
646 |
– |
(unsigned long)source_p->tsinfo, |
647 |
– |
ubuf, source_p->username, source_p->host, |
648 |
– |
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
649 |
– |
"0" : source_p->sockhost, source_p->id, source_p->info); |
650 |
– |
else |
651 |
– |
sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", |
652 |
– |
source_p->name, source_p->hopcount+1, |
653 |
– |
(unsigned long)source_p->tsinfo, |
654 |
– |
ubuf, source_p->username, source_p->host, |
655 |
– |
source_p->servptr->name, source_p->info); |
656 |
– |
} |
631 |
|
} |
632 |
|
} |
633 |
|
|
812 |
|
|
813 |
|
strlcpy(source_p->info, realname, sizeof(source_p->info)); |
814 |
|
|
815 |
+ |
/* stash for later */ |
816 |
+ |
strlcpy(source_p->client_host, host, sizeof(source_p->client_host)); |
817 |
+ |
strlcpy(source_p->client_server, server, sizeof(source_p->client_server)); |
818 |
+ |
|
819 |
|
if (!IsGotId(source_p)) |
820 |
|
{ |
821 |
|
/* save the username in the client |
1028 |
|
/* send_umode() |
1029 |
|
* send the MODE string for user (user) to connection client_p |
1030 |
|
* -avalon |
1031 |
+ |
* |
1032 |
+ |
* inputs - client_p |
1033 |
+ |
* - source_p |
1034 |
+ |
* - int old |
1035 |
+ |
* - sendmask mask of modes to send |
1036 |
+ |
* - suplied umode_buf |
1037 |
+ |
* output - NONE |
1038 |
|
*/ |
1039 |
|
void |
1040 |
|
send_umode(struct Client *client_p, struct Client *source_p, |
1113 |
|
struct Client *target_p = ptr->data; |
1114 |
|
|
1115 |
|
if ((target_p != client_p) && (target_p != source_p)) |
1116 |
< |
{ |
1117 |
< |
if ((!(ServerInfo.hub && IsCapable(target_p, CAP_LL))) || |
1118 |
< |
(target_p->localClient->serverMask & |
1134 |
< |
source_p->lazyLinkClientExists)) |
1135 |
< |
sendto_one(target_p, ":%s MODE %s :%s", |
1136 |
< |
ID_or_name(source_p, target_p), |
1137 |
< |
ID_or_name(source_p, target_p), buf); |
1138 |
< |
} |
1116 |
> |
sendto_one(target_p, ":%s MODE %s :%s", |
1117 |
> |
ID_or_name(source_p, target_p), |
1118 |
> |
ID_or_name(source_p, target_p), buf); |
1119 |
|
} |
1120 |
|
} |
1121 |
|
|
1255 |
|
source_p->umodes |= (UMODE_SERVNOTICE|UMODE_OPERWALL| |
1256 |
|
UMODE_WALLOP|UMODE_LOCOPS); |
1257 |
|
|
1258 |
+ |
if (!(old & UMODE_INVISIBLE) && IsInvisible(source_p)) |
1259 |
+ |
++Count.invisi; |
1260 |
+ |
if ((old & UMODE_INVISIBLE) && !IsInvisible(source_p)) |
1261 |
+ |
--Count.invisi; |
1262 |
+ |
|
1263 |
|
assert(dlinkFind(&oper_list, source_p) == NULL); |
1264 |
|
dlinkAdd(source_p, make_dlink_node(), &oper_list); |
1265 |
|
|