40 |
|
#include "log.h" |
41 |
|
#include "server.h" |
42 |
|
#include "send.h" |
43 |
– |
#include "supported.h" |
43 |
|
#include "memory.h" |
44 |
|
#include "packet.h" |
45 |
|
#include "rng_mt.h" |
126 |
|
UMODE_WALLOP, /* w */ |
127 |
|
UMODE_HIDDENHOST, /* x */ |
128 |
|
UMODE_SPY, /* y */ |
129 |
< |
UMODE_OPERWALL, /* z 0x7A */ |
129 |
> |
0, /* z 0x7A */ |
130 |
|
0,0,0,0,0, /* 0x7B - 0x7F */ |
131 |
|
|
132 |
|
/* 0x80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x8F */ |
174 |
|
if (dlink_list_length(&unknown_list)) |
175 |
|
sendto_one_numeric(source_p, &me, RPL_LUSERUNKNOWN, dlink_list_length(&unknown_list)); |
176 |
|
|
177 |
< |
if (dlink_list_length(&global_channel_list)) |
178 |
< |
sendto_one_numeric(source_p, &me, RPL_LUSERCHANNELS, dlink_list_length(&global_channel_list)); |
177 |
> |
if (dlink_list_length(&channel_list)) |
178 |
> |
sendto_one_numeric(source_p, &me, RPL_LUSERCHANNELS, dlink_list_length(&channel_list)); |
179 |
|
|
180 |
|
if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) |
181 |
|
{ |
285 |
|
char ubuf[IRCD_BUFSIZE] = ""; |
286 |
|
|
287 |
|
if (MyClient(source_p)) |
288 |
< |
send_umode(source_p, source_p, 0, SEND_UMODES, ubuf); |
288 |
> |
send_umode(source_p, source_p, 0, ubuf); |
289 |
|
else |
290 |
< |
send_umode(NULL, source_p, 0, SEND_UMODES, ubuf); |
290 |
> |
send_umode(NULL, source_p, 0, ubuf); |
291 |
|
|
292 |
|
watch_check_hash(source_p, RPL_LOGON); |
293 |
|
|
475 |
|
source_p->username[i++] = '~'; |
476 |
|
|
477 |
|
for (; *p && i < USERLEN; ++p) |
478 |
< |
if (*p != '[') |
480 |
< |
source_p->username[i++] = *p; |
478 |
> |
source_p->username[i++] = *p; |
479 |
|
|
480 |
|
source_p->username[i] = '\0'; |
481 |
|
} |
603 |
|
* is introduced by a server. |
604 |
|
*/ |
605 |
|
void |
606 |
< |
register_remote_user(struct Client *source_p, const char *username, |
609 |
< |
const char *host, const char *server) |
606 |
> |
register_remote_user(struct Client *source_p) |
607 |
|
{ |
608 |
|
struct Client *target_p = NULL; |
609 |
|
|
613 |
– |
assert(source_p->username != username); |
614 |
– |
|
615 |
– |
strlcpy(source_p->host, host, sizeof(source_p->host)); |
616 |
– |
strlcpy(source_p->username, username, sizeof(source_p->username)); |
617 |
– |
|
618 |
– |
/* |
619 |
– |
* Coming from another server, take the servers word for it |
620 |
– |
*/ |
621 |
– |
source_p->servptr = hash_find_server(server); |
622 |
– |
|
623 |
– |
/* |
624 |
– |
* Super GhostDetect: |
625 |
– |
* If we can't find the server the user is supposed to be on, |
626 |
– |
* then simply blow the user away. -Taner |
627 |
– |
*/ |
628 |
– |
if (source_p->servptr == NULL) |
629 |
– |
{ |
630 |
– |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
631 |
– |
"No server %s for user %s[%s@%s] from %s", |
632 |
– |
server, source_p->name, source_p->username, |
633 |
– |
source_p->host, source_p->from->name); |
634 |
– |
sendto_one(source_p->from, |
635 |
– |
":%s KILL %s :%s (Ghosted, server %s doesn't exist)", |
636 |
– |
me.id, source_p->id, me.name, server); |
637 |
– |
|
638 |
– |
AddFlag(source_p, FLAGS_KILLED); |
639 |
– |
exit_client(source_p, "Ghosted Client"); |
640 |
– |
return; |
641 |
– |
} |
642 |
– |
|
610 |
|
if ((target_p = source_p->servptr) && target_p->from != source_p->from) |
611 |
|
{ |
612 |
|
sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, |
689 |
|
int |
690 |
|
valid_username(const char *username, const int local) |
691 |
|
{ |
692 |
< |
int dots = 0; |
692 |
> |
unsigned int dots = 0; |
693 |
|
const char *p = username; |
694 |
|
|
695 |
|
assert(p); |
727 |
|
return 0; |
728 |
|
} |
729 |
|
|
730 |
< |
return p - username <= USERLEN;; |
730 |
> |
return p - username <= USERLEN; |
731 |
|
} |
732 |
|
|
733 |
|
/* clean_nick_name() |
770 |
|
*/ |
771 |
|
void |
772 |
|
send_umode(struct Client *client_p, struct Client *source_p, |
773 |
< |
unsigned int old, unsigned int sendmask, char *umode_buf) |
773 |
> |
unsigned int old, char *umode_buf) |
774 |
|
{ |
775 |
|
char *m = umode_buf; |
776 |
|
int what = 0; |
786 |
|
if (!flag) |
787 |
|
continue; |
788 |
|
|
822 |
– |
if (MyClient(source_p) && !(flag & sendmask)) |
823 |
– |
continue; |
824 |
– |
|
789 |
|
if ((flag & old) && !HasUMode(source_p, flag)) |
790 |
|
{ |
791 |
|
if (what == MODE_DEL) |
830 |
|
{ |
831 |
|
char buf[IRCD_BUFSIZE] = ""; |
832 |
|
|
833 |
< |
send_umode(NULL, source_p, old, SEND_UMODES, buf); |
833 |
> |
send_umode(NULL, source_p, old, buf); |
834 |
|
|
835 |
|
if (buf[0]) |
836 |
|
sendto_server(source_p, NOCAPS, NOCAPS, ":%s MODE %s :%s", |
837 |
|
source_p->id, source_p->id, buf); |
838 |
|
|
839 |
|
if (client_p && MyClient(client_p)) |
840 |
< |
send_umode(client_p, source_p, old, 0xffffffff, buf); |
840 |
> |
send_umode(client_p, source_p, old, buf); |
841 |
|
} |
842 |
|
|
843 |
|
void |
1063 |
|
init_isupport(void) |
1064 |
|
{ |
1065 |
|
add_isupport("CALLERID", NULL, -1); |
1066 |
< |
add_isupport("CASEMAPPING", CASEMAP, -1); |
1066 |
> |
add_isupport("CASEMAPPING", "rfc1459", -1); |
1067 |
|
add_isupport("DEAF", "D", -1); |
1068 |
|
add_isupport("KICKLEN", NULL, KICKLEN); |
1069 |
|
add_isupport("MODES", NULL, MAXMODEPARAMS); |
1106 |
– |
#ifdef HALFOPS |
1070 |
|
add_isupport("PREFIX", "(ohv)@%+", -1); |
1071 |
|
add_isupport("STATUSMSG", "@%+", -1); |
1109 |
– |
#else |
1110 |
– |
add_isupport("PREFIX", "(ov)@+", -1); |
1111 |
– |
add_isupport("STATUSMSG", "@+", -1); |
1112 |
– |
#endif |
1072 |
|
add_isupport("EXCEPTS", "e", -1); |
1073 |
|
add_isupport("INVEX", "I", -1); |
1074 |
|
} |
1086 |
|
add_isupport(const char *name, const char *options, int n) |
1087 |
|
{ |
1088 |
|
dlink_node *ptr; |
1089 |
< |
struct Isupport *support; |
1089 |
> |
struct Isupport *support = NULL; |
1090 |
|
|
1091 |
|
DLINK_FOREACH(ptr, support_list.head) |
1092 |
|
{ |