106 |
|
0, /* O */ |
107 |
|
0, /* P */ |
108 |
|
0, /* Q */ |
109 |
< |
0, /* R */ |
110 |
< |
UMODE_REGONLY, /* S */ |
109 |
> |
UMODE_REGONLY, /* R */ |
110 |
> |
0, /* S */ |
111 |
|
0, /* T */ |
112 |
|
0, /* U */ |
113 |
|
0, /* V */ |
190 |
|
to = source_p->name; |
191 |
|
} |
192 |
|
|
193 |
< |
if (!ConfigServerHide.hide_servers || IsOper(source_p)) |
193 |
> |
if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) |
194 |
|
sendto_one(source_p, form_str(RPL_LUSERCLIENT), |
195 |
|
from, to, (Count.total-Count.invisi), |
196 |
|
Count.invisi, dlink_list_length(&global_serv_list)); |
210 |
|
sendto_one(source_p, form_str(RPL_LUSERCHANNELS), |
211 |
|
from, to, dlink_list_length(&global_channel_list)); |
212 |
|
|
213 |
< |
if (!ConfigServerHide.hide_servers || IsOper(source_p)) |
213 |
> |
if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) |
214 |
|
{ |
215 |
|
sendto_one(source_p, form_str(RPL_LUSERME), |
216 |
|
from, to, Count.local, Count.myserver); |
231 |
|
from, to, Count.total, Count.max_tot, |
232 |
|
Count.total, Count.max_tot); |
233 |
|
|
234 |
< |
if (!ConfigServerHide.hide_servers || IsOper(source_p)) |
234 |
> |
if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) |
235 |
|
sendto_one(source_p, form_str(RPL_STATSCONN), from, to, |
236 |
|
Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount); |
237 |
|
|
309 |
|
return; |
310 |
|
} |
311 |
|
|
312 |
< |
source_p->localClient->last = CurrentTime; |
312 |
> |
source_p->localClient->last_privmsg = CurrentTime; |
313 |
|
/* Straight up the maximum rate of flooding... */ |
314 |
|
source_p->localClient->allow_read = MAX_FLOOD_BURST; |
315 |
|
|
445 |
|
|
446 |
|
if (ConfigFileEntry.invisible_on_connect) |
447 |
|
{ |
448 |
< |
source_p->umodes |= UMODE_INVISIBLE; |
448 |
> |
AddUMode(source_p, UMODE_INVISIBLE); |
449 |
|
++Count.invisi; |
450 |
|
} |
451 |
|
|
522 |
|
source_p->host, source_p->from->name); |
523 |
|
kill_client(source_p->from, source_p, "%s (Server doesn't exist)", me.name); |
524 |
|
|
525 |
< |
SetKilled(source_p); |
525 |
> |
AddFlag(source_p, FLAGS_KILLED); |
526 |
|
exit_client(source_p, &me, "Ghosted Client"); |
527 |
|
return; |
528 |
|
} |
537 |
|
kill_client(source_p->from, source_p, |
538 |
|
"%s (NICK from wrong direction (%s != %s))", |
539 |
|
me.name, source_p->servptr->name, target_p->from->name); |
540 |
< |
SetKilled(source_p); |
540 |
> |
AddFlag(source_p, FLAGS_KILLED); |
541 |
|
exit_client(source_p, &me, "USER server wrong direction"); |
542 |
|
return; |
543 |
|
} |
546 |
|
* If the nick has been introduced by a services server, |
547 |
|
* make it a service as well. |
548 |
|
*/ |
549 |
< |
if (IsService(source_p->servptr)) |
550 |
< |
SetService(source_p); |
549 |
> |
if (HasFlag(source_p->servptr, FLAGS_SERVICE)) |
550 |
> |
AddFlag(source_p, FLAGS_SERVICE); |
551 |
|
|
552 |
|
/* Increment our total user count here */ |
553 |
|
if (++Count.total > Count.max_tot) |
595 |
|
if (server == source_p->from) |
596 |
|
continue; |
597 |
|
|
598 |
< |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
599 |
< |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
600 |
< |
source_p->servptr->id, |
601 |
< |
source_p->name, source_p->hopcount+1, |
602 |
< |
(unsigned long)source_p->tsinfo, |
603 |
< |
ubuf, source_p->username, source_p->host, |
604 |
< |
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
605 |
< |
"0" : source_p->sockhost, source_p->id, source_p->info); |
598 |
> |
if (IsCapable(server, CAP_SVS)) |
599 |
> |
{ |
600 |
> |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
601 |
> |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s %lu :%s", |
602 |
> |
source_p->servptr->id, |
603 |
> |
source_p->name, source_p->hopcount+1, |
604 |
> |
(unsigned long)source_p->tsinfo, |
605 |
> |
ubuf, source_p->username, source_p->host, |
606 |
> |
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
607 |
> |
"0" : source_p->sockhost, source_p->id, |
608 |
> |
(unsigned long)source_p->servicestamp, |
609 |
> |
source_p->info); |
610 |
> |
else |
611 |
> |
sendto_one(server, "NICK %s %d %lu %s %s %s %s %lu :%s", |
612 |
> |
source_p->name, source_p->hopcount+1, |
613 |
> |
(unsigned long)source_p->tsinfo, |
614 |
> |
ubuf, source_p->username, source_p->host, |
615 |
> |
source_p->servptr->name, (unsigned long)source_p->servicestamp, |
616 |
> |
source_p->info); |
617 |
> |
|
618 |
> |
} |
619 |
|
else |
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); |
620 |
> |
{ |
621 |
> |
if (IsCapable(server, CAP_TS6) && HasID(source_p)) |
622 |
> |
sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
623 |
> |
source_p->servptr->id, |
624 |
> |
source_p->name, source_p->hopcount+1, |
625 |
> |
(unsigned long)source_p->tsinfo, |
626 |
> |
ubuf, source_p->username, source_p->host, |
627 |
> |
(MyClient(source_p) && IsIPSpoof(source_p)) ? |
628 |
> |
"0" : source_p->sockhost, source_p->id, source_p->info); |
629 |
> |
else |
630 |
> |
sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", |
631 |
> |
source_p->name, source_p->hopcount+1, |
632 |
> |
(unsigned long)source_p->tsinfo, |
633 |
> |
ubuf, source_p->username, source_p->host, |
634 |
> |
source_p->servptr->name, source_p->info); |
635 |
> |
} |
636 |
|
} |
637 |
|
} |
638 |
|
|
786 |
|
me.name,source_p->name); |
787 |
|
} |
788 |
|
|
765 |
– |
/* If this user is exempt from idle time outs */ |
766 |
– |
if (IsConfIdlelined(aconf)) |
767 |
– |
{ |
768 |
– |
SetIdlelined(source_p); |
769 |
– |
sendto_one(source_p, |
770 |
– |
":%s NOTICE %s :*** You are exempt from idle limits. congrats.", |
771 |
– |
me.name, source_p->name); |
772 |
– |
} |
773 |
– |
|
789 |
|
if (IsConfCanFlood(aconf)) |
790 |
|
{ |
791 |
|
SetCanFlood(source_p); |
814 |
|
flag = va_arg(args, unsigned int); |
815 |
|
|
816 |
|
if (what == MODE_ADD) |
817 |
< |
source_p->umodes |= flag; |
817 |
> |
AddUMode(source_p, flag); |
818 |
|
else |
819 |
< |
source_p->umodes &= ~flag; |
819 |
> |
DelUMode(source_p, flag); |
820 |
|
|
821 |
|
return NULL; |
822 |
|
} |
867 |
|
*m++ = '+'; |
868 |
|
|
869 |
|
for (i = 0; i < 128; i++) |
870 |
< |
if (source_p->umodes & user_modes[i]) |
870 |
> |
if (HasUMode(source_p, user_modes[i])) |
871 |
|
*m++ = (char)i; |
872 |
|
*m = '\0'; |
873 |
|
|
897 |
|
case 'o': |
898 |
|
if (what == MODE_ADD) |
899 |
|
{ |
900 |
< |
if (IsServer(client_p) && !IsOper(source_p)) |
900 |
> |
if (IsServer(client_p) && !HasUMode(source_p, UMODE_OPER)) |
901 |
|
{ |
902 |
|
++Count.oper; |
903 |
|
SetOper(source_p); |
908 |
|
/* Only decrement the oper counts if an oper to begin with |
909 |
|
* found by Pat Szuta, Perly , perly@xnet.com |
910 |
|
*/ |
911 |
< |
if (!IsOper(source_p)) |
911 |
> |
if (!HasUMode(source_p, UMODE_OPER)) |
912 |
|
break; |
913 |
|
|
914 |
|
ClearOper(source_p); |
919 |
|
dlink_node *dm; |
920 |
|
|
921 |
|
detach_conf(source_p, OPER_TYPE); |
922 |
< |
ClearOperFlags(source_p); |
923 |
< |
source_p->umodes &= ~ConfigFileEntry.oper_only_umodes; |
922 |
> |
ClrOFlag(source_p); |
923 |
> |
DelUMode(source_p, ConfigFileEntry.oper_only_umodes); |
924 |
|
|
925 |
|
if ((dm = dlinkFindDelete(&oper_list, source_p)) != NULL) |
926 |
|
free_dlink_node(dm); |
942 |
|
default: |
943 |
|
if ((flag = user_modes[(unsigned char)*m])) |
944 |
|
{ |
945 |
< |
if (MyConnect(source_p) && !IsOper(source_p) && |
945 |
> |
if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) && |
946 |
|
(ConfigFileEntry.oper_only_umodes & flag)) |
947 |
|
{ |
948 |
|
badflag = 1; |
965 |
|
sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), |
966 |
|
me.name, source_p->name); |
967 |
|
|
968 |
< |
if (HasUMode(source_p, UMODE_NCHANGE) && !IsOperN(source_p)) |
968 |
> |
if (HasUMode(source_p, UMODE_NCHANGE) && !HasOFlag(source_p, OPER_FLAG_N)) |
969 |
|
{ |
970 |
< |
sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;", |
970 |
> |
sendto_one(source_p, ":%s NOTICE %s :*** You have no nchange flag;", |
971 |
|
me.name, source_p->name); |
972 |
< |
DelUMode(source_p, UMODE_NCHANGE); /* only tcm's really need this */ |
972 |
> |
DelUMode(source_p, UMODE_NCHANGE); |
973 |
|
} |
974 |
|
|
975 |
< |
if (MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) && |
976 |
< |
!IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p)) |
975 |
> |
if (MyConnect(source_p) && HasUMode(source_p, UMODE_ADMIN) && |
976 |
> |
!HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN|OPER_FLAG_ADMIN)) |
977 |
|
{ |
978 |
|
sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;", |
979 |
|
me.name, source_p->name); |
980 |
< |
source_p->umodes &= ~UMODE_ADMIN; |
980 |
> |
DelUMode(source_p, UMODE_ADMIN); |
981 |
|
} |
982 |
|
|
983 |
< |
if (!(setflags & UMODE_INVISIBLE) && IsInvisible(source_p)) |
983 |
> |
if (!(setflags & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE)) |
984 |
|
++Count.invisi; |
985 |
< |
if ((setflags & UMODE_INVISIBLE) && !IsInvisible(source_p)) |
985 |
> |
if ((setflags & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE)) |
986 |
|
--Count.invisi; |
987 |
|
|
988 |
|
/* |
1025 |
|
if (MyClient(source_p) && !(flag & sendmask)) |
1026 |
|
continue; |
1027 |
|
|
1028 |
< |
if ((flag & old) && !(source_p->umodes & flag)) |
1028 |
> |
if ((flag & old) && !HasUMode(source_p, flag)) |
1029 |
|
{ |
1030 |
|
if (what == MODE_DEL) |
1031 |
|
*m++ = (char)i; |
1036 |
|
*m++ = (char)i; |
1037 |
|
} |
1038 |
|
} |
1039 |
< |
else if (!(flag & old) && (source_p->umodes & flag)) |
1039 |
> |
else if (!(flag & old) && HasUMode(source_p, flag)) |
1040 |
|
{ |
1041 |
|
if (what == MODE_ADD) |
1042 |
|
*m++ = (char)i; |
1070 |
|
char buf[IRCD_BUFSIZE] = { '\0' }; |
1071 |
|
dlink_node *ptr = NULL; |
1072 |
|
|
1073 |
< |
send_umode(NULL, source_p, old, IsOperHiddenAdmin(source_p) ? |
1073 |
> |
send_umode(NULL, source_p, old, HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN) ? |
1074 |
|
SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, buf); |
1075 |
|
|
1076 |
|
if (buf[0]) |
1215 |
|
SetOper(source_p); |
1216 |
|
|
1217 |
|
if (oconf->modes) |
1218 |
< |
source_p->umodes |= oconf->modes; |
1218 |
> |
AddUMode(source_p, oconf->modes); |
1219 |
|
else if (ConfigFileEntry.oper_umodes) |
1220 |
< |
source_p->umodes |= ConfigFileEntry.oper_umodes; |
1206 |
< |
else |
1207 |
< |
source_p->umodes |= (UMODE_SERVNOTICE|UMODE_OPERWALL| |
1208 |
< |
UMODE_WALLOP|UMODE_LOCOPS); |
1220 |
> |
AddUMode(source_p, ConfigFileEntry.oper_umodes); |
1221 |
|
|
1222 |
< |
if (!(old & UMODE_INVISIBLE) && IsInvisible(source_p)) |
1222 |
> |
if (!(old & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE)) |
1223 |
|
++Count.invisi; |
1224 |
< |
if ((old & UMODE_INVISIBLE) && !IsInvisible(source_p)) |
1224 |
> |
if ((old & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE)) |
1225 |
|
--Count.invisi; |
1226 |
|
|
1227 |
|
assert(dlinkFind(&oper_list, source_p) == NULL); |
1229 |
|
|
1230 |
|
operprivs = oper_privs_as_string(oconf->port); |
1231 |
|
|
1232 |
< |
SetOFlag(source_p, oconf->port); |
1232 |
> |
AddOFlag(source_p, oconf->port); |
1233 |
|
|
1234 |
< |
if (IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p)) |
1234 |
> |
if (HasOFlag(source_p, OPER_FLAG_HIDDEN_ADMIN|OPER_FLAG_ADMIN)) |
1235 |
|
AddUMode(source_p, UMODE_ADMIN); |
1236 |
< |
if (!IsOperN(source_p)) |
1236 |
> |
if (!HasOFlag(source_p, OPER_FLAG_N)) |
1237 |
|
DelUMode(source_p, UMODE_NCHANGE); |
1238 |
|
|
1239 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, "%s (%s@%s) is now an operator", |