23 |
|
*/ |
24 |
|
|
25 |
|
#include "stdinc.h" |
26 |
+ |
#include "list.h" |
27 |
|
#include "ircd_defs.h" |
28 |
< |
#include "tools.h" |
28 |
> |
#include "balloc.h" |
29 |
|
#include "s_conf.h" |
30 |
|
#include "s_serv.h" |
31 |
|
#include "resv.h" |
38 |
|
#include "irc_string.h" |
39 |
|
#include "sprintf_irc.h" |
40 |
|
#include "s_bsd.h" |
40 |
– |
#include "irc_getaddrinfo.h" |
41 |
|
#include "ircd.h" |
42 |
– |
#include "list.h" |
42 |
|
#include "listener.h" |
43 |
|
#include "hostmask.h" |
44 |
|
#include "modules.h" |
58 |
|
struct config_server_hide ConfigServerHide; |
59 |
|
|
60 |
|
/* general conf items link list root, other than k lines etc. */ |
61 |
+ |
dlink_list service_items = { NULL, NULL, 0 }; |
62 |
|
dlink_list server_items = { NULL, NULL, 0 }; |
63 |
|
dlink_list cluster_items = { NULL, NULL, 0 }; |
64 |
|
dlink_list hub_items = { NULL, NULL, 0 }; |
137 |
|
static int ip_entries_count = 0; |
138 |
|
|
139 |
|
|
140 |
< |
inline void * |
140 |
> |
void * |
141 |
|
map_to_conf(struct ConfItem *aconf) |
142 |
|
{ |
143 |
|
void *conf; |
144 |
< |
conf = (void *)((unsigned long)aconf + |
145 |
< |
(unsigned long)sizeof(struct ConfItem)); |
144 |
> |
conf = (void *)((uintptr_t)aconf + |
145 |
> |
(uintptr_t)sizeof(struct ConfItem)); |
146 |
|
return(conf); |
147 |
|
} |
148 |
|
|
149 |
< |
inline struct ConfItem * |
149 |
> |
struct ConfItem * |
150 |
|
unmap_conf_item(void *aconf) |
151 |
|
{ |
152 |
|
struct ConfItem *conf; |
153 |
|
|
154 |
< |
conf = (struct ConfItem *)((unsigned long)aconf - |
155 |
< |
(unsigned long)sizeof(struct ConfItem)); |
154 |
> |
conf = (struct ConfItem *)((uintptr_t)aconf - |
155 |
> |
(uintptr_t)sizeof(struct ConfItem)); |
156 |
|
return(conf); |
157 |
|
} |
158 |
|
|
169 |
|
static void |
170 |
|
conf_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) |
171 |
|
{ |
172 |
< |
struct AccessItem *aconf = (struct AccessItem *)vptr; |
173 |
< |
struct ConfItem *conf; |
172 |
> |
struct AccessItem *aconf = vptr; |
173 |
|
|
174 |
|
aconf->dns_pending = 0; |
175 |
|
|
291 |
|
sizeof(struct MatchItem)); |
292 |
|
dlinkAdd(conf, &conf->node, &xconf_items); |
293 |
|
break; |
294 |
< |
|
294 |
> |
#ifdef HAVE_LIBPCRE |
295 |
|
case RXLINE_TYPE: |
296 |
|
conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem) + |
297 |
|
sizeof(struct MatchItem)); |
305 |
|
aconf->status = CONF_KLINE; |
306 |
|
dlinkAdd(conf, &conf->node, &rkconf_items); |
307 |
|
break; |
308 |
< |
|
308 |
> |
#endif |
309 |
|
case CLUSTER_TYPE: |
310 |
|
conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem)); |
311 |
|
dlinkAdd(conf, &conf->node, &cluster_items); |
322 |
|
dlinkAdd(conf, &conf->node, &nresv_items); |
323 |
|
break; |
324 |
|
|
325 |
+ |
case SERVICE_TYPE: |
326 |
+ |
status = CONF_SERVICE; |
327 |
+ |
conf = MyMalloc(sizeof(struct ConfItem)); |
328 |
+ |
dlinkAdd(conf, &conf->node, &service_items); |
329 |
+ |
break; |
330 |
+ |
|
331 |
|
case CLASS_TYPE: |
332 |
|
conf = MyMalloc(sizeof(struct ConfItem) + |
333 |
|
sizeof(struct ClassItem)); |
389 |
|
MyFree(aconf->oper_reason); |
390 |
|
MyFree(aconf->user); |
391 |
|
MyFree(aconf->host); |
387 |
– |
MyFree(aconf->fakename); |
392 |
|
#ifdef HAVE_LIBCRYPTO |
393 |
|
if (aconf->rsa_public_key) |
394 |
|
RSA_free(aconf->rsa_public_key); |
468 |
|
dlinkDelete(&conf->node, &xconf_items); |
469 |
|
MyFree(conf); |
470 |
|
break; |
471 |
< |
|
471 |
> |
#ifdef HAVE_LIBPCRE |
472 |
|
case RKLINE_TYPE: |
473 |
|
aconf = map_to_conf(conf); |
474 |
|
MyFree(aconf->regexuser); |
491 |
|
dlinkDelete(&conf->node, &rxconf_items); |
492 |
|
MyFree(conf); |
493 |
|
break; |
494 |
< |
|
494 |
> |
#endif |
495 |
|
case NRESV_TYPE: |
496 |
|
match_item = map_to_conf(conf); |
497 |
|
MyFree(match_item->user); |
533 |
|
MyFree(conf); |
534 |
|
break; |
535 |
|
|
536 |
+ |
case SERVICE_TYPE: |
537 |
+ |
dlinkDelete(&conf->node, &service_items); |
538 |
+ |
MyFree(conf); |
539 |
+ |
break; |
540 |
+ |
|
541 |
|
default: |
542 |
|
break; |
543 |
|
} |
623 |
|
} |
624 |
|
break; |
625 |
|
|
626 |
+ |
#ifdef HAVE_LIBPCRE |
627 |
|
case RXLINE_TYPE: |
628 |
|
DLINK_FOREACH(ptr, rxconf_items.head) |
629 |
|
{ |
652 |
|
aconf->reason, aconf->oper_reason ? aconf->oper_reason : ""); |
653 |
|
} |
654 |
|
break; |
655 |
+ |
#endif |
656 |
|
|
657 |
|
case ULINE_TYPE: |
658 |
|
DLINK_FOREACH(ptr, uconf_items.head) |
697 |
|
aconf = map_to_conf(conf); |
698 |
|
|
699 |
|
/* Don't allow non opers to see oper privs */ |
700 |
< |
if (IsOper(source_p)) |
700 |
> |
if (HasUMode(source_p, UMODE_OPER)) |
701 |
|
sendto_one(source_p, form_str(RPL_STATSOLINE), |
702 |
|
me.name, source_p->name, 'O', aconf->user, aconf->host, |
703 |
|
conf->name, oper_privs_as_string(aconf->port), |
729 |
|
case CLIENT_TYPE: |
730 |
|
break; |
731 |
|
|
732 |
+ |
case SERVICE_TYPE: |
733 |
+ |
DLINK_FOREACH(ptr, service_items.head) |
734 |
+ |
{ |
735 |
+ |
conf = ptr->data; |
736 |
+ |
sendto_one(source_p, form_str(RPL_STATSSERVICE), |
737 |
+ |
me.name, source_p->name, 'S', "*", conf->name, 0, 0); |
738 |
+ |
} |
739 |
+ |
break; |
740 |
+ |
|
741 |
|
case SERVER_TYPE: |
742 |
|
DLINK_FOREACH(ptr, server_items.head) |
743 |
|
{ |
752 |
|
*p++ = 'A'; |
753 |
|
if (IsConfCryptLink(aconf)) |
754 |
|
*p++ = 'C'; |
735 |
– |
if (aconf->fakename) |
736 |
– |
*p++ = 'M'; |
755 |
|
if (IsConfTopicBurst(aconf)) |
756 |
|
*p++ = 'T'; |
757 |
|
if (IsConfCompressed(aconf)) |
764 |
|
/* |
765 |
|
* Allow admins to see actual ips unless hide_server_ips is enabled |
766 |
|
*/ |
767 |
< |
if (!ConfigServerHide.hide_server_ips && IsAdmin(source_p)) |
767 |
> |
if (!ConfigServerHide.hide_server_ips && HasUMode(source_p, UMODE_ADMIN)) |
768 |
|
sendto_one(source_p, form_str(RPL_STATSCLINE), |
769 |
|
me.name, source_p->name, 'C', aconf->host, |
770 |
|
buf, conf->name, aconf->port, |
804 |
|
case CRESV_TYPE: |
805 |
|
case NRESV_TYPE: |
806 |
|
case CLUSTER_TYPE: |
807 |
+ |
default: |
808 |
|
break; |
809 |
|
} |
810 |
|
} |
1196 |
|
{ |
1197 |
|
struct sockaddr_in *v4 = (struct sockaddr_in *)addr; |
1198 |
|
int hash; |
1199 |
< |
u_int32_t ip; |
1199 |
> |
uint32_t ip; |
1200 |
|
|
1201 |
|
ip = ntohl(v4->sin_addr.s_addr); |
1202 |
|
hash = ((ip >> 12) + ip) & (IP_HASH_SIZE-1); |
1207 |
|
{ |
1208 |
|
int hash; |
1209 |
|
struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr; |
1210 |
< |
u_int32_t *ip = (u_int32_t *)&v6->sin6_addr.s6_addr; |
1210 |
> |
uint32_t *ip = (uint32_t *)&v6->sin6_addr.s6_addr; |
1211 |
|
|
1212 |
|
hash = ip[0] ^ ip[3]; |
1213 |
|
hash ^= hash >> 16; |
1557 |
|
case SERVER_TYPE: |
1558 |
|
return(&server_items); |
1559 |
|
break; |
1560 |
+ |
case SERVICE_TYPE: |
1561 |
+ |
return(&service_items); |
1562 |
+ |
break; |
1563 |
|
case CLUSTER_TYPE: |
1564 |
|
return(&cluster_items); |
1565 |
|
break; |
1595 |
|
|
1596 |
|
switch (type) |
1597 |
|
{ |
1598 |
< |
case RXLINE_TYPE: |
1598 |
> |
#ifdef HAVE_LIBPCRE |
1599 |
> |
case RXLINE_TYPE: |
1600 |
|
DLINK_FOREACH(ptr, list_p->head) |
1601 |
|
{ |
1602 |
|
conf = ptr->data; |
1606 |
|
return conf; |
1607 |
|
} |
1608 |
|
break; |
1609 |
+ |
#endif |
1610 |
+ |
case SERVICE_TYPE: |
1611 |
+ |
DLINK_FOREACH(ptr, list_p->head) |
1612 |
+ |
{ |
1613 |
+ |
conf = ptr->data; |
1614 |
+ |
|
1615 |
+ |
if (EmptyString(conf->name)) |
1616 |
+ |
continue; |
1617 |
+ |
if ((name != NULL) && !irccmp(name, conf->name)) |
1618 |
+ |
return conf; |
1619 |
+ |
} |
1620 |
+ |
break; |
1621 |
|
|
1622 |
|
case XLINE_TYPE: |
1623 |
|
case ULINE_TYPE: |
1794 |
|
if (ServerInfo.description != NULL) |
1795 |
|
strlcpy(me.info, ServerInfo.description, sizeof(me.info)); |
1796 |
|
|
1762 |
– |
#ifndef STATIC_MODULES |
1797 |
|
load_conf_modules(); |
1764 |
– |
#endif |
1798 |
|
|
1799 |
|
flush_deleted_I_P(); |
1800 |
|
|
1842 |
|
ServerInfo.max_clients = MAXCLIENTS_MAX; |
1843 |
|
|
1844 |
|
ServerInfo.hub = 0; |
1812 |
– |
delete_capability("HUB"); |
1845 |
|
ServerInfo.dns_host.sin_addr.s_addr = 0; |
1846 |
|
ServerInfo.dns_host.sin_port = 0; |
1847 |
|
AdminInfo.name = NULL; |
1885 |
|
ConfigServerHide.hide_server_ips = NO; |
1886 |
|
|
1887 |
|
|
1888 |
+ |
DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT); |
1889 |
|
ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT; |
1890 |
|
ConfigFileEntry.gline_min_cidr = 16; |
1891 |
|
ConfigFileEntry.gline_min_cidr6 = 48; |
1898 |
|
ConfigFileEntry.disable_auth = NO; |
1899 |
|
ConfigFileEntry.disable_remote = NO; |
1900 |
|
ConfigFileEntry.kill_chase_time_limit = 90; |
1901 |
< |
ConfigFileEntry.default_floodcount = 8; /* XXX */ |
1901 |
> |
ConfigFileEntry.default_floodcount = 8; |
1902 |
|
ConfigFileEntry.failed_oper_notice = YES; |
1903 |
< |
ConfigFileEntry.dots_in_ident = 0; /* XXX */ |
1871 |
< |
ConfigFileEntry.dot_in_ip6_addr = YES; |
1903 |
> |
ConfigFileEntry.dots_in_ident = 0; |
1904 |
|
ConfigFileEntry.min_nonwildcard = 4; |
1905 |
|
ConfigFileEntry.min_nonwildcard_simple = 3; |
1906 |
|
ConfigFileEntry.max_accept = 20; |
1907 |
< |
ConfigFileEntry.anti_nick_flood = NO; /* XXX */ |
1907 |
> |
ConfigFileEntry.anti_nick_flood = NO; |
1908 |
|
ConfigFileEntry.max_nick_time = 20; |
1909 |
|
ConfigFileEntry.max_nick_changes = 5; |
1910 |
< |
ConfigFileEntry.anti_spam_exit_message_time = 0; /* XXX */ |
1910 |
> |
ConfigFileEntry.anti_spam_exit_message_time = 0; |
1911 |
|
ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; |
1912 |
< |
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; /* XXX */ |
1912 |
> |
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; |
1913 |
|
ConfigFileEntry.kline_with_reason = YES; |
1914 |
|
ConfigFileEntry.kline_reason = NULL; |
1915 |
|
ConfigFileEntry.warn_no_nline = YES; |
1916 |
< |
ConfigFileEntry.stats_o_oper_only = NO; /* XXX */ |
1916 |
> |
ConfigFileEntry.stats_o_oper_only = NO; |
1917 |
|
ConfigFileEntry.stats_k_oper_only = 1; /* masked */ |
1918 |
|
ConfigFileEntry.stats_i_oper_only = 1; /* masked */ |
1919 |
|
ConfigFileEntry.stats_P_oper_only = NO; |
1923 |
|
ConfigFileEntry.pace_wait_simple = 1; |
1924 |
|
ConfigFileEntry.short_motd = NO; |
1925 |
|
ConfigFileEntry.ping_cookie = NO; |
1926 |
< |
ConfigFileEntry.no_oper_flood = NO; /* XXX */ |
1927 |
< |
ConfigFileEntry.true_no_oper_flood = NO; /* XXX */ |
1926 |
> |
ConfigFileEntry.no_oper_flood = NO; |
1927 |
> |
ConfigFileEntry.true_no_oper_flood = NO; |
1928 |
|
ConfigFileEntry.oper_pass_resv = YES; |
1929 |
< |
ConfigFileEntry.glines = NO; /* XXX */ |
1930 |
< |
ConfigFileEntry.gline_time = 12 * 3600; /* XXX */ |
1899 |
< |
ConfigFileEntry.idletime = 0; |
1929 |
> |
ConfigFileEntry.glines = NO; |
1930 |
> |
ConfigFileEntry.gline_time = 12 * 3600; |
1931 |
|
ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT; |
1932 |
|
ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT; |
1933 |
< |
ConfigFileEntry.oper_only_umodes = UMODE_DEBUG; /* XXX */ |
1933 |
> |
ConfigFileEntry.oper_only_umodes = UMODE_DEBUG; |
1934 |
|
ConfigFileEntry.oper_umodes = UMODE_BOTS | UMODE_LOCOPS | UMODE_SERVNOTICE | |
1935 |
< |
UMODE_OPERWALL | UMODE_WALLOP; /* XXX */ |
1935 |
> |
UMODE_OPERWALL | UMODE_WALLOP; |
1936 |
|
DupString(ConfigFileEntry.servlink_path, SLPATH); |
1937 |
|
#ifdef HAVE_LIBCRYPTO |
1938 |
|
/* jdc -- This is our default value for a cipher. According to the |
1995 |
|
if (ServerInfo.network_desc == NULL) |
1996 |
|
DupString(ServerInfo.network_desc,NETWORK_DESC_DEFAULT); |
1997 |
|
|
1998 |
+ |
if (ConfigFileEntry.service_name == NULL) |
1999 |
+ |
DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT); |
2000 |
+ |
|
2001 |
|
if ((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) || |
2002 |
|
(ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX)) |
2003 |
|
ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX; |
2041 |
|
/* Get us ready for a bind() and don't bother doing dns lookup */ |
2042 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
2043 |
|
|
2044 |
< |
if (irc_getaddrinfo(aconf->host, NULL, &hints, &res)) |
2044 |
> |
if (getaddrinfo(aconf->host, NULL, &hints, &res)) |
2045 |
|
{ |
2046 |
|
conf_dns_lookup(aconf); |
2047 |
|
return; |
2052 |
|
memcpy(&aconf->ipnum, res->ai_addr, res->ai_addrlen); |
2053 |
|
aconf->ipnum.ss_len = res->ai_addrlen; |
2054 |
|
aconf->ipnum.ss.ss_family = res->ai_family; |
2055 |
< |
irc_freeaddrinfo(res); |
2055 |
> |
freeaddrinfo(res); |
2056 |
|
} |
2057 |
|
|
2058 |
|
/* conf_connect_allowed() |
2091 |
|
static struct AccessItem * |
2092 |
|
find_regexp_kline(const char *uhi[]) |
2093 |
|
{ |
2094 |
+ |
#ifdef HAVE_LIBPCRE |
2095 |
|
const dlink_node *ptr = NULL; |
2096 |
|
|
2097 |
|
DLINK_FOREACH(ptr, rkconf_items.head) |
2106 |
|
!ircd_pcre_exec(aptr->regexhost, uhi[2]))) |
2107 |
|
return aptr; |
2108 |
|
} |
2109 |
< |
|
2109 |
> |
#endif |
2110 |
|
return NULL; |
2111 |
|
} |
2112 |
|
|
2404 |
|
struct AccessItem *aconf; |
2405 |
|
|
2406 |
|
/* +5 for !,@,{,} and null */ |
2407 |
< |
static char buffer[NICKLEN+USERLEN+HOSTLEN+HOSTLEN+5]; |
2407 |
> |
static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5]; |
2408 |
|
|
2409 |
|
if (MyConnect(client_p)) |
2410 |
|
{ |
2415 |
|
|
2416 |
|
if (IsConfOperator(aconf)) |
2417 |
|
{ |
2418 |
< |
ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name, |
2419 |
< |
client_p->username, client_p->host, |
2385 |
< |
conf->name); |
2418 |
> |
snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name, |
2419 |
> |
client_p->username, client_p->host, conf->name); |
2420 |
|
return buffer; |
2421 |
|
} |
2422 |
|
} |
2427 |
|
assert(0); /* Oper without oper conf! */ |
2428 |
|
} |
2429 |
|
|
2430 |
< |
ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name, |
2431 |
< |
client_p->username, client_p->host, client_p->servptr->name); |
2430 |
> |
snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name, |
2431 |
> |
client_p->username, client_p->host, client_p->servptr->name); |
2432 |
|
return buffer; |
2433 |
|
} |
2434 |
|
|
2480 |
|
fbclose(conf_parser_ctx.conf_file); |
2481 |
|
|
2482 |
|
add_isupport("NETWORK", ServerInfo.network_name, -1); |
2483 |
< |
ircsprintf(chanmodes, "b%s%s:%d", ConfigChannel.use_except ? "e" : "", |
2484 |
< |
ConfigChannel.use_invex ? "I" : "", ConfigChannel.max_bans); |
2483 |
> |
snprintf(chanmodes, sizeof(chanmodes), "b%s%s:%d", |
2484 |
> |
ConfigChannel.use_except ? "e" : "", |
2485 |
> |
ConfigChannel.use_invex ? "I" : "", ConfigChannel.max_bans); |
2486 |
|
add_isupport("MAXLIST", chanmodes, -1); |
2487 |
|
add_isupport("MAXTARGETS", NULL, ConfigFileEntry.max_targets); |
2488 |
+ |
|
2489 |
|
if (ConfigChannel.disable_local_channels) |
2490 |
|
add_isupport("CHANTYPES", "#", -1); |
2491 |
|
else |
2492 |
|
add_isupport("CHANTYPES", "#&", -1); |
2493 |
< |
ircsprintf(chanlimit, "%s:%d", ConfigChannel.disable_local_channels ? "#" : "#&", |
2494 |
< |
ConfigChannel.max_chans_per_user); |
2493 |
> |
|
2494 |
> |
snprintf(chanlimit, sizeof(chanlimit), "%s:%d", |
2495 |
> |
ConfigChannel.disable_local_channels ? "#" : "#&", |
2496 |
> |
ConfigChannel.max_chans_per_user); |
2497 |
|
add_isupport("CHANLIMIT", chanlimit, -1); |
2498 |
< |
ircsprintf(chanmodes, "%s%s%s", ConfigChannel.use_except ? "e" : "", |
2499 |
< |
ConfigChannel.use_invex ? "I" : "", "b,k,l,imnpst"); |
2498 |
> |
snprintf(chanmodes, sizeof(chanmodes), "%s%s%s", |
2499 |
> |
ConfigChannel.use_except ? "e" : "", |
2500 |
> |
ConfigChannel.use_invex ? "I" : "", "b,k,l,imnprstORS"); |
2501 |
|
add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN); |
2502 |
+ |
|
2503 |
|
if (ConfigChannel.use_except) |
2504 |
|
add_isupport("EXCEPTS", "e", -1); |
2505 |
|
if (ConfigChannel.use_invex) |
2512 |
|
*/ |
2513 |
|
rebuild_isupport_message_line(); |
2514 |
|
|
2515 |
< |
parse_conf_file(KLINE_TYPE, cold); |
2515 |
> |
#ifdef HAVE_LIBPCRE |
2516 |
|
parse_conf_file(RKLINE_TYPE, cold); |
2517 |
+ |
parse_conf_file(RXLINE_TYPE, cold); |
2518 |
+ |
#endif |
2519 |
+ |
parse_conf_file(KLINE_TYPE, cold); |
2520 |
|
parse_conf_file(DLINE_TYPE, cold); |
2521 |
|
parse_conf_file(XLINE_TYPE, cold); |
2479 |
– |
parse_conf_file(RXLINE_TYPE, cold); |
2522 |
|
parse_conf_file(NRESV_TYPE, cold); |
2523 |
|
parse_conf_file(CRESV_TYPE, cold); |
2524 |
|
} |
2569 |
|
dlink_list *free_items [] = { |
2570 |
|
&server_items, &oconf_items, &hub_items, &leaf_items, |
2571 |
|
&uconf_items, &xconf_items, &rxconf_items, &rkconf_items, |
2572 |
< |
&nresv_items, &cluster_items, &gdeny_items, NULL |
2572 |
> |
&nresv_items, &cluster_items, &gdeny_items, &service_items, NULL |
2573 |
|
}; |
2574 |
|
|
2575 |
|
dlink_list ** iterator = free_items; /* C is dumb */ |
2670 |
|
clear_out_address_conf(); |
2671 |
|
|
2672 |
|
/* clean out module paths */ |
2631 |
– |
#ifndef STATIC_MODULES |
2673 |
|
mod_clear_paths(); |
2633 |
– |
#endif |
2674 |
|
|
2675 |
|
/* clean out ServerInfo */ |
2676 |
|
MyFree(ServerInfo.description); |
2712 |
|
*/ |
2713 |
|
|
2714 |
|
/* clean out general */ |
2715 |
+ |
MyFree(ConfigFileEntry.service_name); |
2716 |
+ |
ConfigFileEntry.service_name = NULL; |
2717 |
+ |
|
2718 |
|
MyFree(ConfigFileEntry.servlink_path); |
2719 |
|
ConfigFileEntry.servlink_path = NULL; |
2720 |
|
#ifdef HAVE_LIBCRYPTO |
3109 |
|
return 0; |
3110 |
|
} |
3111 |
|
|
3069 |
– |
/* conf_add_d_conf() |
3070 |
– |
* |
3071 |
– |
* inputs - pointer to config item |
3072 |
– |
* output - NONE |
3073 |
– |
* side effects - Add a d/D line |
3074 |
– |
*/ |
3075 |
– |
void |
3076 |
– |
conf_add_d_conf(struct AccessItem *aconf) |
3077 |
– |
{ |
3078 |
– |
if (aconf->host == NULL) |
3079 |
– |
return; |
3080 |
– |
|
3081 |
– |
aconf->user = NULL; |
3082 |
– |
|
3083 |
– |
/* XXX - Should 'd' ever be in the old conf? For new conf we don't |
3084 |
– |
* need this anyway, so I will disable it for now... -A1kmm |
3085 |
– |
*/ |
3086 |
– |
if (parse_netmask(aconf->host, NULL, NULL) == HM_HOST) |
3087 |
– |
{ |
3088 |
– |
ilog(L_WARN, "Invalid Dline %s ignored", aconf->host); |
3089 |
– |
free_access_item(aconf); |
3090 |
– |
} |
3091 |
– |
else |
3092 |
– |
{ |
3093 |
– |
/* XXX ensure user is NULL */ |
3094 |
– |
MyFree(aconf->user); |
3095 |
– |
aconf->user = NULL; |
3096 |
– |
add_conf_by_address(CONF_DLINE, aconf); |
3097 |
– |
} |
3098 |
– |
} |
3099 |
– |
|
3112 |
|
/* yyerror() |
3113 |
|
* |
3114 |
|
* inputs - message from parser |
3156 |
|
* Originally written by Dianora (Diane, db@db.net) |
3157 |
|
*/ |
3158 |
|
time_t |
3159 |
< |
valid_tkline(char *p, int minutes) |
3159 |
> |
valid_tkline(const char *p, int minutes) |
3160 |
|
{ |
3161 |
|
time_t result = 0; |
3162 |
|
|
3163 |
< |
while (*p) |
3163 |
> |
for (; *p; ++p) |
3164 |
|
{ |
3165 |
< |
if (IsDigit(*p)) |
3154 |
< |
{ |
3155 |
< |
result *= 10; |
3156 |
< |
result += ((*p) & 0xF); |
3157 |
< |
p++; |
3158 |
< |
} |
3159 |
< |
else |
3165 |
> |
if (!IsDigit(*p)) |
3166 |
|
return 0; |
3167 |
+ |
|
3168 |
+ |
result *= 10; |
3169 |
+ |
result += ((*p) & 0xF); |
3170 |
|
} |
3171 |
|
|
3172 |
< |
/* in the degenerate case where oper does a /quote kline 0 user@host :reason |
3172 |
> |
/* |
3173 |
> |
* In the degenerate case where oper does a /quote kline 0 user@host :reason |
3174 |
|
* i.e. they specifically use 0, I am going to return 1 instead |
3175 |
|
* as a return value of non-zero is used to flag it as a temporary kline |
3176 |
|
*/ |
3167 |
– |
|
3177 |
|
if (result == 0) |
3178 |
|
result = 1; |
3179 |
|
|
3344 |
|
return -1; |
3345 |
|
} |
3346 |
|
|
3347 |
< |
if (!IsOperRemoteBan(source_p)) |
3347 |
> |
if (!HasOFlag(source_p, OPER_FLAG_REMOTEBAN)) |
3348 |
|
{ |
3349 |
|
sendto_one(source_p, form_str(ERR_NOPRIVS), |
3350 |
|
me.name, source_p->name, "remoteban"); |