| 1 |
|
/* |
| 2 |
< |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
< |
* conf_parser.y: Parses the ircd configuration file. |
| 2 |
> |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (C) 2005 by the past and present ircd coders, and others. |
| 4 |
> |
* Copyright (c) 2000-2014 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 |
| 17 |
|
* along with this program; if not, write to the Free Software |
| 18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 |
|
* USA |
| 21 |
– |
* |
| 22 |
– |
* $Id$ |
| 20 |
|
*/ |
| 21 |
|
|
| 22 |
+ |
/*! \file conf_parser.y |
| 23 |
+ |
* \brief Parses the ircd configuration file. |
| 24 |
+ |
* \version $Id$ |
| 25 |
+ |
*/ |
| 26 |
+ |
|
| 27 |
+ |
|
| 28 |
|
%{ |
| 29 |
|
|
| 30 |
|
#define YY_NO_UNPUT |
| 160 |
|
%token CLASS |
| 161 |
|
%token CONNECT |
| 162 |
|
%token CONNECTFREQ |
| 163 |
+ |
%token CYCLE_ON_HOST_CHANGE |
| 164 |
|
%token DEFAULT_FLOODCOUNT |
| 165 |
|
%token DEFAULT_SPLIT_SERVER_COUNT |
| 166 |
|
%token DEFAULT_SPLIT_USER_COUNT |
| 293 |
|
%token STATS_K_OPER_ONLY |
| 294 |
|
%token STATS_O_OPER_ONLY |
| 295 |
|
%token STATS_P_OPER_ONLY |
| 296 |
+ |
%token STATS_U_OPER_ONLY |
| 297 |
|
%token T_ALL |
| 298 |
|
%token T_BOTS |
| 299 |
|
%token T_CALLERID |
| 370 |
|
%type <number> sizespec_ |
| 371 |
|
|
| 372 |
|
%% |
| 373 |
< |
conf: |
| 373 |
> |
conf: |
| 374 |
|
| conf conf_item |
| 375 |
|
; |
| 376 |
|
|
| 378 |
|
| logging_entry |
| 379 |
|
| oper_entry |
| 380 |
|
| channel_entry |
| 381 |
< |
| class_entry |
| 381 |
> |
| class_entry |
| 382 |
|
| listen_entry |
| 383 |
|
| auth_entry |
| 384 |
|
| serverinfo_entry |
| 516 |
|
serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' |
| 517 |
|
{ |
| 518 |
|
#ifdef HAVE_LIBCRYPTO |
| 519 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 519 |
> |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 520 |
|
{ |
| 521 |
|
if (!ServerInfo.rsa_private_key_file) |
| 522 |
|
{ |
| 603 |
|
break; |
| 604 |
|
} |
| 605 |
|
|
| 606 |
< |
/* require 2048 bit (256 byte) key */ |
| 602 |
< |
if (RSA_size(ServerInfo.rsa_private_key) != 256) |
| 606 |
> |
if (RSA_size(ServerInfo.rsa_private_key) < 128) |
| 607 |
|
{ |
| 608 |
|
RSA_free(ServerInfo.rsa_private_key); |
| 609 |
|
ServerInfo.rsa_private_key = NULL; |
| 610 |
|
|
| 611 |
< |
conf_error_report("Not a 2048 bit key, ignoring"); |
| 611 |
> |
conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 1024 bit key size"); |
| 612 |
|
} |
| 613 |
|
#endif |
| 614 |
|
}; |
| 649 |
|
#endif |
| 650 |
|
}; |
| 651 |
|
|
| 652 |
< |
serverinfo_name: NAME '=' QSTRING ';' |
| 652 |
> |
serverinfo_name: NAME '=' QSTRING ';' |
| 653 |
|
{ |
| 654 |
|
/* this isn't rehashable */ |
| 655 |
|
if (conf_parser_ctx.pass == 2 && !ServerInfo.name) |
| 664 |
|
} |
| 665 |
|
}; |
| 666 |
|
|
| 667 |
< |
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 667 |
> |
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 668 |
|
{ |
| 669 |
|
/* this isn't rehashable */ |
| 670 |
|
if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) |
| 838 |
|
ServerInfo.max_topic_length = $3; |
| 839 |
|
}; |
| 840 |
|
|
| 841 |
< |
serverinfo_hub: HUB '=' TBOOL ';' |
| 841 |
> |
serverinfo_hub: HUB '=' TBOOL ';' |
| 842 |
|
{ |
| 843 |
|
if (conf_parser_ctx.pass == 2) |
| 844 |
|
ServerInfo.hub = yylval.number; |
| 853 |
|
admin_item: admin_name | admin_description | |
| 854 |
|
admin_email | error ';' ; |
| 855 |
|
|
| 856 |
< |
admin_name: NAME '=' QSTRING ';' |
| 856 |
> |
admin_name: NAME '=' QSTRING ';' |
| 857 |
|
{ |
| 858 |
|
if (conf_parser_ctx.pass != 2) |
| 859 |
|
break; |
| 883 |
|
/*************************************************************************** |
| 884 |
|
* motd section |
| 885 |
|
***************************************************************************/ |
| 886 |
< |
motd_entry: MOTD |
| 886 |
> |
motd_entry: MOTD |
| 887 |
|
{ |
| 888 |
|
if (conf_parser_ctx.pass == 2) |
| 889 |
|
reset_block_state(); |
| 904 |
|
motd_items: motd_items motd_item | motd_item; |
| 905 |
|
motd_item: motd_mask | motd_file | error ';' ; |
| 906 |
|
|
| 907 |
< |
motd_mask: MASK '=' QSTRING ';' |
| 907 |
> |
motd_mask: MASK '=' QSTRING ';' |
| 908 |
|
{ |
| 909 |
|
if (conf_parser_ctx.pass == 2) |
| 910 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); |
| 986 |
|
{ |
| 987 |
|
if (conf_parser_ctx.pass == 2) |
| 988 |
|
block_state.type.value = LOG_TYPE_GLINE; |
| 989 |
+ |
} | XLINE |
| 990 |
+ |
{ |
| 991 |
+ |
if (conf_parser_ctx.pass == 2) |
| 992 |
+ |
block_state.type.value = LOG_TYPE_XLINE; |
| 993 |
+ |
} | RESV |
| 994 |
+ |
{ |
| 995 |
+ |
if (conf_parser_ctx.pass == 2) |
| 996 |
+ |
block_state.type.value = LOG_TYPE_RESV; |
| 997 |
|
} | T_DLINE |
| 998 |
|
{ |
| 999 |
|
if (conf_parser_ctx.pass == 2) |
| 1016 |
|
/*************************************************************************** |
| 1017 |
|
* section oper |
| 1018 |
|
***************************************************************************/ |
| 1019 |
< |
oper_entry: OPERATOR |
| 1019 |
> |
oper_entry: OPERATOR |
| 1020 |
|
{ |
| 1021 |
|
if (conf_parser_ctx.pass != 2) |
| 1022 |
|
break; |
| 1304 |
|
} | XLINE |
| 1305 |
|
{ |
| 1306 |
|
if (conf_parser_ctx.pass == 2) |
| 1307 |
< |
block_state.port.value |= OPER_FLAG_X; |
| 1307 |
> |
block_state.port.value |= OPER_FLAG_XLINE; |
| 1308 |
> |
} | T_UNXLINE |
| 1309 |
> |
{ |
| 1310 |
> |
if (conf_parser_ctx.pass == 2) |
| 1311 |
> |
block_state.port.value |= OPER_FLAG_UNXLINE; |
| 1312 |
|
} | GLINE |
| 1313 |
|
{ |
| 1314 |
|
if (conf_parser_ctx.pass == 2) |
| 1441 |
|
class_flags | |
| 1442 |
|
error ';' ; |
| 1443 |
|
|
| 1444 |
< |
class_name: NAME '=' QSTRING ';' |
| 1444 |
> |
class_name: NAME '=' QSTRING ';' |
| 1445 |
|
{ |
| 1446 |
|
if (conf_parser_ctx.pass == 1) |
| 1447 |
|
strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); |
| 1681 |
|
conf_add_class_to_conf(conf, block_state.class.buf); |
| 1682 |
|
add_conf_by_address(CONF_CLIENT, conf); |
| 1683 |
|
} |
| 1684 |
< |
}; |
| 1684 |
> |
}; |
| 1685 |
|
|
| 1686 |
|
auth_items: auth_items auth_item | auth_item; |
| 1687 |
|
auth_item: auth_user | auth_passwd | auth_class | auth_flags | |
| 1766 |
|
block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD; |
| 1767 |
|
}; |
| 1768 |
|
|
| 1769 |
< |
auth_spoof: SPOOF '=' QSTRING ';' |
| 1769 |
> |
auth_spoof: SPOOF '=' QSTRING ';' |
| 1770 |
|
{ |
| 1771 |
|
if (conf_parser_ctx.pass != 2) |
| 1772 |
|
break; |
| 2049 |
|
/*************************************************************************** |
| 2050 |
|
* section connect |
| 2051 |
|
***************************************************************************/ |
| 2052 |
< |
connect_entry: CONNECT |
| 2052 |
> |
connect_entry: CONNECT |
| 2053 |
|
{ |
| 2054 |
|
|
| 2055 |
|
if (conf_parser_ctx.pass != 2) |
| 2056 |
|
break; |
| 2057 |
|
|
| 2058 |
|
reset_block_state(); |
| 2059 |
+ |
block_state.aftype.value = AF_INET; |
| 2060 |
|
block_state.port.value = PORTNUM; |
| 2061 |
|
} '{' connect_items '}' ';' |
| 2062 |
|
{ |
| 2127 |
|
connect_ssl_certificate_fingerprint | |
| 2128 |
|
connect_aftype | connect_port | connect_ssl_cipher_list | |
| 2129 |
|
connect_flags | connect_hub_mask | connect_leaf_mask | |
| 2130 |
< |
connect_class | connect_encrypted | |
| 2130 |
> |
connect_class | connect_encrypted | |
| 2131 |
|
error ';' ; |
| 2132 |
|
|
| 2133 |
|
connect_name: NAME '=' QSTRING ';' |
| 2136 |
|
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 2137 |
|
}; |
| 2138 |
|
|
| 2139 |
< |
connect_host: HOST '=' QSTRING ';' |
| 2139 |
> |
connect_host: HOST '=' QSTRING ';' |
| 2140 |
|
{ |
| 2141 |
|
if (conf_parser_ctx.pass == 2) |
| 2142 |
|
strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf)); |
| 2143 |
|
}; |
| 2144 |
|
|
| 2145 |
< |
connect_vhost: VHOST '=' QSTRING ';' |
| 2145 |
> |
connect_vhost: VHOST '=' QSTRING ';' |
| 2146 |
|
{ |
| 2147 |
|
if (conf_parser_ctx.pass == 2) |
| 2148 |
|
strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf)); |
| 2149 |
|
}; |
| 2150 |
< |
|
| 2150 |
> |
|
| 2151 |
|
connect_send_password: SEND_PASSWORD '=' QSTRING ';' |
| 2152 |
|
{ |
| 2153 |
|
if (conf_parser_ctx.pass != 2) |
| 2225 |
|
} |
| 2226 |
|
}; |
| 2227 |
|
|
| 2228 |
< |
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2228 |
> |
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2229 |
|
{ |
| 2230 |
|
if (conf_parser_ctx.pass == 2) |
| 2231 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list); |
| 2232 |
|
}; |
| 2233 |
|
|
| 2234 |
< |
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2234 |
> |
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2235 |
|
{ |
| 2236 |
|
if (conf_parser_ctx.pass == 2) |
| 2237 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list); |
| 2282 |
|
else |
| 2283 |
|
conf->reason = xstrdup(CONF_NOREASON); |
| 2284 |
|
add_conf_by_address(CONF_KLINE, conf); |
| 2285 |
< |
}; |
| 2285 |
> |
}; |
| 2286 |
|
|
| 2287 |
|
kill_items: kill_items kill_item | kill_item; |
| 2288 |
|
kill_item: kill_user | kill_reason | error; |
| 2307 |
|
} |
| 2308 |
|
}; |
| 2309 |
|
|
| 2310 |
< |
kill_reason: REASON '=' QSTRING ';' |
| 2310 |
> |
kill_reason: REASON '=' QSTRING ';' |
| 2311 |
|
{ |
| 2312 |
|
if (conf_parser_ctx.pass == 2) |
| 2313 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2316 |
|
/*************************************************************************** |
| 2317 |
|
* section deny |
| 2318 |
|
***************************************************************************/ |
| 2319 |
< |
deny_entry: DENY |
| 2319 |
> |
deny_entry: DENY |
| 2320 |
|
{ |
| 2321 |
|
if (conf_parser_ctx.pass == 2) |
| 2322 |
|
reset_block_state(); |
| 2341 |
|
conf->reason = xstrdup(CONF_NOREASON); |
| 2342 |
|
add_conf_by_address(CONF_DLINE, conf); |
| 2343 |
|
} |
| 2344 |
< |
}; |
| 2344 |
> |
}; |
| 2345 |
|
|
| 2346 |
|
deny_items: deny_items deny_item | deny_item; |
| 2347 |
|
deny_item: deny_ip | deny_reason | error; |
| 2352 |
|
strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); |
| 2353 |
|
}; |
| 2354 |
|
|
| 2355 |
< |
deny_reason: REASON '=' QSTRING ';' |
| 2355 |
> |
deny_reason: REASON '=' QSTRING ';' |
| 2356 |
|
{ |
| 2357 |
|
if (conf_parser_ctx.pass == 2) |
| 2358 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2409 |
|
gecos_items: gecos_items gecos_item | gecos_item; |
| 2410 |
|
gecos_item: gecos_name | gecos_reason | error; |
| 2411 |
|
|
| 2412 |
< |
gecos_name: NAME '=' QSTRING ';' |
| 2412 |
> |
gecos_name: NAME '=' QSTRING ';' |
| 2413 |
|
{ |
| 2414 |
|
if (conf_parser_ctx.pass == 2) |
| 2415 |
|
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 2416 |
|
}; |
| 2417 |
|
|
| 2418 |
< |
gecos_reason: REASON '=' QSTRING ';' |
| 2418 |
> |
gecos_reason: REASON '=' QSTRING ';' |
| 2419 |
|
{ |
| 2420 |
|
if (conf_parser_ctx.pass == 2) |
| 2421 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2439 |
|
general_stats_o_oper_only | general_stats_k_oper_only | |
| 2440 |
|
general_pace_wait | general_stats_i_oper_only | |
| 2441 |
|
general_pace_wait_simple | general_stats_P_oper_only | |
| 2442 |
+ |
general_stats_u_oper_only | |
| 2443 |
|
general_short_motd | general_no_oper_flood | |
| 2444 |
|
general_true_no_oper_flood | general_oper_pass_resv | |
| 2445 |
|
general_oper_only_umodes | general_max_targets | |
| 2449 |
|
general_min_nonwildcard | general_min_nonwildcard_simple | |
| 2450 |
|
general_throttle_time | general_havent_read_conf | |
| 2451 |
|
general_ping_cookie | |
| 2452 |
< |
general_disable_auth | |
| 2452 |
> |
general_disable_auth | |
| 2453 |
|
general_tkline_expire_notices | general_gline_enable | |
| 2454 |
|
general_gline_duration | general_gline_request_duration | |
| 2455 |
|
general_gline_min_cidr | |
| 2456 |
|
general_gline_min_cidr6 | |
| 2457 |
|
general_stats_e_disabled | |
| 2458 |
|
general_max_watch | general_services_name | |
| 2459 |
+ |
general_cycle_on_host_change | |
| 2460 |
|
error; |
| 2461 |
|
|
| 2462 |
|
|
| 2465 |
|
ConfigFileEntry.max_watch = $3; |
| 2466 |
|
}; |
| 2467 |
|
|
| 2468 |
+ |
general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';' |
| 2469 |
+ |
{ |
| 2470 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2471 |
+ |
ConfigFileEntry.cycle_on_host_change = yylval.number; |
| 2472 |
+ |
}; |
| 2473 |
+ |
|
| 2474 |
|
general_gline_enable: GLINE_ENABLE '=' TBOOL ';' |
| 2475 |
|
{ |
| 2476 |
|
if (conf_parser_ctx.pass == 2) |
| 2531 |
|
|
| 2532 |
|
general_max_nick_time: MAX_NICK_TIME '=' timespec ';' |
| 2533 |
|
{ |
| 2534 |
< |
ConfigFileEntry.max_nick_time = $3; |
| 2534 |
> |
ConfigFileEntry.max_nick_time = $3; |
| 2535 |
|
}; |
| 2536 |
|
|
| 2537 |
|
general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';' |
| 2596 |
|
ConfigFileEntry.stats_P_oper_only = yylval.number; |
| 2597 |
|
}; |
| 2598 |
|
|
| 2599 |
+ |
general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';' |
| 2600 |
+ |
{ |
| 2601 |
+ |
ConfigFileEntry.stats_u_oper_only = yylval.number; |
| 2602 |
+ |
}; |
| 2603 |
+ |
|
| 2604 |
|
general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';' |
| 2605 |
|
{ |
| 2606 |
|
ConfigFileEntry.stats_k_oper_only = 2 * yylval.number; |
| 2641 |
|
{ |
| 2642 |
|
ConfigFileEntry.short_motd = yylval.number; |
| 2643 |
|
}; |
| 2644 |
< |
|
| 2644 |
> |
|
| 2645 |
|
general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';' |
| 2646 |
|
{ |
| 2647 |
|
ConfigFileEntry.no_oper_flood = yylval.number; |
| 2776 |
|
ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; |
| 2777 |
|
}; |
| 2778 |
|
|
| 2779 |
< |
general_oper_only_umodes: OPER_ONLY_UMODES |
| 2779 |
> |
general_oper_only_umodes: OPER_ONLY_UMODES |
| 2780 |
|
{ |
| 2781 |
|
ConfigFileEntry.oper_only_umodes = 0; |
| 2782 |
|
} '=' umode_items ';' ; |
| 2783 |
|
|
| 2784 |
|
umode_items: umode_items ',' umode_item | umode_item; |
| 2785 |
< |
umode_item: T_BOTS |
| 2785 |
> |
umode_item: T_BOTS |
| 2786 |
|
{ |
| 2787 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_BOTS; |
| 2788 |
|
} | T_CCONN |
| 2795 |
|
{ |
| 2796 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG; |
| 2797 |
|
} | T_FULL |
| 2798 |
< |
{ |
| 2798 |
> |
{ |
| 2799 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_FULL; |
| 2800 |
|
} | T_SKILL |
| 2801 |
|
{ |
| 2947 |
|
'{' serverhide_items '}' ';'; |
| 2948 |
|
|
| 2949 |
|
serverhide_items: serverhide_items serverhide_item | serverhide_item; |
| 2950 |
< |
serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | |
| 2950 |
> |
serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | |
| 2951 |
|
serverhide_hide_servers | |
| 2952 |
|
serverhide_hide_services | |
| 2953 |
|
serverhide_links_delay | |