38 |
|
#include "log.h" |
39 |
|
#include "client.h" /* for UMODE_ALL only */ |
40 |
|
#include "irc_string.h" |
41 |
– |
#include "sprintf_irc.h" |
41 |
|
#include "memory.h" |
42 |
|
#include "modules.h" |
43 |
|
#include "s_serv.h" |
55 |
|
#include <openssl/dh.h> |
56 |
|
#endif |
57 |
|
|
58 |
+ |
#include "rsa.h" |
59 |
+ |
|
60 |
|
int yylex(void); |
61 |
|
|
62 |
|
static struct |
91 |
|
ping_freq, |
92 |
|
max_perip, |
93 |
|
con_freq, |
94 |
+ |
min_idle, |
95 |
+ |
max_idle, |
96 |
|
max_total, |
97 |
|
max_global, |
98 |
|
max_local, |
190 |
|
%token HIDDEN_NAME |
191 |
|
%token HIDE_SERVER_IPS |
192 |
|
%token HIDE_SERVERS |
193 |
+ |
%token HIDE_SERVICES |
194 |
|
%token HIDE_SPOOF_IPS |
195 |
|
%token HOST |
196 |
|
%token HUB |
208 |
|
%token LINKS_DELAY |
209 |
|
%token LISTEN |
210 |
|
%token T_LOG |
211 |
+ |
%token MASK |
212 |
|
%token MAX_ACCEPT |
213 |
|
%token MAX_BANS |
214 |
|
%token MAX_CHANS_PER_OPER |
217 |
|
%token MAX_IDENT |
218 |
|
%token MAX_LOCAL |
219 |
|
%token MAX_NICK_CHANGES |
220 |
+ |
%token MAX_NICK_LENGTH |
221 |
|
%token MAX_NICK_TIME |
222 |
|
%token MAX_NUMBER |
223 |
|
%token MAX_TARGETS |
224 |
+ |
%token MAX_TOPIC_LENGTH |
225 |
|
%token MAX_WATCH |
219 |
– |
%token MESSAGE_LOCALE |
226 |
|
%token MIN_NONWILDCARD |
227 |
|
%token MIN_NONWILDCARD_SIMPLE |
228 |
+ |
%token MIN_IDLE |
229 |
+ |
%token MAX_IDLE |
230 |
+ |
%token RANDOM_IDLE |
231 |
+ |
%token HIDE_IDLE_FROM_OPERS |
232 |
|
%token MODULE |
233 |
|
%token MODULES |
234 |
|
%token NAME |
236 |
|
%token NETWORK_DESC |
237 |
|
%token NETWORK_NAME |
238 |
|
%token NICK |
229 |
– |
%token NICK_CHANGES |
239 |
|
%token NO_CREATE_ON_SPLIT |
240 |
|
%token NO_JOIN_ON_SPLIT |
241 |
|
%token NO_OPER_FLOOD |
267 |
|
%token REHASH |
268 |
|
%token REMOTE |
269 |
|
%token REMOTEBAN |
261 |
– |
%token RESTRICT_CHANNELS |
270 |
|
%token RSA_PRIVATE_KEY_FILE |
271 |
|
%token RSA_PUBLIC_KEY_FILE |
272 |
|
%token SSL_CERTIFICATE_FILE |
277 |
|
%token T_TLSV1 |
278 |
|
%token RESV |
279 |
|
%token RESV_EXEMPT |
280 |
< |
%token SECONDS MINUTES HOURS DAYS WEEKS |
280 |
> |
%token SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS |
281 |
|
%token SENDQ |
282 |
|
%token SEND_PASSWORD |
283 |
|
%token SERVERHIDE |
318 |
|
%token T_LOCOPS |
319 |
|
%token T_MAX_CLIENTS |
320 |
|
%token T_NCHANGE |
321 |
+ |
%token T_NONONREG |
322 |
|
%token T_OPERWALL |
323 |
|
%token T_RECVQ |
324 |
|
%token T_REJ |
336 |
|
%token T_UNXLINE |
337 |
|
%token T_GLOBOPS |
338 |
|
%token T_WALLOP |
339 |
+ |
%token T_WEBIRC |
340 |
|
%token T_RESTART |
341 |
|
%token T_SERVICE |
342 |
|
%token T_SERVICES_NAME |
415 |
|
{ |
416 |
|
$$ = $1 * 60 * 60 * 24 * 7 + $3; |
417 |
|
} |
418 |
+ |
| NUMBER MONTHS timespec_ |
419 |
+ |
{ |
420 |
+ |
$$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; |
421 |
+ |
} |
422 |
+ |
| NUMBER YEARS timespec_ |
423 |
+ |
{ |
424 |
+ |
$$ = $1 * 60 * 60 * 24 * 365 + $3; |
425 |
+ |
} |
426 |
|
; |
427 |
|
|
428 |
|
sizespec_: { $$ = 0; } | sizespec; |
461 |
|
serverinfo_item: serverinfo_name | serverinfo_vhost | |
462 |
|
serverinfo_hub | serverinfo_description | |
463 |
|
serverinfo_network_name | serverinfo_network_desc | |
464 |
< |
serverinfo_max_clients | serverinfo_ssl_dh_param_file | |
464 |
> |
serverinfo_max_clients | serverinfo_max_nick_length | |
465 |
> |
serverinfo_max_topic_length | serverinfo_ssl_dh_param_file | |
466 |
|
serverinfo_rsa_private_key_file | serverinfo_vhost6 | |
467 |
|
serverinfo_sid | serverinfo_ssl_certificate_file | |
468 |
|
serverinfo_ssl_client_method | serverinfo_ssl_server_method | |
510 |
|
{ |
511 |
|
if (!ServerInfo.rsa_private_key_file) |
512 |
|
{ |
513 |
< |
yyerror("No rsa_private_key_file specified, SSL disabled"); |
513 |
> |
conf_error_report("No rsa_private_key_file specified, SSL disabled"); |
514 |
|
break; |
515 |
|
} |
516 |
|
|
519 |
|
SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string, |
520 |
|
SSL_FILETYPE_PEM) <= 0) |
521 |
|
{ |
522 |
< |
yyerror(ERR_lib_error_string(ERR_get_error())); |
522 |
> |
report_crypto_errors(); |
523 |
> |
conf_error_report("Could not open/read certificate file"); |
524 |
|
break; |
525 |
|
} |
526 |
|
|
529 |
|
SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file, |
530 |
|
SSL_FILETYPE_PEM) <= 0) |
531 |
|
{ |
532 |
< |
yyerror(ERR_lib_error_string(ERR_get_error())); |
532 |
> |
report_crypto_errors(); |
533 |
> |
conf_error_report("Could not read RSA private key"); |
534 |
|
break; |
535 |
|
} |
536 |
|
|
537 |
|
if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) || |
538 |
|
!SSL_CTX_check_private_key(ServerInfo.client_ctx)) |
539 |
|
{ |
540 |
< |
yyerror(ERR_lib_error_string(ERR_get_error())); |
540 |
> |
report_crypto_errors(); |
541 |
> |
conf_error_report("Could not read RSA private key"); |
542 |
|
break; |
543 |
|
} |
544 |
|
} |
568 |
|
|
569 |
|
if ((file = BIO_new_file(yylval.string, "r")) == NULL) |
570 |
|
{ |
571 |
< |
yyerror("File open failed, ignoring"); |
571 |
> |
conf_error_report("File open failed, ignoring"); |
572 |
|
break; |
573 |
|
} |
574 |
|
|
579 |
|
|
580 |
|
if (ServerInfo.rsa_private_key == NULL) |
581 |
|
{ |
582 |
< |
yyerror("Couldn't extract key, ignoring"); |
582 |
> |
conf_error_report("Couldn't extract key, ignoring"); |
583 |
|
break; |
584 |
|
} |
585 |
|
|
588 |
|
RSA_free(ServerInfo.rsa_private_key); |
589 |
|
ServerInfo.rsa_private_key = NULL; |
590 |
|
|
591 |
< |
yyerror("Invalid key, ignoring"); |
591 |
> |
conf_error_report("Invalid key, ignoring"); |
592 |
|
break; |
593 |
|
} |
594 |
|
|
598 |
|
RSA_free(ServerInfo.rsa_private_key); |
599 |
|
ServerInfo.rsa_private_key = NULL; |
600 |
|
|
601 |
< |
yyerror("Not a 2048 bit key, ignoring"); |
601 |
> |
conf_error_report("Not a 2048 bit key, ignoring"); |
602 |
|
} |
603 |
|
} |
604 |
|
#endif |
621 |
|
if (dh) |
622 |
|
{ |
623 |
|
if (DH_size(dh) < 128) |
624 |
< |
ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size"); |
624 |
> |
conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size"); |
625 |
|
else |
626 |
|
SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh); |
627 |
|
|
649 |
|
ServerInfo.name = xstrdup(yylval.string); |
650 |
|
else |
651 |
|
{ |
652 |
< |
ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting."); |
652 |
> |
conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting."); |
653 |
|
exit(0); |
654 |
|
} |
655 |
|
} |
664 |
|
ServerInfo.sid = xstrdup(yylval.string); |
665 |
|
else |
666 |
|
{ |
667 |
< |
ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting."); |
667 |
> |
conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting."); |
668 |
|
exit(0); |
669 |
|
} |
670 |
|
} |
762 |
|
|
763 |
|
serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';' |
764 |
|
{ |
765 |
< |
if (conf_parser_ctx.pass == 2) |
765 |
> |
if (conf_parser_ctx.pass != 2) |
766 |
> |
break; |
767 |
> |
|
768 |
> |
if ($3 < MAXCLIENTS_MIN) |
769 |
|
{ |
770 |
< |
recalc_fdlimit(NULL); |
770 |
> |
char buf[IRCD_BUFSIZE]; |
771 |
|
|
772 |
< |
if ($3 < MAXCLIENTS_MIN) |
773 |
< |
{ |
774 |
< |
char buf[IRCD_BUFSIZE]; |
775 |
< |
ircsprintf(buf, "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); |
776 |
< |
yyerror(buf); |
777 |
< |
} |
778 |
< |
else if ($3 > MAXCLIENTS_MAX) |
779 |
< |
{ |
780 |
< |
char buf[IRCD_BUFSIZE]; |
781 |
< |
ircsprintf(buf, "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); |
782 |
< |
yyerror(buf); |
783 |
< |
} |
784 |
< |
else |
785 |
< |
ServerInfo.max_clients = $3; |
772 |
> |
snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); |
773 |
> |
conf_error_report(buf); |
774 |
> |
ServerInfo.max_clients = MAXCLIENTS_MIN; |
775 |
> |
} |
776 |
> |
else if ($3 > MAXCLIENTS_MAX) |
777 |
> |
{ |
778 |
> |
char buf[IRCD_BUFSIZE]; |
779 |
> |
|
780 |
> |
snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); |
781 |
> |
conf_error_report(buf); |
782 |
> |
ServerInfo.max_clients = MAXCLIENTS_MAX; |
783 |
> |
} |
784 |
> |
else |
785 |
> |
ServerInfo.max_clients = $3; |
786 |
> |
}; |
787 |
> |
|
788 |
> |
serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';' |
789 |
> |
{ |
790 |
> |
if (conf_parser_ctx.pass != 2) |
791 |
> |
break; |
792 |
> |
|
793 |
> |
if ($3 < 9) |
794 |
> |
{ |
795 |
> |
conf_error_report("max_nick_length too low, setting to 9"); |
796 |
> |
ServerInfo.max_nick_length = 9; |
797 |
> |
} |
798 |
> |
else if ($3 > NICKLEN) |
799 |
> |
{ |
800 |
> |
char buf[IRCD_BUFSIZE]; |
801 |
> |
|
802 |
> |
snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN); |
803 |
> |
conf_error_report(buf); |
804 |
> |
ServerInfo.max_nick_length = NICKLEN; |
805 |
> |
} |
806 |
> |
else |
807 |
> |
ServerInfo.max_nick_length = $3; |
808 |
> |
}; |
809 |
> |
|
810 |
> |
serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';' |
811 |
> |
{ |
812 |
> |
if (conf_parser_ctx.pass != 2) |
813 |
> |
break; |
814 |
> |
|
815 |
> |
if ($3 < 80) |
816 |
> |
{ |
817 |
> |
conf_error_report("max_topic_length too low, setting to 80"); |
818 |
> |
ServerInfo.max_topic_length = 80; |
819 |
|
} |
820 |
+ |
else if ($3 > TOPICLEN) |
821 |
+ |
{ |
822 |
+ |
char buf[IRCD_BUFSIZE]; |
823 |
+ |
|
824 |
+ |
snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN); |
825 |
+ |
conf_error_report(buf); |
826 |
+ |
ServerInfo.max_topic_length = TOPICLEN; |
827 |
+ |
} |
828 |
+ |
else |
829 |
+ |
ServerInfo.max_topic_length = $3; |
830 |
|
}; |
831 |
|
|
832 |
|
serverinfo_hub: HUB '=' TBOOL ';' |
896 |
|
break; |
897 |
|
|
898 |
|
if (block_state.type.value && block_state.file.buf[0]) |
899 |
< |
log_add_file(block_state.type.value, block_state.size.value, |
899 |
> |
log_set_file(block_state.type.value, block_state.size.value, |
900 |
|
block_state.file.buf); |
901 |
|
}; |
902 |
|
|
1003 |
|
split_nuh(&nuh); |
1004 |
|
|
1005 |
|
conf = conf_make(CONF_OPER); |
1006 |
+ |
conf->name = xstrdup(block_state.name.buf); |
1007 |
|
conf->user = xstrdup(block_state.user.buf); |
1008 |
|
conf->host = xstrdup(block_state.host.buf); |
1009 |
|
|
1025 |
|
|
1026 |
|
if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL) |
1027 |
|
{ |
1028 |
< |
yyerror("Ignoring rsa_public_key_file -- file doesn't exist"); |
1028 |
> |
conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist"); |
1029 |
|
break; |
1030 |
|
} |
1031 |
|
|
1032 |
|
if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL) |
1033 |
< |
{ |
965 |
< |
yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax."); |
966 |
< |
break; |
967 |
< |
} |
1033 |
> |
conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax."); |
1034 |
|
|
1035 |
|
conf->rsa_public_key = pkey; |
1036 |
|
BIO_set_close(file, BIO_CLOSE); |
1173 |
|
{ |
1174 |
|
if (conf_parser_ctx.pass == 2) |
1175 |
|
block_state.modes.value |= UMODE_LOCOPS; |
1176 |
+ |
} | T_NONONREG |
1177 |
+ |
{ |
1178 |
+ |
if (conf_parser_ctx.pass == 2) |
1179 |
+ |
block_state.modes.value |= UMODE_REGONLY; |
1180 |
|
}; |
1181 |
|
|
1182 |
|
oper_flags: IRCD_FLAGS |
1234 |
|
{ |
1235 |
|
if (conf_parser_ctx.pass == 2) |
1236 |
|
block_state.port.value |= OPER_FLAG_ADMIN; |
1167 |
– |
} | NICK_CHANGES |
1168 |
– |
{ |
1169 |
– |
if (conf_parser_ctx.pass == 2) |
1170 |
– |
block_state.port.value |= OPER_FLAG_N; |
1237 |
|
} | T_OPERWALL |
1238 |
|
{ |
1239 |
|
if (conf_parser_ctx.pass == 2) |
1266 |
|
***************************************************************************/ |
1267 |
|
class_entry: CLASS |
1268 |
|
{ |
1269 |
< |
if (conf_parser_ctx.pass == 1) |
1270 |
< |
reset_block_state(); |
1269 |
> |
if (conf_parser_ctx.pass != 1) |
1270 |
> |
break; |
1271 |
> |
|
1272 |
> |
reset_block_state(); |
1273 |
> |
|
1274 |
> |
block_state.ping_freq.value = DEFAULT_PINGFREQUENCY; |
1275 |
> |
block_state.con_freq.value = DEFAULT_CONNECTFREQUENCY; |
1276 |
> |
block_state.max_total.value = MAXIMUM_LINKS_DEFAULT; |
1277 |
> |
block_state.max_sendq.value = DEFAULT_SENDQ; |
1278 |
> |
block_state.max_recvq.value = DEFAULT_RECVQ; |
1279 |
|
} '{' class_items '}' ';' |
1280 |
|
{ |
1281 |
|
struct ClassItem *class = NULL; |
1302 |
|
class->max_sendq = block_state.max_sendq.value; |
1303 |
|
class->max_recvq = block_state.max_recvq.value; |
1304 |
|
|
1305 |
+ |
if (block_state.min_idle.value > block_state.max_idle.value) |
1306 |
+ |
{ |
1307 |
+ |
block_state.min_idle.value = 0; |
1308 |
+ |
block_state.max_idle.value = 0; |
1309 |
+ |
block_state.flags.value &= ~CLASS_FLAGS_FAKE_IDLE; |
1310 |
+ |
} |
1311 |
+ |
|
1312 |
+ |
class->flags = block_state.flags.value; |
1313 |
+ |
class->min_idle = block_state.min_idle.value; |
1314 |
+ |
class->max_idle = block_state.max_idle.value; |
1315 |
+ |
|
1316 |
|
if (class->number_per_cidr && block_state.number_per_cidr.value) |
1317 |
|
if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) || |
1318 |
|
(class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value)) |
1337 |
|
class_max_local | |
1338 |
|
class_max_ident | |
1339 |
|
class_sendq | class_recvq | |
1340 |
+ |
class_min_idle | |
1341 |
+ |
class_max_idle | |
1342 |
+ |
class_flags | |
1343 |
|
error ';' ; |
1344 |
|
|
1345 |
|
class_name: NAME '=' QSTRING ';' |
1421 |
|
block_state.number_per_cidr.value = $3; |
1422 |
|
}; |
1423 |
|
|
1424 |
+ |
class_min_idle: MIN_IDLE '=' timespec ';' |
1425 |
+ |
{ |
1426 |
+ |
if (conf_parser_ctx.pass != 1) |
1427 |
+ |
break; |
1428 |
+ |
|
1429 |
+ |
block_state.min_idle.value = $3; |
1430 |
+ |
block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; |
1431 |
+ |
}; |
1432 |
+ |
|
1433 |
+ |
class_max_idle: MAX_IDLE '=' timespec ';' |
1434 |
+ |
{ |
1435 |
+ |
if (conf_parser_ctx.pass != 1) |
1436 |
+ |
break; |
1437 |
+ |
|
1438 |
+ |
block_state.max_idle.value = $3; |
1439 |
+ |
block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; |
1440 |
+ |
}; |
1441 |
+ |
|
1442 |
+ |
class_flags: IRCD_FLAGS |
1443 |
+ |
{ |
1444 |
+ |
if (conf_parser_ctx.pass == 1) |
1445 |
+ |
block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE; |
1446 |
+ |
} '=' class_flags_items ';'; |
1447 |
+ |
|
1448 |
+ |
class_flags_items: class_flags_items ',' class_flags_item | class_flags_item; |
1449 |
+ |
class_flags_item: RANDOM_IDLE |
1450 |
+ |
{ |
1451 |
+ |
if (conf_parser_ctx.pass == 1) |
1452 |
+ |
block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE; |
1453 |
+ |
} | HIDE_IDLE_FROM_OPERS |
1454 |
+ |
{ |
1455 |
+ |
if (conf_parser_ctx.pass == 1) |
1456 |
+ |
block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS; |
1457 |
+ |
}; |
1458 |
+ |
|
1459 |
+ |
|
1460 |
|
/*************************************************************************** |
1461 |
|
* section listen |
1462 |
|
***************************************************************************/ |
1489 |
|
listen_items: listen_items listen_item | listen_item; |
1490 |
|
listen_item: listen_port | listen_flags | listen_address | listen_host | error ';'; |
1491 |
|
|
1492 |
< |
listen_port: PORT '=' port_items { block_state.flags.value |= 0; } ';'; |
1492 |
> |
listen_port: PORT '=' port_items { block_state.flags.value = 0; } ';'; |
1493 |
|
|
1494 |
|
port_items: port_items ',' port_item | port_item; |
1495 |
|
|
1502 |
|
if (!ServerInfo.server_ctx) |
1503 |
|
#endif |
1504 |
|
{ |
1505 |
< |
yyerror("SSL not available - port closed"); |
1505 |
> |
conf_error_report("SSL not available - port closed"); |
1506 |
|
break; |
1507 |
|
} |
1508 |
|
add_listener($1, block_state.addr.buf, block_state.flags.value); |
1518 |
|
if (!ServerInfo.server_ctx) |
1519 |
|
#endif |
1520 |
|
{ |
1521 |
< |
yyerror("SSL not available - port closed"); |
1521 |
> |
conf_error_report("SSL not available - port closed"); |
1522 |
|
break; |
1523 |
|
} |
1524 |
|
|
1574 |
|
if (block_state.rpass.buf[0]) |
1575 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
1576 |
|
if (block_state.name.buf[0]) |
1577 |
< |
conf->passwd = xstrdup(block_state.name.buf); |
1577 |
> |
conf->name = xstrdup(block_state.name.buf); |
1578 |
|
|
1579 |
|
conf->flags = block_state.flags.value; |
1580 |
|
conf->port = block_state.port.value; |
1621 |
|
auth_flags: IRCD_FLAGS |
1622 |
|
{ |
1623 |
|
if (conf_parser_ctx.pass == 2) |
1624 |
< |
block_state.flags.value = 0; |
1624 |
> |
block_state.flags.value &= CONF_FLAGS_ENCRYPTED; |
1625 |
|
} '=' auth_flags_items ';'; |
1626 |
|
|
1627 |
|
auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item; |
1657 |
|
{ |
1658 |
|
if (conf_parser_ctx.pass == 2) |
1659 |
|
block_state.flags.value |= CONF_FLAGS_EXEMPTRESV; |
1660 |
+ |
} | T_WEBIRC |
1661 |
+ |
{ |
1662 |
+ |
if (conf_parser_ctx.pass == 2) |
1663 |
+ |
block_state.flags.value |= CONF_FLAGS_WEBIRC; |
1664 |
|
} | NEED_PASSWORD |
1665 |
|
{ |
1666 |
|
if (conf_parser_ctx.pass == 2) |
1710 |
|
|
1711 |
|
reset_block_state(); |
1712 |
|
strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf)); |
1713 |
< |
} '{' resv_items '}' ';'; |
1713 |
> |
} '{' resv_items '}' ';' |
1714 |
> |
{ |
1715 |
> |
if (conf_parser_ctx.pass != 2) |
1716 |
> |
break; |
1717 |
> |
|
1718 |
> |
create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); |
1719 |
> |
}; |
1720 |
|
|
1721 |
|
resv_items: resv_items resv_item | resv_item; |
1722 |
< |
resv_item: resv_creason | resv_channel | resv_nick | error ';' ; |
1722 |
> |
resv_item: resv_mask | resv_reason | resv_exempt | error ';' ; |
1723 |
|
|
1724 |
< |
resv_creason: REASON '=' QSTRING ';' |
1724 |
> |
resv_mask: MASK '=' QSTRING ';' |
1725 |
|
{ |
1726 |
|
if (conf_parser_ctx.pass == 2) |
1727 |
< |
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
1727 |
> |
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
1728 |
|
}; |
1729 |
|
|
1730 |
< |
resv_channel: CHANNEL '=' QSTRING ';' |
1730 |
> |
resv_reason: REASON '=' QSTRING ';' |
1731 |
|
{ |
1732 |
< |
if (conf_parser_ctx.pass != 2) |
1733 |
< |
break; |
1600 |
< |
|
1601 |
< |
if (IsChanPrefix(*yylval.string)) |
1602 |
< |
create_channel_resv(yylval.string, block_state.rpass.buf, 1); |
1732 |
> |
if (conf_parser_ctx.pass == 2) |
1733 |
> |
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
1734 |
|
}; |
1735 |
|
|
1736 |
< |
resv_nick: NICK '=' QSTRING ';' |
1736 |
> |
resv_exempt: EXEMPT '=' QSTRING ';' |
1737 |
|
{ |
1738 |
|
if (conf_parser_ctx.pass == 2) |
1739 |
< |
create_nick_resv(yylval.string, block_state.rpass.buf, 1); |
1739 |
> |
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); |
1740 |
|
}; |
1741 |
|
|
1742 |
+ |
|
1743 |
|
/*************************************************************************** |
1744 |
|
* section service |
1745 |
|
***************************************************************************/ |
1785 |
|
conf->flags = block_state.flags.value; |
1786 |
|
conf->name = xstrdup(block_state.name.buf); |
1787 |
|
conf->user = xstrdup(block_state.user.buf); |
1788 |
< |
conf->user = xstrdup(block_state.host.buf); |
1788 |
> |
conf->host = xstrdup(block_state.host.buf); |
1789 |
|
}; |
1790 |
|
|
1791 |
|
shared_items: shared_items shared_item | shared_item; |
1966 |
|
if (conf_parser_ctx.pass != 2) |
1967 |
|
break; |
1968 |
|
|
1969 |
< |
if (!(block_state.name.buf[0] || |
1970 |
< |
block_state.host.buf[0])) |
1969 |
> |
if (!block_state.name.buf[0] || |
1970 |
> |
!block_state.host.buf[0]) |
1971 |
|
break; |
1972 |
|
|
1973 |
|
if (!(block_state.rpass.buf[0] || |
2048 |
|
break; |
2049 |
|
|
2050 |
|
if ($3[0] == ':') |
2051 |
< |
yyerror("Server passwords cannot begin with a colon"); |
2051 |
> |
conf_error_report("Server passwords cannot begin with a colon"); |
2052 |
|
else if (strchr($3, ' ') != NULL) |
2053 |
< |
yyerror("Server passwords cannot contain spaces"); |
2053 |
> |
conf_error_report("Server passwords cannot contain spaces"); |
2054 |
|
else |
2055 |
|
strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf)); |
2056 |
|
}; |
2061 |
|
break; |
2062 |
|
|
2063 |
|
if ($3[0] == ':') |
2064 |
< |
yyerror("Server passwords cannot begin with a colon"); |
2064 |
> |
conf_error_report("Server passwords cannot begin with a colon"); |
2065 |
|
else if (strchr($3, ' ') != NULL) |
2066 |
< |
yyerror("Server passwords cannot contain spaces"); |
2066 |
> |
conf_error_report("Server passwords cannot contain spaces"); |
2067 |
|
else |
2068 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
2069 |
|
}; |
2088 |
|
|
2089 |
|
connect_flags: IRCD_FLAGS |
2090 |
|
{ |
2091 |
< |
/* XXX */ |
2091 |
> |
block_state.flags.value &= CONF_FLAGS_ENCRYPTED; |
2092 |
|
} '=' connect_flags_items ';'; |
2093 |
|
|
2094 |
|
connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item; |
2138 |
|
strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf)); |
2139 |
|
#else |
2140 |
|
if (conf_parser_ctx.pass == 2) |
2141 |
< |
yyerror("Ignoring connect::ciphers -- no OpenSSL support"); |
2141 |
> |
conf_error_report("Ignoring connect::ciphers -- no OpenSSL support"); |
2142 |
|
#endif |
2143 |
|
}; |
2144 |
|
|
2350 |
|
conf = conf_make(CONF_RXLINE); |
2351 |
|
conf->regexuser = exp_p; |
2352 |
|
#else |
2353 |
< |
ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support"); |
2353 |
> |
conf_error_report("Failed to add regular expression based X-Line: no PCRE support"); |
2354 |
|
break; |
2355 |
|
#endif |
2356 |
|
} |
2413 |
|
general_pace_wait_simple | general_stats_P_oper_only | |
2414 |
|
general_short_motd | general_no_oper_flood | |
2415 |
|
general_true_no_oper_flood | general_oper_pass_resv | |
2284 |
– |
general_message_locale | |
2416 |
|
general_oper_only_umodes | general_max_targets | |
2417 |
|
general_use_egd | general_egdpool_path | |
2418 |
|
general_oper_umodes | general_caller_id_wait | |
2622 |
|
ConfigFileEntry.oper_pass_resv = yylval.number; |
2623 |
|
}; |
2624 |
|
|
2494 |
– |
general_message_locale: MESSAGE_LOCALE '=' QSTRING ';' |
2495 |
– |
{ |
2496 |
– |
if (conf_parser_ctx.pass == 2) |
2497 |
– |
{ |
2498 |
– |
if (strlen(yylval.string) > LOCALE_LENGTH-2) |
2499 |
– |
yylval.string[LOCALE_LENGTH-1] = '\0'; |
2500 |
– |
|
2501 |
– |
set_locale(yylval.string); |
2502 |
– |
} |
2503 |
– |
}; |
2504 |
– |
|
2625 |
|
general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';' |
2626 |
|
{ |
2627 |
|
ConfigFileEntry.dots_in_ident = $3; |
2804 |
|
} | T_LOCOPS |
2805 |
|
{ |
2806 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS; |
2807 |
+ |
} | T_NONONREG |
2808 |
+ |
{ |
2809 |
+ |
ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY; |
2810 |
|
}; |
2811 |
|
|
2812 |
|
general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';' |
2837 |
|
channel_max_chans_per_user | channel_max_chans_per_oper | |
2838 |
|
channel_quiet_on_ban | channel_default_split_user_count | |
2839 |
|
channel_default_split_server_count | |
2840 |
< |
channel_no_create_on_split | channel_restrict_channels | |
2840 |
> |
channel_no_create_on_split | |
2841 |
|
channel_no_join_on_split | |
2842 |
|
channel_jflood_count | channel_jflood_time | |
2843 |
|
channel_disable_fake_channels | error; |
2847 |
|
ConfigChannel.disable_fake_channels = yylval.number; |
2848 |
|
}; |
2849 |
|
|
2727 |
– |
channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';' |
2728 |
– |
{ |
2729 |
– |
ConfigChannel.restrict_channels = yylval.number; |
2730 |
– |
}; |
2731 |
– |
|
2850 |
|
channel_knock_delay: KNOCK_DELAY '=' timespec ';' |
2851 |
|
{ |
2852 |
|
ConfigChannel.knock_delay = $3; |
2915 |
|
|
2916 |
|
serverhide_items: serverhide_items serverhide_item | serverhide_item; |
2917 |
|
serverhide_item: serverhide_flatten_links | serverhide_hide_servers | |
2918 |
+ |
serverhide_hide_services | |
2919 |
|
serverhide_links_delay | |
2920 |
|
serverhide_hidden | serverhide_hidden_name | |
2921 |
|
serverhide_hide_server_ips | |
2933 |
|
ConfigServerHide.hide_servers = yylval.number; |
2934 |
|
}; |
2935 |
|
|
2936 |
+ |
serverhide_hide_services: HIDE_SERVICES '=' TBOOL ';' |
2937 |
+ |
{ |
2938 |
+ |
if (conf_parser_ctx.pass == 2) |
2939 |
+ |
ConfigServerHide.hide_services = yylval.number; |
2940 |
+ |
}; |
2941 |
+ |
|
2942 |
|
serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';' |
2943 |
|
{ |
2944 |
|
if (conf_parser_ctx.pass == 2) |