1 |
|
/* |
2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
|
* |
4 |
< |
* Copyright (c) 1997-2016 ircd-hybrid development team |
4 |
> |
* Copyright (c) 1997-2018 ircd-hybrid development team |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
29 |
|
#include "ircd_defs.h" |
30 |
|
#include "conf.h" |
31 |
|
#include "conf_cluster.h" |
32 |
+ |
#include "conf_gecos.h" |
33 |
|
#include "conf_pseudo.h" |
34 |
|
#include "conf_resv.h" |
35 |
|
#include "conf_service.h" |
60 |
|
#include "motd.h" |
61 |
|
#include "ipcache.h" |
62 |
|
#include "isupport.h" |
63 |
+ |
#include "whowas.h" |
64 |
|
|
65 |
|
|
66 |
|
struct config_channel_entry ConfigChannel; |
72 |
|
struct conf_parser_context conf_parser_ctx; |
73 |
|
|
74 |
|
/* general conf items link list root, other than k lines etc. */ |
75 |
< |
dlink_list server_items; |
75 |
> |
dlink_list connect_items; |
76 |
|
dlink_list operator_items; |
75 |
– |
dlink_list gecos_items; |
76 |
– |
dlink_list nresv_items; |
77 |
– |
dlink_list cresv_items; |
77 |
|
|
78 |
|
extern unsigned int lineno; |
79 |
|
extern char linebuf[]; |
135 |
|
{ |
136 |
|
switch (type) |
137 |
|
{ |
139 |
– |
case CONF_XLINE: |
140 |
– |
return &gecos_items; |
141 |
– |
break; |
142 |
– |
case CONF_NRESV: |
143 |
– |
return &nresv_items; |
144 |
– |
break; |
145 |
– |
case CONF_CRESV: |
146 |
– |
return &cresv_items; |
147 |
– |
break; |
138 |
|
case CONF_OPER: |
139 |
|
return &operator_items; |
140 |
|
break; |
141 |
|
case CONF_SERVER: |
142 |
< |
return &server_items; |
142 |
> |
return &connect_items; |
143 |
|
break; |
144 |
|
default: |
145 |
|
return NULL; |
204 |
|
free_dlink_node(node); |
205 |
|
} |
206 |
|
|
217 |
– |
DLINK_FOREACH_SAFE(node, node_next, conf->exempt_list.head) |
218 |
– |
{ |
219 |
– |
struct exempt *exptr = node->data; |
220 |
– |
|
221 |
– |
dlinkDelete(node, &conf->exempt_list); |
222 |
– |
xfree(exptr->name); |
223 |
– |
xfree(exptr->user); |
224 |
– |
xfree(exptr->host); |
225 |
– |
xfree(exptr); |
226 |
– |
} |
227 |
– |
|
207 |
|
xfree(conf); |
208 |
|
} |
209 |
|
|
220 |
|
const struct ClassItem *const class = conf->class; |
221 |
|
struct ip_entry *ip_found; |
222 |
|
int a_limit_reached = 0; |
223 |
< |
unsigned int local = 0, global = 0, ident = 0; |
223 |
> |
unsigned int local = 0, global = 0; |
224 |
|
|
225 |
|
ip_found = ipcache_find_or_add_address(&client_p->connection->ip); |
226 |
|
ip_found->count++; |
227 |
|
AddFlag(client_p, FLAGS_IPHASH); |
228 |
|
|
229 |
< |
userhost_count(client_p->username, client_p->host, |
251 |
< |
&global, &local, &ident); |
229 |
> |
userhost_count(client_p->sockhost, &global, &local); |
230 |
|
|
231 |
|
/* XXX blah. go down checking the various silly limits |
232 |
|
* setting a_limit_reached if any limit is reached. |
236 |
|
a_limit_reached = 1; |
237 |
|
else if (class->max_perip && ip_found->count > class->max_perip) |
238 |
|
a_limit_reached = 1; |
239 |
< |
else if (class->max_local && local >= class->max_local) |
239 |
> |
else if (class->max_local && local >= class->max_local) /* XXX: redundant */ |
240 |
|
a_limit_reached = 1; |
241 |
|
else if (class->max_global && global >= class->max_global) |
242 |
|
a_limit_reached = 1; |
265 |
– |
else if (class->max_ident && ident >= class->max_ident && |
266 |
– |
client_p->username[0] != '~') |
267 |
– |
a_limit_reached = 1; |
243 |
|
|
244 |
|
if (a_limit_reached) |
245 |
|
{ |
340 |
|
case TOO_MANY: |
341 |
|
sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE, |
342 |
|
"Too many on IP for %s (%s).", |
343 |
< |
get_client_name(source_p, SHOW_IP), |
343 |
> |
client_get_name(source_p, SHOW_IP), |
344 |
|
source_p->sockhost); |
345 |
|
ilog(LOG_TYPE_IRCD, "Too many connections on IP from %s.", |
346 |
< |
get_client_name(source_p, SHOW_IP)); |
346 |
> |
client_get_name(source_p, SHOW_IP)); |
347 |
|
++ServerStats.is_ref; |
348 |
|
exit_client(source_p, "No more connections allowed on that IP"); |
349 |
|
break; |
351 |
|
case I_LINE_FULL: |
352 |
|
sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE, |
353 |
|
"auth {} block is full for %s (%s).", |
354 |
< |
get_client_name(source_p, SHOW_IP), |
354 |
> |
client_get_name(source_p, SHOW_IP), |
355 |
|
source_p->sockhost); |
356 |
|
ilog(LOG_TYPE_IRCD, "Too many connections from %s.", |
357 |
< |
get_client_name(source_p, SHOW_IP)); |
357 |
> |
client_get_name(source_p, SHOW_IP)); |
358 |
|
++ServerStats.is_ref; |
359 |
|
exit_client(source_p, "No more connections allowed in your connection class"); |
360 |
|
break; |
363 |
|
/* jdc - lists server name & port connections are on */ |
364 |
|
/* a purely cosmetical change */ |
365 |
|
sendto_realops_flags(UMODE_UNAUTH, L_ALL, SEND_NOTICE, |
366 |
< |
"Unauthorized client connection from %s [%s] on [%s/%u].", |
367 |
< |
get_client_name(source_p, SHOW_IP), |
393 |
< |
source_p->sockhost, |
366 |
> |
"Unauthorized client connection from %s on [%s/%u].", |
367 |
> |
client_get_name(source_p, SHOW_IP), |
368 |
|
source_p->connection->listener->name, |
369 |
|
source_p->connection->listener->port); |
370 |
|
ilog(LOG_TYPE_IRCD, "Unauthorized client connection from %s on [%s/%u].", |
371 |
< |
get_client_name(source_p, SHOW_IP), |
371 |
> |
client_get_name(source_p, SHOW_IP), |
372 |
|
source_p->connection->listener->name, |
373 |
|
source_p->connection->listener->port); |
374 |
|
|
475 |
|
|
476 |
|
assert(host); |
477 |
|
|
478 |
< |
DLINK_FOREACH(node, server_items.head) |
478 |
> |
DLINK_FOREACH(node, connect_items.head) |
479 |
|
{ |
480 |
|
struct MaskItem *conf = node->data; |
481 |
|
|
482 |
< |
if (match(conf->name, name) || match(conf->host, host)) |
482 |
> |
if (irccmp(conf->name, name) || |
483 |
> |
irccmp(conf->host, host)) |
484 |
|
continue; |
485 |
|
|
486 |
|
attach_conf(client_p, conf); |
529 |
|
* side effects - looks for a match on name field |
530 |
|
*/ |
531 |
|
struct MaskItem * |
532 |
< |
find_matching_name_conf(enum maskitem_type type, const char *name, const char *user, |
558 |
< |
const char *host, unsigned int flags) |
532 |
> |
connect_find(const char *name, const char *host, int (*compare)(const char *, const char *)) |
533 |
|
{ |
534 |
|
dlink_node *node = NULL; |
561 |
– |
dlink_list *list = map_to_list(type); |
562 |
– |
struct MaskItem *conf = NULL; |
535 |
|
|
536 |
< |
switch (type) |
536 |
> |
DLINK_FOREACH(node, connect_items.head) |
537 |
|
{ |
538 |
< |
case CONF_XLINE: |
567 |
< |
case CONF_NRESV: |
568 |
< |
case CONF_CRESV: |
569 |
< |
DLINK_FOREACH(node, list->head) |
570 |
< |
{ |
571 |
< |
conf = node->data; |
572 |
< |
|
573 |
< |
if (EmptyString(conf->name)) |
574 |
< |
continue; |
575 |
< |
if (name && !match(conf->name, name)) |
576 |
< |
{ |
577 |
< |
if ((user == NULL && (host == NULL))) |
578 |
< |
return conf; |
579 |
< |
if ((conf->modes & flags) != flags) |
580 |
< |
continue; |
581 |
< |
if (EmptyString(conf->user) || EmptyString(conf->host)) |
582 |
< |
return conf; |
583 |
< |
if (!match(conf->user, user) && !match(conf->host, host)) |
584 |
< |
return conf; |
585 |
< |
} |
586 |
< |
} |
587 |
< |
break; |
588 |
< |
|
589 |
< |
case CONF_SERVER: |
590 |
< |
DLINK_FOREACH(node, list->head) |
591 |
< |
{ |
592 |
< |
conf = node->data; |
593 |
< |
|
594 |
< |
if (name && !match(name, conf->name)) |
595 |
< |
return conf; |
596 |
< |
if (host && !match(host, conf->host)) |
597 |
< |
return conf; |
598 |
< |
} |
599 |
< |
break; |
538 |
> |
struct MaskItem *conf = node->data; |
539 |
|
|
540 |
< |
default: |
541 |
< |
break; |
540 |
> |
if (name && !compare(name, conf->name)) |
541 |
> |
return conf; |
542 |
> |
if (host && !compare(host, conf->host)) |
543 |
> |
return conf; |
544 |
|
} |
545 |
+ |
|
546 |
|
return NULL; |
547 |
|
} |
548 |
|
|
556 |
|
* side effects - looks for an exact match on name field |
557 |
|
*/ |
558 |
|
struct MaskItem * |
559 |
< |
find_exact_name_conf(enum maskitem_type type, const struct Client *who, const char *name, |
618 |
< |
const char *user, const char *host) |
559 |
> |
operator_find(const struct Client *who, const char *name) |
560 |
|
{ |
561 |
|
dlink_node *node = NULL; |
621 |
– |
dlink_list *list = map_to_list(type); |
622 |
– |
struct MaskItem *conf = NULL; |
562 |
|
|
563 |
< |
switch(type) |
563 |
> |
DLINK_FOREACH(node, operator_items.head) |
564 |
|
{ |
565 |
< |
case CONF_XLINE: |
627 |
< |
case CONF_NRESV: |
628 |
< |
case CONF_CRESV: |
629 |
< |
|
630 |
< |
DLINK_FOREACH(node, list->head) |
631 |
< |
{ |
632 |
< |
conf = node->data; |
633 |
< |
|
634 |
< |
if (EmptyString(conf->name)) |
635 |
< |
continue; |
636 |
< |
|
637 |
< |
if (irccmp(conf->name, name) == 0) |
638 |
< |
{ |
639 |
< |
if ((user == NULL && (host == NULL))) |
640 |
< |
return conf; |
641 |
< |
if (EmptyString(conf->user) || EmptyString(conf->host)) |
642 |
< |
return conf; |
643 |
< |
if (!match(conf->user, user) && !match(conf->host, host)) |
644 |
< |
return conf; |
645 |
< |
} |
646 |
< |
} |
647 |
< |
break; |
565 |
> |
struct MaskItem *conf = node->data; |
566 |
|
|
567 |
< |
case CONF_OPER: |
650 |
< |
DLINK_FOREACH(node, list->head) |
567 |
> |
if (!irccmp(conf->name, name)) |
568 |
|
{ |
569 |
< |
conf = node->data; |
570 |
< |
|
654 |
< |
if (EmptyString(conf->name)) |
655 |
< |
continue; |
569 |
> |
if (!who) |
570 |
> |
return conf; |
571 |
|
|
572 |
< |
if (!irccmp(conf->name, name)) |
572 |
> |
if (!match(conf->user, who->username)) |
573 |
|
{ |
574 |
< |
if (!who) |
660 |
< |
return conf; |
661 |
< |
if (EmptyString(conf->user) || EmptyString(conf->host)) |
662 |
< |
return NULL; |
663 |
< |
if (!match(conf->user, who->username)) |
574 |
> |
switch (conf->htype) |
575 |
|
{ |
576 |
< |
switch (conf->htype) |
577 |
< |
{ |
578 |
< |
case HM_HOST: |
579 |
< |
if (!match(conf->host, who->host) || !match(conf->host, who->sockhost)) |
576 |
> |
case HM_HOST: |
577 |
> |
if (!match(conf->host, who->host) || !match(conf->host, who->sockhost)) |
578 |
> |
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
579 |
> |
return conf; |
580 |
> |
break; |
581 |
> |
case HM_IPV4: |
582 |
> |
if (who->connection->aftype == AF_INET) |
583 |
> |
if (match_ipv4(&who->connection->ip, &conf->addr, conf->bits)) |
584 |
> |
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
585 |
> |
return conf; |
586 |
> |
break; |
587 |
> |
case HM_IPV6: |
588 |
> |
if (who->connection->aftype == AF_INET6) |
589 |
> |
if (match_ipv6(&who->connection->ip, &conf->addr, conf->bits)) |
590 |
|
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
591 |
|
return conf; |
592 |
< |
break; |
593 |
< |
case HM_IPV4: |
594 |
< |
if (who->connection->aftype == AF_INET) |
674 |
< |
if (match_ipv4(&who->connection->ip, &conf->addr, conf->bits)) |
675 |
< |
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
676 |
< |
return conf; |
677 |
< |
break; |
678 |
< |
case HM_IPV6: |
679 |
< |
if (who->connection->aftype == AF_INET6) |
680 |
< |
if (match_ipv6(&who->connection->ip, &conf->addr, conf->bits)) |
681 |
< |
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
682 |
< |
return conf; |
683 |
< |
break; |
684 |
< |
default: |
685 |
< |
assert(0); |
686 |
< |
} |
592 |
> |
break; |
593 |
> |
default: |
594 |
> |
assert(0); |
595 |
|
} |
596 |
|
} |
597 |
|
} |
690 |
– |
|
691 |
– |
break; |
692 |
– |
|
693 |
– |
case CONF_SERVER: |
694 |
– |
DLINK_FOREACH(node, list->head) |
695 |
– |
{ |
696 |
– |
conf = node->data; |
697 |
– |
|
698 |
– |
if (EmptyString(conf->name)) |
699 |
– |
continue; |
700 |
– |
|
701 |
– |
if (name == NULL) |
702 |
– |
{ |
703 |
– |
if (EmptyString(conf->host)) |
704 |
– |
continue; |
705 |
– |
if (irccmp(conf->host, host) == 0) |
706 |
– |
return conf; |
707 |
– |
} |
708 |
– |
else if (irccmp(conf->name, name) == 0) |
709 |
– |
return conf; |
710 |
– |
} |
711 |
– |
|
712 |
– |
break; |
713 |
– |
|
714 |
– |
default: |
715 |
– |
break; |
598 |
|
} |
599 |
|
|
600 |
|
return NULL; |
629 |
|
ConfigServerInfo.max_nick_length = 9; |
630 |
|
ConfigServerInfo.max_topic_length = 80; |
631 |
|
ConfigServerInfo.hub = 0; |
750 |
– |
ConfigServerInfo.libgeoip_database_options = 0; |
632 |
|
|
633 |
|
log_del_all(); |
634 |
|
|
638 |
|
ConfigChannel.invite_client_count = 10; |
639 |
|
ConfigChannel.invite_client_time = 300; |
640 |
|
ConfigChannel.invite_delay_channel = 5; |
641 |
+ |
ConfigChannel.invite_expire_time = 1800; |
642 |
|
ConfigChannel.knock_client_count = 1; |
643 |
|
ConfigChannel.knock_client_time = 300; |
644 |
|
ConfigChannel.knock_delay_channel = 60; |
645 |
|
ConfigChannel.max_channels = 25; |
646 |
< |
ConfigChannel.max_bans = 25; |
646 |
> |
ConfigChannel.max_invites = 20; |
647 |
> |
ConfigChannel.max_bans = 100; |
648 |
> |
ConfigChannel.max_bans_large = 500; |
649 |
|
ConfigChannel.default_join_flood_count = 18; |
650 |
|
ConfigChannel.default_join_flood_time = 6; |
651 |
|
|
661 |
|
ConfigGeneral.away_count = 2; |
662 |
|
ConfigGeneral.away_time = 10; |
663 |
|
ConfigGeneral.max_watch = 50; |
664 |
+ |
ConfigGeneral.whowas_history_length = 15000; |
665 |
|
ConfigGeneral.cycle_on_host_change = 1; |
666 |
|
ConfigGeneral.dline_min_cidr = 16; |
667 |
|
ConfigGeneral.dline_min_cidr6 = 48; |
673 |
|
ConfigGeneral.disable_auth = 0; |
674 |
|
ConfigGeneral.kill_chase_time_limit = 90; |
675 |
|
ConfigGeneral.default_floodcount = 8; |
676 |
+ |
ConfigGeneral.default_floodtime = 1; |
677 |
|
ConfigGeneral.failed_oper_notice = 1; |
678 |
|
ConfigGeneral.dots_in_ident = 0; |
679 |
|
ConfigGeneral.min_nonwildcard = 4; |
694 |
|
ConfigGeneral.stats_P_oper_only = 0; |
695 |
|
ConfigGeneral.stats_u_oper_only = 0; |
696 |
|
ConfigGeneral.caller_id_wait = 60; |
697 |
< |
ConfigGeneral.opers_bypass_callerid = 0; |
697 |
> |
ConfigGeneral.opers_bypass_callerid = 1; |
698 |
|
ConfigGeneral.pace_wait = 10; |
699 |
|
ConfigGeneral.pace_wait_simple = 1; |
700 |
|
ConfigGeneral.short_motd = 0; |
728 |
|
static void |
729 |
|
read_conf(FILE *file) |
730 |
|
{ |
731 |
< |
lineno = 0; |
731 |
> |
lineno = 1; |
732 |
|
|
733 |
|
set_default_conf(); /* Set default values prior to conf parsing */ |
734 |
|
conf_parser_ctx.pass = 1; |
740 |
|
yyparse(); /* Load the values from the conf */ |
741 |
|
validate_conf(); /* Check to make sure some values are still okay. */ |
742 |
|
/* Some global values are also loaded here. */ |
743 |
+ |
whowas_trim(); /* Attempt to trim whowas list if necessary */ |
744 |
|
class_delete_marked(); /* Delete unused classes that are marked for deletion */ |
745 |
|
} |
746 |
|
|
754 |
|
conf_rehash(int sig) |
755 |
|
{ |
756 |
|
if (sig) |
757 |
+ |
{ |
758 |
|
sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, |
759 |
|
"Got signal SIGHUP, reloading configuration file(s)"); |
760 |
+ |
ilog(LOG_TYPE_IRCD, "Got signal SIGHUP, reloading configuration file(s)"); |
761 |
+ |
} |
762 |
|
|
763 |
|
restart_resolver(); |
764 |
|
|
844 |
|
return 0; |
845 |
|
} |
846 |
|
|
957 |
– |
/* expire_tklines() |
958 |
– |
* |
959 |
– |
* inputs - tkline list pointer |
960 |
– |
* output - NONE |
961 |
– |
* side effects - expire tklines |
962 |
– |
*/ |
963 |
– |
static void |
964 |
– |
expire_tklines(dlink_list *list) |
965 |
– |
{ |
966 |
– |
dlink_node *node = NULL, *node_next = NULL; |
967 |
– |
|
968 |
– |
DLINK_FOREACH_SAFE(node, node_next, list->head) |
969 |
– |
{ |
970 |
– |
struct MaskItem *conf = node->data; |
971 |
– |
|
972 |
– |
if (!conf->until || conf->until > CurrentTime) |
973 |
– |
continue; |
974 |
– |
|
975 |
– |
if (ConfigGeneral.tkline_expire_notices) |
976 |
– |
sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, "Temporary %s for [%s] expired", |
977 |
– |
(conf->type == CONF_XLINE) ? "X-line" : "RESV", conf->name); |
978 |
– |
conf_free(conf); |
979 |
– |
} |
980 |
– |
} |
981 |
– |
|
847 |
|
/* cleanup_tklines() |
848 |
|
* |
849 |
|
* inputs - NONE |
855 |
|
cleanup_tklines(void *unused) |
856 |
|
{ |
857 |
|
hostmask_expire_temporary(); |
858 |
< |
expire_tklines(&gecos_items); |
859 |
< |
expire_tklines(&nresv_items); |
995 |
< |
expire_tklines(&cresv_items); |
858 |
> |
gecos_expire(); |
859 |
> |
resv_expire(); |
860 |
|
} |
861 |
|
|
862 |
|
/* oper_privs_as_string() |
904 |
|
const char * |
905 |
|
oper_privs_as_string(const unsigned int flags) |
906 |
|
{ |
907 |
< |
static char buf[sizeof(flag_table) / sizeof(struct oper_flags)]; |
907 |
> |
static char buf[sizeof(flag_table) / sizeof(flag_table[0])]; |
908 |
|
char *p = buf; |
909 |
|
|
910 |
|
for (const struct oper_flags *tab = flag_table; tab->flag; ++tab) |
972 |
|
{ |
973 |
|
dlink_node *node = NULL, *node_next = NULL; |
974 |
|
dlink_list *free_items [] = { |
975 |
< |
&server_items, &operator_items, |
1112 |
< |
&gecos_items, |
1113 |
< |
&nresv_items, &cresv_items, NULL |
975 |
> |
&connect_items, &operator_items, NULL |
976 |
|
}; |
977 |
|
|
978 |
|
dlink_list ** iterator = free_items; /* C is dumb */ |
988 |
|
struct MaskItem *conf = node->data; |
989 |
|
|
990 |
|
conf->active = 0; |
991 |
+ |
dlinkDelete(&conf->node, *iterator); |
992 |
|
|
993 |
< |
if (!IsConfDatabase(conf)) |
994 |
< |
{ |
1132 |
< |
dlinkDelete(&conf->node, *iterator); |
1133 |
< |
|
1134 |
< |
if (!conf->ref_count) |
1135 |
< |
conf_free(conf); |
1136 |
< |
} |
993 |
> |
if (!conf->ref_count) |
994 |
> |
conf_free(conf); |
995 |
|
} |
996 |
|
} |
997 |
|
|
1140 |
– |
motd_clear(); /* Clear motd {} items and re-cache default motd */ |
1141 |
– |
|
998 |
|
/* |
999 |
|
* Don't delete the class table, rather mark all entries for deletion. |
1000 |
|
* The table is cleaned up by class_delete_marked. - avalon |
1009 |
|
|
1010 |
|
cluster_clear(); /* Clear cluster {} items */ |
1011 |
|
|
1012 |
+ |
gecos_clear(); /* Clear gecos {} items */ |
1013 |
+ |
|
1014 |
+ |
resv_clear(); /* Clear resv {} items */ |
1015 |
+ |
|
1016 |
|
service_clear(); /* Clear service {} items */ |
1017 |
|
|
1018 |
|
shared_clear(); /* Clear shared {} items */ |
1019 |
|
|
1020 |
|
pseudo_clear(); /* Clear pseudo {} items */ |
1021 |
|
|
1162 |
– |
#ifdef HAVE_LIBGEOIP |
1163 |
– |
GeoIP_delete(GeoIPv4_ctx); |
1164 |
– |
GeoIPv4_ctx = NULL; |
1165 |
– |
GeoIP_delete(GeoIPv6_ctx); |
1166 |
– |
GeoIPv6_ctx = NULL; |
1167 |
– |
#endif |
1168 |
– |
|
1022 |
|
/* Clean out ConfigServerInfo */ |
1023 |
|
xfree(ConfigServerInfo.description); |
1024 |
|
ConfigServerInfo.description = NULL; |
1026 |
|
ConfigServerInfo.network_name = NULL; |
1027 |
|
xfree(ConfigServerInfo.network_desc); |
1028 |
|
ConfigServerInfo.network_desc = NULL; |
1176 |
– |
xfree(ConfigServerInfo.libgeoip_ipv6_database_file); |
1177 |
– |
ConfigServerInfo.libgeoip_ipv6_database_file = NULL; |
1178 |
– |
xfree(ConfigServerInfo.libgeoip_ipv4_database_file); |
1179 |
– |
ConfigServerInfo.libgeoip_ipv4_database_file = NULL; |
1029 |
|
xfree(ConfigServerInfo.rsa_private_key_file); |
1030 |
|
ConfigServerInfo.rsa_private_key_file = NULL; |
1031 |
|
xfree(ConfigServerInfo.ssl_certificate_file); |
1134 |
|
snprintf(chanlimit, sizeof(chanlimit), "#:%u", |
1135 |
|
ConfigChannel.max_channels); |
1136 |
|
isupport_add("CHANLIMIT", chanlimit, -1); |
1137 |
< |
snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,cimnprstCMORST"); |
1137 |
> |
snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,cimnprstuCLMORST"); |
1138 |
|
isupport_add("CHANNELLEN", NULL, CHANNELLEN); |
1139 |
|
isupport_add("TOPICLEN", NULL, ConfigServerInfo.max_topic_length); |
1140 |
|
isupport_add("CHANMODES", chanmodes, -1); |
1292 |
– |
|
1293 |
– |
/* |
1294 |
– |
* message_locale may have changed. rebuild isupport since it relies |
1295 |
– |
* on strlen(form_str(RPL_ISUPPORT)) |
1296 |
– |
*/ |
1297 |
– |
isupport_rebuild(); |
1141 |
|
} |
1142 |
|
|
1143 |
|
/* conf_add_class_to_conf() |
1173 |
|
void |
1174 |
|
yyerror(const char *msg) |
1175 |
|
{ |
1333 |
– |
char newlinebuf[IRCD_BUFSIZE]; |
1334 |
– |
|
1176 |
|
if (conf_parser_ctx.pass != 1) |
1177 |
|
return; |
1178 |
|
|
1179 |
< |
strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); |
1179 |
> |
const char *p = stripws(linebuf); |
1180 |
|
sendto_realops_flags(UMODE_SERVNOTICE, L_ADMIN, SEND_NOTICE, |
1181 |
|
"\"%s\", line %u: %s: %s", |
1182 |
< |
conffilebuf, lineno + 1, msg, newlinebuf); |
1182 |
> |
conffilebuf, lineno, msg, p); |
1183 |
|
ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", |
1184 |
< |
conffilebuf, lineno + 1, msg, newlinebuf); |
1184 |
> |
conffilebuf, lineno, msg, p); |
1185 |
|
} |
1186 |
|
|
1187 |
|
void |
1188 |
|
conf_error_report(const char *msg) |
1189 |
|
{ |
1190 |
< |
char newlinebuf[IRCD_BUFSIZE]; |
1350 |
< |
|
1351 |
< |
strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); |
1190 |
> |
const char *p = stripws(linebuf); |
1191 |
|
sendto_realops_flags(UMODE_SERVNOTICE, L_ADMIN, SEND_NOTICE, |
1192 |
|
"\"%s\", line %u: %s: %s", |
1193 |
< |
conffilebuf, lineno + 1, msg, newlinebuf); |
1193 |
> |
conffilebuf, lineno, msg, p); |
1194 |
|
ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", |
1195 |
< |
conffilebuf, lineno + 1, msg, newlinebuf); |
1195 |
> |
conffilebuf, lineno, msg, p); |
1196 |
|
} |
1197 |
|
|
1198 |
|
/* |
1205 |
|
* side effects - none |
1206 |
|
* Originally written by Dianora (Diane, db@db.net) |
1207 |
|
*/ |
1208 |
< |
time_t |
1208 |
> |
uintmax_t |
1209 |
|
valid_tkline(const char *data, const int minutes) |
1210 |
|
{ |
1211 |
|
const unsigned char *p = (const unsigned char *)data; |
1212 |
|
unsigned char tmpch = '\0'; |
1213 |
< |
time_t result = 0; |
1213 |
> |
uintmax_t result = 0; |
1214 |
|
|
1215 |
|
while ((tmpch = *p++)) |
1216 |
|
{ |
1286 |
|
* side effects - NOTICE is given to source_p if warn is 1 |
1287 |
|
*/ |
1288 |
|
int |
1289 |
< |
valid_wild_card(struct Client *source_p, int count, ...) |
1289 |
> |
valid_wild_card(int count, ...) |
1290 |
|
{ |
1291 |
|
unsigned char tmpch = '\0'; |
1292 |
|
unsigned int nonwild = 0; |
1329 |
|
} |
1330 |
|
} |
1331 |
|
|
1493 |
– |
if (IsClient(source_p)) |
1494 |
– |
sendto_one_notice(source_p, &me, |
1495 |
– |
":Please include at least %u non-wildcard characters with the mask", |
1496 |
– |
ConfigGeneral.min_nonwildcard); |
1332 |
|
va_end(args); |
1333 |
|
return 0; |
1334 |
|
} |
1445 |
|
int |
1446 |
|
parse_aline(const char *cmd, struct Client *source_p, |
1447 |
|
int parc, char **parv, |
1448 |
< |
int parse_flags, char **up_p, char **h_p, time_t *tkline_time, |
1448 |
> |
char **up_p, char **h_p, uintmax_t *tkline_time, |
1449 |
|
char **target_server, char **reason) |
1450 |
|
{ |
1451 |
< |
int found_tkline_time=0; |
1451 |
> |
uintmax_t found_tkline_time=0; |
1452 |
|
static char default_reason[] = CONF_NOREASON; |
1453 |
|
static char user[USERLEN*4+1]; |
1454 |
|
static char host[HOSTLEN*4+1]; |
1525 |
|
} |
1526 |
|
} |
1527 |
|
|
1693 |
– |
if (h_p) |
1694 |
– |
{ |
1695 |
– |
if (strchr(user, '!')) |
1696 |
– |
{ |
1697 |
– |
sendto_one_notice(source_p, &me, ":Invalid character '!' in kline"); |
1698 |
– |
return 0; |
1699 |
– |
} |
1700 |
– |
|
1701 |
– |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, 2, *up_p, *h_p)) |
1702 |
– |
return 0; |
1703 |
– |
} |
1704 |
– |
else |
1705 |
– |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, *up_p)) |
1706 |
– |
return 0; |
1707 |
– |
|
1528 |
|
if (reason) |
1529 |
|
{ |
1530 |
|
if (parc && !EmptyString(*parv)) |