| 52 |
|
#include "parse.h" |
| 53 |
|
#include "watch.h" |
| 54 |
|
|
| 55 |
– |
|
| 55 |
|
static char umode_buffer[IRCD_BUFSIZE]; |
| 56 |
|
|
| 57 |
|
static void user_welcome(struct Client *); |
| 64 |
|
* used with init_isupport, add_isupport, delete_isupport |
| 65 |
|
*/ |
| 66 |
|
|
| 67 |
< |
struct Isupport |
| 67 |
> |
struct Isupport |
| 68 |
|
{ |
| 69 |
|
dlink_node node; |
| 70 |
|
char *name; |
| 72 |
|
int number; |
| 73 |
|
}; |
| 74 |
|
|
| 75 |
< |
static dlink_list support_list = { NULL, NULL, 0 }; |
| 76 |
< |
MessageFile *isupportFile; |
| 75 |
> |
static dlink_list support_list; |
| 76 |
> |
static dlink_list support_list_lines; |
| 77 |
|
|
| 78 |
|
/* memory is cheap. map 0-255 to equivalent mode */ |
| 79 |
|
const unsigned int user_modes[256] = |
| 85 |
|
0, /* @ */ |
| 86 |
|
0, /* A */ |
| 87 |
|
0, /* B */ |
| 88 |
< |
UMODE_CCONN_FULL, /* C */ |
| 88 |
> |
0, /* C */ |
| 89 |
|
UMODE_DEAF, /* D */ |
| 90 |
|
0, /* E */ |
| 91 |
|
UMODE_FARCONNECT, /* F */ |
| 101 |
|
0, /* P */ |
| 102 |
|
0, /* Q */ |
| 103 |
|
UMODE_REGONLY, /* R */ |
| 104 |
< |
0, /* S */ |
| 104 |
> |
UMODE_SSL, /* S */ |
| 105 |
|
0, /* T */ |
| 106 |
|
0, /* U */ |
| 107 |
|
0, /* V */ |
| 108 |
< |
0, /* W */ |
| 108 |
> |
UMODE_WEBIRC, /* W */ |
| 109 |
|
0, /* X */ |
| 110 |
|
0, /* Y */ |
| 111 |
|
0, /* Z 0x5A */ |
| 112 |
< |
0, 0, 0, 0, 0, /* 0x5F */ |
| 112 |
> |
0, 0, 0, 0, 0, /* 0x5F */ |
| 113 |
|
0, /* 0x60 */ |
| 114 |
|
UMODE_ADMIN, /* a */ |
| 115 |
|
UMODE_BOTS, /* b */ |
| 134 |
|
UMODE_UNAUTH, /* u */ |
| 135 |
|
0, /* v */ |
| 136 |
|
UMODE_WALLOP, /* w */ |
| 137 |
< |
0, /* x */ |
| 137 |
> |
UMODE_HIDDENHOST, /* x */ |
| 138 |
|
UMODE_SPY, /* y */ |
| 139 |
|
UMODE_OPERWALL, /* z 0x7A */ |
| 140 |
|
0,0,0,0,0, /* 0x7B - 0x7F */ |
| 169 |
|
* side effects - display to client user counts etc. |
| 170 |
|
*/ |
| 171 |
|
void |
| 172 |
< |
show_lusers(struct Client *source_p) |
| 172 |
> |
show_lusers(struct Client *source_p) |
| 173 |
|
{ |
| 174 |
|
const char *from, *to; |
| 175 |
|
|
| 215 |
|
{ |
| 216 |
|
sendto_one(source_p, form_str(RPL_LUSERME), |
| 217 |
|
from, to, Count.total, 0); |
| 218 |
< |
sendto_one(source_p, form_str(RPL_LOCALUSERS), |
| 218 |
> |
sendto_one(source_p, form_str(RPL_LOCALUSERS), |
| 219 |
|
from, to, Count.total, Count.max_tot); |
| 220 |
|
} |
| 221 |
|
|
| 230 |
|
Count.max_loc_cli = Count.local; |
| 231 |
|
|
| 232 |
|
if ((Count.local + Count.myserver) > Count.max_loc_con) |
| 233 |
< |
Count.max_loc_con = Count.local + Count.myserver; |
| 233 |
> |
Count.max_loc_con = Count.local + Count.myserver; |
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
/* show_isupport() |
| 240 |
|
* side effects - display to client what we support (for them) |
| 241 |
|
*/ |
| 242 |
|
void |
| 243 |
< |
show_isupport(struct Client *source_p) |
| 243 |
> |
show_isupport(struct Client *source_p) |
| 244 |
|
{ |
| 245 |
< |
send_message_file(source_p, isupportFile); |
| 245 |
> |
const dlink_node *ptr = NULL; |
| 246 |
> |
|
| 247 |
> |
DLINK_FOREACH(ptr, support_list_lines.head) |
| 248 |
> |
sendto_one(source_p, form_str(RPL_ISUPPORT), me.name, |
| 249 |
> |
source_p->name, ptr->data); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
/* |
| 287 |
|
|
| 288 |
|
if (ConfigFileEntry.ping_cookie) |
| 289 |
|
{ |
| 290 |
< |
if (!IsPingSent(source_p) && source_p->localClient->random_ping == 0) |
| 290 |
> |
if (!IsPingSent(source_p) && !source_p->localClient->random_ping) |
| 291 |
|
{ |
| 292 |
|
do |
| 293 |
|
source_p->localClient->random_ping = genrand_int32(); |
| 310 |
|
if (!check_client(source_p)) |
| 311 |
|
return; |
| 312 |
|
|
| 313 |
< |
if (valid_hostname(source_p->host) == 0) |
| 313 |
> |
if (!valid_hostname(source_p->host)) |
| 314 |
|
{ |
| 315 |
|
sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You have an illegal " |
| 316 |
|
"character in your hostname", me.name, source_p->name); |
| 393 |
|
} |
| 394 |
|
|
| 395 |
|
/* valid user name check */ |
| 396 |
< |
if (valid_username(source_p->username) == 0) |
| 396 |
> |
if (!valid_username(source_p->username, 1)) |
| 397 |
|
{ |
| 398 |
|
char tmpstr2[IRCD_BUFSIZE]; |
| 399 |
|
|
| 424 |
|
get_client_class(&source_p->localClient->confs), |
| 425 |
|
source_p->info, source_p->id); |
| 426 |
|
|
| 424 |
– |
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE, |
| 425 |
– |
"CLICONN %s %s %s %s %s %s %s 0 %s", |
| 426 |
– |
source_p->name, source_p->username, source_p->host, |
| 427 |
– |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
| 428 |
– |
"255.255.255.255" : source_p->sockhost, |
| 429 |
– |
get_client_class(&source_p->localClient->confs), |
| 430 |
– |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
| 431 |
– |
"<hidden>" : source_p->localClient->client_host, |
| 432 |
– |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
| 433 |
– |
"<hidden>" : source_p->localClient->client_server, |
| 434 |
– |
source_p->info); |
| 435 |
– |
|
| 436 |
– |
|
| 427 |
|
if (ConfigFileEntry.invisible_on_connect) |
| 428 |
|
{ |
| 429 |
|
AddUMode(source_p, UMODE_INVISIBLE); |
| 430 |
|
++Count.invisi; |
| 431 |
|
} |
| 432 |
|
|
| 433 |
< |
if ((++Count.local) > Count.max_loc) |
| 433 |
> |
if (++Count.local > Count.max_loc) |
| 434 |
|
{ |
| 435 |
|
Count.max_loc = Count.local; |
| 436 |
|
|
| 484 |
|
assert(source_p != NULL); |
| 485 |
|
assert(source_p->username != username); |
| 486 |
|
|
| 487 |
< |
strlcpy(source_p->host, host, sizeof(source_p->host)); |
| 487 |
> |
strlcpy(source_p->host, host, sizeof(source_p->host)); |
| 488 |
|
strlcpy(source_p->username, username, sizeof(source_p->username)); |
| 489 |
|
|
| 490 |
|
/* |
| 563 |
|
introduce_client(struct Client *source_p) |
| 564 |
|
{ |
| 565 |
|
dlink_node *server_node = NULL; |
| 566 |
< |
static char ubuf[12]; |
| 566 |
> |
char ubuf[66]; |
| 567 |
|
|
| 568 |
|
if (MyClient(source_p)) |
| 569 |
|
send_umode(source_p, source_p, 0, SEND_UMODES, ubuf); |
| 572 |
|
|
| 573 |
|
watch_check_hash(source_p, RPL_LOGON); |
| 574 |
|
|
| 575 |
< |
if (*ubuf == '\0') |
| 575 |
> |
if (ubuf[0] == '\0') |
| 576 |
|
{ |
| 577 |
|
ubuf[0] = '+'; |
| 578 |
|
ubuf[1] = '\0'; |
| 623 |
|
ubuf, source_p->username, source_p->host, |
| 624 |
|
source_p->servptr->name, source_p->info); |
| 625 |
|
} |
| 626 |
+ |
|
| 627 |
+ |
if (!EmptyString(source_p->certfp)) |
| 628 |
+ |
sendto_one(server, ":%s CERTFP %s", ID(source_p), source_p->certfp); |
| 629 |
|
} |
| 630 |
|
} |
| 631 |
|
|
| 645 |
|
|
| 646 |
|
assert(p != NULL); |
| 647 |
|
|
| 648 |
< |
if (*p == '.' || *p == ':') |
| 648 |
> |
if (EmptyString(p) || *p == '.' || *p == ':') |
| 649 |
|
return 0; |
| 650 |
|
|
| 651 |
|
for (; *p; ++p) |
| 667 |
|
* style of username |
| 668 |
|
*/ |
| 669 |
|
int |
| 670 |
< |
valid_username(const char *username) |
| 670 |
> |
valid_username(const char *username, const int local) |
| 671 |
|
{ |
| 672 |
|
int dots = 0; |
| 673 |
|
const char *p = username; |
| 677 |
|
if (*p == '~') |
| 678 |
|
++p; |
| 679 |
|
|
| 680 |
< |
/* reject usernames that don't start with an alphanum |
| 680 |
> |
/* |
| 681 |
> |
* Reject usernames that don't start with an alphanum |
| 682 |
|
* i.e. reject jokers who have '-@somehost' or '.@somehost' |
| 683 |
|
* or "-hi-@somehost", "h-----@somehost" would still be accepted. |
| 684 |
|
*/ |
| 685 |
|
if (!IsAlNum(*p)) |
| 686 |
|
return 0; |
| 687 |
|
|
| 688 |
< |
while (*++p) |
| 688 |
> |
if (local) |
| 689 |
|
{ |
| 690 |
< |
if ((*p == '.') && ConfigFileEntry.dots_in_ident) |
| 690 |
> |
while (*++p) |
| 691 |
|
{ |
| 692 |
< |
if (++dots > ConfigFileEntry.dots_in_ident) |
| 693 |
< |
return 0; |
| 694 |
< |
if (!IsUserChar(*(p + 1))) |
| 692 |
> |
if ((*p == '.') && ConfigFileEntry.dots_in_ident) |
| 693 |
> |
{ |
| 694 |
> |
if (++dots > ConfigFileEntry.dots_in_ident) |
| 695 |
> |
return 0; |
| 696 |
> |
if (!IsUserChar(*(p + 1))) |
| 697 |
> |
return 0; |
| 698 |
> |
} |
| 699 |
> |
else if (!IsUserChar(*p)) |
| 700 |
|
return 0; |
| 701 |
|
} |
| 702 |
< |
else if (!IsUserChar(*p)) |
| 703 |
< |
return 0; |
| 702 |
> |
} |
| 703 |
> |
else |
| 704 |
> |
{ |
| 705 |
> |
while (*++p) |
| 706 |
> |
if (!IsUserChar(*p)) |
| 707 |
> |
return 0; |
| 708 |
|
} |
| 709 |
|
|
| 710 |
< |
return 1; |
| 710 |
> |
return p - username <= USERLEN;; |
| 711 |
|
} |
| 712 |
|
|
| 713 |
|
/* clean_nick_name() |
| 748 |
|
{ |
| 749 |
|
/* If this user is being spoofed, tell them so */ |
| 750 |
|
if (IsConfDoSpoofIp(conf)) |
| 748 |
– |
{ |
| 751 |
|
sendto_one(source_p, |
| 752 |
< |
":%s NOTICE %s :*** Spoofing your IP. congrats.", |
| 752 |
> |
":%s NOTICE %s :*** Spoofing your IP. Congrats.", |
| 753 |
|
me.name, source_p->name); |
| 752 |
– |
} |
| 754 |
|
|
| 755 |
|
/* If this user is in the exception class, Set it "E lined" */ |
| 756 |
|
if (IsConfExemptKline(conf)) |
| 757 |
|
{ |
| 758 |
|
SetExemptKline(source_p); |
| 759 |
|
sendto_one(source_p, |
| 760 |
< |
":%s NOTICE %s :*** You are exempt from K/D/G lines. congrats.", |
| 760 |
> |
":%s NOTICE %s :*** You are exempt from K/D/G lines. Congrats.", |
| 761 |
|
me.name, source_p->name); |
| 762 |
|
} |
| 763 |
|
|
| 764 |
< |
/* The else here is to make sure that G line exempt users |
| 764 |
> |
/* |
| 765 |
> |
* The else here is to make sure that G line exempt users |
| 766 |
|
* do not get noticed twice. |
| 767 |
|
*/ |
| 768 |
|
else if (IsConfExemptGline(conf)) |
| 769 |
|
{ |
| 770 |
|
SetExemptGline(source_p); |
| 771 |
< |
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from G lines.", |
| 771 |
> |
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from G lines. Congrats.", |
| 772 |
|
me.name, source_p->name); |
| 773 |
|
} |
| 774 |
|
|
| 775 |
|
if (IsConfExemptResv(conf)) |
| 776 |
|
{ |
| 777 |
|
SetExemptResv(source_p); |
| 778 |
< |
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from resvs.", |
| 778 |
> |
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from resvs. Congrats.", |
| 779 |
|
me.name, source_p->name); |
| 780 |
|
} |
| 781 |
|
|
| 784 |
|
{ |
| 785 |
|
SetExemptLimits(source_p); |
| 786 |
|
sendto_one(source_p, |
| 787 |
< |
":%s NOTICE %s :*** You are exempt from user limits. congrats.", |
| 787 |
> |
":%s NOTICE %s :*** You are exempt from user limits. Congrats.", |
| 788 |
|
me.name,source_p->name); |
| 789 |
|
} |
| 790 |
|
|
| 835 |
|
m = buf; |
| 836 |
|
*m++ = '+'; |
| 837 |
|
|
| 838 |
< |
for (i = 0; i < 128; i++) |
| 838 |
> |
for (i = 0; i < 128; ++i) |
| 839 |
|
if (HasUMode(source_p, user_modes[i])) |
| 840 |
|
*m++ = (char)i; |
| 841 |
|
*m = '\0'; |
| 849 |
|
setflags = source_p->umodes; |
| 850 |
|
|
| 851 |
|
/* parse mode change string(s) */ |
| 852 |
< |
for (p = &parv[2]; p && *p; p++) |
| 852 |
> |
for (p = &parv[2]; p && *p; ++p) |
| 853 |
|
{ |
| 854 |
< |
for (m = *p; *m; m++) |
| 854 |
> |
for (m = *p; *m; ++m) |
| 855 |
|
{ |
| 856 |
|
switch (*m) |
| 857 |
|
{ |
| 872 |
|
} |
| 873 |
|
else |
| 874 |
|
{ |
| 873 |
– |
/* Only decrement the oper counts if an oper to begin with |
| 874 |
– |
* found by Pat Szuta, Perly , perly@xnet.com |
| 875 |
– |
*/ |
| 875 |
|
if (!HasUMode(source_p, UMODE_OPER)) |
| 876 |
|
break; |
| 877 |
|
|
| 880 |
|
|
| 881 |
|
if (MyConnect(source_p)) |
| 882 |
|
{ |
| 883 |
< |
dlink_node *dm; |
| 883 |
> |
dlink_node *dm = NULL; |
| 884 |
|
|
| 885 |
|
detach_conf(source_p, CONF_OPER); |
| 886 |
|
ClrOFlag(source_p); |
| 893 |
|
|
| 894 |
|
break; |
| 895 |
|
|
| 896 |
< |
/* |
| 897 |
< |
* We may not get these, but they shouldnt be in default |
| 898 |
< |
*/ |
| 899 |
< |
case 'r': |
| 901 |
< |
case ' ' : |
| 902 |
< |
case '\n': |
| 903 |
< |
case '\r': |
| 904 |
< |
case '\t': |
| 896 |
> |
case 'S': /* Only servers may set +S in a burst */ |
| 897 |
> |
case 'W': /* Only servers may set +W in a burst */ |
| 898 |
> |
case 'r': /* Only services may set +r */ |
| 899 |
> |
case 'x': /* Only services may set +x */ |
| 900 |
|
break; |
| 901 |
|
|
| 902 |
|
default: |
| 913 |
|
DelUMode(source_p, flag); |
| 914 |
|
} |
| 915 |
|
} |
| 916 |
< |
else |
| 917 |
< |
{ |
| 923 |
< |
if (MyConnect(source_p)) |
| 924 |
< |
badflag = 1; |
| 925 |
< |
} |
| 916 |
> |
else if (MyConnect(source_p)) |
| 917 |
> |
badflag = 1; |
| 918 |
|
|
| 919 |
|
break; |
| 920 |
|
} |
| 969 |
|
* build a string in umode_buf to represent the change in the user's |
| 970 |
|
* mode between the new (source_p->umodes) and 'old'. |
| 971 |
|
*/ |
| 972 |
< |
for (i = 0; i < 128; i++) |
| 972 |
> |
for (i = 0; i < 128; ++i) |
| 973 |
|
{ |
| 974 |
|
flag = user_modes[i]; |
| 975 |
|
if (!flag) |
| 1043 |
|
} |
| 1044 |
|
|
| 1045 |
|
void |
| 1046 |
< |
user_set_hostmask(struct Client *target_p, const char *hostname) |
| 1046 |
> |
user_set_hostmask(struct Client *target_p, const char *hostname, const int what) |
| 1047 |
|
{ |
| 1048 |
< |
if (!valid_hostname(hostname)) |
| 1048 |
> |
dlink_node *ptr = NULL; |
| 1049 |
> |
|
| 1050 |
> |
if (!strcmp(target_p->host, hostname)) |
| 1051 |
|
return; |
| 1052 |
|
|
| 1053 |
+ |
switch (what) |
| 1054 |
+ |
{ |
| 1055 |
+ |
case MODE_ADD: |
| 1056 |
+ |
AddUMode(target_p, UMODE_HIDDENHOST); |
| 1057 |
+ |
AddFlag(target_p, FLAGS_IP_SPOOFING); |
| 1058 |
+ |
break; |
| 1059 |
+ |
case MODE_DEL: |
| 1060 |
+ |
DelUMode(target_p, UMODE_HIDDENHOST); |
| 1061 |
+ |
|
| 1062 |
+ |
if (!HasFlag(target_p, FLAGS_AUTH_SPOOF)) |
| 1063 |
+ |
DelFlag(target_p, FLAGS_IP_SPOOFING); |
| 1064 |
+ |
break; |
| 1065 |
+ |
default: return; |
| 1066 |
+ |
} |
| 1067 |
+ |
|
| 1068 |
+ |
if (ConfigFileEntry.cycle_on_host_change) |
| 1069 |
+ |
sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname", |
| 1070 |
+ |
target_p->name, target_p->username, target_p->host); |
| 1071 |
+ |
|
| 1072 |
|
if (IsUserHostIp(target_p)) |
| 1073 |
|
delete_user_host(target_p->username, target_p->host, !MyConnect(target_p)); |
| 1074 |
|
|
| 1075 |
|
strlcpy(target_p->host, hostname, sizeof(target_p->host)); |
| 1063 |
– |
SetIPSpoof(target_p); |
| 1076 |
|
|
| 1077 |
|
add_user_host(target_p->username, target_p->host, !MyConnect(target_p)); |
| 1078 |
|
SetUserHost(target_p); |
| 1079 |
|
|
| 1080 |
|
if (MyClient(target_p)) |
| 1081 |
+ |
{ |
| 1082 |
+ |
sendto_one(target_p, form_str(RPL_NEWHOSTIS), me.name, |
| 1083 |
+ |
target_p->name, target_p->host); |
| 1084 |
|
clear_ban_cache_client(target_p); |
| 1085 |
+ |
} |
| 1086 |
+ |
|
| 1087 |
+ |
if (!ConfigFileEntry.cycle_on_host_change) |
| 1088 |
+ |
return; |
| 1089 |
+ |
|
| 1090 |
+ |
DLINK_FOREACH(ptr, target_p->channel.head) |
| 1091 |
+ |
{ |
| 1092 |
+ |
char modebuf[4], nickbuf[NICKLEN * 3 + 3] = { '\0' }; |
| 1093 |
+ |
char *p = modebuf; |
| 1094 |
+ |
int len = 0; |
| 1095 |
+ |
const struct Membership *ms = ptr->data; |
| 1096 |
+ |
|
| 1097 |
+ |
if (has_member_flags(ms, CHFL_CHANOP)) |
| 1098 |
+ |
{ |
| 1099 |
+ |
*p++ = 'o'; |
| 1100 |
+ |
len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); |
| 1101 |
+ |
} |
| 1102 |
+ |
|
| 1103 |
+ |
if (has_member_flags(ms, CHFL_HALFOP)) |
| 1104 |
+ |
{ |
| 1105 |
+ |
*p++ = 'h'; |
| 1106 |
+ |
len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); |
| 1107 |
+ |
} |
| 1108 |
+ |
|
| 1109 |
+ |
if (has_member_flags(ms, CHFL_VOICE)) |
| 1110 |
+ |
{ |
| 1111 |
+ |
*p++ = 'v'; |
| 1112 |
+ |
len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); |
| 1113 |
+ |
} |
| 1114 |
+ |
|
| 1115 |
+ |
*p = '\0'; |
| 1116 |
+ |
|
| 1117 |
+ |
sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s!%s@%s JOIN :%s", |
| 1118 |
+ |
target_p->name, target_p->username, target_p->host, |
| 1119 |
+ |
ms->chptr->chname); |
| 1120 |
+ |
if (nickbuf[0]) |
| 1121 |
+ |
sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s MODE %s +%s %s", |
| 1122 |
+ |
target_p->servptr->name, ms->chptr->chname, |
| 1123 |
+ |
modebuf, nickbuf); |
| 1124 |
+ |
|
| 1125 |
+ |
} |
| 1126 |
+ |
|
| 1127 |
+ |
if (target_p->away[0]) |
| 1128 |
+ |
sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY, |
| 1129 |
+ |
":%s!%s@%s AWAY :%s", |
| 1130 |
+ |
target_p->name, target_p->username, |
| 1131 |
+ |
target_p->host, target_p->away); |
| 1132 |
|
} |
| 1133 |
|
|
| 1134 |
|
/* user_welcome() |
| 1147 |
|
#endif |
| 1148 |
|
|
| 1149 |
|
#ifdef HAVE_LIBCRYPTO |
| 1150 |
< |
if (source_p->localClient->fd.ssl != NULL) |
| 1150 |
> |
if (HasFlag(source_p, FLAGS_SSL)) |
| 1151 |
> |
{ |
| 1152 |
> |
AddUMode(source_p, UMODE_SSL); |
| 1153 |
|
sendto_one(source_p, ":%s NOTICE %s :*** Connected securely via %s", |
| 1154 |
|
me.name, source_p->name, |
| 1155 |
|
ssl_get_cipher(source_p->localClient->fd.ssl)); |
| 1156 |
+ |
} |
| 1157 |
|
#endif |
| 1158 |
|
|
| 1159 |
< |
sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name, |
| 1160 |
< |
ServerInfo.network_name, source_p->name, |
| 1096 |
< |
source_p->username, source_p->host); |
| 1159 |
> |
sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name, |
| 1160 |
> |
ServerInfo.network_name, source_p->name); |
| 1161 |
|
sendto_one(source_p, form_str(RPL_YOURHOST), me.name, source_p->name, |
| 1162 |
|
get_listener_name(source_p->localClient->listener), ircd_version); |
| 1163 |
|
sendto_one(source_p, form_str(RPL_CREATED), |
| 1171 |
|
source_p->name, source_p->id); |
| 1172 |
|
|
| 1173 |
|
show_lusers(source_p); |
| 1174 |
< |
|
| 1111 |
< |
if (ConfigFileEntry.short_motd) |
| 1112 |
< |
{ |
| 1113 |
< |
sendto_one(source_p, ":%s NOTICE %s :*** Notice -- motd was last changed at %s", |
| 1114 |
< |
me.name, source_p->name, ConfigFileEntry.motd.lastChangedDate); |
| 1115 |
< |
sendto_one(source_p, |
| 1116 |
< |
":%s NOTICE %s :*** Notice -- Please read the motd if you haven't " |
| 1117 |
< |
"read it", me.name, source_p->name); |
| 1118 |
< |
sendto_one(source_p, form_str(RPL_MOTDSTART), |
| 1119 |
< |
me.name, source_p->name, me.name); |
| 1120 |
< |
sendto_one(source_p, form_str(RPL_MOTD), |
| 1121 |
< |
me.name, source_p->name, |
| 1122 |
< |
"*** This is the short motd ***"); |
| 1123 |
< |
sendto_one(source_p, form_str(RPL_ENDOFMOTD), |
| 1124 |
< |
me.name, source_p->name); |
| 1125 |
< |
} |
| 1126 |
< |
else |
| 1127 |
< |
send_message_file(source_p, &ConfigFileEntry.motd); |
| 1174 |
> |
motd_signon(source_p); |
| 1175 |
|
} |
| 1176 |
|
|
| 1177 |
|
/* check_xline() |
| 1215 |
|
* output - NONE |
| 1216 |
|
* side effects - Blindly opers up given source_p, using conf info |
| 1217 |
|
* all checks on passwords have already been done. |
| 1218 |
< |
* This could also be used by rsa oper routines. |
| 1218 |
> |
* This could also be used by rsa oper routines. |
| 1219 |
|
*/ |
| 1220 |
|
void |
| 1221 |
|
oper_up(struct Client *source_p) |
| 1267 |
|
|
| 1268 |
|
/* |
| 1269 |
|
* init_uid() |
| 1270 |
< |
* |
| 1270 |
> |
* |
| 1271 |
|
* inputs - NONE |
| 1272 |
|
* output - NONE |
| 1273 |
|
* side effects - new_uid is filled in with server id portion (sid) |
| 1285 |
|
strlcpy(new_uid, ServerInfo.sid, sizeof(new_uid)); |
| 1286 |
|
|
| 1287 |
|
for (i = 0; i < IRC_MAXSID; ++i) |
| 1288 |
< |
if (new_uid[i] == '\0') |
| 1288 |
> |
if (new_uid[i] == '\0') |
| 1289 |
|
new_uid[i] = 'A'; |
| 1290 |
|
|
| 1291 |
|
/* NOTE: if IRC_MAXUID != 6, this will have to be rewritten */ |
| 1245 |
– |
/* Yes nenolod, I have known it was off by one ever since I wrote it |
| 1246 |
– |
* But *JUST* for you, though, it really doesn't look as *pretty* |
| 1247 |
– |
* -Dianora |
| 1248 |
– |
*/ |
| 1292 |
|
memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID); |
| 1293 |
|
} |
| 1294 |
|
|
| 1349 |
|
void |
| 1350 |
|
init_isupport(void) |
| 1351 |
|
{ |
| 1309 |
– |
isupportFile = init_MessageLine(); |
| 1310 |
– |
|
| 1352 |
|
add_isupport("CALLERID", NULL, -1); |
| 1353 |
|
add_isupport("CASEMAPPING", CASEMAP, -1); |
| 1354 |
|
add_isupport("DEAF", "D", -1); |
| 1361 |
|
add_isupport("PREFIX", "(ov)@+", -1); |
| 1362 |
|
add_isupport("STATUSMSG", "@+", -1); |
| 1363 |
|
#endif |
| 1364 |
+ |
add_isupport("EXCEPTS", "e", -1); |
| 1365 |
+ |
add_isupport("INVEX", "I", -1); |
| 1366 |
|
} |
| 1367 |
|
|
| 1368 |
|
/* |
| 1446 |
|
{ |
| 1447 |
|
char isupportbuffer[IRCD_BUFSIZE]; |
| 1448 |
|
char *p = isupportbuffer; |
| 1449 |
< |
dlink_node *ptr = NULL; |
| 1449 |
> |
dlink_node *ptr = NULL, *ptr_next = NULL; |
| 1450 |
|
int n = 0; |
| 1451 |
|
int tokens = 0; |
| 1452 |
|
size_t len = 0; |
| 1453 |
|
size_t reserve = strlen(me.name) + HOSTLEN + strlen(form_str(RPL_ISUPPORT)); |
| 1454 |
|
|
| 1455 |
< |
destroy_MessageLine(isupportFile); |
| 1455 |
> |
DLINK_FOREACH_SAFE(ptr, ptr_next, support_list_lines.head) |
| 1456 |
> |
{ |
| 1457 |
> |
dlinkDelete(ptr, &support_list_lines); |
| 1458 |
> |
MyFree(ptr->data); |
| 1459 |
> |
free_dlink_node(ptr); |
| 1460 |
> |
} |
| 1461 |
|
|
| 1462 |
|
DLINK_FOREACH(ptr, support_list.head) |
| 1463 |
|
{ |
| 1487 |
|
if (*--p == ' ') |
| 1488 |
|
*p = '\0'; |
| 1489 |
|
|
| 1490 |
< |
addto_MessageLine(isupportFile, isupportbuffer); |
| 1490 |
> |
dlinkAddTail(xstrdup(isupportbuffer), make_dlink_node(), &support_list_lines); |
| 1491 |
|
p = isupportbuffer; |
| 1492 |
|
len = 0; |
| 1493 |
|
n = tokens = 0; |
| 1498 |
|
{ |
| 1499 |
|
if (*--p == ' ') |
| 1500 |
|
*p = '\0'; |
| 1501 |
< |
addto_MessageLine(isupportFile, isupportbuffer); |
| 1501 |
> |
dlinkAddTail(xstrdup(isupportbuffer), make_dlink_node(), &support_list_lines); |
| 1502 |
|
} |
| 1503 |
|
} |