| 26 |
|
|
| 27 |
|
#define YY_NO_UNPUT |
| 28 |
|
#include <sys/types.h> |
| 29 |
+ |
#include <string.h> |
| 30 |
|
|
| 31 |
+ |
#include "config.h" |
| 32 |
|
#include "stdinc.h" |
| 31 |
– |
#include "dalloca.h" |
| 33 |
|
#include "ircd.h" |
| 33 |
– |
#include "tools.h" |
| 34 |
|
#include "list.h" |
| 35 |
|
#include "s_conf.h" |
| 36 |
|
#include "event.h" |
| 37 |
|
#include "s_log.h" |
| 38 |
|
#include "client.h" /* for UMODE_ALL only */ |
| 39 |
– |
#include "pcre.h" |
| 39 |
|
#include "irc_string.h" |
| 41 |
– |
#include "irc_getaddrinfo.h" |
| 40 |
|
#include "sprintf_irc.h" |
| 41 |
|
#include "memory.h" |
| 42 |
|
#include "modules.h" |
| 43 |
< |
#include "s_serv.h" /* for CAP_LL / IsCapable */ |
| 43 |
> |
#include "s_serv.h" |
| 44 |
|
#include "hostmask.h" |
| 45 |
|
#include "send.h" |
| 46 |
|
#include "listener.h" |
| 71 |
|
static char reasonbuf[REASONLEN + 1]; |
| 72 |
|
static char gecos_name[REALLEN * 4]; |
| 73 |
|
|
| 76 |
– |
extern dlink_list gdeny_items; /* XXX */ |
| 77 |
– |
|
| 74 |
|
static char *resv_reason = NULL; |
| 75 |
|
static char *listener_address = NULL; |
| 76 |
|
static int not_atom = 0; |
| 77 |
|
|
| 78 |
< |
struct CollectItem { |
| 78 |
> |
struct CollectItem |
| 79 |
> |
{ |
| 80 |
|
dlink_node node; |
| 81 |
|
char *name; |
| 82 |
|
char *user; |
| 166 |
|
%token DESCRIPTION |
| 167 |
|
%token DIE |
| 168 |
|
%token DISABLE_AUTH |
| 169 |
+ |
%token DISABLE_FAKE_CHANNELS |
| 170 |
|
%token DISABLE_HIDDEN |
| 171 |
|
%token DISABLE_LOCAL_CHANNELS |
| 172 |
|
%token DISABLE_REMOTE_COMMANDS |
| 175 |
– |
%token DOT_IN_IP6_ADDR |
| 173 |
|
%token DOTS_IN_IDENT |
| 174 |
|
%token DURATION |
| 175 |
|
%token EGDPOOL_PATH |
| 179 |
|
%token EXCEED_LIMIT |
| 180 |
|
%token EXEMPT |
| 181 |
|
%token FAILED_OPER_NOTICE |
| 185 |
– |
%token FAKENAME |
| 182 |
|
%token IRCD_FLAGS |
| 183 |
|
%token FLATTEN_LINKS |
| 184 |
|
%token FFAILED_OPERLOG |
| 224 |
|
%token KLINE_WITH_REASON |
| 225 |
|
%token KNOCK_DELAY |
| 226 |
|
%token KNOCK_DELAY_CHANNEL |
| 231 |
– |
%token LAZYLINK |
| 227 |
|
%token LEAF_MASK |
| 228 |
|
%token LINKS_DELAY |
| 229 |
|
%token LISTEN |
| 240 |
|
%token MAX_NICK_TIME |
| 241 |
|
%token MAX_NUMBER |
| 242 |
|
%token MAX_TARGETS |
| 243 |
+ |
%token MAX_WATCH |
| 244 |
|
%token MESSAGE_LOCALE |
| 245 |
|
%token MIN_NONWILDCARD |
| 246 |
|
%token MIN_NONWILDCARD_SIMPLE |
| 294 |
|
%token RSA_PRIVATE_KEY_FILE |
| 295 |
|
%token RSA_PUBLIC_KEY_FILE |
| 296 |
|
%token SSL_CERTIFICATE_FILE |
| 297 |
+ |
%token T_SSL_CONNECTION_METHOD |
| 298 |
+ |
%token T_SSLV3 |
| 299 |
+ |
%token T_TLSV1 |
| 300 |
|
%token RESV |
| 301 |
|
%token RESV_EXEMPT |
| 302 |
|
%token SECONDS MINUTES HOURS DAYS WEEKS |
| 314 |
|
%token SILENT |
| 315 |
|
%token SPOOF |
| 316 |
|
%token SPOOF_NOTICE |
| 317 |
+ |
%token STATS_E_DISABLED |
| 318 |
|
%token STATS_I_OPER_ONLY |
| 319 |
|
%token STATS_K_OPER_ONLY |
| 320 |
|
%token STATS_O_OPER_ONLY |
| 330 |
|
%token T_SOFTCALLERID |
| 331 |
|
%token T_CALLERID |
| 332 |
|
%token T_CCONN |
| 333 |
+ |
%token T_CCONN_FULL |
| 334 |
|
%token T_CLIENT_FLOOD |
| 335 |
|
%token T_DEAF |
| 336 |
|
%token T_DEBUG |
| 353 |
|
%token T_NCHANGE |
| 354 |
|
%token T_OPERWALL |
| 355 |
|
%token T_REJ |
| 356 |
+ |
%token T_SERVER |
| 357 |
|
%token T_SERVNOTICE |
| 358 |
|
%token T_SKILL |
| 359 |
|
%token T_SPY |
| 466 |
|
|
| 467 |
|
modules_module: MODULE '=' QSTRING ';' |
| 468 |
|
{ |
| 469 |
< |
#ifndef STATIC_MODULES /* NOOP in the static case */ |
| 470 |
< |
if (ypass == 2) |
| 469 |
< |
{ |
| 470 |
< |
char *m_bn; |
| 471 |
< |
|
| 472 |
< |
m_bn = basename(yylval.string); |
| 473 |
< |
|
| 474 |
< |
/* I suppose we should just ignore it if it is already loaded(since |
| 475 |
< |
* otherwise we would flood the opers on rehash) -A1kmm. |
| 476 |
< |
*/ |
| 477 |
< |
add_conf_module(yylval.string); |
| 478 |
< |
} |
| 479 |
< |
#endif |
| 469 |
> |
if (conf_parser_ctx.pass == 2) |
| 470 |
> |
add_conf_module(libio_basename(yylval.string)); |
| 471 |
|
}; |
| 472 |
|
|
| 473 |
|
modules_path: PATH '=' QSTRING ';' |
| 474 |
|
{ |
| 475 |
< |
#ifndef STATIC_MODULES |
| 485 |
< |
if (ypass == 2) |
| 475 |
> |
if (conf_parser_ctx.pass == 2) |
| 476 |
|
mod_add_path(yylval.string); |
| 487 |
– |
#endif |
| 477 |
|
}; |
| 478 |
|
|
| 490 |
– |
/*************************************************************************** |
| 491 |
– |
* section serverinfo |
| 492 |
– |
***************************************************************************/ |
| 493 |
– |
serverinfo_entry: SERVERINFO |
| 494 |
– |
'{' serverinfo_items '}' ';'; |
| 479 |
|
|
| 480 |
< |
serverinfo_items: serverinfo_items serverinfo_item | |
| 481 |
< |
serverinfo_item ; |
| 480 |
> |
serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';'; |
| 481 |
> |
|
| 482 |
> |
serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ; |
| 483 |
|
serverinfo_item: serverinfo_name | serverinfo_vhost | |
| 484 |
|
serverinfo_hub | serverinfo_description | |
| 485 |
|
serverinfo_network_name | serverinfo_network_desc | |
| 486 |
|
serverinfo_max_clients | |
| 487 |
|
serverinfo_rsa_private_key_file | serverinfo_vhost6 | |
| 488 |
|
serverinfo_sid | serverinfo_ssl_certificate_file | |
| 489 |
+ |
serverinfo_ssl_connection_method | |
| 490 |
|
error ';' ; |
| 491 |
|
|
| 492 |
+ |
|
| 493 |
+ |
serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD |
| 494 |
+ |
{ |
| 495 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 496 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 497 |
+ |
ServerInfo.tls_version = 0; |
| 498 |
+ |
#endif |
| 499 |
+ |
} '=' method_types ';' |
| 500 |
+ |
{ |
| 501 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 502 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 503 |
+ |
{ |
| 504 |
+ |
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3)) |
| 505 |
+ |
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3); |
| 506 |
+ |
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1)) |
| 507 |
+ |
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); |
| 508 |
+ |
} |
| 509 |
+ |
#endif |
| 510 |
+ |
}; |
| 511 |
+ |
|
| 512 |
+ |
method_types: method_types ',' method_type_item | method_type_item; |
| 513 |
+ |
method_type_item: T_SSLV3 |
| 514 |
+ |
{ |
| 515 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 516 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 517 |
+ |
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3; |
| 518 |
+ |
#endif |
| 519 |
+ |
} | T_TLSV1 |
| 520 |
+ |
{ |
| 521 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 522 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 523 |
+ |
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1; |
| 524 |
+ |
#endif |
| 525 |
+ |
}; |
| 526 |
+ |
|
| 527 |
|
serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' |
| 528 |
|
{ |
| 529 |
|
#ifdef HAVE_LIBCRYPTO |
| 530 |
< |
if (ypass == 2 && ServerInfo.ctx) |
| 530 |
> |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 531 |
|
{ |
| 532 |
|
if (!ServerInfo.rsa_private_key_file) |
| 533 |
|
{ |
| 535 |
|
break; |
| 536 |
|
} |
| 537 |
|
|
| 538 |
< |
if (SSL_CTX_use_certificate_file(ServerInfo.ctx, |
| 539 |
< |
yylval.string, SSL_FILETYPE_PEM) <= 0) |
| 538 |
> |
if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string, |
| 539 |
> |
SSL_FILETYPE_PEM) <= 0) |
| 540 |
|
{ |
| 541 |
|
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 542 |
|
break; |
| 543 |
|
} |
| 544 |
|
|
| 545 |
< |
if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx, |
| 546 |
< |
ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0) |
| 545 |
> |
if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file, |
| 546 |
> |
SSL_FILETYPE_PEM) <= 0) |
| 547 |
|
{ |
| 548 |
|
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 549 |
|
break; |
| 550 |
|
} |
| 551 |
|
|
| 552 |
< |
if (!SSL_CTX_check_private_key(ServerInfo.ctx)) |
| 552 |
> |
if (!SSL_CTX_check_private_key(ServerInfo.server_ctx)) |
| 553 |
|
{ |
| 554 |
< |
yyerror("RSA private key does not match the SSL certificate public key!"); |
| 554 |
> |
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 555 |
|
break; |
| 556 |
|
} |
| 557 |
|
} |
| 561 |
|
serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';' |
| 562 |
|
{ |
| 563 |
|
#ifdef HAVE_LIBCRYPTO |
| 564 |
< |
if (ypass == 1) |
| 564 |
> |
if (conf_parser_ctx.pass == 1) |
| 565 |
|
{ |
| 566 |
|
BIO *file; |
| 567 |
|
|
| 621 |
|
serverinfo_name: NAME '=' QSTRING ';' |
| 622 |
|
{ |
| 623 |
|
/* this isn't rehashable */ |
| 624 |
< |
if (ypass == 2) |
| 624 |
> |
if (conf_parser_ctx.pass == 2 && !ServerInfo.name) |
| 625 |
|
{ |
| 626 |
< |
if (ServerInfo.name == NULL) |
| 626 |
> |
if (valid_servname(yylval.string)) |
| 627 |
> |
DupString(ServerInfo.name, yylval.string); |
| 628 |
> |
else |
| 629 |
|
{ |
| 630 |
< |
/* the ircd will exit() in main() if we dont set one */ |
| 631 |
< |
if (strlen(yylval.string) <= HOSTLEN) |
| 609 |
< |
DupString(ServerInfo.name, yylval.string); |
| 630 |
> |
ilog(L_ERROR, "Ignoring serverinfo::name -- invalid name. Aborting."); |
| 631 |
> |
exit(0); |
| 632 |
|
} |
| 633 |
|
} |
| 634 |
|
}; |
| 636 |
|
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 637 |
|
{ |
| 638 |
|
/* this isn't rehashable */ |
| 639 |
< |
if (ypass == 2 && !ServerInfo.sid) |
| 639 |
> |
if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) |
| 640 |
|
{ |
| 641 |
|
if (valid_sid(yylval.string)) |
| 642 |
|
DupString(ServerInfo.sid, yylval.string); |
| 643 |
|
else |
| 644 |
|
{ |
| 645 |
< |
ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting."); |
| 645 |
> |
ilog(L_ERROR, "Ignoring serverinfo::sid -- invalid SID. Aborting."); |
| 646 |
|
exit(0); |
| 647 |
|
} |
| 648 |
|
} |
| 650 |
|
|
| 651 |
|
serverinfo_description: DESCRIPTION '=' QSTRING ';' |
| 652 |
|
{ |
| 653 |
< |
if (ypass == 2) |
| 653 |
> |
if (conf_parser_ctx.pass == 2) |
| 654 |
|
{ |
| 655 |
|
MyFree(ServerInfo.description); |
| 656 |
|
DupString(ServerInfo.description,yylval.string); |
| 659 |
|
|
| 660 |
|
serverinfo_network_name: NETWORK_NAME '=' QSTRING ';' |
| 661 |
|
{ |
| 662 |
< |
if (ypass == 2) |
| 662 |
> |
if (conf_parser_ctx.pass == 2) |
| 663 |
|
{ |
| 664 |
|
char *p; |
| 665 |
|
|
| 673 |
|
|
| 674 |
|
serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';' |
| 675 |
|
{ |
| 676 |
< |
if (ypass == 2) |
| 676 |
> |
if (conf_parser_ctx.pass == 2) |
| 677 |
|
{ |
| 678 |
|
MyFree(ServerInfo.network_desc); |
| 679 |
|
DupString(ServerInfo.network_desc, yylval.string); |
| 682 |
|
|
| 683 |
|
serverinfo_vhost: VHOST '=' QSTRING ';' |
| 684 |
|
{ |
| 685 |
< |
if (ypass == 2 && *yylval.string != '*') |
| 685 |
> |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 686 |
|
{ |
| 687 |
|
struct addrinfo hints, *res; |
| 688 |
|
|
| 692 |
|
hints.ai_socktype = SOCK_STREAM; |
| 693 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 694 |
|
|
| 695 |
< |
if (irc_getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 695 |
> |
if (getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 696 |
|
ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string); |
| 697 |
|
else |
| 698 |
|
{ |
| 701 |
|
memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen); |
| 702 |
|
ServerInfo.ip.ss.ss_family = res->ai_family; |
| 703 |
|
ServerInfo.ip.ss_len = res->ai_addrlen; |
| 704 |
< |
irc_freeaddrinfo(res); |
| 704 |
> |
freeaddrinfo(res); |
| 705 |
|
|
| 706 |
|
ServerInfo.specific_ipv4_vhost = 1; |
| 707 |
|
} |
| 711 |
|
serverinfo_vhost6: VHOST6 '=' QSTRING ';' |
| 712 |
|
{ |
| 713 |
|
#ifdef IPV6 |
| 714 |
< |
if (ypass == 2 && *yylval.string != '*') |
| 714 |
> |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 715 |
|
{ |
| 716 |
|
struct addrinfo hints, *res; |
| 717 |
|
|
| 721 |
|
hints.ai_socktype = SOCK_STREAM; |
| 722 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 723 |
|
|
| 724 |
< |
if (irc_getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 724 |
> |
if (getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 725 |
|
ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string); |
| 726 |
|
else |
| 727 |
|
{ |
| 730 |
|
memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen); |
| 731 |
|
ServerInfo.ip6.ss.ss_family = res->ai_family; |
| 732 |
|
ServerInfo.ip6.ss_len = res->ai_addrlen; |
| 733 |
< |
irc_freeaddrinfo(res); |
| 733 |
> |
freeaddrinfo(res); |
| 734 |
|
|
| 735 |
|
ServerInfo.specific_ipv6_vhost = 1; |
| 736 |
|
} |
| 740 |
|
|
| 741 |
|
serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';' |
| 742 |
|
{ |
| 743 |
< |
if (ypass == 2) |
| 743 |
> |
if (conf_parser_ctx.pass == 2) |
| 744 |
|
{ |
| 745 |
|
recalc_fdlimit(NULL); |
| 746 |
|
|
| 763 |
|
|
| 764 |
|
serverinfo_hub: HUB '=' TBOOL ';' |
| 765 |
|
{ |
| 766 |
< |
if (ypass == 2) |
| 767 |
< |
{ |
| 746 |
< |
if (yylval.number) |
| 747 |
< |
{ |
| 748 |
< |
/* Don't become a hub if we have a lazylink active. */ |
| 749 |
< |
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL)) |
| 750 |
< |
{ |
| 751 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 752 |
< |
"Ignoring config file line hub=yes; " |
| 753 |
< |
"due to active LazyLink (%s)", uplink->name); |
| 754 |
< |
} |
| 755 |
< |
else |
| 756 |
< |
{ |
| 757 |
< |
ServerInfo.hub = 1; |
| 758 |
< |
uplink = NULL; |
| 759 |
< |
delete_capability("HUB"); |
| 760 |
< |
add_capability("HUB", CAP_HUB, 1); |
| 761 |
< |
} |
| 762 |
< |
} |
| 763 |
< |
else if (ServerInfo.hub) |
| 764 |
< |
{ |
| 765 |
< |
dlink_node *ptr = NULL; |
| 766 |
< |
|
| 767 |
< |
ServerInfo.hub = 0; |
| 768 |
< |
delete_capability("HUB"); |
| 769 |
< |
|
| 770 |
< |
/* Don't become a leaf if we have a lazylink active. */ |
| 771 |
< |
DLINK_FOREACH(ptr, serv_list.head) |
| 772 |
< |
{ |
| 773 |
< |
const struct Client *acptr = ptr->data; |
| 774 |
< |
if (MyConnect(acptr) && IsCapable(acptr, CAP_LL)) |
| 775 |
< |
{ |
| 776 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 777 |
< |
"Ignoring config file line hub=no; " |
| 778 |
< |
"due to active LazyLink (%s)", |
| 779 |
< |
acptr->name); |
| 780 |
< |
add_capability("HUB", CAP_HUB, 1); |
| 781 |
< |
ServerInfo.hub = 1; |
| 782 |
< |
break; |
| 783 |
< |
} |
| 784 |
< |
} |
| 785 |
< |
} |
| 786 |
< |
} |
| 766 |
> |
if (conf_parser_ctx.pass == 2) |
| 767 |
> |
ServerInfo.hub = yylval.number; |
| 768 |
|
}; |
| 769 |
|
|
| 770 |
|
/*************************************************************************** |
| 778 |
|
|
| 779 |
|
admin_name: NAME '=' QSTRING ';' |
| 780 |
|
{ |
| 781 |
< |
if (ypass == 2) |
| 781 |
> |
if (conf_parser_ctx.pass == 2) |
| 782 |
|
{ |
| 783 |
|
MyFree(AdminInfo.name); |
| 784 |
|
DupString(AdminInfo.name, yylval.string); |
| 787 |
|
|
| 788 |
|
admin_email: EMAIL '=' QSTRING ';' |
| 789 |
|
{ |
| 790 |
< |
if (ypass == 2) |
| 790 |
> |
if (conf_parser_ctx.pass == 2) |
| 791 |
|
{ |
| 792 |
|
MyFree(AdminInfo.email); |
| 793 |
|
DupString(AdminInfo.email, yylval.string); |
| 796 |
|
|
| 797 |
|
admin_description: DESCRIPTION '=' QSTRING ';' |
| 798 |
|
{ |
| 799 |
< |
if (ypass == 2) |
| 799 |
> |
if (conf_parser_ctx.pass == 2) |
| 800 |
|
{ |
| 801 |
|
MyFree(AdminInfo.description); |
| 802 |
|
DupString(AdminInfo.description, yylval.string); |
| 831 |
|
|
| 832 |
|
logging_fuserlog: FUSERLOG '=' QSTRING ';' |
| 833 |
|
{ |
| 834 |
< |
if (ypass == 2) |
| 834 |
> |
if (conf_parser_ctx.pass == 2) |
| 835 |
|
strlcpy(ConfigLoggingEntry.userlog, yylval.string, |
| 836 |
|
sizeof(ConfigLoggingEntry.userlog)); |
| 837 |
|
}; |
| 838 |
|
|
| 839 |
|
logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';' |
| 840 |
|
{ |
| 841 |
< |
if (ypass == 2) |
| 841 |
> |
if (conf_parser_ctx.pass == 2) |
| 842 |
|
strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string, |
| 843 |
|
sizeof(ConfigLoggingEntry.failed_operlog)); |
| 844 |
|
}; |
| 845 |
|
|
| 846 |
|
logging_foperlog: FOPERLOG '=' QSTRING ';' |
| 847 |
|
{ |
| 848 |
< |
if (ypass == 2) |
| 848 |
> |
if (conf_parser_ctx.pass == 2) |
| 849 |
|
strlcpy(ConfigLoggingEntry.operlog, yylval.string, |
| 850 |
|
sizeof(ConfigLoggingEntry.operlog)); |
| 851 |
|
}; |
| 852 |
|
|
| 853 |
|
logging_foperspylog: FOPERSPYLOG '=' QSTRING ';' |
| 854 |
|
{ |
| 855 |
< |
if (ypass == 2) |
| 855 |
> |
if (conf_parser_ctx.pass == 2) |
| 856 |
|
strlcpy(ConfigLoggingEntry.operspylog, yylval.string, |
| 857 |
|
sizeof(ConfigLoggingEntry.operspylog)); |
| 858 |
|
}; |
| 859 |
|
|
| 860 |
|
logging_fglinelog: FGLINELOG '=' QSTRING ';' |
| 861 |
|
{ |
| 862 |
< |
if (ypass == 2) |
| 862 |
> |
if (conf_parser_ctx.pass == 2) |
| 863 |
|
strlcpy(ConfigLoggingEntry.glinelog, yylval.string, |
| 864 |
|
sizeof(ConfigLoggingEntry.glinelog)); |
| 865 |
|
}; |
| 866 |
|
|
| 867 |
|
logging_fklinelog: FKLINELOG '=' QSTRING ';' |
| 868 |
|
{ |
| 869 |
< |
if (ypass == 2) |
| 869 |
> |
if (conf_parser_ctx.pass == 2) |
| 870 |
|
strlcpy(ConfigLoggingEntry.klinelog, yylval.string, |
| 871 |
|
sizeof(ConfigLoggingEntry.klinelog)); |
| 872 |
|
}; |
| 873 |
|
|
| 874 |
|
logging_ioerrlog: FIOERRLOG '=' QSTRING ';' |
| 875 |
|
{ |
| 876 |
< |
if (ypass == 2) |
| 876 |
> |
if (conf_parser_ctx.pass == 2) |
| 877 |
|
strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string, |
| 878 |
|
sizeof(ConfigLoggingEntry.ioerrlog)); |
| 879 |
|
}; |
| 880 |
|
|
| 881 |
|
logging_killlog: FKILLLOG '=' QSTRING ';' |
| 882 |
|
{ |
| 883 |
< |
if (ypass == 2) |
| 883 |
> |
if (conf_parser_ctx.pass == 2) |
| 884 |
|
strlcpy(ConfigLoggingEntry.killlog, yylval.string, |
| 885 |
|
sizeof(ConfigLoggingEntry.killlog)); |
| 886 |
|
}; |
| 887 |
|
|
| 888 |
|
logging_log_level: LOG_LEVEL '=' T_L_CRIT ';' |
| 889 |
|
{ |
| 890 |
< |
if (ypass == 2) |
| 890 |
> |
if (conf_parser_ctx.pass == 2) |
| 891 |
|
set_log_level(L_CRIT); |
| 892 |
|
} | LOG_LEVEL '=' T_L_ERROR ';' |
| 893 |
|
{ |
| 894 |
< |
if (ypass == 2) |
| 894 |
> |
if (conf_parser_ctx.pass == 2) |
| 895 |
|
set_log_level(L_ERROR); |
| 896 |
|
} | LOG_LEVEL '=' T_L_WARN ';' |
| 897 |
|
{ |
| 898 |
< |
if (ypass == 2) |
| 898 |
> |
if (conf_parser_ctx.pass == 2) |
| 899 |
|
set_log_level(L_WARN); |
| 900 |
|
} | LOG_LEVEL '=' T_L_NOTICE ';' |
| 901 |
|
{ |
| 902 |
< |
if (ypass == 2) |
| 902 |
> |
if (conf_parser_ctx.pass == 2) |
| 903 |
|
set_log_level(L_NOTICE); |
| 904 |
|
} | LOG_LEVEL '=' T_L_TRACE ';' |
| 905 |
|
{ |
| 906 |
< |
if (ypass == 2) |
| 906 |
> |
if (conf_parser_ctx.pass == 2) |
| 907 |
|
set_log_level(L_TRACE); |
| 908 |
|
} | LOG_LEVEL '=' T_L_INFO ';' |
| 909 |
|
{ |
| 910 |
< |
if (ypass == 2) |
| 910 |
> |
if (conf_parser_ctx.pass == 2) |
| 911 |
|
set_log_level(L_INFO); |
| 912 |
|
} | LOG_LEVEL '=' T_L_DEBUG ';' |
| 913 |
|
{ |
| 914 |
< |
if (ypass == 2) |
| 914 |
> |
if (conf_parser_ctx.pass == 2) |
| 915 |
|
set_log_level(L_DEBUG); |
| 916 |
|
}; |
| 917 |
|
|
| 918 |
|
logging_use_logging: USE_LOGGING '=' TBOOL ';' |
| 919 |
|
{ |
| 920 |
< |
if (ypass == 2) |
| 920 |
> |
if (conf_parser_ctx.pass == 2) |
| 921 |
|
ConfigLoggingEntry.use_logging = yylval.number; |
| 922 |
|
}; |
| 923 |
|
|
| 926 |
|
***************************************************************************/ |
| 927 |
|
oper_entry: OPERATOR |
| 928 |
|
{ |
| 929 |
< |
if (ypass == 2) |
| 929 |
> |
if (conf_parser_ctx.pass == 2) |
| 930 |
|
{ |
| 931 |
|
yy_conf = make_conf_item(OPER_TYPE); |
| 932 |
|
yy_aconf = map_to_conf(yy_conf); |
| 939 |
|
} |
| 940 |
|
} oper_name_b '{' oper_items '}' ';' |
| 941 |
|
{ |
| 942 |
< |
if (ypass == 2) |
| 942 |
> |
if (conf_parser_ctx.pass == 2) |
| 943 |
|
{ |
| 944 |
|
struct CollectItem *yy_tmp; |
| 945 |
|
dlink_node *ptr; |
| 1020 |
|
|
| 1021 |
|
oper_name_b: | oper_name_t; |
| 1022 |
|
oper_items: oper_items oper_item | oper_item; |
| 1023 |
< |
oper_item: oper_name | oper_user | oper_password | oper_hidden_admin | |
| 1024 |
< |
oper_hidden_oper | oper_umodes | |
| 1025 |
< |
oper_class | oper_global_kill | oper_remote | |
| 1045 |
< |
oper_kline | oper_xline | oper_unkline | |
| 1046 |
< |
oper_gline | oper_nick_changes | oper_remoteban | |
| 1047 |
< |
oper_die | oper_rehash | oper_admin | oper_operwall | |
| 1048 |
< |
oper_encrypted | oper_rsa_public_key_file | |
| 1049 |
< |
oper_flags | error ';' ; |
| 1023 |
> |
oper_item: oper_name | oper_user | oper_password | |
| 1024 |
> |
oper_umodes | oper_class | oper_encrypted | |
| 1025 |
> |
oper_rsa_public_key_file | oper_flags | error ';' ; |
| 1026 |
|
|
| 1027 |
|
oper_name: NAME '=' QSTRING ';' |
| 1028 |
|
{ |
| 1029 |
< |
if (ypass == 2) |
| 1029 |
> |
if (conf_parser_ctx.pass == 2) |
| 1030 |
|
{ |
| 1031 |
|
if (strlen(yylval.string) > OPERNICKLEN) |
| 1032 |
|
yylval.string[OPERNICKLEN] = '\0'; |
| 1038 |
|
|
| 1039 |
|
oper_name_t: QSTRING |
| 1040 |
|
{ |
| 1041 |
< |
if (ypass == 2) |
| 1041 |
> |
if (conf_parser_ctx.pass == 2) |
| 1042 |
|
{ |
| 1043 |
|
if (strlen(yylval.string) > OPERNICKLEN) |
| 1044 |
|
yylval.string[OPERNICKLEN] = '\0'; |
| 1050 |
|
|
| 1051 |
|
oper_user: USER '=' QSTRING ';' |
| 1052 |
|
{ |
| 1053 |
< |
if (ypass == 2) |
| 1053 |
> |
if (conf_parser_ctx.pass == 2) |
| 1054 |
|
{ |
| 1055 |
< |
struct CollectItem *yy_tmp; |
| 1055 |
> |
struct split_nuh_item nuh; |
| 1056 |
> |
|
| 1057 |
> |
nuh.nuhmask = yylval.string; |
| 1058 |
> |
nuh.nickptr = NULL; |
| 1059 |
> |
nuh.userptr = userbuf; |
| 1060 |
> |
nuh.hostptr = hostbuf; |
| 1061 |
> |
|
| 1062 |
> |
nuh.nicksize = 0; |
| 1063 |
> |
nuh.usersize = sizeof(userbuf); |
| 1064 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 1065 |
> |
|
| 1066 |
> |
split_nuh(&nuh); |
| 1067 |
|
|
| 1068 |
|
if (yy_aconf->user == NULL) |
| 1069 |
|
{ |
| 1070 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 1070 |
> |
DupString(yy_aconf->user, userbuf); |
| 1071 |
> |
DupString(yy_aconf->host, hostbuf); |
| 1072 |
|
} |
| 1073 |
|
else |
| 1074 |
|
{ |
| 1075 |
< |
yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem)); |
| 1076 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 1075 |
> |
struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 1076 |
> |
|
| 1077 |
> |
DupString(yy_tmp->user, userbuf); |
| 1078 |
> |
DupString(yy_tmp->host, hostbuf); |
| 1079 |
> |
|
| 1080 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 1081 |
|
} |
| 1082 |
|
} |
| 1084 |
|
|
| 1085 |
|
oper_password: PASSWORD '=' QSTRING ';' |
| 1086 |
|
{ |
| 1087 |
< |
if (ypass == 2) |
| 1087 |
> |
if (conf_parser_ctx.pass == 2) |
| 1088 |
|
{ |
| 1089 |
|
if (yy_aconf->passwd != NULL) |
| 1090 |
|
memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd)); |
| 1096 |
|
|
| 1097 |
|
oper_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1098 |
|
{ |
| 1099 |
< |
if (ypass == 2) |
| 1099 |
> |
if (conf_parser_ctx.pass == 2) |
| 1100 |
|
{ |
| 1101 |
|
if (yylval.number) |
| 1102 |
|
SetConfEncrypted(yy_aconf); |
| 1108 |
|
oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 1109 |
|
{ |
| 1110 |
|
#ifdef HAVE_LIBCRYPTO |
| 1111 |
< |
if (ypass == 2) |
| 1111 |
> |
if (conf_parser_ctx.pass == 2) |
| 1112 |
|
{ |
| 1113 |
|
BIO *file; |
| 1114 |
|
|
| 1149 |
|
|
| 1150 |
|
oper_class: CLASS '=' QSTRING ';' |
| 1151 |
|
{ |
| 1152 |
< |
if (ypass == 2) |
| 1152 |
> |
if (conf_parser_ctx.pass == 2) |
| 1153 |
|
{ |
| 1154 |
|
MyFree(class_name); |
| 1155 |
|
DupString(class_name, yylval.string); |
| 1158 |
|
|
| 1159 |
|
oper_umodes: T_UMODES |
| 1160 |
|
{ |
| 1161 |
< |
if (ypass == 2) |
| 1161 |
> |
if (conf_parser_ctx.pass == 2) |
| 1162 |
|
yy_aconf->modes = 0; |
| 1163 |
|
} '=' oper_umodes_items ';' ; |
| 1164 |
|
|
| 1165 |
|
oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item; |
| 1166 |
|
oper_umodes_item: T_BOTS |
| 1167 |
|
{ |
| 1168 |
< |
if (ypass == 2) |
| 1168 |
> |
if (conf_parser_ctx.pass == 2) |
| 1169 |
|
yy_aconf->modes |= UMODE_BOTS; |
| 1170 |
|
} | T_CCONN |
| 1171 |
|
{ |
| 1172 |
< |
if (ypass == 2) |
| 1172 |
> |
if (conf_parser_ctx.pass == 2) |
| 1173 |
|
yy_aconf->modes |= UMODE_CCONN; |
| 1174 |
+ |
} | T_CCONN_FULL |
| 1175 |
+ |
{ |
| 1176 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1177 |
+ |
yy_aconf->modes |= UMODE_CCONN_FULL; |
| 1178 |
|
} | T_DEAF |
| 1179 |
|
{ |
| 1180 |
< |
if (ypass == 2) |
| 1180 |
> |
if (conf_parser_ctx.pass == 2) |
| 1181 |
|
yy_aconf->modes |= UMODE_DEAF; |
| 1182 |
|
} | T_DEBUG |
| 1183 |
|
{ |
| 1184 |
< |
if (ypass == 2) |
| 1184 |
> |
if (conf_parser_ctx.pass == 2) |
| 1185 |
|
yy_aconf->modes |= UMODE_DEBUG; |
| 1186 |
|
} | T_FULL |
| 1187 |
|
{ |
| 1188 |
< |
if (ypass == 2) |
| 1188 |
> |
if (conf_parser_ctx.pass == 2) |
| 1189 |
|
yy_aconf->modes |= UMODE_FULL; |
| 1190 |
|
} | T_SKILL |
| 1191 |
|
{ |
| 1192 |
< |
if (ypass == 2) |
| 1192 |
> |
if (conf_parser_ctx.pass == 2) |
| 1193 |
|
yy_aconf->modes |= UMODE_SKILL; |
| 1194 |
|
} | T_NCHANGE |
| 1195 |
|
{ |
| 1196 |
< |
if (ypass == 2) |
| 1196 |
> |
if (conf_parser_ctx.pass == 2) |
| 1197 |
|
yy_aconf->modes |= UMODE_NCHANGE; |
| 1198 |
|
} | T_REJ |
| 1199 |
|
{ |
| 1200 |
< |
if (ypass == 2) |
| 1200 |
> |
if (conf_parser_ctx.pass == 2) |
| 1201 |
|
yy_aconf->modes |= UMODE_REJ; |
| 1202 |
|
} | T_UNAUTH |
| 1203 |
|
{ |
| 1204 |
< |
if (ypass == 2) |
| 1204 |
> |
if (conf_parser_ctx.pass == 2) |
| 1205 |
|
yy_aconf->modes |= UMODE_UNAUTH; |
| 1206 |
|
} | T_SPY |
| 1207 |
|
{ |
| 1208 |
< |
if (ypass == 2) |
| 1208 |
> |
if (conf_parser_ctx.pass == 2) |
| 1209 |
|
yy_aconf->modes |= UMODE_SPY; |
| 1210 |
|
} | T_EXTERNAL |
| 1211 |
|
{ |
| 1212 |
< |
if (ypass == 2) |
| 1212 |
> |
if (conf_parser_ctx.pass == 2) |
| 1213 |
|
yy_aconf->modes |= UMODE_EXTERNAL; |
| 1214 |
|
} | T_OPERWALL |
| 1215 |
|
{ |
| 1216 |
< |
if (ypass == 2) |
| 1216 |
> |
if (conf_parser_ctx.pass == 2) |
| 1217 |
|
yy_aconf->modes |= UMODE_OPERWALL; |
| 1218 |
|
} | T_SERVNOTICE |
| 1219 |
|
{ |
| 1220 |
< |
if (ypass == 2) |
| 1220 |
> |
if (conf_parser_ctx.pass == 2) |
| 1221 |
|
yy_aconf->modes |= UMODE_SERVNOTICE; |
| 1222 |
|
} | T_INVISIBLE |
| 1223 |
|
{ |
| 1224 |
< |
if (ypass == 2) |
| 1224 |
> |
if (conf_parser_ctx.pass == 2) |
| 1225 |
|
yy_aconf->modes |= UMODE_INVISIBLE; |
| 1226 |
|
} | T_WALLOP |
| 1227 |
|
{ |
| 1228 |
< |
if (ypass == 2) |
| 1228 |
> |
if (conf_parser_ctx.pass == 2) |
| 1229 |
|
yy_aconf->modes |= UMODE_WALLOP; |
| 1230 |
|
} | T_SOFTCALLERID |
| 1231 |
|
{ |
| 1232 |
< |
if (ypass == 2) |
| 1232 |
> |
if (conf_parser_ctx.pass == 2) |
| 1233 |
|
yy_aconf->modes |= UMODE_SOFTCALLERID; |
| 1234 |
|
} | T_CALLERID |
| 1235 |
|
{ |
| 1236 |
< |
if (ypass == 2) |
| 1236 |
> |
if (conf_parser_ctx.pass == 2) |
| 1237 |
|
yy_aconf->modes |= UMODE_CALLERID; |
| 1238 |
|
} | T_LOCOPS |
| 1239 |
|
{ |
| 1240 |
< |
if (ypass == 2) |
| 1240 |
> |
if (conf_parser_ctx.pass == 2) |
| 1241 |
|
yy_aconf->modes |= UMODE_LOCOPS; |
| 1242 |
|
}; |
| 1243 |
|
|
| 1249 |
– |
oper_global_kill: GLOBAL_KILL '=' TBOOL ';' |
| 1250 |
– |
{ |
| 1251 |
– |
if (ypass == 2) |
| 1252 |
– |
{ |
| 1253 |
– |
if (yylval.number) |
| 1254 |
– |
yy_aconf->port |= OPER_FLAG_GLOBAL_KILL; |
| 1255 |
– |
else |
| 1256 |
– |
yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL; |
| 1257 |
– |
} |
| 1258 |
– |
}; |
| 1259 |
– |
|
| 1260 |
– |
oper_remote: REMOTE '=' TBOOL ';' |
| 1261 |
– |
{ |
| 1262 |
– |
if (ypass == 2) |
| 1263 |
– |
{ |
| 1264 |
– |
if (yylval.number) |
| 1265 |
– |
yy_aconf->port |= OPER_FLAG_REMOTE; |
| 1266 |
– |
else |
| 1267 |
– |
yy_aconf->port &= ~OPER_FLAG_REMOTE; |
| 1268 |
– |
} |
| 1269 |
– |
}; |
| 1270 |
– |
|
| 1271 |
– |
oper_remoteban: REMOTEBAN '=' TBOOL ';' |
| 1272 |
– |
{ |
| 1273 |
– |
if (ypass == 2) |
| 1274 |
– |
{ |
| 1275 |
– |
if (yylval.number) |
| 1276 |
– |
yy_aconf->port |= OPER_FLAG_REMOTEBAN; |
| 1277 |
– |
else |
| 1278 |
– |
yy_aconf->port &= ~OPER_FLAG_REMOTEBAN; |
| 1279 |
– |
} |
| 1280 |
– |
}; |
| 1281 |
– |
|
| 1282 |
– |
oper_kline: KLINE '=' TBOOL ';' |
| 1283 |
– |
{ |
| 1284 |
– |
if (ypass == 2) |
| 1285 |
– |
{ |
| 1286 |
– |
if (yylval.number) |
| 1287 |
– |
yy_aconf->port |= OPER_FLAG_K; |
| 1288 |
– |
else |
| 1289 |
– |
yy_aconf->port &= ~OPER_FLAG_K; |
| 1290 |
– |
} |
| 1291 |
– |
}; |
| 1292 |
– |
|
| 1293 |
– |
oper_xline: XLINE '=' TBOOL ';' |
| 1294 |
– |
{ |
| 1295 |
– |
if (ypass == 2) |
| 1296 |
– |
{ |
| 1297 |
– |
if (yylval.number) |
| 1298 |
– |
yy_aconf->port |= OPER_FLAG_X; |
| 1299 |
– |
else |
| 1300 |
– |
yy_aconf->port &= ~OPER_FLAG_X; |
| 1301 |
– |
} |
| 1302 |
– |
}; |
| 1303 |
– |
|
| 1304 |
– |
oper_unkline: UNKLINE '=' TBOOL ';' |
| 1305 |
– |
{ |
| 1306 |
– |
if (ypass == 2) |
| 1307 |
– |
{ |
| 1308 |
– |
if (yylval.number) |
| 1309 |
– |
yy_aconf->port |= OPER_FLAG_UNKLINE; |
| 1310 |
– |
else |
| 1311 |
– |
yy_aconf->port &= ~OPER_FLAG_UNKLINE; |
| 1312 |
– |
} |
| 1313 |
– |
}; |
| 1314 |
– |
|
| 1315 |
– |
oper_gline: GLINE '=' TBOOL ';' |
| 1316 |
– |
{ |
| 1317 |
– |
if (ypass == 2) |
| 1318 |
– |
{ |
| 1319 |
– |
if (yylval.number) |
| 1320 |
– |
yy_aconf->port |= OPER_FLAG_GLINE; |
| 1321 |
– |
else |
| 1322 |
– |
yy_aconf->port &= ~OPER_FLAG_GLINE; |
| 1323 |
– |
} |
| 1324 |
– |
}; |
| 1325 |
– |
|
| 1326 |
– |
oper_nick_changes: NICK_CHANGES '=' TBOOL ';' |
| 1327 |
– |
{ |
| 1328 |
– |
if (ypass == 2) |
| 1329 |
– |
{ |
| 1330 |
– |
if (yylval.number) |
| 1331 |
– |
yy_aconf->port |= OPER_FLAG_N; |
| 1332 |
– |
else |
| 1333 |
– |
yy_aconf->port &= ~OPER_FLAG_N; |
| 1334 |
– |
} |
| 1335 |
– |
}; |
| 1336 |
– |
|
| 1337 |
– |
oper_die: DIE '=' TBOOL ';' |
| 1338 |
– |
{ |
| 1339 |
– |
if (ypass == 2) |
| 1340 |
– |
{ |
| 1341 |
– |
if (yylval.number) |
| 1342 |
– |
yy_aconf->port |= OPER_FLAG_DIE; |
| 1343 |
– |
else |
| 1344 |
– |
yy_aconf->port &= ~OPER_FLAG_DIE; |
| 1345 |
– |
} |
| 1346 |
– |
}; |
| 1347 |
– |
|
| 1348 |
– |
oper_rehash: REHASH '=' TBOOL ';' |
| 1349 |
– |
{ |
| 1350 |
– |
if (ypass == 2) |
| 1351 |
– |
{ |
| 1352 |
– |
if (yylval.number) |
| 1353 |
– |
yy_aconf->port |= OPER_FLAG_REHASH; |
| 1354 |
– |
else |
| 1355 |
– |
yy_aconf->port &= ~OPER_FLAG_REHASH; |
| 1356 |
– |
} |
| 1357 |
– |
}; |
| 1358 |
– |
|
| 1359 |
– |
oper_admin: ADMIN '=' TBOOL ';' |
| 1360 |
– |
{ |
| 1361 |
– |
if (ypass == 2) |
| 1362 |
– |
{ |
| 1363 |
– |
if (yylval.number) |
| 1364 |
– |
yy_aconf->port |= OPER_FLAG_ADMIN; |
| 1365 |
– |
else |
| 1366 |
– |
yy_aconf->port &= ~OPER_FLAG_ADMIN; |
| 1367 |
– |
} |
| 1368 |
– |
}; |
| 1369 |
– |
|
| 1370 |
– |
oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';' |
| 1371 |
– |
{ |
| 1372 |
– |
if (ypass == 2) |
| 1373 |
– |
{ |
| 1374 |
– |
if (yylval.number) |
| 1375 |
– |
yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN; |
| 1376 |
– |
else |
| 1377 |
– |
yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN; |
| 1378 |
– |
} |
| 1379 |
– |
}; |
| 1380 |
– |
|
| 1381 |
– |
oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';' |
| 1382 |
– |
{ |
| 1383 |
– |
if (ypass == 2) |
| 1384 |
– |
{ |
| 1385 |
– |
if (yylval.number) |
| 1386 |
– |
yy_aconf->port |= OPER_FLAG_HIDDEN_OPER; |
| 1387 |
– |
else |
| 1388 |
– |
yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER; |
| 1389 |
– |
} |
| 1390 |
– |
}; |
| 1391 |
– |
|
| 1392 |
– |
oper_operwall: T_OPERWALL '=' TBOOL ';' |
| 1393 |
– |
{ |
| 1394 |
– |
if (ypass == 2) |
| 1395 |
– |
{ |
| 1396 |
– |
if (yylval.number) |
| 1397 |
– |
yy_aconf->port |= OPER_FLAG_OPERWALL; |
| 1398 |
– |
else |
| 1399 |
– |
yy_aconf->port &= ~OPER_FLAG_OPERWALL; |
| 1400 |
– |
} |
| 1401 |
– |
}; |
| 1402 |
– |
|
| 1244 |
|
oper_flags: IRCD_FLAGS |
| 1245 |
|
{ |
| 1246 |
|
} '=' oper_flags_items ';'; |
| 1251 |
|
|
| 1252 |
|
oper_flags_item_atom: GLOBAL_KILL |
| 1253 |
|
{ |
| 1254 |
< |
if (ypass == 2) |
| 1254 |
> |
if (conf_parser_ctx.pass == 2) |
| 1255 |
|
{ |
| 1256 |
|
if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL; |
| 1257 |
|
else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL; |
| 1258 |
|
} |
| 1259 |
|
} | REMOTE |
| 1260 |
|
{ |
| 1261 |
< |
if (ypass == 2) |
| 1261 |
> |
if (conf_parser_ctx.pass == 2) |
| 1262 |
|
{ |
| 1263 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE; |
| 1264 |
|
else yy_aconf->port |= OPER_FLAG_REMOTE; |
| 1265 |
|
} |
| 1266 |
|
} | KLINE |
| 1267 |
|
{ |
| 1268 |
< |
if (ypass == 2) |
| 1268 |
> |
if (conf_parser_ctx.pass == 2) |
| 1269 |
|
{ |
| 1270 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_K; |
| 1271 |
|
else yy_aconf->port |= OPER_FLAG_K; |
| 1272 |
|
} |
| 1273 |
|
} | UNKLINE |
| 1274 |
|
{ |
| 1275 |
< |
if (ypass == 2) |
| 1275 |
> |
if (conf_parser_ctx.pass == 2) |
| 1276 |
|
{ |
| 1277 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE; |
| 1278 |
|
else yy_aconf->port |= OPER_FLAG_UNKLINE; |
| 1279 |
|
} |
| 1280 |
|
} | XLINE |
| 1281 |
|
{ |
| 1282 |
< |
if (ypass == 2) |
| 1282 |
> |
if (conf_parser_ctx.pass == 2) |
| 1283 |
|
{ |
| 1284 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_X; |
| 1285 |
|
else yy_aconf->port |= OPER_FLAG_X; |
| 1286 |
|
} |
| 1287 |
|
} | GLINE |
| 1288 |
|
{ |
| 1289 |
< |
if (ypass == 2) |
| 1289 |
> |
if (conf_parser_ctx.pass == 2) |
| 1290 |
|
{ |
| 1291 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE; |
| 1292 |
|
else yy_aconf->port |= OPER_FLAG_GLINE; |
| 1293 |
|
} |
| 1294 |
|
} | DIE |
| 1295 |
|
{ |
| 1296 |
< |
if (ypass == 2) |
| 1296 |
> |
if (conf_parser_ctx.pass == 2) |
| 1297 |
|
{ |
| 1298 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE; |
| 1299 |
|
else yy_aconf->port |= OPER_FLAG_DIE; |
| 1300 |
|
} |
| 1301 |
|
} | REHASH |
| 1302 |
|
{ |
| 1303 |
< |
if (ypass == 2) |
| 1303 |
> |
if (conf_parser_ctx.pass == 2) |
| 1304 |
|
{ |
| 1305 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH; |
| 1306 |
|
else yy_aconf->port |= OPER_FLAG_REHASH; |
| 1307 |
|
} |
| 1308 |
|
} | ADMIN |
| 1309 |
|
{ |
| 1310 |
< |
if (ypass == 2) |
| 1310 |
> |
if (conf_parser_ctx.pass == 2) |
| 1311 |
|
{ |
| 1312 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN; |
| 1313 |
|
else yy_aconf->port |= OPER_FLAG_ADMIN; |
| 1314 |
|
} |
| 1315 |
|
} | HIDDEN_ADMIN |
| 1316 |
|
{ |
| 1317 |
< |
if (ypass == 2) |
| 1317 |
> |
if (conf_parser_ctx.pass == 2) |
| 1318 |
|
{ |
| 1319 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN; |
| 1320 |
|
else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN; |
| 1321 |
|
} |
| 1322 |
|
} | NICK_CHANGES |
| 1323 |
|
{ |
| 1324 |
< |
if (ypass == 2) |
| 1324 |
> |
if (conf_parser_ctx.pass == 2) |
| 1325 |
|
{ |
| 1326 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_N; |
| 1327 |
|
else yy_aconf->port |= OPER_FLAG_N; |
| 1328 |
|
} |
| 1329 |
|
} | T_OPERWALL |
| 1330 |
|
{ |
| 1331 |
< |
if (ypass == 2) |
| 1331 |
> |
if (conf_parser_ctx.pass == 2) |
| 1332 |
|
{ |
| 1333 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL; |
| 1334 |
|
else yy_aconf->port |= OPER_FLAG_OPERWALL; |
| 1335 |
|
} |
| 1336 |
|
} | OPER_SPY_T |
| 1337 |
|
{ |
| 1338 |
< |
if (ypass == 2) |
| 1338 |
> |
if (conf_parser_ctx.pass == 2) |
| 1339 |
|
{ |
| 1340 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY; |
| 1341 |
|
else yy_aconf->port |= OPER_FLAG_OPER_SPY; |
| 1342 |
|
} |
| 1343 |
|
} | HIDDEN_OPER |
| 1344 |
|
{ |
| 1345 |
< |
if (ypass == 2) |
| 1345 |
> |
if (conf_parser_ctx.pass == 2) |
| 1346 |
|
{ |
| 1347 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER; |
| 1348 |
|
else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER; |
| 1349 |
|
} |
| 1350 |
|
} | REMOTEBAN |
| 1351 |
|
{ |
| 1352 |
< |
if (ypass == 2) |
| 1352 |
> |
if (conf_parser_ctx.pass == 2) |
| 1353 |
|
{ |
| 1354 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN; |
| 1355 |
|
else yy_aconf->port |= OPER_FLAG_REMOTEBAN; |
| 1356 |
|
} |
| 1357 |
|
} | ENCRYPTED |
| 1358 |
|
{ |
| 1359 |
< |
if (ypass == 2) |
| 1359 |
> |
if (conf_parser_ctx.pass == 2) |
| 1360 |
|
{ |
| 1361 |
|
if (not_atom) ClearConfEncrypted(yy_aconf); |
| 1362 |
|
else SetConfEncrypted(yy_aconf); |
| 1369 |
|
***************************************************************************/ |
| 1370 |
|
class_entry: CLASS |
| 1371 |
|
{ |
| 1372 |
< |
if (ypass == 1) |
| 1372 |
> |
if (conf_parser_ctx.pass == 1) |
| 1373 |
|
{ |
| 1374 |
|
yy_conf = make_conf_item(CLASS_TYPE); |
| 1375 |
< |
yy_class = (struct ClassItem *)map_to_conf(yy_conf); |
| 1375 |
> |
yy_class = map_to_conf(yy_conf); |
| 1376 |
|
} |
| 1377 |
|
} class_name_b '{' class_items '}' ';' |
| 1378 |
|
{ |
| 1379 |
< |
if (ypass == 1) |
| 1379 |
> |
if (conf_parser_ctx.pass == 1) |
| 1380 |
|
{ |
| 1381 |
< |
struct ConfItem *cconf; |
| 1381 |
> |
struct ConfItem *cconf = NULL; |
| 1382 |
|
struct ClassItem *class = NULL; |
| 1383 |
|
|
| 1384 |
|
if (yy_class_name == NULL) |
| 1544 |
– |
{ |
| 1385 |
|
delete_conf_item(yy_conf); |
| 1546 |
– |
} |
| 1386 |
|
else |
| 1387 |
|
{ |
| 1388 |
|
cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL); |
| 1389 |
|
|
| 1390 |
|
if (cconf != NULL) /* The class existed already */ |
| 1391 |
|
{ |
| 1392 |
+ |
int user_count = 0; |
| 1393 |
+ |
|
| 1394 |
|
rebuild_cidr_class(cconf, yy_class); |
| 1395 |
< |
class = (struct ClassItem *) map_to_conf(cconf); |
| 1396 |
< |
*class = *yy_class; |
| 1395 |
> |
|
| 1396 |
> |
class = map_to_conf(cconf); |
| 1397 |
> |
|
| 1398 |
> |
user_count = class->curr_user_count; |
| 1399 |
> |
memcpy(class, yy_class, sizeof(*class)); |
| 1400 |
> |
class->curr_user_count = user_count; |
| 1401 |
> |
class->active = 1; |
| 1402 |
> |
|
| 1403 |
|
delete_conf_item(yy_conf); |
| 1404 |
|
|
| 1405 |
|
MyFree(cconf->name); /* Allows case change of class name */ |
| 1409 |
|
{ |
| 1410 |
|
MyFree(yy_conf->name); /* just in case it was allocated */ |
| 1411 |
|
yy_conf->name = yy_class_name; |
| 1412 |
+ |
yy_class->active = 1; |
| 1413 |
|
} |
| 1414 |
|
} |
| 1415 |
+ |
|
| 1416 |
|
yy_class_name = NULL; |
| 1417 |
|
} |
| 1418 |
|
}; |
| 1436 |
|
|
| 1437 |
|
class_name: NAME '=' QSTRING ';' |
| 1438 |
|
{ |
| 1439 |
< |
if (ypass == 1) |
| 1439 |
> |
if (conf_parser_ctx.pass == 1) |
| 1440 |
|
{ |
| 1441 |
|
MyFree(yy_class_name); |
| 1442 |
|
DupString(yy_class_name, yylval.string); |
| 1445 |
|
|
| 1446 |
|
class_name_t: QSTRING |
| 1447 |
|
{ |
| 1448 |
< |
if (ypass == 1) |
| 1448 |
> |
if (conf_parser_ctx.pass == 1) |
| 1449 |
|
{ |
| 1450 |
|
MyFree(yy_class_name); |
| 1451 |
|
DupString(yy_class_name, yylval.string); |
| 1454 |
|
|
| 1455 |
|
class_ping_time: PING_TIME '=' timespec ';' |
| 1456 |
|
{ |
| 1457 |
< |
if (ypass == 1) |
| 1457 |
> |
if (conf_parser_ctx.pass == 1) |
| 1458 |
|
PingFreq(yy_class) = $3; |
| 1459 |
|
}; |
| 1460 |
|
|
| 1461 |
|
class_ping_warning: PING_WARNING '=' timespec ';' |
| 1462 |
|
{ |
| 1463 |
< |
if (ypass == 1) |
| 1463 |
> |
if (conf_parser_ctx.pass == 1) |
| 1464 |
|
PingWarning(yy_class) = $3; |
| 1465 |
|
}; |
| 1466 |
|
|
| 1467 |
|
class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';' |
| 1468 |
|
{ |
| 1469 |
< |
if (ypass == 1) |
| 1469 |
> |
if (conf_parser_ctx.pass == 1) |
| 1470 |
|
MaxPerIp(yy_class) = $3; |
| 1471 |
|
}; |
| 1472 |
|
|
| 1473 |
|
class_connectfreq: CONNECTFREQ '=' timespec ';' |
| 1474 |
|
{ |
| 1475 |
< |
if (ypass == 1) |
| 1475 |
> |
if (conf_parser_ctx.pass == 1) |
| 1476 |
|
ConFreq(yy_class) = $3; |
| 1477 |
|
}; |
| 1478 |
|
|
| 1479 |
|
class_max_number: MAX_NUMBER '=' NUMBER ';' |
| 1480 |
|
{ |
| 1481 |
< |
if (ypass == 1) |
| 1481 |
> |
if (conf_parser_ctx.pass == 1) |
| 1482 |
|
MaxTotal(yy_class) = $3; |
| 1483 |
|
}; |
| 1484 |
|
|
| 1485 |
|
class_max_global: MAX_GLOBAL '=' NUMBER ';' |
| 1486 |
|
{ |
| 1487 |
< |
if (ypass == 1) |
| 1487 |
> |
if (conf_parser_ctx.pass == 1) |
| 1488 |
|
MaxGlobal(yy_class) = $3; |
| 1489 |
|
}; |
| 1490 |
|
|
| 1491 |
|
class_max_local: MAX_LOCAL '=' NUMBER ';' |
| 1492 |
|
{ |
| 1493 |
< |
if (ypass == 1) |
| 1493 |
> |
if (conf_parser_ctx.pass == 1) |
| 1494 |
|
MaxLocal(yy_class) = $3; |
| 1495 |
|
}; |
| 1496 |
|
|
| 1497 |
|
class_max_ident: MAX_IDENT '=' NUMBER ';' |
| 1498 |
|
{ |
| 1499 |
< |
if (ypass == 1) |
| 1499 |
> |
if (conf_parser_ctx.pass == 1) |
| 1500 |
|
MaxIdent(yy_class) = $3; |
| 1501 |
|
}; |
| 1502 |
|
|
| 1503 |
|
class_sendq: SENDQ '=' sizespec ';' |
| 1504 |
|
{ |
| 1505 |
< |
if (ypass == 1) |
| 1505 |
> |
if (conf_parser_ctx.pass == 1) |
| 1506 |
|
MaxSendq(yy_class) = $3; |
| 1507 |
|
}; |
| 1508 |
|
|
| 1509 |
|
class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';' |
| 1510 |
|
{ |
| 1511 |
< |
if (ypass == 1) |
| 1511 |
> |
if (conf_parser_ctx.pass == 1) |
| 1512 |
|
CidrBitlenIPV4(yy_class) = $3; |
| 1513 |
|
}; |
| 1514 |
|
|
| 1515 |
|
class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';' |
| 1516 |
|
{ |
| 1517 |
< |
if (ypass == 1) |
| 1517 |
> |
if (conf_parser_ctx.pass == 1) |
| 1518 |
|
CidrBitlenIPV6(yy_class) = $3; |
| 1519 |
|
}; |
| 1520 |
|
|
| 1521 |
|
class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';' |
| 1522 |
|
{ |
| 1523 |
< |
if (ypass == 1) |
| 1523 |
> |
if (conf_parser_ctx.pass == 1) |
| 1524 |
|
NumberPerCidr(yy_class) = $3; |
| 1525 |
|
}; |
| 1526 |
|
|
| 1529 |
|
***************************************************************************/ |
| 1530 |
|
listen_entry: LISTEN |
| 1531 |
|
{ |
| 1532 |
< |
if (ypass == 2) |
| 1532 |
> |
if (conf_parser_ctx.pass == 2) |
| 1533 |
|
{ |
| 1534 |
|
listener_address = NULL; |
| 1535 |
|
listener_flags = 0; |
| 1536 |
|
} |
| 1537 |
|
} '{' listen_items '}' ';' |
| 1538 |
|
{ |
| 1539 |
< |
if (ypass == 2) |
| 1539 |
> |
if (conf_parser_ctx.pass == 2) |
| 1540 |
|
{ |
| 1541 |
|
MyFree(listener_address); |
| 1542 |
|
listener_address = NULL; |
| 1551 |
|
listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item; |
| 1552 |
|
listen_flags_item: T_SSL |
| 1553 |
|
{ |
| 1554 |
< |
if (ypass == 2) |
| 1554 |
> |
if (conf_parser_ctx.pass == 2) |
| 1555 |
|
listener_flags |= LISTENER_SSL; |
| 1556 |
|
} | HIDDEN |
| 1557 |
|
{ |
| 1558 |
< |
if (ypass == 2) |
| 1558 |
> |
if (conf_parser_ctx.pass == 2) |
| 1559 |
|
listener_flags |= LISTENER_HIDDEN; |
| 1560 |
+ |
} | T_SERVER |
| 1561 |
+ |
{ |
| 1562 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1563 |
+ |
listener_flags |= LISTENER_SERVER; |
| 1564 |
|
}; |
| 1565 |
|
|
| 1566 |
+ |
|
| 1567 |
+ |
|
| 1568 |
|
listen_items: listen_items listen_item | listen_item; |
| 1569 |
|
listen_item: listen_port | listen_flags | listen_address | listen_host | error ';'; |
| 1570 |
|
|
| 1574 |
|
|
| 1575 |
|
port_item: NUMBER |
| 1576 |
|
{ |
| 1577 |
< |
if (ypass == 2) |
| 1577 |
> |
if (conf_parser_ctx.pass == 2) |
| 1578 |
|
{ |
| 1579 |
|
if ((listener_flags & LISTENER_SSL)) |
| 1580 |
|
#ifdef HAVE_LIBCRYPTO |
| 1581 |
< |
if (!ServerInfo.ctx) |
| 1581 |
> |
if (!ServerInfo.server_ctx) |
| 1582 |
|
#endif |
| 1583 |
|
{ |
| 1584 |
|
yyerror("SSL not available - port closed"); |
| 1588 |
|
} |
| 1589 |
|
} | NUMBER TWODOTS NUMBER |
| 1590 |
|
{ |
| 1591 |
< |
if (ypass == 2) |
| 1591 |
> |
if (conf_parser_ctx.pass == 2) |
| 1592 |
|
{ |
| 1593 |
|
int i; |
| 1594 |
|
|
| 1595 |
|
if ((listener_flags & LISTENER_SSL)) |
| 1596 |
|
#ifdef HAVE_LIBCRYPTO |
| 1597 |
< |
if (!ServerInfo.ctx) |
| 1597 |
> |
if (!ServerInfo.server_ctx) |
| 1598 |
|
#endif |
| 1599 |
|
{ |
| 1600 |
|
yyerror("SSL not available - port closed"); |
| 1608 |
|
|
| 1609 |
|
listen_address: IP '=' QSTRING ';' |
| 1610 |
|
{ |
| 1611 |
< |
if (ypass == 2) |
| 1611 |
> |
if (conf_parser_ctx.pass == 2) |
| 1612 |
|
{ |
| 1613 |
|
MyFree(listener_address); |
| 1614 |
|
DupString(listener_address, yylval.string); |
| 1617 |
|
|
| 1618 |
|
listen_host: HOST '=' QSTRING ';' |
| 1619 |
|
{ |
| 1620 |
< |
if (ypass == 2) |
| 1620 |
> |
if (conf_parser_ctx.pass == 2) |
| 1621 |
|
{ |
| 1622 |
|
MyFree(listener_address); |
| 1623 |
|
DupString(listener_address, yylval.string); |
| 1629 |
|
***************************************************************************/ |
| 1630 |
|
auth_entry: IRCD_AUTH |
| 1631 |
|
{ |
| 1632 |
< |
if (ypass == 2) |
| 1632 |
> |
if (conf_parser_ctx.pass == 2) |
| 1633 |
|
{ |
| 1634 |
|
yy_conf = make_conf_item(CLIENT_TYPE); |
| 1635 |
|
yy_aconf = map_to_conf(yy_conf); |
| 1641 |
|
} |
| 1642 |
|
} '{' auth_items '}' ';' |
| 1643 |
|
{ |
| 1644 |
< |
if (ypass == 2) |
| 1644 |
> |
if (conf_parser_ctx.pass == 2) |
| 1645 |
|
{ |
| 1646 |
|
struct CollectItem *yy_tmp = NULL; |
| 1647 |
|
dlink_node *ptr = NULL, *next_ptr = NULL; |
| 1698 |
|
|
| 1699 |
|
auth_items: auth_items auth_item | auth_item; |
| 1700 |
|
auth_item: auth_user | auth_passwd | auth_class | auth_flags | |
| 1701 |
< |
auth_kline_exempt | auth_need_ident | |
| 1702 |
< |
auth_exceed_limit | auth_no_tilde | auth_gline_exempt | |
| 1848 |
< |
auth_spoof | auth_spoof_notice | |
| 1849 |
< |
auth_redir_serv | auth_redir_port | auth_can_flood | |
| 1850 |
< |
auth_need_password | auth_encrypted | error ';' ; |
| 1701 |
> |
auth_spoof | auth_redir_serv | auth_redir_port | |
| 1702 |
> |
auth_encrypted | error ';' ; |
| 1703 |
|
|
| 1704 |
|
auth_user: USER '=' QSTRING ';' |
| 1705 |
|
{ |
| 1706 |
< |
if (ypass == 2) |
| 1706 |
> |
if (conf_parser_ctx.pass == 2) |
| 1707 |
|
{ |
| 1708 |
< |
struct CollectItem *yy_tmp; |
| 1708 |
> |
struct CollectItem *yy_tmp = NULL; |
| 1709 |
> |
struct split_nuh_item nuh; |
| 1710 |
> |
|
| 1711 |
> |
nuh.nuhmask = yylval.string; |
| 1712 |
> |
nuh.nickptr = NULL; |
| 1713 |
> |
nuh.userptr = userbuf; |
| 1714 |
> |
nuh.hostptr = hostbuf; |
| 1715 |
> |
|
| 1716 |
> |
nuh.nicksize = 0; |
| 1717 |
> |
nuh.usersize = sizeof(userbuf); |
| 1718 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 1719 |
> |
|
| 1720 |
> |
split_nuh(&nuh); |
| 1721 |
|
|
| 1722 |
|
if (yy_aconf->user == NULL) |
| 1723 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 1723 |
> |
{ |
| 1724 |
> |
DupString(yy_aconf->user, userbuf); |
| 1725 |
> |
DupString(yy_aconf->host, hostbuf); |
| 1726 |
> |
} |
| 1727 |
|
else |
| 1728 |
|
{ |
| 1729 |
|
yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 1730 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 1730 |
> |
|
| 1731 |
> |
DupString(yy_tmp->user, userbuf); |
| 1732 |
> |
DupString(yy_tmp->host, hostbuf); |
| 1733 |
> |
|
| 1734 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 1735 |
|
} |
| 1736 |
|
} |
| 1740 |
|
|
| 1741 |
|
auth_passwd: PASSWORD '=' QSTRING ';' |
| 1742 |
|
{ |
| 1743 |
< |
if (ypass == 2) |
| 1743 |
> |
if (conf_parser_ctx.pass == 2) |
| 1744 |
|
{ |
| 1745 |
|
/* be paranoid */ |
| 1746 |
|
if (yy_aconf->passwd != NULL) |
| 1751 |
|
} |
| 1752 |
|
}; |
| 1753 |
|
|
| 1884 |
– |
auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';' |
| 1885 |
– |
{ |
| 1886 |
– |
if (ypass == 2) |
| 1887 |
– |
{ |
| 1888 |
– |
if (yylval.number) |
| 1889 |
– |
yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE; |
| 1890 |
– |
else |
| 1891 |
– |
yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE; |
| 1892 |
– |
} |
| 1893 |
– |
}; |
| 1894 |
– |
|
| 1754 |
|
auth_class: CLASS '=' QSTRING ';' |
| 1755 |
|
{ |
| 1756 |
< |
if (ypass == 2) |
| 1756 |
> |
if (conf_parser_ctx.pass == 2) |
| 1757 |
|
{ |
| 1758 |
|
MyFree(class_name); |
| 1759 |
|
DupString(class_name, yylval.string); |
| 1762 |
|
|
| 1763 |
|
auth_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1764 |
|
{ |
| 1765 |
< |
if (ypass == 2) |
| 1765 |
> |
if (conf_parser_ctx.pass == 2) |
| 1766 |
|
{ |
| 1767 |
|
if (yylval.number) |
| 1768 |
|
SetConfEncrypted(yy_aconf); |
| 1781 |
|
|
| 1782 |
|
auth_flags_item_atom: SPOOF_NOTICE |
| 1783 |
|
{ |
| 1784 |
< |
if (ypass == 2) |
| 1784 |
> |
if (conf_parser_ctx.pass == 2) |
| 1785 |
|
{ |
| 1786 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE; |
| 1787 |
|
else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE; |
| 1788 |
|
} |
| 1930 |
– |
|
| 1789 |
|
} | EXCEED_LIMIT |
| 1790 |
|
{ |
| 1791 |
< |
if (ypass == 2) |
| 1791 |
> |
if (conf_parser_ctx.pass == 2) |
| 1792 |
|
{ |
| 1793 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT; |
| 1794 |
|
else yy_aconf->flags |= CONF_FLAGS_NOLIMIT; |
| 1795 |
|
} |
| 1796 |
|
} | KLINE_EXEMPT |
| 1797 |
|
{ |
| 1798 |
< |
if (ypass == 2) |
| 1798 |
> |
if (conf_parser_ctx.pass == 2) |
| 1799 |
|
{ |
| 1800 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE; |
| 1801 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE; |
| 1802 |
|
} |
| 1803 |
|
} | NEED_IDENT |
| 1804 |
|
{ |
| 1805 |
< |
if (ypass == 2) |
| 1805 |
> |
if (conf_parser_ctx.pass == 2) |
| 1806 |
|
{ |
| 1807 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD; |
| 1808 |
|
else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD; |
| 1809 |
|
} |
| 1810 |
|
} | CAN_FLOOD |
| 1811 |
|
{ |
| 1812 |
< |
if (ypass == 2) |
| 1812 |
> |
if (conf_parser_ctx.pass == 2) |
| 1813 |
|
{ |
| 1814 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD; |
| 1815 |
|
else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD; |
| 1816 |
|
} |
| 1817 |
|
} | CAN_IDLE |
| 1818 |
|
{ |
| 1819 |
< |
if (ypass == 2) |
| 1819 |
> |
if (conf_parser_ctx.pass == 2) |
| 1820 |
|
{ |
| 1821 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED; |
| 1822 |
|
else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED; |
| 1823 |
|
} |
| 1824 |
|
} | NO_TILDE |
| 1825 |
|
{ |
| 1826 |
< |
if (ypass == 2) |
| 1826 |
> |
if (conf_parser_ctx.pass == 2) |
| 1827 |
|
{ |
| 1828 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE; |
| 1829 |
|
else yy_aconf->flags |= CONF_FLAGS_NO_TILDE; |
| 1830 |
|
} |
| 1831 |
|
} | GLINE_EXEMPT |
| 1832 |
|
{ |
| 1833 |
< |
if (ypass == 2) |
| 1833 |
> |
if (conf_parser_ctx.pass == 2) |
| 1834 |
|
{ |
| 1835 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE; |
| 1836 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE; |
| 1837 |
|
} |
| 1838 |
|
} | RESV_EXEMPT |
| 1839 |
|
{ |
| 1840 |
< |
if (ypass == 2) |
| 1840 |
> |
if (conf_parser_ctx.pass == 2) |
| 1841 |
|
{ |
| 1842 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV; |
| 1843 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV; |
| 1844 |
|
} |
| 1845 |
|
} | NEED_PASSWORD |
| 1846 |
|
{ |
| 1847 |
< |
if (ypass == 2) |
| 1847 |
> |
if (conf_parser_ctx.pass == 2) |
| 1848 |
|
{ |
| 1849 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD; |
| 1850 |
|
else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD; |
| 1851 |
|
} |
| 1852 |
|
}; |
| 1853 |
|
|
| 1996 |
– |
auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';' |
| 1997 |
– |
{ |
| 1998 |
– |
if (ypass == 2) |
| 1999 |
– |
{ |
| 2000 |
– |
if (yylval.number) |
| 2001 |
– |
yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE; |
| 2002 |
– |
else |
| 2003 |
– |
yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE; |
| 2004 |
– |
} |
| 2005 |
– |
}; |
| 2006 |
– |
|
| 2007 |
– |
auth_need_ident: NEED_IDENT '=' TBOOL ';' |
| 2008 |
– |
{ |
| 2009 |
– |
if (ypass == 2) |
| 2010 |
– |
{ |
| 2011 |
– |
if (yylval.number) |
| 2012 |
– |
yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD; |
| 2013 |
– |
else |
| 2014 |
– |
yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD; |
| 2015 |
– |
} |
| 2016 |
– |
}; |
| 2017 |
– |
|
| 2018 |
– |
auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';' |
| 2019 |
– |
{ |
| 2020 |
– |
if (ypass == 2) |
| 2021 |
– |
{ |
| 2022 |
– |
if (yylval.number) |
| 2023 |
– |
yy_aconf->flags |= CONF_FLAGS_NOLIMIT; |
| 2024 |
– |
else |
| 2025 |
– |
yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT; |
| 2026 |
– |
} |
| 2027 |
– |
}; |
| 2028 |
– |
|
| 2029 |
– |
auth_can_flood: CAN_FLOOD '=' TBOOL ';' |
| 2030 |
– |
{ |
| 2031 |
– |
if (ypass == 2) |
| 2032 |
– |
{ |
| 2033 |
– |
if (yylval.number) |
| 2034 |
– |
yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD; |
| 2035 |
– |
else |
| 2036 |
– |
yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD; |
| 2037 |
– |
} |
| 2038 |
– |
}; |
| 2039 |
– |
|
| 2040 |
– |
auth_no_tilde: NO_TILDE '=' TBOOL ';' |
| 2041 |
– |
{ |
| 2042 |
– |
if (ypass == 2) |
| 2043 |
– |
{ |
| 2044 |
– |
if (yylval.number) |
| 2045 |
– |
yy_aconf->flags |= CONF_FLAGS_NO_TILDE; |
| 2046 |
– |
else |
| 2047 |
– |
yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE; |
| 2048 |
– |
} |
| 2049 |
– |
}; |
| 2050 |
– |
|
| 2051 |
– |
auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';' |
| 2052 |
– |
{ |
| 2053 |
– |
if (ypass == 2) |
| 2054 |
– |
{ |
| 2055 |
– |
if (yylval.number) |
| 2056 |
– |
yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE; |
| 2057 |
– |
else |
| 2058 |
– |
yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE; |
| 2059 |
– |
} |
| 2060 |
– |
}; |
| 2061 |
– |
|
| 1854 |
|
/* XXX - need check for illegal hostnames here */ |
| 1855 |
|
auth_spoof: SPOOF '=' QSTRING ';' |
| 1856 |
|
{ |
| 1857 |
< |
if (ypass == 2) |
| 1857 |
> |
if (conf_parser_ctx.pass == 2) |
| 1858 |
|
{ |
| 1859 |
|
MyFree(yy_conf->name); |
| 1860 |
|
|
| 1873 |
|
|
| 1874 |
|
auth_redir_serv: REDIRSERV '=' QSTRING ';' |
| 1875 |
|
{ |
| 1876 |
< |
if (ypass == 2) |
| 1876 |
> |
if (conf_parser_ctx.pass == 2) |
| 1877 |
|
{ |
| 1878 |
|
yy_aconf->flags |= CONF_FLAGS_REDIR; |
| 1879 |
|
MyFree(yy_conf->name); |
| 1883 |
|
|
| 1884 |
|
auth_redir_port: REDIRPORT '=' NUMBER ';' |
| 1885 |
|
{ |
| 1886 |
< |
if (ypass == 2) |
| 1886 |
> |
if (conf_parser_ctx.pass == 2) |
| 1887 |
|
{ |
| 1888 |
|
yy_aconf->flags |= CONF_FLAGS_REDIR; |
| 1889 |
|
yy_aconf->port = $3; |
| 1890 |
|
} |
| 1891 |
|
}; |
| 1892 |
|
|
| 2101 |
– |
auth_need_password: NEED_PASSWORD '=' TBOOL ';' |
| 2102 |
– |
{ |
| 2103 |
– |
if (ypass == 2) |
| 2104 |
– |
{ |
| 2105 |
– |
if (yylval.number) |
| 2106 |
– |
yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD; |
| 2107 |
– |
else |
| 2108 |
– |
yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD; |
| 2109 |
– |
} |
| 2110 |
– |
}; |
| 2111 |
– |
|
| 1893 |
|
|
| 1894 |
|
/*************************************************************************** |
| 1895 |
|
* section resv |
| 1896 |
|
***************************************************************************/ |
| 1897 |
|
resv_entry: RESV |
| 1898 |
|
{ |
| 1899 |
< |
if (ypass == 2) |
| 1899 |
> |
if (conf_parser_ctx.pass == 2) |
| 1900 |
|
{ |
| 1901 |
|
MyFree(resv_reason); |
| 1902 |
|
resv_reason = NULL; |
| 1903 |
|
} |
| 1904 |
|
} '{' resv_items '}' ';' |
| 1905 |
|
{ |
| 1906 |
< |
if (ypass == 2) |
| 1906 |
> |
if (conf_parser_ctx.pass == 2) |
| 1907 |
|
{ |
| 1908 |
|
MyFree(resv_reason); |
| 1909 |
|
resv_reason = NULL; |
| 1915 |
|
|
| 1916 |
|
resv_creason: REASON '=' QSTRING ';' |
| 1917 |
|
{ |
| 1918 |
< |
if (ypass == 2) |
| 1918 |
> |
if (conf_parser_ctx.pass == 2) |
| 1919 |
|
{ |
| 1920 |
|
MyFree(resv_reason); |
| 1921 |
|
DupString(resv_reason, yylval.string); |
| 1924 |
|
|
| 1925 |
|
resv_channel: CHANNEL '=' QSTRING ';' |
| 1926 |
|
{ |
| 1927 |
< |
if (ypass == 2) |
| 1927 |
> |
if (conf_parser_ctx.pass == 2) |
| 1928 |
|
{ |
| 1929 |
|
if (IsChanPrefix(*yylval.string)) |
| 1930 |
|
{ |
| 1939 |
|
|
| 1940 |
|
resv_nick: NICK '=' QSTRING ';' |
| 1941 |
|
{ |
| 1942 |
< |
if (ypass == 2) |
| 1942 |
> |
if (conf_parser_ctx.pass == 2) |
| 1943 |
|
{ |
| 1944 |
|
char def_reason[] = "No reason"; |
| 1945 |
|
|
| 1952 |
|
***************************************************************************/ |
| 1953 |
|
shared_entry: T_SHARED |
| 1954 |
|
{ |
| 1955 |
< |
if (ypass == 2) |
| 1955 |
> |
if (conf_parser_ctx.pass == 2) |
| 1956 |
|
{ |
| 1957 |
|
yy_conf = make_conf_item(ULINE_TYPE); |
| 1958 |
|
yy_match_item = map_to_conf(yy_conf); |
| 1960 |
|
} |
| 1961 |
|
} '{' shared_items '}' ';' |
| 1962 |
|
{ |
| 1963 |
< |
if (ypass == 2) |
| 1963 |
> |
if (conf_parser_ctx.pass == 2) |
| 1964 |
|
{ |
| 1965 |
|
yy_conf = NULL; |
| 1966 |
|
} |
| 1971 |
|
|
| 1972 |
|
shared_name: NAME '=' QSTRING ';' |
| 1973 |
|
{ |
| 1974 |
< |
if (ypass == 2) |
| 1974 |
> |
if (conf_parser_ctx.pass == 2) |
| 1975 |
|
{ |
| 1976 |
|
MyFree(yy_conf->name); |
| 1977 |
|
DupString(yy_conf->name, yylval.string); |
| 1980 |
|
|
| 1981 |
|
shared_user: USER '=' QSTRING ';' |
| 1982 |
|
{ |
| 1983 |
< |
if (ypass == 2) |
| 1983 |
> |
if (conf_parser_ctx.pass == 2) |
| 1984 |
|
{ |
| 1985 |
< |
split_nuh(yylval.string, NULL, &yy_match_item->user, &yy_match_item->host); |
| 1985 |
> |
struct split_nuh_item nuh; |
| 1986 |
> |
|
| 1987 |
> |
nuh.nuhmask = yylval.string; |
| 1988 |
> |
nuh.nickptr = NULL; |
| 1989 |
> |
nuh.userptr = userbuf; |
| 1990 |
> |
nuh.hostptr = hostbuf; |
| 1991 |
> |
|
| 1992 |
> |
nuh.nicksize = 0; |
| 1993 |
> |
nuh.usersize = sizeof(userbuf); |
| 1994 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 1995 |
> |
|
| 1996 |
> |
split_nuh(&nuh); |
| 1997 |
> |
|
| 1998 |
> |
DupString(yy_match_item->user, userbuf); |
| 1999 |
> |
DupString(yy_match_item->host, hostbuf); |
| 2000 |
|
} |
| 2001 |
|
}; |
| 2002 |
|
|
| 2003 |
|
shared_type: TYPE |
| 2004 |
|
{ |
| 2005 |
< |
if (ypass == 2) |
| 2005 |
> |
if (conf_parser_ctx.pass == 2) |
| 2006 |
|
yy_match_item->action = 0; |
| 2007 |
|
} '=' shared_types ';' ; |
| 2008 |
|
|
| 2009 |
|
shared_types: shared_types ',' shared_type_item | shared_type_item; |
| 2010 |
|
shared_type_item: KLINE |
| 2011 |
|
{ |
| 2012 |
< |
if (ypass == 2) |
| 2012 |
> |
if (conf_parser_ctx.pass == 2) |
| 2013 |
|
yy_match_item->action |= SHARED_KLINE; |
| 2014 |
|
} | TKLINE |
| 2015 |
|
{ |
| 2016 |
< |
if (ypass == 2) |
| 2016 |
> |
if (conf_parser_ctx.pass == 2) |
| 2017 |
|
yy_match_item->action |= SHARED_TKLINE; |
| 2018 |
|
} | UNKLINE |
| 2019 |
|
{ |
| 2020 |
< |
if (ypass == 2) |
| 2020 |
> |
if (conf_parser_ctx.pass == 2) |
| 2021 |
|
yy_match_item->action |= SHARED_UNKLINE; |
| 2022 |
|
} | XLINE |
| 2023 |
|
{ |
| 2024 |
< |
if (ypass == 2) |
| 2024 |
> |
if (conf_parser_ctx.pass == 2) |
| 2025 |
|
yy_match_item->action |= SHARED_XLINE; |
| 2026 |
|
} | TXLINE |
| 2027 |
|
{ |
| 2028 |
< |
if (ypass == 2) |
| 2028 |
> |
if (conf_parser_ctx.pass == 2) |
| 2029 |
|
yy_match_item->action |= SHARED_TXLINE; |
| 2030 |
|
} | T_UNXLINE |
| 2031 |
|
{ |
| 2032 |
< |
if (ypass == 2) |
| 2032 |
> |
if (conf_parser_ctx.pass == 2) |
| 2033 |
|
yy_match_item->action |= SHARED_UNXLINE; |
| 2034 |
|
} | RESV |
| 2035 |
|
{ |
| 2036 |
< |
if (ypass == 2) |
| 2036 |
> |
if (conf_parser_ctx.pass == 2) |
| 2037 |
|
yy_match_item->action |= SHARED_RESV; |
| 2038 |
|
} | TRESV |
| 2039 |
|
{ |
| 2040 |
< |
if (ypass == 2) |
| 2040 |
> |
if (conf_parser_ctx.pass == 2) |
| 2041 |
|
yy_match_item->action |= SHARED_TRESV; |
| 2042 |
|
} | T_UNRESV |
| 2043 |
|
{ |
| 2044 |
< |
if (ypass == 2) |
| 2044 |
> |
if (conf_parser_ctx.pass == 2) |
| 2045 |
|
yy_match_item->action |= SHARED_UNRESV; |
| 2046 |
|
} | T_LOCOPS |
| 2047 |
|
{ |
| 2048 |
< |
if (ypass == 2) |
| 2048 |
> |
if (conf_parser_ctx.pass == 2) |
| 2049 |
|
yy_match_item->action |= SHARED_LOCOPS; |
| 2050 |
|
} | T_ALL |
| 2051 |
|
{ |
| 2052 |
< |
if (ypass == 2) |
| 2052 |
> |
if (conf_parser_ctx.pass == 2) |
| 2053 |
|
yy_match_item->action = SHARED_ALL; |
| 2054 |
|
}; |
| 2055 |
|
|
| 2058 |
|
***************************************************************************/ |
| 2059 |
|
cluster_entry: T_CLUSTER |
| 2060 |
|
{ |
| 2061 |
< |
if (ypass == 2) |
| 2061 |
> |
if (conf_parser_ctx.pass == 2) |
| 2062 |
|
{ |
| 2063 |
|
yy_conf = make_conf_item(CLUSTER_TYPE); |
| 2064 |
|
yy_conf->flags = SHARED_ALL; |
| 2065 |
|
} |
| 2066 |
|
} '{' cluster_items '}' ';' |
| 2067 |
|
{ |
| 2068 |
< |
if (ypass == 2) |
| 2068 |
> |
if (conf_parser_ctx.pass == 2) |
| 2069 |
|
{ |
| 2070 |
|
if (yy_conf->name == NULL) |
| 2071 |
|
DupString(yy_conf->name, "*"); |
| 2078 |
|
|
| 2079 |
|
cluster_name: NAME '=' QSTRING ';' |
| 2080 |
|
{ |
| 2081 |
< |
if (ypass == 2) |
| 2081 |
> |
if (conf_parser_ctx.pass == 2) |
| 2082 |
|
DupString(yy_conf->name, yylval.string); |
| 2083 |
|
}; |
| 2084 |
|
|
| 2085 |
|
cluster_type: TYPE |
| 2086 |
|
{ |
| 2087 |
< |
if (ypass == 2) |
| 2087 |
> |
if (conf_parser_ctx.pass == 2) |
| 2088 |
|
yy_conf->flags = 0; |
| 2089 |
|
} '=' cluster_types ';' ; |
| 2090 |
|
|
| 2091 |
|
cluster_types: cluster_types ',' cluster_type_item | cluster_type_item; |
| 2092 |
|
cluster_type_item: KLINE |
| 2093 |
|
{ |
| 2094 |
< |
if (ypass == 2) |
| 2094 |
> |
if (conf_parser_ctx.pass == 2) |
| 2095 |
|
yy_conf->flags |= SHARED_KLINE; |
| 2096 |
|
} | TKLINE |
| 2097 |
|
{ |
| 2098 |
< |
if (ypass == 2) |
| 2098 |
> |
if (conf_parser_ctx.pass == 2) |
| 2099 |
|
yy_conf->flags |= SHARED_TKLINE; |
| 2100 |
|
} | UNKLINE |
| 2101 |
|
{ |
| 2102 |
< |
if (ypass == 2) |
| 2102 |
> |
if (conf_parser_ctx.pass == 2) |
| 2103 |
|
yy_conf->flags |= SHARED_UNKLINE; |
| 2104 |
|
} | XLINE |
| 2105 |
|
{ |
| 2106 |
< |
if (ypass == 2) |
| 2106 |
> |
if (conf_parser_ctx.pass == 2) |
| 2107 |
|
yy_conf->flags |= SHARED_XLINE; |
| 2108 |
|
} | TXLINE |
| 2109 |
|
{ |
| 2110 |
< |
if (ypass == 2) |
| 2110 |
> |
if (conf_parser_ctx.pass == 2) |
| 2111 |
|
yy_conf->flags |= SHARED_TXLINE; |
| 2112 |
|
} | T_UNXLINE |
| 2113 |
|
{ |
| 2114 |
< |
if (ypass == 2) |
| 2114 |
> |
if (conf_parser_ctx.pass == 2) |
| 2115 |
|
yy_conf->flags |= SHARED_UNXLINE; |
| 2116 |
|
} | RESV |
| 2117 |
|
{ |
| 2118 |
< |
if (ypass == 2) |
| 2118 |
> |
if (conf_parser_ctx.pass == 2) |
| 2119 |
|
yy_conf->flags |= SHARED_RESV; |
| 2120 |
|
} | TRESV |
| 2121 |
|
{ |
| 2122 |
< |
if (ypass == 2) |
| 2122 |
> |
if (conf_parser_ctx.pass == 2) |
| 2123 |
|
yy_conf->flags |= SHARED_TRESV; |
| 2124 |
|
} | T_UNRESV |
| 2125 |
|
{ |
| 2126 |
< |
if (ypass == 2) |
| 2126 |
> |
if (conf_parser_ctx.pass == 2) |
| 2127 |
|
yy_conf->flags |= SHARED_UNRESV; |
| 2128 |
|
} | T_LOCOPS |
| 2129 |
|
{ |
| 2130 |
< |
if (ypass == 2) |
| 2130 |
> |
if (conf_parser_ctx.pass == 2) |
| 2131 |
|
yy_conf->flags |= SHARED_LOCOPS; |
| 2132 |
|
} | T_ALL |
| 2133 |
|
{ |
| 2134 |
< |
if (ypass == 2) |
| 2134 |
> |
if (conf_parser_ctx.pass == 2) |
| 2135 |
|
yy_conf->flags = SHARED_ALL; |
| 2136 |
|
}; |
| 2137 |
|
|
| 2140 |
|
***************************************************************************/ |
| 2141 |
|
connect_entry: CONNECT |
| 2142 |
|
{ |
| 2143 |
< |
if (ypass == 2) |
| 2143 |
> |
if (conf_parser_ctx.pass == 2) |
| 2144 |
|
{ |
| 2145 |
|
yy_conf = make_conf_item(SERVER_TYPE); |
| 2146 |
|
yy_aconf = (struct AccessItem *)map_to_conf(yy_conf); |
| 2158 |
|
} |
| 2159 |
|
} connect_name_b '{' connect_items '}' ';' |
| 2160 |
|
{ |
| 2161 |
< |
if (ypass == 2) |
| 2161 |
> |
if (conf_parser_ctx.pass == 2) |
| 2162 |
|
{ |
| 2163 |
|
struct CollectItem *yy_hconf=NULL; |
| 2164 |
|
struct CollectItem *yy_lconf=NULL; |
| 2173 |
|
yy_aconf->passwd && yy_aconf->spasswd) |
| 2174 |
|
#endif /* !HAVE_LIBCRYPTO */ |
| 2175 |
|
{ |
| 2176 |
< |
if (conf_add_server(yy_conf, scount, class_name) >= 0) |
| 2382 |
< |
{ |
| 2383 |
< |
++scount; |
| 2384 |
< |
} |
| 2385 |
< |
else |
| 2176 |
> |
if (conf_add_server(yy_conf, class_name) == -1) |
| 2177 |
|
{ |
| 2178 |
|
delete_conf_item(yy_conf); |
| 2179 |
|
yy_conf = NULL; |
| 2289 |
|
connect_item: connect_name | connect_host | connect_vhost | |
| 2290 |
|
connect_send_password | connect_accept_password | |
| 2291 |
|
connect_aftype | connect_port | |
| 2292 |
< |
connect_fakename | connect_flags | connect_hub_mask | |
| 2293 |
< |
connect_leaf_mask | connect_class | connect_auto | |
| 2503 |
< |
connect_encrypted | connect_compressed | connect_cryptlink | |
| 2292 |
> |
connect_flags | connect_hub_mask | connect_leaf_mask | |
| 2293 |
> |
connect_class | connect_encrypted | |
| 2294 |
|
connect_rsa_public_key_file | connect_cipher_preference | |
| 2295 |
< |
connect_topicburst | error ';' ; |
| 2295 |
> |
error ';' ; |
| 2296 |
|
|
| 2297 |
|
connect_name: NAME '=' QSTRING ';' |
| 2298 |
|
{ |
| 2299 |
< |
if (ypass == 2) |
| 2299 |
> |
if (conf_parser_ctx.pass == 2) |
| 2300 |
|
{ |
| 2301 |
|
if (yy_conf->name != NULL) |
| 2302 |
|
yyerror("Multiple connect name entry"); |
| 2308 |
|
|
| 2309 |
|
connect_name_t: QSTRING |
| 2310 |
|
{ |
| 2311 |
< |
if (ypass == 2) |
| 2311 |
> |
if (conf_parser_ctx.pass == 2) |
| 2312 |
|
{ |
| 2313 |
|
if (yy_conf->name != NULL) |
| 2314 |
|
yyerror("Multiple connect name entry"); |
| 2320 |
|
|
| 2321 |
|
connect_host: HOST '=' QSTRING ';' |
| 2322 |
|
{ |
| 2323 |
< |
if (ypass == 2) |
| 2323 |
> |
if (conf_parser_ctx.pass == 2) |
| 2324 |
|
{ |
| 2325 |
|
MyFree(yy_aconf->host); |
| 2326 |
|
DupString(yy_aconf->host, yylval.string); |
| 2329 |
|
|
| 2330 |
|
connect_vhost: VHOST '=' QSTRING ';' |
| 2331 |
|
{ |
| 2332 |
< |
if (ypass == 2) |
| 2332 |
> |
if (conf_parser_ctx.pass == 2) |
| 2333 |
|
{ |
| 2334 |
|
struct addrinfo hints, *res; |
| 2335 |
|
|
| 2339 |
|
hints.ai_socktype = SOCK_STREAM; |
| 2340 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 2341 |
|
|
| 2342 |
< |
if (irc_getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 2342 |
> |
if (getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 2343 |
|
ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string); |
| 2344 |
|
else |
| 2345 |
|
{ |
| 2348 |
|
memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen); |
| 2349 |
|
yy_aconf->my_ipnum.ss.ss_family = res->ai_family; |
| 2350 |
|
yy_aconf->my_ipnum.ss_len = res->ai_addrlen; |
| 2351 |
< |
irc_freeaddrinfo(res); |
| 2351 |
> |
freeaddrinfo(res); |
| 2352 |
|
} |
| 2353 |
|
} |
| 2354 |
|
}; |
| 2355 |
|
|
| 2356 |
|
connect_send_password: SEND_PASSWORD '=' QSTRING ';' |
| 2357 |
|
{ |
| 2358 |
< |
if (ypass == 2) |
| 2358 |
> |
if (conf_parser_ctx.pass == 2) |
| 2359 |
|
{ |
| 2360 |
|
if ($3[0] == ':') |
| 2361 |
|
yyerror("Server passwords cannot begin with a colon"); |
| 2373 |
|
|
| 2374 |
|
connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';' |
| 2375 |
|
{ |
| 2376 |
< |
if (ypass == 2) |
| 2376 |
> |
if (conf_parser_ctx.pass == 2) |
| 2377 |
|
{ |
| 2378 |
|
if ($3[0] == ':') |
| 2379 |
|
yyerror("Server passwords cannot begin with a colon"); |
| 2391 |
|
|
| 2392 |
|
connect_port: PORT '=' NUMBER ';' |
| 2393 |
|
{ |
| 2394 |
< |
if (ypass == 2) |
| 2394 |
> |
if (conf_parser_ctx.pass == 2) |
| 2395 |
|
yy_aconf->port = $3; |
| 2396 |
|
}; |
| 2397 |
|
|
| 2398 |
|
connect_aftype: AFTYPE '=' T_IPV4 ';' |
| 2399 |
|
{ |
| 2400 |
< |
if (ypass == 2) |
| 2400 |
> |
if (conf_parser_ctx.pass == 2) |
| 2401 |
|
yy_aconf->aftype = AF_INET; |
| 2402 |
|
} | AFTYPE '=' T_IPV6 ';' |
| 2403 |
|
{ |
| 2404 |
|
#ifdef IPV6 |
| 2405 |
< |
if (ypass == 2) |
| 2405 |
> |
if (conf_parser_ctx.pass == 2) |
| 2406 |
|
yy_aconf->aftype = AF_INET6; |
| 2407 |
|
#endif |
| 2408 |
|
}; |
| 2409 |
|
|
| 2620 |
– |
connect_fakename: FAKENAME '=' QSTRING ';' |
| 2621 |
– |
{ |
| 2622 |
– |
if (ypass == 2) |
| 2623 |
– |
{ |
| 2624 |
– |
MyFree(yy_aconf->fakename); |
| 2625 |
– |
DupString(yy_aconf->fakename, yylval.string); |
| 2626 |
– |
} |
| 2627 |
– |
}; |
| 2628 |
– |
|
| 2410 |
|
connect_flags: IRCD_FLAGS |
| 2411 |
|
{ |
| 2412 |
|
} '=' connect_flags_items ';'; |
| 2415 |
|
connect_flags_item: NOT { not_atom = 1; } connect_flags_item_atom |
| 2416 |
|
| { not_atom = 0; } connect_flags_item_atom; |
| 2417 |
|
|
| 2418 |
< |
connect_flags_item_atom: LAZYLINK |
| 2638 |
< |
{ |
| 2639 |
< |
if (ypass == 2) |
| 2640 |
< |
{ |
| 2641 |
< |
if (not_atom)ClearConfLazyLink(yy_aconf); |
| 2642 |
< |
else SetConfLazyLink(yy_aconf); |
| 2643 |
< |
} |
| 2644 |
< |
} | COMPRESSED |
| 2418 |
> |
connect_flags_item_atom: COMPRESSED |
| 2419 |
|
{ |
| 2420 |
< |
if (ypass == 2) |
| 2420 |
> |
if (conf_parser_ctx.pass == 2) |
| 2421 |
|
#ifndef HAVE_LIBZ |
| 2422 |
|
yyerror("Ignoring flags = compressed; -- no zlib support"); |
| 2423 |
|
#else |
| 2428 |
|
#endif |
| 2429 |
|
} | CRYPTLINK |
| 2430 |
|
{ |
| 2431 |
< |
if (ypass == 2) |
| 2431 |
> |
if (conf_parser_ctx.pass == 2) |
| 2432 |
|
{ |
| 2433 |
|
if (not_atom)ClearConfCryptLink(yy_aconf); |
| 2434 |
|
else SetConfCryptLink(yy_aconf); |
| 2435 |
|
} |
| 2436 |
|
} | AUTOCONN |
| 2437 |
|
{ |
| 2438 |
< |
if (ypass == 2) |
| 2438 |
> |
if (conf_parser_ctx.pass == 2) |
| 2439 |
|
{ |
| 2440 |
|
if (not_atom)ClearConfAllowAutoConn(yy_aconf); |
| 2441 |
|
else SetConfAllowAutoConn(yy_aconf); |
| 2442 |
|
} |
| 2443 |
|
} | BURST_AWAY |
| 2444 |
|
{ |
| 2445 |
< |
if (ypass == 2) |
| 2445 |
> |
if (conf_parser_ctx.pass == 2) |
| 2446 |
|
{ |
| 2447 |
|
if (not_atom)ClearConfAwayBurst(yy_aconf); |
| 2448 |
|
else SetConfAwayBurst(yy_aconf); |
| 2449 |
|
} |
| 2450 |
|
} | TOPICBURST |
| 2451 |
|
{ |
| 2452 |
< |
if (ypass == 2) |
| 2452 |
> |
if (conf_parser_ctx.pass == 2) |
| 2453 |
|
{ |
| 2454 |
|
if (not_atom)ClearConfTopicBurst(yy_aconf); |
| 2455 |
|
else SetConfTopicBurst(yy_aconf); |
| 2460 |
|
connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 2461 |
|
{ |
| 2462 |
|
#ifdef HAVE_LIBCRYPTO |
| 2463 |
< |
if (ypass == 2) |
| 2463 |
> |
if (conf_parser_ctx.pass == 2) |
| 2464 |
|
{ |
| 2465 |
|
BIO *file; |
| 2466 |
|
|
| 2500 |
|
|
| 2501 |
|
connect_encrypted: ENCRYPTED '=' TBOOL ';' |
| 2502 |
|
{ |
| 2503 |
< |
if (ypass == 2) |
| 2503 |
> |
if (conf_parser_ctx.pass == 2) |
| 2504 |
|
{ |
| 2505 |
|
if (yylval.number) |
| 2506 |
|
yy_aconf->flags |= CONF_FLAGS_ENCRYPTED; |
| 2509 |
|
} |
| 2510 |
|
}; |
| 2511 |
|
|
| 2738 |
– |
connect_cryptlink: CRYPTLINK '=' TBOOL ';' |
| 2739 |
– |
{ |
| 2740 |
– |
if (ypass == 2) |
| 2741 |
– |
{ |
| 2742 |
– |
if (yylval.number) |
| 2743 |
– |
yy_aconf->flags |= CONF_FLAGS_CRYPTLINK; |
| 2744 |
– |
else |
| 2745 |
– |
yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK; |
| 2746 |
– |
} |
| 2747 |
– |
}; |
| 2748 |
– |
|
| 2749 |
– |
connect_compressed: COMPRESSED '=' TBOOL ';' |
| 2750 |
– |
{ |
| 2751 |
– |
if (ypass == 2) |
| 2752 |
– |
{ |
| 2753 |
– |
if (yylval.number) |
| 2754 |
– |
#ifndef HAVE_LIBZ |
| 2755 |
– |
yyerror("Ignoring compressed=yes; -- no zlib support"); |
| 2756 |
– |
#else |
| 2757 |
– |
yy_aconf->flags |= CONF_FLAGS_COMPRESSED; |
| 2758 |
– |
#endif |
| 2759 |
– |
else |
| 2760 |
– |
yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED; |
| 2761 |
– |
} |
| 2762 |
– |
}; |
| 2763 |
– |
|
| 2764 |
– |
connect_auto: AUTOCONN '=' TBOOL ';' |
| 2765 |
– |
{ |
| 2766 |
– |
if (ypass == 2) |
| 2767 |
– |
{ |
| 2768 |
– |
if (yylval.number) |
| 2769 |
– |
yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN; |
| 2770 |
– |
else |
| 2771 |
– |
yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN; |
| 2772 |
– |
} |
| 2773 |
– |
}; |
| 2774 |
– |
|
| 2775 |
– |
connect_topicburst: TOPICBURST '=' TBOOL ';' |
| 2776 |
– |
{ |
| 2777 |
– |
if (ypass == 2) |
| 2778 |
– |
{ |
| 2779 |
– |
if (yylval.number) |
| 2780 |
– |
SetConfTopicBurst(yy_aconf); |
| 2781 |
– |
else |
| 2782 |
– |
ClearConfTopicBurst(yy_aconf); |
| 2783 |
– |
} |
| 2784 |
– |
}; |
| 2785 |
– |
|
| 2512 |
|
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2513 |
|
{ |
| 2514 |
< |
if (ypass == 2) |
| 2514 |
> |
if (conf_parser_ctx.pass == 2) |
| 2515 |
|
{ |
| 2516 |
|
struct CollectItem *yy_tmp; |
| 2517 |
|
|
| 2524 |
|
|
| 2525 |
|
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2526 |
|
{ |
| 2527 |
< |
if (ypass == 2) |
| 2527 |
> |
if (conf_parser_ctx.pass == 2) |
| 2528 |
|
{ |
| 2529 |
|
struct CollectItem *yy_tmp; |
| 2530 |
|
|
| 2537 |
|
|
| 2538 |
|
connect_class: CLASS '=' QSTRING ';' |
| 2539 |
|
{ |
| 2540 |
< |
if (ypass == 2) |
| 2540 |
> |
if (conf_parser_ctx.pass == 2) |
| 2541 |
|
{ |
| 2542 |
|
MyFree(class_name); |
| 2543 |
|
DupString(class_name, yylval.string); |
| 2547 |
|
connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';' |
| 2548 |
|
{ |
| 2549 |
|
#ifdef HAVE_LIBCRYPTO |
| 2550 |
< |
if (ypass == 2) |
| 2550 |
> |
if (conf_parser_ctx.pass == 2) |
| 2551 |
|
{ |
| 2552 |
|
struct EncCapability *ecap; |
| 2553 |
|
const char *cipher_name; |
| 2571 |
|
yyerror("Invalid cipher"); |
| 2572 |
|
} |
| 2573 |
|
#else |
| 2574 |
< |
if (ypass == 2) |
| 2574 |
> |
if (conf_parser_ctx.pass == 2) |
| 2575 |
|
yyerror("Ignoring cipher_preference -- no OpenSSL support"); |
| 2576 |
|
#endif |
| 2577 |
|
}; |
| 2581 |
|
***************************************************************************/ |
| 2582 |
|
kill_entry: KILL |
| 2583 |
|
{ |
| 2584 |
< |
if (ypass == 2) |
| 2584 |
> |
if (conf_parser_ctx.pass == 2) |
| 2585 |
|
{ |
| 2586 |
|
userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0'; |
| 2587 |
|
regex_ban = 0; |
| 2588 |
|
} |
| 2589 |
|
} '{' kill_items '}' ';' |
| 2590 |
|
{ |
| 2591 |
< |
if (ypass == 2) |
| 2591 |
> |
if (conf_parser_ctx.pass == 2) |
| 2592 |
|
{ |
| 2593 |
|
if (userbuf[0] && hostbuf[0]) |
| 2594 |
|
{ |
| 2595 |
|
if (regex_ban) |
| 2596 |
|
{ |
| 2597 |
< |
pcre *exp_user = NULL; |
| 2598 |
< |
pcre *exp_host = NULL; |
| 2597 |
> |
#ifdef HAVE_LIBPCRE |
| 2598 |
> |
void *exp_user = NULL; |
| 2599 |
> |
void *exp_host = NULL; |
| 2600 |
|
const char *errptr = NULL; |
| 2601 |
|
|
| 2602 |
|
if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) || |
| 2603 |
|
!(exp_host = ircd_pcre_compile(hostbuf, &errptr))) |
| 2604 |
|
{ |
| 2605 |
< |
ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", errptr); |
| 2605 |
> |
ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", |
| 2606 |
> |
errptr); |
| 2607 |
|
break; |
| 2608 |
|
} |
| 2609 |
|
|
| 2610 |
< |
yy_conf = make_conf_item(RKLINE_TYPE); |
| 2610 |
> |
yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE)); |
| 2611 |
|
yy_aconf->regexuser = exp_user; |
| 2612 |
|
yy_aconf->regexhost = exp_host; |
| 2613 |
|
|
| 2618 |
|
DupString(yy_aconf->reason, reasonbuf); |
| 2619 |
|
else |
| 2620 |
|
DupString(yy_aconf->reason, "No reason"); |
| 2621 |
+ |
#else |
| 2622 |
+ |
ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support"); |
| 2623 |
+ |
break; |
| 2624 |
+ |
#endif |
| 2625 |
|
} |
| 2626 |
|
else |
| 2627 |
|
{ |
| 2628 |
< |
yy_conf = make_conf_item(KLINE_TYPE); |
| 2897 |
< |
yy_aconf = map_to_conf(yy_conf); |
| 2628 |
> |
yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE)); |
| 2629 |
|
|
| 2630 |
|
DupString(yy_aconf->user, userbuf); |
| 2631 |
|
DupString(yy_aconf->host, hostbuf); |
| 2637 |
|
add_conf_by_address(CONF_KILL, yy_aconf); |
| 2638 |
|
} |
| 2639 |
|
} |
| 2909 |
– |
else |
| 2910 |
– |
delete_conf_item(yy_conf); |
| 2640 |
|
|
| 2912 |
– |
yy_conf = NULL; |
| 2641 |
|
yy_aconf = NULL; |
| 2642 |
|
} |
| 2643 |
|
}; |
| 2649 |
|
kill_type_items: kill_type_items ',' kill_type_item | kill_type_item; |
| 2650 |
|
kill_type_item: REGEX_T |
| 2651 |
|
{ |
| 2652 |
< |
if (ypass == 2) |
| 2652 |
> |
if (conf_parser_ctx.pass == 2) |
| 2653 |
|
regex_ban = 1; |
| 2654 |
|
}; |
| 2655 |
|
|
| 2658 |
|
|
| 2659 |
|
kill_user: USER '=' QSTRING ';' |
| 2660 |
|
{ |
| 2661 |
< |
if (ypass == 2) |
| 2661 |
> |
if (conf_parser_ctx.pass == 2) |
| 2662 |
|
{ |
| 2663 |
< |
char *user = NULL, *host = NULL; |
| 2663 |
> |
struct split_nuh_item nuh; |
| 2664 |
|
|
| 2665 |
< |
split_nuh(yylval.string, NULL, &user, &host); |
| 2665 |
> |
nuh.nuhmask = yylval.string; |
| 2666 |
> |
nuh.nickptr = NULL; |
| 2667 |
> |
nuh.userptr = userbuf; |
| 2668 |
> |
nuh.hostptr = hostbuf; |
| 2669 |
|
|
| 2670 |
< |
strlcpy(userbuf, user, sizeof(userbuf)); |
| 2671 |
< |
strlcpy(hostbuf, host, sizeof(hostbuf)); |
| 2670 |
> |
nuh.nicksize = 0; |
| 2671 |
> |
nuh.usersize = sizeof(userbuf); |
| 2672 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 2673 |
|
|
| 2674 |
< |
MyFree(user); |
| 2943 |
< |
MyFree(host); |
| 2674 |
> |
split_nuh(&nuh); |
| 2675 |
|
} |
| 2676 |
|
}; |
| 2677 |
|
|
| 2678 |
|
kill_reason: REASON '=' QSTRING ';' |
| 2679 |
|
{ |
| 2680 |
< |
if (ypass == 2) |
| 2680 |
> |
if (conf_parser_ctx.pass == 2) |
| 2681 |
|
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf)); |
| 2682 |
|
}; |
| 2683 |
|
|
| 2686 |
|
***************************************************************************/ |
| 2687 |
|
deny_entry: DENY |
| 2688 |
|
{ |
| 2689 |
< |
if (ypass == 2) |
| 2690 |
< |
{ |
| 2960 |
< |
yy_conf = make_conf_item(DLINE_TYPE); |
| 2961 |
< |
yy_aconf = map_to_conf(yy_conf); |
| 2962 |
< |
/* default reason */ |
| 2963 |
< |
DupString(yy_aconf->reason, "No reason"); |
| 2964 |
< |
} |
| 2689 |
> |
if (conf_parser_ctx.pass == 2) |
| 2690 |
> |
hostbuf[0] = reasonbuf[0] = '\0'; |
| 2691 |
|
} '{' deny_items '}' ';' |
| 2692 |
|
{ |
| 2693 |
< |
if (ypass == 2) |
| 2693 |
> |
if (conf_parser_ctx.pass == 2) |
| 2694 |
|
{ |
| 2695 |
< |
if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST) |
| 2695 |
> |
if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST) |
| 2696 |
> |
{ |
| 2697 |
> |
yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE)); |
| 2698 |
> |
DupString(yy_aconf->host, hostbuf); |
| 2699 |
> |
|
| 2700 |
> |
if (reasonbuf[0]) |
| 2701 |
> |
DupString(yy_aconf->reason, reasonbuf); |
| 2702 |
> |
else |
| 2703 |
> |
DupString(yy_aconf->reason, "No reason"); |
| 2704 |
|
add_conf_by_address(CONF_DLINE, yy_aconf); |
| 2705 |
< |
else |
| 2706 |
< |
delete_conf_item(yy_conf); |
| 2973 |
< |
yy_conf = NULL; |
| 2974 |
< |
yy_aconf = NULL; |
| 2705 |
> |
yy_aconf = NULL; |
| 2706 |
> |
} |
| 2707 |
|
} |
| 2708 |
|
}; |
| 2709 |
|
|
| 2712 |
|
|
| 2713 |
|
deny_ip: IP '=' QSTRING ';' |
| 2714 |
|
{ |
| 2715 |
< |
if (ypass == 2) |
| 2716 |
< |
{ |
| 2985 |
< |
MyFree(yy_aconf->host); |
| 2986 |
< |
DupString(yy_aconf->host, yylval.string); |
| 2987 |
< |
} |
| 2715 |
> |
if (conf_parser_ctx.pass == 2) |
| 2716 |
> |
strlcpy(hostbuf, yylval.string, sizeof(hostbuf)); |
| 2717 |
|
}; |
| 2718 |
|
|
| 2719 |
|
deny_reason: REASON '=' QSTRING ';' |
| 2720 |
|
{ |
| 2721 |
< |
if (ypass == 2) |
| 2722 |
< |
{ |
| 2994 |
< |
MyFree(yy_aconf->reason); |
| 2995 |
< |
DupString(yy_aconf->reason, yylval.string); |
| 2996 |
< |
} |
| 2721 |
> |
if (conf_parser_ctx.pass == 2) |
| 2722 |
> |
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf)); |
| 2723 |
|
}; |
| 2724 |
|
|
| 2725 |
|
/*************************************************************************** |
| 2732 |
|
|
| 2733 |
|
exempt_ip: IP '=' QSTRING ';' |
| 2734 |
|
{ |
| 2735 |
< |
if (ypass == 2) |
| 2735 |
> |
if (conf_parser_ctx.pass == 2) |
| 2736 |
|
{ |
| 2737 |
|
if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) |
| 2738 |
|
{ |
| 2739 |
< |
yy_conf = make_conf_item(EXEMPTDLINE_TYPE); |
| 3014 |
< |
yy_aconf = map_to_conf(yy_conf); |
| 2739 |
> |
yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE)); |
| 2740 |
|
DupString(yy_aconf->host, yylval.string); |
| 2741 |
|
|
| 2742 |
|
add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf); |
| 3018 |
– |
|
| 3019 |
– |
yy_conf = NULL; |
| 2743 |
|
yy_aconf = NULL; |
| 2744 |
|
} |
| 2745 |
|
} |
| 2750 |
|
***************************************************************************/ |
| 2751 |
|
gecos_entry: GECOS |
| 2752 |
|
{ |
| 2753 |
< |
if (ypass == 2) |
| 2753 |
> |
if (conf_parser_ctx.pass == 2) |
| 2754 |
|
{ |
| 2755 |
|
regex_ban = 0; |
| 2756 |
|
reasonbuf[0] = gecos_name[0] = '\0'; |
| 2757 |
|
} |
| 2758 |
|
} '{' gecos_items '}' ';' |
| 2759 |
|
{ |
| 2760 |
< |
if (ypass == 2) |
| 2760 |
> |
if (conf_parser_ctx.pass == 2) |
| 2761 |
|
{ |
| 2762 |
|
if (gecos_name[0]) |
| 2763 |
|
{ |
| 2764 |
|
if (regex_ban) |
| 2765 |
|
{ |
| 2766 |
< |
pcre *exp_p = NULL; |
| 2766 |
> |
#ifdef HAVE_LIBPCRE |
| 2767 |
> |
void *exp_p = NULL; |
| 2768 |
|
const char *errptr = NULL; |
| 2769 |
|
|
| 2770 |
|
if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr))) |
| 2771 |
|
{ |
| 2772 |
< |
ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", errptr); |
| 2772 |
> |
ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", |
| 2773 |
> |
errptr); |
| 2774 |
|
break; |
| 2775 |
|
} |
| 2776 |
|
|
| 2777 |
|
yy_conf = make_conf_item(RXLINE_TYPE); |
| 2778 |
|
yy_conf->regexpname = exp_p; |
| 2779 |
+ |
#else |
| 2780 |
+ |
ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support"); |
| 2781 |
+ |
break; |
| 2782 |
+ |
#endif |
| 2783 |
|
} |
| 2784 |
|
else |
| 2785 |
|
yy_conf = make_conf_item(XLINE_TYPE); |
| 2802 |
|
gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item; |
| 2803 |
|
gecos_flags_item: REGEX_T |
| 2804 |
|
{ |
| 2805 |
< |
if (ypass == 2) |
| 2805 |
> |
if (conf_parser_ctx.pass == 2) |
| 2806 |
|
regex_ban = 1; |
| 2807 |
|
}; |
| 2808 |
|
|
| 2811 |
|
|
| 2812 |
|
gecos_name: NAME '=' QSTRING ';' |
| 2813 |
|
{ |
| 2814 |
< |
if (ypass == 2) |
| 2814 |
> |
if (conf_parser_ctx.pass == 2) |
| 2815 |
|
strlcpy(gecos_name, yylval.string, sizeof(gecos_name)); |
| 2816 |
|
}; |
| 2817 |
|
|
| 2818 |
|
gecos_reason: REASON '=' QSTRING ';' |
| 2819 |
|
{ |
| 2820 |
< |
if (ypass == 2) |
| 2820 |
> |
if (conf_parser_ctx.pass == 2) |
| 2821 |
|
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf)); |
| 2822 |
|
}; |
| 2823 |
|
|
| 2851 |
|
general_default_cipher_preference | |
| 2852 |
|
general_compression_level | general_client_flood | |
| 2853 |
|
general_throttle_time | general_havent_read_conf | |
| 2854 |
< |
general_dot_in_ip6_addr | general_ping_cookie | |
| 2854 |
> |
general_ping_cookie | |
| 2855 |
|
general_disable_auth | general_burst_away | |
| 2856 |
|
general_tkline_expire_notices | general_gline_min_cidr | |
| 2857 |
|
general_gline_min_cidr6 | general_use_whois_actually | |
| 2858 |
< |
general_reject_hold_time | |
| 2858 |
> |
general_reject_hold_time | general_stats_e_disabled | |
| 2859 |
> |
general_max_watch | |
| 2860 |
|
error; |
| 2861 |
|
|
| 2862 |
|
|
| 2863 |
+ |
general_max_watch: MAX_WATCH '=' NUMBER ';' |
| 2864 |
+ |
{ |
| 2865 |
+ |
ConfigFileEntry.max_watch = $3; |
| 2866 |
+ |
}; |
| 2867 |
|
|
| 2868 |
|
general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';' |
| 2869 |
|
{ |
| 2895 |
|
ConfigFileEntry.tkline_expire_notices = yylval.number; |
| 2896 |
|
}; |
| 2897 |
|
|
| 2898 |
< |
general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' NUMBER ';' |
| 2898 |
> |
general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';' |
| 2899 |
|
{ |
| 2900 |
|
ConfigFileEntry.kill_chase_time_limit = $3; |
| 2901 |
|
}; |
| 2952 |
|
|
| 2953 |
|
general_ts_max_delta: TS_MAX_DELTA '=' timespec ';' |
| 2954 |
|
{ |
| 2955 |
< |
if (ypass == 2) |
| 2955 |
> |
if (conf_parser_ctx.pass == 2) |
| 2956 |
|
ConfigFileEntry.ts_max_delta = $3; |
| 2957 |
|
}; |
| 2958 |
|
|
| 2959 |
|
general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';' |
| 2960 |
|
{ |
| 2961 |
< |
if (($3 > 0) && ypass == 1) |
| 2961 |
> |
if (($3 > 0) && conf_parser_ctx.pass == 1) |
| 2962 |
|
{ |
| 2963 |
|
ilog(L_CRIT, "You haven't read your config file properly."); |
| 2964 |
|
ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed."); |
| 2974 |
|
|
| 2975 |
|
general_kline_reason: KLINE_REASON '=' QSTRING ';' |
| 2976 |
|
{ |
| 2977 |
< |
if (ypass == 2) |
| 2977 |
> |
if (conf_parser_ctx.pass == 2) |
| 2978 |
|
{ |
| 2979 |
|
MyFree(ConfigFileEntry.kline_reason); |
| 2980 |
|
DupString(ConfigFileEntry.kline_reason, yylval.string); |
| 2991 |
|
ConfigFileEntry.warn_no_nline = yylval.number; |
| 2992 |
|
}; |
| 2993 |
|
|
| 2994 |
+ |
general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';' |
| 2995 |
+ |
{ |
| 2996 |
+ |
ConfigFileEntry.stats_e_disabled = yylval.number; |
| 2997 |
+ |
}; |
| 2998 |
+ |
|
| 2999 |
|
general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';' |
| 3000 |
|
{ |
| 3001 |
|
ConfigFileEntry.stats_o_oper_only = yylval.number; |
| 3064 |
|
|
| 3065 |
|
general_message_locale: MESSAGE_LOCALE '=' QSTRING ';' |
| 3066 |
|
{ |
| 3067 |
< |
if (ypass == 2) |
| 3067 |
> |
if (conf_parser_ctx.pass == 2) |
| 3068 |
|
{ |
| 3069 |
|
if (strlen(yylval.string) > LOCALE_LENGTH-2) |
| 3070 |
|
yylval.string[LOCALE_LENGTH-1] = '\0'; |
| 3090 |
|
|
| 3091 |
|
general_servlink_path: SERVLINK_PATH '=' QSTRING ';' |
| 3092 |
|
{ |
| 3093 |
< |
if (ypass == 2) |
| 3093 |
> |
if (conf_parser_ctx.pass == 2) |
| 3094 |
|
{ |
| 3095 |
|
MyFree(ConfigFileEntry.servlink_path); |
| 3096 |
|
DupString(ConfigFileEntry.servlink_path, yylval.string); |
| 3100 |
|
general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';' |
| 3101 |
|
{ |
| 3102 |
|
#ifdef HAVE_LIBCRYPTO |
| 3103 |
< |
if (ypass == 2) |
| 3103 |
> |
if (conf_parser_ctx.pass == 2) |
| 3104 |
|
{ |
| 3105 |
|
struct EncCapability *ecap; |
| 3106 |
|
const char *cipher_name; |
| 3124 |
|
yyerror("Invalid cipher"); |
| 3125 |
|
} |
| 3126 |
|
#else |
| 3127 |
< |
if (ypass == 2) |
| 3127 |
> |
if (conf_parser_ctx.pass == 2) |
| 3128 |
|
yyerror("Ignoring default_cipher_preference -- no OpenSSL support"); |
| 3129 |
|
#endif |
| 3130 |
|
}; |
| 3131 |
|
|
| 3132 |
|
general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';' |
| 3133 |
|
{ |
| 3134 |
< |
if (ypass == 2) |
| 3134 |
> |
if (conf_parser_ctx.pass == 2) |
| 3135 |
|
{ |
| 3136 |
|
ConfigFileEntry.compression_level = $3; |
| 3137 |
|
#ifndef HAVE_LIBZ |
| 3154 |
|
|
| 3155 |
|
general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';' |
| 3156 |
|
{ |
| 3157 |
< |
if (ypass == 2) |
| 3157 |
> |
if (conf_parser_ctx.pass == 2) |
| 3158 |
|
{ |
| 3159 |
|
MyFree(ConfigFileEntry.egdpool_path); |
| 3160 |
|
DupString(ConfigFileEntry.egdpool_path, yylval.string); |
| 3188 |
|
} | T_CCONN |
| 3189 |
|
{ |
| 3190 |
|
ConfigFileEntry.oper_umodes |= UMODE_CCONN; |
| 3191 |
+ |
} | T_CCONN_FULL |
| 3192 |
+ |
{ |
| 3193 |
+ |
ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL; |
| 3194 |
|
} | T_DEAF |
| 3195 |
|
{ |
| 3196 |
|
ConfigFileEntry.oper_umodes |= UMODE_DEAF; |
| 3253 |
|
} | T_CCONN |
| 3254 |
|
{ |
| 3255 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; |
| 3256 |
+ |
} | T_CCONN_FULL |
| 3257 |
+ |
{ |
| 3258 |
+ |
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL; |
| 3259 |
|
} | T_DEAF |
| 3260 |
|
{ |
| 3261 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; |
| 3326 |
|
ConfigFileEntry.client_flood = $3; |
| 3327 |
|
}; |
| 3328 |
|
|
| 3584 |
– |
general_dot_in_ip6_addr: DOT_IN_IP6_ADDR '=' TBOOL ';' |
| 3585 |
– |
{ |
| 3586 |
– |
ConfigFileEntry.dot_in_ip6_addr = yylval.number; |
| 3587 |
– |
}; |
| 3329 |
|
|
| 3330 |
|
/*************************************************************************** |
| 3331 |
|
* section glines |
| 3332 |
|
***************************************************************************/ |
| 3333 |
|
gline_entry: GLINES |
| 3334 |
|
{ |
| 3335 |
< |
if (ypass == 2) |
| 3335 |
> |
if (conf_parser_ctx.pass == 2) |
| 3336 |
|
{ |
| 3337 |
|
yy_conf = make_conf_item(GDENY_TYPE); |
| 3338 |
|
yy_aconf = map_to_conf(yy_conf); |
| 3339 |
|
} |
| 3340 |
|
} '{' gline_items '}' ';' |
| 3341 |
|
{ |
| 3342 |
< |
if (ypass == 2) |
| 3342 |
> |
if (conf_parser_ctx.pass == 2) |
| 3343 |
|
{ |
| 3344 |
|
/* |
| 3345 |
|
* since we re-allocate yy_conf/yy_aconf after the end of action=, at the |
| 3365 |
|
|
| 3366 |
|
gline_enable: ENABLE '=' TBOOL ';' |
| 3367 |
|
{ |
| 3368 |
< |
if (ypass == 2) |
| 3368 |
> |
if (conf_parser_ctx.pass == 2) |
| 3369 |
|
ConfigFileEntry.glines = yylval.number; |
| 3370 |
|
}; |
| 3371 |
|
|
| 3372 |
|
gline_duration: DURATION '=' timespec ';' |
| 3373 |
|
{ |
| 3374 |
< |
if (ypass == 2) |
| 3374 |
> |
if (conf_parser_ctx.pass == 2) |
| 3375 |
|
ConfigFileEntry.gline_time = $3; |
| 3376 |
|
}; |
| 3377 |
|
|
| 3378 |
|
gline_logging: LOGGING |
| 3379 |
|
{ |
| 3380 |
< |
if (ypass == 2) |
| 3380 |
> |
if (conf_parser_ctx.pass == 2) |
| 3381 |
|
ConfigFileEntry.gline_logging = 0; |
| 3382 |
|
} '=' gline_logging_types ';'; |
| 3383 |
|
gline_logging_types: gline_logging_types ',' gline_logging_type_item | gline_logging_type_item; |
| 3384 |
|
gline_logging_type_item: T_REJECT |
| 3385 |
|
{ |
| 3386 |
< |
if (ypass == 2) |
| 3386 |
> |
if (conf_parser_ctx.pass == 2) |
| 3387 |
|
ConfigFileEntry.gline_logging |= GDENY_REJECT; |
| 3388 |
|
} | T_BLOCK |
| 3389 |
|
{ |
| 3390 |
< |
if (ypass == 2) |
| 3390 |
> |
if (conf_parser_ctx.pass == 2) |
| 3391 |
|
ConfigFileEntry.gline_logging |= GDENY_BLOCK; |
| 3392 |
|
}; |
| 3393 |
|
|
| 3394 |
|
gline_user: USER '=' QSTRING ';' |
| 3395 |
|
{ |
| 3396 |
< |
if (ypass == 2) |
| 3396 |
> |
if (conf_parser_ctx.pass == 2) |
| 3397 |
|
{ |
| 3398 |
< |
struct CollectItem *yy_tmp = NULL; |
| 3398 |
> |
struct split_nuh_item nuh; |
| 3399 |
> |
|
| 3400 |
> |
nuh.nuhmask = yylval.string; |
| 3401 |
> |
nuh.nickptr = NULL; |
| 3402 |
> |
nuh.userptr = userbuf; |
| 3403 |
> |
nuh.hostptr = hostbuf; |
| 3404 |
> |
|
| 3405 |
> |
nuh.nicksize = 0; |
| 3406 |
> |
nuh.usersize = sizeof(userbuf); |
| 3407 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 3408 |
> |
|
| 3409 |
> |
split_nuh(&nuh); |
| 3410 |
|
|
| 3411 |
|
if (yy_aconf->user == NULL) |
| 3412 |
|
{ |
| 3413 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 3413 |
> |
DupString(yy_aconf->user, userbuf); |
| 3414 |
> |
DupString(yy_aconf->host, hostbuf); |
| 3415 |
|
} |
| 3416 |
|
else |
| 3417 |
|
{ |
| 3418 |
< |
yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 3419 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 3418 |
> |
struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 3419 |
> |
|
| 3420 |
> |
DupString(yy_tmp->user, userbuf); |
| 3421 |
> |
DupString(yy_tmp->host, hostbuf); |
| 3422 |
> |
|
| 3423 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 3424 |
|
} |
| 3425 |
|
} |
| 3427 |
|
|
| 3428 |
|
gline_server: NAME '=' QSTRING ';' |
| 3429 |
|
{ |
| 3430 |
< |
if (ypass == 2) |
| 3430 |
> |
if (conf_parser_ctx.pass == 2) |
| 3431 |
|
{ |
| 3432 |
|
MyFree(yy_conf->name); |
| 3433 |
|
DupString(yy_conf->name, yylval.string); |
| 3436 |
|
|
| 3437 |
|
gline_action: ACTION |
| 3438 |
|
{ |
| 3439 |
< |
if (ypass == 2) |
| 3439 |
> |
if (conf_parser_ctx.pass == 2) |
| 3440 |
|
yy_aconf->flags = 0; |
| 3441 |
|
} '=' gdeny_types ';' |
| 3442 |
|
{ |
| 3443 |
< |
if (ypass == 2) |
| 3443 |
> |
if (conf_parser_ctx.pass == 2) |
| 3444 |
|
{ |
| 3445 |
|
struct CollectItem *yy_tmp = NULL; |
| 3446 |
|
dlink_node *ptr, *next_ptr; |
| 3487 |
|
gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item; |
| 3488 |
|
gdeny_type_item: T_REJECT |
| 3489 |
|
{ |
| 3490 |
< |
if (ypass == 2) |
| 3490 |
> |
if (conf_parser_ctx.pass == 2) |
| 3491 |
|
yy_aconf->flags |= GDENY_REJECT; |
| 3492 |
|
} | T_BLOCK |
| 3493 |
|
{ |
| 3494 |
< |
if (ypass == 2) |
| 3494 |
> |
if (conf_parser_ctx.pass == 2) |
| 3495 |
|
yy_aconf->flags |= GDENY_BLOCK; |
| 3496 |
|
}; |
| 3497 |
|
|
| 3511 |
|
channel_no_create_on_split | channel_restrict_channels | |
| 3512 |
|
channel_no_join_on_split | channel_burst_topicwho | |
| 3513 |
|
channel_jflood_count | channel_jflood_time | |
| 3514 |
< |
error; |
| 3514 |
> |
channel_disable_fake_channels | error; |
| 3515 |
> |
|
| 3516 |
> |
channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';' |
| 3517 |
> |
{ |
| 3518 |
> |
ConfigChannel.disable_fake_channels = yylval.number; |
| 3519 |
> |
}; |
| 3520 |
|
|
| 3521 |
|
channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';' |
| 3522 |
|
{ |
| 3619 |
|
|
| 3620 |
|
serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';' |
| 3621 |
|
{ |
| 3622 |
< |
if (ypass == 2) |
| 3622 |
> |
if (conf_parser_ctx.pass == 2) |
| 3623 |
|
ConfigServerHide.flatten_links = yylval.number; |
| 3624 |
|
}; |
| 3625 |
|
|
| 3626 |
|
serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';' |
| 3627 |
|
{ |
| 3628 |
< |
if (ypass == 2) |
| 3628 |
> |
if (conf_parser_ctx.pass == 2) |
| 3629 |
|
ConfigServerHide.hide_servers = yylval.number; |
| 3630 |
|
}; |
| 3631 |
|
|
| 3632 |
|
serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';' |
| 3633 |
|
{ |
| 3634 |
< |
if (ypass == 2) |
| 3634 |
> |
if (conf_parser_ctx.pass == 2) |
| 3635 |
|
{ |
| 3636 |
|
MyFree(ConfigServerHide.hidden_name); |
| 3637 |
|
DupString(ConfigServerHide.hidden_name, yylval.string); |
| 3640 |
|
|
| 3641 |
|
serverhide_links_delay: LINKS_DELAY '=' timespec ';' |
| 3642 |
|
{ |
| 3643 |
< |
if (ypass == 2) |
| 3643 |
> |
if (conf_parser_ctx.pass == 2) |
| 3644 |
|
{ |
| 3645 |
|
if (($3 > 0) && ConfigServerHide.links_disabled == 1) |
| 3646 |
|
{ |
| 3654 |
|
|
| 3655 |
|
serverhide_hidden: HIDDEN '=' TBOOL ';' |
| 3656 |
|
{ |
| 3657 |
< |
if (ypass == 2) |
| 3657 |
> |
if (conf_parser_ctx.pass == 2) |
| 3658 |
|
ConfigServerHide.hidden = yylval.number; |
| 3659 |
|
}; |
| 3660 |
|
|
| 3661 |
|
serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';' |
| 3662 |
|
{ |
| 3663 |
< |
if (ypass == 2) |
| 3663 |
> |
if (conf_parser_ctx.pass == 2) |
| 3664 |
|
ConfigServerHide.disable_hidden = yylval.number; |
| 3665 |
|
}; |
| 3666 |
|
|
| 3667 |
|
serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';' |
| 3668 |
|
{ |
| 3669 |
< |
if (ypass == 2) |
| 3669 |
> |
if (conf_parser_ctx.pass == 2) |
| 3670 |
|
ConfigServerHide.hide_server_ips = yylval.number; |
| 3671 |
|
}; |