1 |
|
/* |
2 |
|
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
< |
* s_conf.c: Configuration file functions. |
3 |
> |
* conf.c: Configuration file functions. |
4 |
|
* |
5 |
|
* Copyright (C) 2002 by the past and present ircd coders, and others. |
6 |
|
* |
26 |
|
#include "list.h" |
27 |
|
#include "ircd_defs.h" |
28 |
|
#include "balloc.h" |
29 |
< |
#include "s_conf.h" |
29 |
> |
#include "conf.h" |
30 |
|
#include "s_serv.h" |
31 |
|
#include "resv.h" |
32 |
|
#include "channel.h" |
33 |
|
#include "client.h" |
34 |
– |
#include "common.h" |
34 |
|
#include "event.h" |
35 |
|
#include "hash.h" |
36 |
|
#include "hook.h" |
43 |
|
#include "modules.h" |
44 |
|
#include "numeric.h" |
45 |
|
#include "fdlist.h" |
46 |
< |
#include "s_log.h" |
46 |
> |
#include "log.h" |
47 |
|
#include "send.h" |
48 |
|
#include "s_gline.h" |
49 |
|
#include "fileio.h" |
52 |
|
#include "userhost.h" |
53 |
|
#include "s_user.h" |
54 |
|
#include "channel_mode.h" |
55 |
+ |
#include "parse.h" |
56 |
+ |
#include "s_misc.h" |
57 |
|
|
58 |
|
struct Callback *client_check_cb = NULL; |
59 |
|
struct config_server_hide ConfigServerHide; |
60 |
|
|
61 |
|
/* general conf items link list root, other than k lines etc. */ |
62 |
+ |
dlink_list service_items = { NULL, NULL, 0 }; |
63 |
|
dlink_list server_items = { NULL, NULL, 0 }; |
64 |
|
dlink_list cluster_items = { NULL, NULL, 0 }; |
65 |
|
dlink_list hub_items = { NULL, NULL, 0 }; |
323 |
|
dlinkAdd(conf, &conf->node, &nresv_items); |
324 |
|
break; |
325 |
|
|
326 |
+ |
case SERVICE_TYPE: |
327 |
+ |
status = CONF_SERVICE; |
328 |
+ |
conf = MyMalloc(sizeof(struct ConfItem)); |
329 |
+ |
dlinkAdd(conf, &conf->node, &service_items); |
330 |
+ |
break; |
331 |
+ |
|
332 |
|
case CLASS_TYPE: |
333 |
|
conf = MyMalloc(sizeof(struct ConfItem) + |
334 |
|
sizeof(struct ClassItem)); |
390 |
|
MyFree(aconf->oper_reason); |
391 |
|
MyFree(aconf->user); |
392 |
|
MyFree(aconf->host); |
393 |
+ |
MyFree(aconf->cipher_list); |
394 |
|
#ifdef HAVE_LIBCRYPTO |
395 |
|
if (aconf->rsa_public_key) |
396 |
|
RSA_free(aconf->rsa_public_key); |
535 |
|
MyFree(conf); |
536 |
|
break; |
537 |
|
|
538 |
+ |
case SERVICE_TYPE: |
539 |
+ |
dlinkDelete(&conf->node, &service_items); |
540 |
+ |
MyFree(conf); |
541 |
+ |
break; |
542 |
+ |
|
543 |
|
default: |
544 |
|
break; |
545 |
|
} |
699 |
|
aconf = map_to_conf(conf); |
700 |
|
|
701 |
|
/* Don't allow non opers to see oper privs */ |
702 |
< |
if (IsOper(source_p)) |
702 |
> |
if (HasUMode(source_p, UMODE_OPER)) |
703 |
|
sendto_one(source_p, form_str(RPL_STATSOLINE), |
704 |
|
me.name, source_p->name, 'O', aconf->user, aconf->host, |
705 |
|
conf->name, oper_privs_as_string(aconf->port), |
731 |
|
case CLIENT_TYPE: |
732 |
|
break; |
733 |
|
|
734 |
+ |
case SERVICE_TYPE: |
735 |
+ |
DLINK_FOREACH(ptr, service_items.head) |
736 |
+ |
{ |
737 |
+ |
conf = ptr->data; |
738 |
+ |
sendto_one(source_p, form_str(RPL_STATSSERVICE), |
739 |
+ |
me.name, source_p->name, 'S', "*", conf->name, 0, 0); |
740 |
+ |
} |
741 |
+ |
break; |
742 |
+ |
|
743 |
|
case SERVER_TYPE: |
744 |
|
DLINK_FOREACH(ptr, server_items.head) |
745 |
|
{ |
752 |
|
|
753 |
|
if (IsConfAllowAutoConn(aconf)) |
754 |
|
*p++ = 'A'; |
755 |
< |
if (IsConfCryptLink(aconf)) |
756 |
< |
*p++ = 'C'; |
755 |
> |
if (IsConfSSL(aconf)) |
756 |
> |
*p++ = 'S'; |
757 |
|
if (IsConfTopicBurst(aconf)) |
758 |
|
*p++ = 'T'; |
736 |
– |
if (IsConfCompressed(aconf)) |
737 |
– |
*p++ = 'Z'; |
759 |
|
if (buf[0] == '\0') |
760 |
|
*p++ = '*'; |
761 |
|
|
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, |
831 |
|
|
832 |
|
/* I'm already in big trouble if source_p->localClient is NULL -db */ |
833 |
|
if ((i = verify_access(source_p, username))) |
834 |
< |
ilog(L_INFO, "Access denied: %s[%s]", |
834 |
> |
ilog(LOG_TYPE_IRCD, "Access denied: %s[%s]", |
835 |
|
source_p->name, source_p->sockhost); |
836 |
|
|
837 |
|
switch (i) |
841 |
|
"Too many on IP for %s (%s).", |
842 |
|
get_client_name(source_p, SHOW_IP), |
843 |
|
source_p->sockhost); |
844 |
< |
ilog(L_INFO,"Too many connections on IP from %s.", |
844 |
> |
ilog(LOG_TYPE_IRCD, "Too many connections on IP from %s.", |
845 |
|
get_client_name(source_p, SHOW_IP)); |
846 |
|
++ServerStats.is_ref; |
847 |
|
exit_client(source_p, &me, "No more connections allowed on that IP"); |
852 |
|
"I-line is full for %s (%s).", |
853 |
|
get_client_name(source_p, SHOW_IP), |
854 |
|
source_p->sockhost); |
855 |
< |
ilog(L_INFO,"Too many connections from %s.", |
855 |
> |
ilog(LOG_TYPE_IRCD, "Too many connections from %s.", |
856 |
|
get_client_name(source_p, SHOW_IP)); |
857 |
|
++ServerStats.is_ref; |
858 |
|
exit_client(source_p, &me, |
869 |
|
source_p->sockhost, |
870 |
|
source_p->localClient->listener->name, |
871 |
|
source_p->localClient->listener->port); |
872 |
< |
ilog(L_INFO, |
872 |
> |
ilog(LOG_TYPE_IRCD, |
873 |
|
"Unauthorized client connection from %s on [%s/%u].", |
874 |
|
get_client_name(source_p, SHOW_IP), |
875 |
|
source_p->localClient->listener->name, |
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; |
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: |
1624 |
|
case NRESV_TYPE: |
1672 |
|
* side effects - looks for an exact match on name field |
1673 |
|
*/ |
1674 |
|
struct ConfItem * |
1675 |
< |
find_exact_name_conf(ConfType type, const char *name, |
1675 |
> |
find_exact_name_conf(ConfType type, const struct Client *who, const char *name, |
1676 |
|
const char *user, const char *host) |
1677 |
|
{ |
1678 |
|
dlink_node *ptr = NULL; |
1713 |
|
DLINK_FOREACH(ptr, list_p->head) |
1714 |
|
{ |
1715 |
|
conf = ptr->data; |
1716 |
< |
aconf = (struct AccessItem *)map_to_conf(conf); |
1716 |
> |
aconf = map_to_conf(conf); |
1717 |
> |
|
1718 |
|
if (EmptyString(conf->name)) |
1719 |
< |
continue; |
1720 |
< |
|
1721 |
< |
if (irccmp(conf->name, name) == 0) |
1719 |
> |
continue; |
1720 |
> |
|
1721 |
> |
if (!irccmp(conf->name, name)) |
1722 |
|
{ |
1723 |
< |
if ((user == NULL && (host == NULL))) |
1724 |
< |
return (conf); |
1725 |
< |
if (EmptyString(aconf->user) || EmptyString(aconf->host)) |
1726 |
< |
return (conf); |
1727 |
< |
if (match(aconf->user, user) && match(aconf->host, host)) |
1728 |
< |
return (conf); |
1723 |
> |
if (!who) |
1724 |
> |
return conf; |
1725 |
> |
if (EmptyString(aconf->user) || EmptyString(aconf->host)) |
1726 |
> |
return conf; |
1727 |
> |
if (match(aconf->user, who->username)) |
1728 |
> |
{ |
1729 |
> |
switch (aconf->type) |
1730 |
> |
{ |
1731 |
> |
case HM_HOST: |
1732 |
> |
if (match(aconf->host, who->host) || match(aconf->host, who->sockhost)) |
1733 |
> |
return conf; |
1734 |
> |
break; |
1735 |
> |
case HM_IPV4: |
1736 |
> |
if (who->localClient->aftype == AF_INET) |
1737 |
> |
if (match_ipv4(&who->localClient->ip, &aconf->ipnum, aconf->bits)) |
1738 |
> |
return conf; |
1739 |
> |
break; |
1740 |
> |
#ifdef IPV6 |
1741 |
> |
case HM_IPV6: |
1742 |
> |
if (who->localClient->aftype == AF_INET6) |
1743 |
> |
if (match_ipv6(&who->localClient->ip, &aconf->ipnum, aconf->bits)) |
1744 |
> |
return conf; |
1745 |
> |
break; |
1746 |
> |
#endif |
1747 |
> |
default: |
1748 |
> |
assert(0); |
1749 |
> |
} |
1750 |
> |
} |
1751 |
|
} |
1752 |
|
} |
1753 |
+ |
|
1754 |
|
break; |
1755 |
|
|
1756 |
|
case SERVER_TYPE: |
1823 |
|
flush_deleted_I_P(); |
1824 |
|
|
1825 |
|
rehashed_klines = 1; |
1826 |
< |
|
1826 |
> |
/* XXX */ |
1827 |
|
if (ConfigLoggingEntry.use_logging) |
1828 |
< |
reopen_log(logFileName); |
1828 |
> |
log_close_all(); |
1829 |
|
|
1830 |
|
return(0); |
1831 |
|
} |
1872 |
|
AdminInfo.email = NULL; |
1873 |
|
AdminInfo.description = NULL; |
1874 |
|
|
1875 |
< |
set_log_level(L_NOTICE); |
1875 |
> |
log_close_all(); |
1876 |
> |
|
1877 |
|
ConfigLoggingEntry.use_logging = 1; |
1878 |
< |
ConfigLoggingEntry.operlog[0] = '\0'; |
1879 |
< |
ConfigLoggingEntry.userlog[0] = '\0'; |
1880 |
< |
ConfigLoggingEntry.klinelog[0] = '\0'; |
1881 |
< |
ConfigLoggingEntry.glinelog[0] = '\0'; |
1882 |
< |
ConfigLoggingEntry.killlog[0] = '\0'; |
1883 |
< |
ConfigLoggingEntry.operspylog[0] = '\0'; |
1884 |
< |
ConfigLoggingEntry.ioerrlog[0] = '\0'; |
1885 |
< |
ConfigLoggingEntry.failed_operlog[0] = '\0'; |
1825 |
< |
|
1826 |
< |
ConfigChannel.disable_fake_channels = NO; |
1827 |
< |
ConfigChannel.restrict_channels = NO; |
1828 |
< |
ConfigChannel.disable_local_channels = NO; |
1829 |
< |
ConfigChannel.use_invex = YES; |
1830 |
< |
ConfigChannel.use_except = YES; |
1831 |
< |
ConfigChannel.use_knock = YES; |
1878 |
> |
ConfigLoggingEntry.timestamp = 1; |
1879 |
> |
|
1880 |
> |
ConfigChannel.disable_fake_channels = 0; |
1881 |
> |
ConfigChannel.restrict_channels = 0; |
1882 |
> |
ConfigChannel.disable_local_channels = 0; |
1883 |
> |
ConfigChannel.use_invex = 1; |
1884 |
> |
ConfigChannel.use_except = 1; |
1885 |
> |
ConfigChannel.use_knock = 1; |
1886 |
|
ConfigChannel.knock_delay = 300; |
1887 |
|
ConfigChannel.knock_delay_channel = 60; |
1888 |
|
ConfigChannel.max_chans_per_user = 15; |
1889 |
< |
ConfigChannel.quiet_on_ban = YES; |
1889 |
> |
ConfigChannel.quiet_on_ban = 1; |
1890 |
|
ConfigChannel.max_bans = 25; |
1891 |
|
ConfigChannel.default_split_user_count = 0; |
1892 |
|
ConfigChannel.default_split_server_count = 0; |
1893 |
< |
ConfigChannel.no_join_on_split = NO; |
1894 |
< |
ConfigChannel.no_create_on_split = NO; |
1895 |
< |
ConfigChannel.burst_topicwho = YES; |
1893 |
> |
ConfigChannel.no_join_on_split = 0; |
1894 |
> |
ConfigChannel.no_create_on_split = 0; |
1895 |
> |
ConfigChannel.burst_topicwho = 1; |
1896 |
|
|
1897 |
< |
ConfigServerHide.flatten_links = NO; |
1897 |
> |
ConfigServerHide.flatten_links = 0; |
1898 |
|
ConfigServerHide.links_delay = 300; |
1899 |
< |
ConfigServerHide.hidden = NO; |
1900 |
< |
ConfigServerHide.disable_hidden = NO; |
1901 |
< |
ConfigServerHide.hide_servers = NO; |
1899 |
> |
ConfigServerHide.hidden = 0; |
1900 |
> |
ConfigServerHide.disable_hidden = 0; |
1901 |
> |
ConfigServerHide.hide_servers = 0; |
1902 |
|
DupString(ConfigServerHide.hidden_name, NETWORK_NAME_DEFAULT); |
1903 |
< |
ConfigServerHide.hide_server_ips = NO; |
1903 |
> |
ConfigServerHide.hide_server_ips = 0; |
1904 |
|
|
1905 |
|
|
1906 |
+ |
DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT); |
1907 |
|
ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT; |
1908 |
|
ConfigFileEntry.gline_min_cidr = 16; |
1909 |
|
ConfigFileEntry.gline_min_cidr6 = 48; |
1910 |
< |
ConfigFileEntry.invisible_on_connect = YES; |
1911 |
< |
ConfigFileEntry.burst_away = NO; |
1912 |
< |
ConfigFileEntry.use_whois_actually = YES; |
1913 |
< |
ConfigFileEntry.tkline_expire_notices = YES; |
1914 |
< |
ConfigFileEntry.hide_spoof_ips = YES; |
1915 |
< |
ConfigFileEntry.ignore_bogus_ts = NO; |
1916 |
< |
ConfigFileEntry.disable_auth = NO; |
1917 |
< |
ConfigFileEntry.disable_remote = NO; |
1910 |
> |
ConfigFileEntry.invisible_on_connect = 1; |
1911 |
> |
ConfigFileEntry.burst_away = 0; |
1912 |
> |
ConfigFileEntry.use_whois_actually = 1; |
1913 |
> |
ConfigFileEntry.tkline_expire_notices = 1; |
1914 |
> |
ConfigFileEntry.hide_spoof_ips = 1; |
1915 |
> |
ConfigFileEntry.ignore_bogus_ts = 0; |
1916 |
> |
ConfigFileEntry.disable_auth = 0; |
1917 |
> |
ConfigFileEntry.disable_remote = 0; |
1918 |
|
ConfigFileEntry.kill_chase_time_limit = 90; |
1919 |
|
ConfigFileEntry.default_floodcount = 8; |
1920 |
< |
ConfigFileEntry.failed_oper_notice = YES; |
1920 |
> |
ConfigFileEntry.failed_oper_notice = 1; |
1921 |
|
ConfigFileEntry.dots_in_ident = 0; |
1922 |
|
ConfigFileEntry.min_nonwildcard = 4; |
1923 |
|
ConfigFileEntry.min_nonwildcard_simple = 3; |
1924 |
|
ConfigFileEntry.max_accept = 20; |
1925 |
< |
ConfigFileEntry.anti_nick_flood = NO; |
1925 |
> |
ConfigFileEntry.anti_nick_flood = 0; |
1926 |
|
ConfigFileEntry.max_nick_time = 20; |
1927 |
|
ConfigFileEntry.max_nick_changes = 5; |
1928 |
|
ConfigFileEntry.anti_spam_exit_message_time = 0; |
1929 |
|
ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; |
1930 |
|
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; |
1931 |
< |
ConfigFileEntry.kline_with_reason = YES; |
1931 |
> |
ConfigFileEntry.kline_with_reason = 1; |
1932 |
|
ConfigFileEntry.kline_reason = NULL; |
1933 |
< |
ConfigFileEntry.warn_no_nline = YES; |
1934 |
< |
ConfigFileEntry.stats_o_oper_only = NO; |
1933 |
> |
ConfigFileEntry.warn_no_nline = 1; |
1934 |
> |
ConfigFileEntry.stats_o_oper_only = 0; |
1935 |
|
ConfigFileEntry.stats_k_oper_only = 1; /* masked */ |
1936 |
|
ConfigFileEntry.stats_i_oper_only = 1; /* masked */ |
1937 |
< |
ConfigFileEntry.stats_P_oper_only = NO; |
1937 |
> |
ConfigFileEntry.stats_P_oper_only = 0; |
1938 |
|
ConfigFileEntry.caller_id_wait = 60; |
1939 |
< |
ConfigFileEntry.opers_bypass_callerid = NO; |
1939 |
> |
ConfigFileEntry.opers_bypass_callerid = 0; |
1940 |
|
ConfigFileEntry.pace_wait = 10; |
1941 |
|
ConfigFileEntry.pace_wait_simple = 1; |
1942 |
< |
ConfigFileEntry.short_motd = NO; |
1943 |
< |
ConfigFileEntry.ping_cookie = NO; |
1944 |
< |
ConfigFileEntry.no_oper_flood = NO; |
1945 |
< |
ConfigFileEntry.true_no_oper_flood = NO; |
1946 |
< |
ConfigFileEntry.oper_pass_resv = YES; |
1947 |
< |
ConfigFileEntry.glines = NO; |
1942 |
> |
ConfigFileEntry.short_motd = 0; |
1943 |
> |
ConfigFileEntry.ping_cookie = 0; |
1944 |
> |
ConfigFileEntry.no_oper_flood = 0; |
1945 |
> |
ConfigFileEntry.true_no_oper_flood = 0; |
1946 |
> |
ConfigFileEntry.oper_pass_resv = 1; |
1947 |
> |
ConfigFileEntry.glines = 0; |
1948 |
|
ConfigFileEntry.gline_time = 12 * 3600; |
1894 |
– |
ConfigFileEntry.idletime = 0; |
1949 |
|
ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT; |
1950 |
|
ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT; |
1951 |
|
ConfigFileEntry.oper_only_umodes = UMODE_DEBUG; |
1952 |
|
ConfigFileEntry.oper_umodes = UMODE_BOTS | UMODE_LOCOPS | UMODE_SERVNOTICE | |
1953 |
|
UMODE_OPERWALL | UMODE_WALLOP; |
1954 |
< |
DupString(ConfigFileEntry.servlink_path, SLPATH); |
1901 |
< |
#ifdef HAVE_LIBCRYPTO |
1902 |
< |
/* jdc -- This is our default value for a cipher. According to the |
1903 |
< |
* CRYPTLINK document (doc/cryptlink.txt), BF/128 must be supported |
1904 |
< |
* under all circumstances if cryptlinks are enabled. So, |
1905 |
< |
* this will be our default. |
1906 |
< |
* |
1907 |
< |
* NOTE: I apologise for the hard-coded value of "1" (BF/128). |
1908 |
< |
* This should be moved into a find_cipher() routine. |
1909 |
< |
*/ |
1910 |
< |
ConfigFileEntry.default_cipher_preference = &CipherTable[1]; |
1911 |
< |
#endif |
1912 |
< |
ConfigFileEntry.use_egd = NO; |
1954 |
> |
ConfigFileEntry.use_egd = 0; |
1955 |
|
ConfigFileEntry.egdpool_path = NULL; |
1914 |
– |
#ifdef HAVE_LIBZ |
1915 |
– |
ConfigFileEntry.compression_level = 0; |
1916 |
– |
#endif |
1956 |
|
ConfigFileEntry.throttle_time = 10; |
1957 |
|
} |
1958 |
|
|
1989 |
|
if (ConfigFileEntry.ts_max_delta < TS_MAX_DELTA_MIN) |
1990 |
|
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; |
1991 |
|
|
1953 |
– |
if (ConfigFileEntry.servlink_path == NULL) |
1954 |
– |
DupString(ConfigFileEntry.servlink_path, SLPATH); |
1955 |
– |
|
1992 |
|
if (ServerInfo.network_name == NULL) |
1993 |
|
DupString(ServerInfo.network_name,NETWORK_NAME_DEFAULT); |
1994 |
|
|
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; |
2021 |
|
if (EmptyString(aconf->host) || |
2022 |
|
EmptyString(aconf->user)) |
2023 |
|
{ |
2024 |
< |
ilog(L_ERROR, "Host/server name error: (%s) (%s)", |
2024 |
> |
ilog(LOG_TYPE_IRCD, "Host/server name error: (%s) (%s)", |
2025 |
|
aconf->host, conf->name); |
2026 |
|
return; |
2027 |
|
} |
2350 |
|
static const struct oper_privs |
2351 |
|
{ |
2352 |
|
const unsigned int oprivs; |
2314 |
– |
const unsigned int hidden; |
2353 |
|
const unsigned char c; |
2354 |
|
} flag_list[] = { |
2355 |
< |
{ OPER_FLAG_ADMIN, OPER_FLAG_HIDDEN_ADMIN, 'A' }, |
2356 |
< |
{ OPER_FLAG_REMOTEBAN, 0, 'B' }, |
2357 |
< |
{ OPER_FLAG_DIE, 0, 'D' }, |
2358 |
< |
{ OPER_FLAG_GLINE, 0, 'G' }, |
2359 |
< |
{ OPER_FLAG_REHASH, 0, 'H' }, |
2360 |
< |
{ OPER_FLAG_K, 0, 'K' }, |
2361 |
< |
{ OPER_FLAG_OPERWALL, 0, 'L' }, |
2362 |
< |
{ OPER_FLAG_N, 0, 'N' }, |
2363 |
< |
{ OPER_FLAG_GLOBAL_KILL, 0, 'O' }, |
2364 |
< |
{ OPER_FLAG_REMOTE, 0, 'R' }, |
2365 |
< |
{ OPER_FLAG_OPER_SPY, 0, 'S' }, |
2366 |
< |
{ OPER_FLAG_UNKLINE, 0, 'U' }, |
2367 |
< |
{ OPER_FLAG_X, 0, 'X' }, |
2368 |
< |
{ 0, 0, '\0' } |
2355 |
> |
{ OPER_FLAG_ADMIN, 'A' }, |
2356 |
> |
{ OPER_FLAG_REMOTEBAN, 'B' }, |
2357 |
> |
{ OPER_FLAG_DIE, 'D' }, |
2358 |
> |
{ OPER_FLAG_GLINE, 'G' }, |
2359 |
> |
{ OPER_FLAG_REHASH, 'H' }, |
2360 |
> |
{ OPER_FLAG_K, 'K' }, |
2361 |
> |
{ OPER_FLAG_OPERWALL, 'L' }, |
2362 |
> |
{ OPER_FLAG_N, 'N' }, |
2363 |
> |
{ OPER_FLAG_GLOBAL_KILL, 'O' }, |
2364 |
> |
{ OPER_FLAG_REMOTE, 'R' }, |
2365 |
> |
{ OPER_FLAG_OPER_SPY, 'S' }, |
2366 |
> |
{ OPER_FLAG_UNKLINE, 'U' }, |
2367 |
> |
{ OPER_FLAG_X, 'X' }, |
2368 |
> |
{ 0, '\0' } |
2369 |
|
}; |
2370 |
|
|
2371 |
|
char * |
2377 |
|
|
2378 |
|
for (; flag_list[i].oprivs; ++i) |
2379 |
|
{ |
2380 |
< |
if ((port & flag_list[i].oprivs) && |
2343 |
< |
(port & flag_list[i].hidden) == 0) |
2380 |
> |
if (port & flag_list[i].oprivs) |
2381 |
|
*privs_ptr++ = flag_list[i].c; |
2382 |
|
else |
2383 |
|
*privs_ptr++ = ToLowerTab[flag_list[i].c]; |
2458 |
|
{ |
2459 |
|
if (cold) |
2460 |
|
{ |
2461 |
< |
ilog(L_CRIT, "Unable to read configuration file '%s': %s", |
2461 |
> |
ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", |
2462 |
|
filename, strerror(errno)); |
2463 |
|
exit(-1); |
2464 |
|
} |
2495 |
|
add_isupport("CHANLIMIT", chanlimit, -1); |
2496 |
|
snprintf(chanmodes, sizeof(chanmodes), "%s%s%s", |
2497 |
|
ConfigChannel.use_except ? "e" : "", |
2498 |
< |
ConfigChannel.use_invex ? "I" : "", "b,k,l,imnpstOS"); |
2498 |
> |
ConfigChannel.use_invex ? "I" : "", "b,k,l,imnprstORS"); |
2499 |
|
add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN); |
2500 |
|
|
2501 |
|
if (ConfigChannel.use_except) |
2536 |
|
if ((file = fbopen(filename, "r")) == NULL) |
2537 |
|
{ |
2538 |
|
if (cold) |
2539 |
< |
ilog(L_ERROR, "Unable to read configuration file '%s': %s", |
2539 |
> |
ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", |
2540 |
|
filename, strerror(errno)); |
2541 |
|
else |
2542 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, |
2567 |
|
dlink_list *free_items [] = { |
2568 |
|
&server_items, &oconf_items, &hub_items, &leaf_items, |
2569 |
|
&uconf_items, &xconf_items, &rxconf_items, &rkconf_items, |
2570 |
< |
&nresv_items, &cluster_items, &gdeny_items, NULL |
2570 |
> |
&nresv_items, &cluster_items, &gdeny_items, &service_items, NULL |
2571 |
|
}; |
2572 |
|
|
2573 |
|
dlink_list ** iterator = free_items; /* C is dumb */ |
2688 |
|
|
2689 |
|
MyFree(ServerInfo.rsa_private_key_file); |
2690 |
|
ServerInfo.rsa_private_key_file = NULL; |
2691 |
+ |
|
2692 |
+ |
if (ServerInfo.server_ctx) |
2693 |
+ |
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2| |
2694 |
+ |
SSL_OP_NO_SSLv3| |
2695 |
+ |
SSL_OP_NO_TLSv1); |
2696 |
+ |
if (ServerInfo.client_ctx) |
2697 |
+ |
SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv2| |
2698 |
+ |
SSL_OP_NO_SSLv3| |
2699 |
+ |
SSL_OP_NO_TLSv1); |
2700 |
|
#endif |
2701 |
|
|
2702 |
|
/* clean out old resvs from the conf */ |
2719 |
|
*/ |
2720 |
|
|
2721 |
|
/* clean out general */ |
2722 |
< |
MyFree(ConfigFileEntry.servlink_path); |
2723 |
< |
ConfigFileEntry.servlink_path = NULL; |
2724 |
< |
#ifdef HAVE_LIBCRYPTO |
2679 |
< |
ConfigFileEntry.default_cipher_preference = NULL; |
2680 |
< |
#endif /* HAVE_LIBCRYPTO */ |
2722 |
> |
MyFree(ConfigFileEntry.service_name); |
2723 |
> |
ConfigFileEntry.service_name = NULL; |
2724 |
> |
|
2725 |
|
delete_isupport("INVEX"); |
2726 |
|
delete_isupport("EXCEPTS"); |
2727 |
|
} |
2916 |
|
{ |
2917 |
|
struct ConfItem *conf; |
2918 |
|
|
2919 |
< |
if ((conf = find_exact_name_conf(CLASS_TYPE, classname, NULL, NULL)) != NULL) |
2919 |
> |
if ((conf = find_exact_name_conf(CLASS_TYPE, NULL, classname, NULL, NULL)) != NULL) |
2920 |
|
return conf; |
2921 |
|
|
2922 |
|
return class_default; |
3076 |
|
if (!aconf->host || !conf->name) |
3077 |
|
{ |
3078 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block"); |
3079 |
< |
ilog(L_WARN, "Bad connect block"); |
3079 |
> |
ilog(LOG_TYPE_IRCD, "Bad connect block"); |
3080 |
|
return -1; |
3081 |
|
} |
3082 |
|
|
3083 |
< |
if (EmptyString(aconf->passwd) && !IsConfCryptLink(aconf)) |
3083 |
> |
if (EmptyString(aconf->passwd)) |
3084 |
|
{ |
3085 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block, name %s", |
3086 |
|
conf->name); |
3087 |
< |
ilog(L_WARN, "Bad connect block, host %s", conf->name); |
3087 |
> |
ilog(LOG_TYPE_IRCD, "Bad connect block, host %s", conf->name); |
3088 |
|
return -1; |
3089 |
|
} |
3090 |
|
|
3128 |
|
strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); |
3129 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %u: %s: %s", |
3130 |
|
conffilebuf, lineno + 1, msg, newlinebuf); |
3131 |
< |
ilog(L_WARN, "\"%s\", line %u: %s: %s", |
3131 |
> |
ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", |
3132 |
|
conffilebuf, lineno + 1, msg, newlinebuf); |
3133 |
|
} |
3134 |
|
|
3346 |
|
return -1; |
3347 |
|
} |
3348 |
|
|
3349 |
< |
if (!IsOperRemoteBan(source_p)) |
3349 |
> |
if (!HasOFlag(source_p, OPER_FLAG_REMOTEBAN)) |
3350 |
|
{ |
3351 |
|
sendto_one(source_p, form_str(ERR_NOPRIVS), |
3352 |
|
me.name, source_p->name, "remoteban"); |
3383 |
|
return -1; |
3384 |
|
} |
3385 |
|
|
3386 |
< |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, YES, 2, *up_p, *h_p)) |
3386 |
> |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 2, *up_p, *h_p)) |
3387 |
|
return -1; |
3388 |
|
} |
3389 |
|
else |
3390 |
< |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, YES, 1, *up_p)) |
3390 |
> |
if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 1, *up_p)) |
3391 |
|
return -1; |
3392 |
|
|
3393 |
|
if (reason != NULL) |
3395 |
|
if (parc != 0 && !EmptyString(*parv)) |
3396 |
|
{ |
3397 |
|
*reason = *parv; |
3398 |
< |
if (!valid_comment(source_p, *reason, YES)) |
3398 |
> |
if (!valid_comment(source_p, *reason, 1)) |
3399 |
|
return -1; |
3400 |
|
} |
3401 |
|
else |
3554 |
|
* inputs - client sending the cluster |
3555 |
|
* - command name "KLINE" "XLINE" etc. |
3556 |
|
* - capab -- CAP_KLN etc. from s_serv.h |
3557 |
< |
* - cluster type -- CLUSTER_KLINE etc. from s_conf.h |
3557 |
> |
* - cluster type -- CLUSTER_KLINE etc. from conf.h |
3558 |
|
* - pattern and args to send along |
3559 |
|
* output - none |
3560 |
|
* side effects - Take source_p send the pattern with args given |