| 26 |
|
|
| 27 |
|
#define YY_NO_UNPUT |
| 28 |
|
#include <sys/types.h> |
| 29 |
+ |
#include <string.h> |
| 30 |
|
|
| 31 |
|
#include "stdinc.h" |
| 31 |
– |
#include "dalloca.h" |
| 32 |
|
#include "ircd.h" |
| 33 |
|
#include "tools.h" |
| 34 |
|
#include "list.h" |
| 42 |
|
#include "sprintf_irc.h" |
| 43 |
|
#include "memory.h" |
| 44 |
|
#include "modules.h" |
| 45 |
< |
#include "s_serv.h" /* for CAP_LL / IsCapable */ |
| 45 |
> |
#include "s_serv.h" |
| 46 |
|
#include "hostmask.h" |
| 47 |
|
#include "send.h" |
| 48 |
|
#include "listener.h" |
| 79 |
|
static char *listener_address = NULL; |
| 80 |
|
static int not_atom = 0; |
| 81 |
|
|
| 82 |
< |
struct CollectItem { |
| 82 |
> |
struct CollectItem |
| 83 |
> |
{ |
| 84 |
|
dlink_node node; |
| 85 |
|
char *name; |
| 86 |
|
char *user; |
| 170 |
|
%token DESCRIPTION |
| 171 |
|
%token DIE |
| 172 |
|
%token DISABLE_AUTH |
| 173 |
+ |
%token DISABLE_FAKE_CHANNELS |
| 174 |
|
%token DISABLE_HIDDEN |
| 175 |
|
%token DISABLE_LOCAL_CHANNELS |
| 176 |
|
%token DISABLE_REMOTE_COMMANDS |
| 230 |
|
%token KLINE_WITH_REASON |
| 231 |
|
%token KNOCK_DELAY |
| 232 |
|
%token KNOCK_DELAY_CHANNEL |
| 231 |
– |
%token LAZYLINK |
| 233 |
|
%token LEAF_MASK |
| 234 |
|
%token LINKS_DELAY |
| 235 |
|
%token LISTEN |
| 246 |
|
%token MAX_NICK_TIME |
| 247 |
|
%token MAX_NUMBER |
| 248 |
|
%token MAX_TARGETS |
| 249 |
+ |
%token MAX_WATCH |
| 250 |
|
%token MESSAGE_LOCALE |
| 251 |
|
%token MIN_NONWILDCARD |
| 252 |
|
%token MIN_NONWILDCARD_SIMPLE |
| 300 |
|
%token RSA_PRIVATE_KEY_FILE |
| 301 |
|
%token RSA_PUBLIC_KEY_FILE |
| 302 |
|
%token SSL_CERTIFICATE_FILE |
| 303 |
+ |
%token T_SSL_CONNECTION_METHOD |
| 304 |
+ |
%token T_SSLV3 |
| 305 |
+ |
%token T_TLSV1 |
| 306 |
|
%token RESV |
| 307 |
|
%token RESV_EXEMPT |
| 308 |
|
%token SECONDS MINUTES HOURS DAYS WEEKS |
| 320 |
|
%token SILENT |
| 321 |
|
%token SPOOF |
| 322 |
|
%token SPOOF_NOTICE |
| 323 |
+ |
%token STATS_E_DISABLED |
| 324 |
|
%token STATS_I_OPER_ONLY |
| 325 |
|
%token STATS_K_OPER_ONLY |
| 326 |
|
%token STATS_O_OPER_ONLY |
| 336 |
|
%token T_SOFTCALLERID |
| 337 |
|
%token T_CALLERID |
| 338 |
|
%token T_CCONN |
| 339 |
+ |
%token T_CCONN_FULL |
| 340 |
|
%token T_CLIENT_FLOOD |
| 341 |
|
%token T_DEAF |
| 342 |
|
%token T_DEBUG |
| 359 |
|
%token T_NCHANGE |
| 360 |
|
%token T_OPERWALL |
| 361 |
|
%token T_REJ |
| 362 |
+ |
%token T_SERVER |
| 363 |
|
%token T_SERVNOTICE |
| 364 |
|
%token T_SKILL |
| 365 |
|
%token T_SPY |
| 473 |
|
modules_module: MODULE '=' QSTRING ';' |
| 474 |
|
{ |
| 475 |
|
#ifndef STATIC_MODULES /* NOOP in the static case */ |
| 476 |
< |
if (ypass == 2) |
| 477 |
< |
{ |
| 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 |
< |
} |
| 476 |
> |
if (conf_parser_ctx.pass == 2) |
| 477 |
> |
add_conf_module(libio_basename(yylval.string)); |
| 478 |
|
#endif |
| 479 |
|
}; |
| 480 |
|
|
| 481 |
|
modules_path: PATH '=' QSTRING ';' |
| 482 |
|
{ |
| 483 |
|
#ifndef STATIC_MODULES |
| 484 |
< |
if (ypass == 2) |
| 484 |
> |
if (conf_parser_ctx.pass == 2) |
| 485 |
|
mod_add_path(yylval.string); |
| 486 |
|
#endif |
| 487 |
|
}; |
| 488 |
|
|
| 490 |
– |
/*************************************************************************** |
| 491 |
– |
* section serverinfo |
| 492 |
– |
***************************************************************************/ |
| 493 |
– |
serverinfo_entry: SERVERINFO |
| 494 |
– |
'{' serverinfo_items '}' ';'; |
| 489 |
|
|
| 490 |
< |
serverinfo_items: serverinfo_items serverinfo_item | |
| 491 |
< |
serverinfo_item ; |
| 490 |
> |
serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';'; |
| 491 |
> |
|
| 492 |
> |
serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ; |
| 493 |
|
serverinfo_item: serverinfo_name | serverinfo_vhost | |
| 494 |
|
serverinfo_hub | serverinfo_description | |
| 495 |
|
serverinfo_network_name | serverinfo_network_desc | |
| 496 |
|
serverinfo_max_clients | |
| 497 |
|
serverinfo_rsa_private_key_file | serverinfo_vhost6 | |
| 498 |
|
serverinfo_sid | serverinfo_ssl_certificate_file | |
| 499 |
+ |
serverinfo_ssl_connection_method | |
| 500 |
|
error ';' ; |
| 501 |
|
|
| 502 |
+ |
|
| 503 |
+ |
serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD |
| 504 |
+ |
{ |
| 505 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 506 |
+ |
ServerInfo.tls_version = 0; |
| 507 |
+ |
} '=' method_types ';' |
| 508 |
+ |
{ |
| 509 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 510 |
+ |
{ |
| 511 |
+ |
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3)) |
| 512 |
+ |
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3); |
| 513 |
+ |
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1)) |
| 514 |
+ |
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); |
| 515 |
+ |
} |
| 516 |
+ |
}; |
| 517 |
+ |
|
| 518 |
+ |
method_types: method_types ',' method_type_item | method_type_item; |
| 519 |
+ |
method_type_item: T_SSLV3 |
| 520 |
+ |
{ |
| 521 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 522 |
+ |
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3; |
| 523 |
+ |
} | T_TLSV1 |
| 524 |
+ |
{ |
| 525 |
+ |
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 526 |
+ |
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1; |
| 527 |
+ |
}; |
| 528 |
+ |
|
| 529 |
|
serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' |
| 530 |
|
{ |
| 531 |
|
#ifdef HAVE_LIBCRYPTO |
| 532 |
< |
if (ypass == 2 && ServerInfo.ctx) |
| 532 |
> |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 533 |
|
{ |
| 534 |
|
if (!ServerInfo.rsa_private_key_file) |
| 535 |
|
{ |
| 537 |
|
break; |
| 538 |
|
} |
| 539 |
|
|
| 540 |
< |
if (SSL_CTX_use_certificate_file(ServerInfo.ctx, |
| 541 |
< |
yylval.string, SSL_FILETYPE_PEM) <= 0) |
| 540 |
> |
if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string, |
| 541 |
> |
SSL_FILETYPE_PEM) <= 0) |
| 542 |
|
{ |
| 543 |
|
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 544 |
|
break; |
| 545 |
|
} |
| 546 |
|
|
| 547 |
< |
if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx, |
| 548 |
< |
ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0) |
| 547 |
> |
if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file, |
| 548 |
> |
SSL_FILETYPE_PEM) <= 0) |
| 549 |
|
{ |
| 550 |
|
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 551 |
|
break; |
| 552 |
|
} |
| 553 |
|
|
| 554 |
< |
if (!SSL_CTX_check_private_key(ServerInfo.ctx)) |
| 554 |
> |
if (!SSL_CTX_check_private_key(ServerInfo.server_ctx)) |
| 555 |
|
{ |
| 556 |
< |
yyerror("RSA private key does not match the SSL certificate public key!"); |
| 556 |
> |
yyerror(ERR_lib_error_string(ERR_get_error())); |
| 557 |
|
break; |
| 558 |
|
} |
| 559 |
|
} |
| 563 |
|
serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';' |
| 564 |
|
{ |
| 565 |
|
#ifdef HAVE_LIBCRYPTO |
| 566 |
< |
if (ypass == 1) |
| 566 |
> |
if (conf_parser_ctx.pass == 1) |
| 567 |
|
{ |
| 568 |
|
BIO *file; |
| 569 |
|
|
| 623 |
|
serverinfo_name: NAME '=' QSTRING ';' |
| 624 |
|
{ |
| 625 |
|
/* this isn't rehashable */ |
| 626 |
< |
if (ypass == 2) |
| 626 |
> |
if (conf_parser_ctx.pass == 2) |
| 627 |
|
{ |
| 628 |
|
if (ServerInfo.name == NULL) |
| 629 |
|
{ |
| 637 |
|
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 638 |
|
{ |
| 639 |
|
/* this isn't rehashable */ |
| 640 |
< |
if (ypass == 2 && !ServerInfo.sid) |
| 640 |
> |
if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) |
| 641 |
|
{ |
| 642 |
< |
if ((strlen(yylval.string) == IRC_MAXSID) && IsDigit(yylval.string[0]) |
| 620 |
< |
&& IsAlNum(yylval.string[1]) && IsAlNum(yylval.string[2])) |
| 621 |
< |
{ |
| 642 |
> |
if (valid_sid(yylval.string)) |
| 643 |
|
DupString(ServerInfo.sid, yylval.string); |
| 623 |
– |
} |
| 644 |
|
else |
| 645 |
|
{ |
| 646 |
|
ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting."); |
| 651 |
|
|
| 652 |
|
serverinfo_description: DESCRIPTION '=' QSTRING ';' |
| 653 |
|
{ |
| 654 |
< |
if (ypass == 2) |
| 654 |
> |
if (conf_parser_ctx.pass == 2) |
| 655 |
|
{ |
| 656 |
|
MyFree(ServerInfo.description); |
| 657 |
|
DupString(ServerInfo.description,yylval.string); |
| 660 |
|
|
| 661 |
|
serverinfo_network_name: NETWORK_NAME '=' QSTRING ';' |
| 662 |
|
{ |
| 663 |
< |
if (ypass == 2) |
| 663 |
> |
if (conf_parser_ctx.pass == 2) |
| 664 |
|
{ |
| 665 |
|
char *p; |
| 666 |
|
|
| 674 |
|
|
| 675 |
|
serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';' |
| 676 |
|
{ |
| 677 |
< |
if (ypass == 2) |
| 677 |
> |
if (conf_parser_ctx.pass == 2) |
| 678 |
|
{ |
| 679 |
|
MyFree(ServerInfo.network_desc); |
| 680 |
|
DupString(ServerInfo.network_desc, yylval.string); |
| 683 |
|
|
| 684 |
|
serverinfo_vhost: VHOST '=' QSTRING ';' |
| 685 |
|
{ |
| 686 |
< |
if (ypass == 2 && *yylval.string != '*') |
| 686 |
> |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 687 |
|
{ |
| 688 |
|
struct addrinfo hints, *res; |
| 689 |
|
|
| 712 |
|
serverinfo_vhost6: VHOST6 '=' QSTRING ';' |
| 713 |
|
{ |
| 714 |
|
#ifdef IPV6 |
| 715 |
< |
if (ypass == 2 && *yylval.string != '*') |
| 715 |
> |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 716 |
|
{ |
| 717 |
|
struct addrinfo hints, *res; |
| 718 |
|
|
| 741 |
|
|
| 742 |
|
serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';' |
| 743 |
|
{ |
| 744 |
< |
if (ypass == 2) |
| 744 |
> |
if (conf_parser_ctx.pass == 2) |
| 745 |
|
{ |
| 746 |
|
recalc_fdlimit(NULL); |
| 747 |
|
|
| 764 |
|
|
| 765 |
|
serverinfo_hub: HUB '=' TBOOL ';' |
| 766 |
|
{ |
| 767 |
< |
if (ypass == 2) |
| 767 |
> |
if (conf_parser_ctx.pass == 2) |
| 768 |
|
{ |
| 769 |
|
if (yylval.number) |
| 770 |
|
{ |
| 771 |
< |
/* Don't become a hub if we have a lazylink active. */ |
| 772 |
< |
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL)) |
| 773 |
< |
{ |
| 754 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 755 |
< |
"Ignoring config file line hub=yes; " |
| 756 |
< |
"due to active LazyLink (%s)", uplink->name); |
| 757 |
< |
} |
| 758 |
< |
else |
| 759 |
< |
{ |
| 760 |
< |
ServerInfo.hub = 1; |
| 761 |
< |
uplink = NULL; |
| 762 |
< |
delete_capability("HUB"); |
| 763 |
< |
add_capability("HUB", CAP_HUB, 1); |
| 764 |
< |
} |
| 771 |
> |
ServerInfo.hub = 1; |
| 772 |
> |
delete_capability("HUB"); |
| 773 |
> |
add_capability("HUB", CAP_HUB, 1); |
| 774 |
|
} |
| 775 |
|
else if (ServerInfo.hub) |
| 776 |
|
{ |
| 768 |
– |
dlink_node *ptr = NULL; |
| 777 |
|
|
| 778 |
|
ServerInfo.hub = 0; |
| 779 |
|
delete_capability("HUB"); |
| 772 |
– |
|
| 773 |
– |
/* Don't become a leaf if we have a lazylink active. */ |
| 774 |
– |
DLINK_FOREACH(ptr, serv_list.head) |
| 775 |
– |
{ |
| 776 |
– |
const struct Client *acptr = ptr->data; |
| 777 |
– |
if (MyConnect(acptr) && IsCapable(acptr, CAP_LL)) |
| 778 |
– |
{ |
| 779 |
– |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 780 |
– |
"Ignoring config file line hub=no; " |
| 781 |
– |
"due to active LazyLink (%s)", |
| 782 |
– |
acptr->name); |
| 783 |
– |
add_capability("HUB", CAP_HUB, 1); |
| 784 |
– |
ServerInfo.hub = 1; |
| 785 |
– |
break; |
| 786 |
– |
} |
| 787 |
– |
} |
| 780 |
|
} |
| 781 |
|
} |
| 782 |
|
}; |
| 792 |
|
|
| 793 |
|
admin_name: NAME '=' QSTRING ';' |
| 794 |
|
{ |
| 795 |
< |
if (ypass == 2) |
| 795 |
> |
if (conf_parser_ctx.pass == 2) |
| 796 |
|
{ |
| 797 |
|
MyFree(AdminInfo.name); |
| 798 |
|
DupString(AdminInfo.name, yylval.string); |
| 801 |
|
|
| 802 |
|
admin_email: EMAIL '=' QSTRING ';' |
| 803 |
|
{ |
| 804 |
< |
if (ypass == 2) |
| 804 |
> |
if (conf_parser_ctx.pass == 2) |
| 805 |
|
{ |
| 806 |
|
MyFree(AdminInfo.email); |
| 807 |
|
DupString(AdminInfo.email, yylval.string); |
| 810 |
|
|
| 811 |
|
admin_description: DESCRIPTION '=' QSTRING ';' |
| 812 |
|
{ |
| 813 |
< |
if (ypass == 2) |
| 813 |
> |
if (conf_parser_ctx.pass == 2) |
| 814 |
|
{ |
| 815 |
|
MyFree(AdminInfo.description); |
| 816 |
|
DupString(AdminInfo.description, yylval.string); |
| 845 |
|
|
| 846 |
|
logging_fuserlog: FUSERLOG '=' QSTRING ';' |
| 847 |
|
{ |
| 848 |
< |
if (ypass == 2) |
| 848 |
> |
if (conf_parser_ctx.pass == 2) |
| 849 |
|
strlcpy(ConfigLoggingEntry.userlog, yylval.string, |
| 850 |
|
sizeof(ConfigLoggingEntry.userlog)); |
| 851 |
|
}; |
| 852 |
|
|
| 853 |
|
logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';' |
| 854 |
|
{ |
| 855 |
< |
if (ypass == 2) |
| 855 |
> |
if (conf_parser_ctx.pass == 2) |
| 856 |
|
strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string, |
| 857 |
|
sizeof(ConfigLoggingEntry.failed_operlog)); |
| 858 |
|
}; |
| 859 |
|
|
| 860 |
|
logging_foperlog: FOPERLOG '=' QSTRING ';' |
| 861 |
|
{ |
| 862 |
< |
if (ypass == 2) |
| 862 |
> |
if (conf_parser_ctx.pass == 2) |
| 863 |
|
strlcpy(ConfigLoggingEntry.operlog, yylval.string, |
| 864 |
|
sizeof(ConfigLoggingEntry.operlog)); |
| 865 |
|
}; |
| 866 |
|
|
| 867 |
|
logging_foperspylog: FOPERSPYLOG '=' QSTRING ';' |
| 868 |
|
{ |
| 869 |
< |
if (ypass == 2) |
| 869 |
> |
if (conf_parser_ctx.pass == 2) |
| 870 |
|
strlcpy(ConfigLoggingEntry.operspylog, yylval.string, |
| 871 |
|
sizeof(ConfigLoggingEntry.operspylog)); |
| 872 |
|
}; |
| 873 |
|
|
| 874 |
|
logging_fglinelog: FGLINELOG '=' QSTRING ';' |
| 875 |
|
{ |
| 876 |
< |
if (ypass == 2) |
| 876 |
> |
if (conf_parser_ctx.pass == 2) |
| 877 |
|
strlcpy(ConfigLoggingEntry.glinelog, yylval.string, |
| 878 |
|
sizeof(ConfigLoggingEntry.glinelog)); |
| 879 |
|
}; |
| 880 |
|
|
| 881 |
|
logging_fklinelog: FKLINELOG '=' QSTRING ';' |
| 882 |
|
{ |
| 883 |
< |
if (ypass == 2) |
| 883 |
> |
if (conf_parser_ctx.pass == 2) |
| 884 |
|
strlcpy(ConfigLoggingEntry.klinelog, yylval.string, |
| 885 |
|
sizeof(ConfigLoggingEntry.klinelog)); |
| 886 |
|
}; |
| 887 |
|
|
| 888 |
|
logging_ioerrlog: FIOERRLOG '=' QSTRING ';' |
| 889 |
|
{ |
| 890 |
< |
if (ypass == 2) |
| 890 |
> |
if (conf_parser_ctx.pass == 2) |
| 891 |
|
strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string, |
| 892 |
|
sizeof(ConfigLoggingEntry.ioerrlog)); |
| 893 |
|
}; |
| 894 |
|
|
| 895 |
|
logging_killlog: FKILLLOG '=' QSTRING ';' |
| 896 |
|
{ |
| 897 |
< |
if (ypass == 2) |
| 897 |
> |
if (conf_parser_ctx.pass == 2) |
| 898 |
|
strlcpy(ConfigLoggingEntry.killlog, yylval.string, |
| 899 |
|
sizeof(ConfigLoggingEntry.killlog)); |
| 900 |
|
}; |
| 901 |
|
|
| 902 |
|
logging_log_level: LOG_LEVEL '=' T_L_CRIT ';' |
| 903 |
|
{ |
| 904 |
< |
if (ypass == 2) |
| 904 |
> |
if (conf_parser_ctx.pass == 2) |
| 905 |
|
set_log_level(L_CRIT); |
| 906 |
|
} | LOG_LEVEL '=' T_L_ERROR ';' |
| 907 |
|
{ |
| 908 |
< |
if (ypass == 2) |
| 908 |
> |
if (conf_parser_ctx.pass == 2) |
| 909 |
|
set_log_level(L_ERROR); |
| 910 |
|
} | LOG_LEVEL '=' T_L_WARN ';' |
| 911 |
|
{ |
| 912 |
< |
if (ypass == 2) |
| 912 |
> |
if (conf_parser_ctx.pass == 2) |
| 913 |
|
set_log_level(L_WARN); |
| 914 |
|
} | LOG_LEVEL '=' T_L_NOTICE ';' |
| 915 |
|
{ |
| 916 |
< |
if (ypass == 2) |
| 916 |
> |
if (conf_parser_ctx.pass == 2) |
| 917 |
|
set_log_level(L_NOTICE); |
| 918 |
|
} | LOG_LEVEL '=' T_L_TRACE ';' |
| 919 |
|
{ |
| 920 |
< |
if (ypass == 2) |
| 920 |
> |
if (conf_parser_ctx.pass == 2) |
| 921 |
|
set_log_level(L_TRACE); |
| 922 |
|
} | LOG_LEVEL '=' T_L_INFO ';' |
| 923 |
|
{ |
| 924 |
< |
if (ypass == 2) |
| 924 |
> |
if (conf_parser_ctx.pass == 2) |
| 925 |
|
set_log_level(L_INFO); |
| 926 |
|
} | LOG_LEVEL '=' T_L_DEBUG ';' |
| 927 |
|
{ |
| 928 |
< |
if (ypass == 2) |
| 928 |
> |
if (conf_parser_ctx.pass == 2) |
| 929 |
|
set_log_level(L_DEBUG); |
| 930 |
|
}; |
| 931 |
|
|
| 932 |
|
logging_use_logging: USE_LOGGING '=' TBOOL ';' |
| 933 |
|
{ |
| 934 |
< |
if (ypass == 2) |
| 934 |
> |
if (conf_parser_ctx.pass == 2) |
| 935 |
|
ConfigLoggingEntry.use_logging = yylval.number; |
| 936 |
|
}; |
| 937 |
|
|
| 940 |
|
***************************************************************************/ |
| 941 |
|
oper_entry: OPERATOR |
| 942 |
|
{ |
| 943 |
< |
if (ypass == 2) |
| 943 |
> |
if (conf_parser_ctx.pass == 2) |
| 944 |
|
{ |
| 945 |
|
yy_conf = make_conf_item(OPER_TYPE); |
| 946 |
|
yy_aconf = map_to_conf(yy_conf); |
| 953 |
|
} |
| 954 |
|
} oper_name_b '{' oper_items '}' ';' |
| 955 |
|
{ |
| 956 |
< |
if (ypass == 2) |
| 956 |
> |
if (conf_parser_ctx.pass == 2) |
| 957 |
|
{ |
| 958 |
|
struct CollectItem *yy_tmp; |
| 959 |
|
dlink_node *ptr; |
| 1045 |
|
|
| 1046 |
|
oper_name: NAME '=' QSTRING ';' |
| 1047 |
|
{ |
| 1048 |
< |
if (ypass == 2) |
| 1048 |
> |
if (conf_parser_ctx.pass == 2) |
| 1049 |
|
{ |
| 1050 |
|
if (strlen(yylval.string) > OPERNICKLEN) |
| 1051 |
|
yylval.string[OPERNICKLEN] = '\0'; |
| 1057 |
|
|
| 1058 |
|
oper_name_t: QSTRING |
| 1059 |
|
{ |
| 1060 |
< |
if (ypass == 2) |
| 1060 |
> |
if (conf_parser_ctx.pass == 2) |
| 1061 |
|
{ |
| 1062 |
|
if (strlen(yylval.string) > OPERNICKLEN) |
| 1063 |
|
yylval.string[OPERNICKLEN] = '\0'; |
| 1069 |
|
|
| 1070 |
|
oper_user: USER '=' QSTRING ';' |
| 1071 |
|
{ |
| 1072 |
< |
if (ypass == 2) |
| 1072 |
> |
if (conf_parser_ctx.pass == 2) |
| 1073 |
|
{ |
| 1074 |
< |
struct CollectItem *yy_tmp; |
| 1074 |
> |
struct split_nuh_item nuh; |
| 1075 |
> |
|
| 1076 |
> |
nuh.nuhmask = yylval.string; |
| 1077 |
> |
nuh.nickptr = NULL; |
| 1078 |
> |
nuh.userptr = userbuf; |
| 1079 |
> |
nuh.hostptr = hostbuf; |
| 1080 |
> |
|
| 1081 |
> |
nuh.nicksize = 0; |
| 1082 |
> |
nuh.usersize = sizeof(userbuf); |
| 1083 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 1084 |
> |
|
| 1085 |
> |
split_nuh(&nuh); |
| 1086 |
|
|
| 1087 |
|
if (yy_aconf->user == NULL) |
| 1088 |
|
{ |
| 1089 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 1089 |
> |
DupString(yy_aconf->user, userbuf); |
| 1090 |
> |
DupString(yy_aconf->host, hostbuf); |
| 1091 |
|
} |
| 1092 |
|
else |
| 1093 |
|
{ |
| 1094 |
< |
yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem)); |
| 1095 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 1094 |
> |
struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 1095 |
> |
|
| 1096 |
> |
DupString(yy_tmp->user, userbuf); |
| 1097 |
> |
DupString(yy_tmp->host, hostbuf); |
| 1098 |
> |
|
| 1099 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 1100 |
|
} |
| 1101 |
|
} |
| 1103 |
|
|
| 1104 |
|
oper_password: PASSWORD '=' QSTRING ';' |
| 1105 |
|
{ |
| 1106 |
< |
if (ypass == 2) |
| 1106 |
> |
if (conf_parser_ctx.pass == 2) |
| 1107 |
|
{ |
| 1108 |
|
if (yy_aconf->passwd != NULL) |
| 1109 |
|
memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd)); |
| 1115 |
|
|
| 1116 |
|
oper_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1117 |
|
{ |
| 1118 |
< |
if (ypass == 2) |
| 1118 |
> |
if (conf_parser_ctx.pass == 2) |
| 1119 |
|
{ |
| 1120 |
|
if (yylval.number) |
| 1121 |
|
SetConfEncrypted(yy_aconf); |
| 1127 |
|
oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 1128 |
|
{ |
| 1129 |
|
#ifdef HAVE_LIBCRYPTO |
| 1130 |
< |
if (ypass == 2) |
| 1130 |
> |
if (conf_parser_ctx.pass == 2) |
| 1131 |
|
{ |
| 1132 |
|
BIO *file; |
| 1133 |
|
|
| 1168 |
|
|
| 1169 |
|
oper_class: CLASS '=' QSTRING ';' |
| 1170 |
|
{ |
| 1171 |
< |
if (ypass == 2) |
| 1171 |
> |
if (conf_parser_ctx.pass == 2) |
| 1172 |
|
{ |
| 1173 |
|
MyFree(class_name); |
| 1174 |
|
DupString(class_name, yylval.string); |
| 1177 |
|
|
| 1178 |
|
oper_umodes: T_UMODES |
| 1179 |
|
{ |
| 1180 |
< |
if (ypass == 2) |
| 1180 |
> |
if (conf_parser_ctx.pass == 2) |
| 1181 |
|
yy_aconf->modes = 0; |
| 1182 |
|
} '=' oper_umodes_items ';' ; |
| 1183 |
|
|
| 1184 |
|
oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item; |
| 1185 |
|
oper_umodes_item: T_BOTS |
| 1186 |
|
{ |
| 1187 |
< |
if (ypass == 2) |
| 1187 |
> |
if (conf_parser_ctx.pass == 2) |
| 1188 |
|
yy_aconf->modes |= UMODE_BOTS; |
| 1189 |
|
} | T_CCONN |
| 1190 |
|
{ |
| 1191 |
< |
if (ypass == 2) |
| 1191 |
> |
if (conf_parser_ctx.pass == 2) |
| 1192 |
|
yy_aconf->modes |= UMODE_CCONN; |
| 1193 |
+ |
} | T_CCONN_FULL |
| 1194 |
+ |
{ |
| 1195 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1196 |
+ |
yy_aconf->modes |= UMODE_CCONN_FULL; |
| 1197 |
|
} | T_DEAF |
| 1198 |
|
{ |
| 1199 |
< |
if (ypass == 2) |
| 1199 |
> |
if (conf_parser_ctx.pass == 2) |
| 1200 |
|
yy_aconf->modes |= UMODE_DEAF; |
| 1201 |
|
} | T_DEBUG |
| 1202 |
|
{ |
| 1203 |
< |
if (ypass == 2) |
| 1203 |
> |
if (conf_parser_ctx.pass == 2) |
| 1204 |
|
yy_aconf->modes |= UMODE_DEBUG; |
| 1205 |
|
} | T_FULL |
| 1206 |
|
{ |
| 1207 |
< |
if (ypass == 2) |
| 1207 |
> |
if (conf_parser_ctx.pass == 2) |
| 1208 |
|
yy_aconf->modes |= UMODE_FULL; |
| 1209 |
|
} | T_SKILL |
| 1210 |
|
{ |
| 1211 |
< |
if (ypass == 2) |
| 1211 |
> |
if (conf_parser_ctx.pass == 2) |
| 1212 |
|
yy_aconf->modes |= UMODE_SKILL; |
| 1213 |
|
} | T_NCHANGE |
| 1214 |
|
{ |
| 1215 |
< |
if (ypass == 2) |
| 1215 |
> |
if (conf_parser_ctx.pass == 2) |
| 1216 |
|
yy_aconf->modes |= UMODE_NCHANGE; |
| 1217 |
|
} | T_REJ |
| 1218 |
|
{ |
| 1219 |
< |
if (ypass == 2) |
| 1219 |
> |
if (conf_parser_ctx.pass == 2) |
| 1220 |
|
yy_aconf->modes |= UMODE_REJ; |
| 1221 |
|
} | T_UNAUTH |
| 1222 |
|
{ |
| 1223 |
< |
if (ypass == 2) |
| 1223 |
> |
if (conf_parser_ctx.pass == 2) |
| 1224 |
|
yy_aconf->modes |= UMODE_UNAUTH; |
| 1225 |
|
} | T_SPY |
| 1226 |
|
{ |
| 1227 |
< |
if (ypass == 2) |
| 1227 |
> |
if (conf_parser_ctx.pass == 2) |
| 1228 |
|
yy_aconf->modes |= UMODE_SPY; |
| 1229 |
|
} | T_EXTERNAL |
| 1230 |
|
{ |
| 1231 |
< |
if (ypass == 2) |
| 1231 |
> |
if (conf_parser_ctx.pass == 2) |
| 1232 |
|
yy_aconf->modes |= UMODE_EXTERNAL; |
| 1233 |
|
} | T_OPERWALL |
| 1234 |
|
{ |
| 1235 |
< |
if (ypass == 2) |
| 1235 |
> |
if (conf_parser_ctx.pass == 2) |
| 1236 |
|
yy_aconf->modes |= UMODE_OPERWALL; |
| 1237 |
|
} | T_SERVNOTICE |
| 1238 |
|
{ |
| 1239 |
< |
if (ypass == 2) |
| 1239 |
> |
if (conf_parser_ctx.pass == 2) |
| 1240 |
|
yy_aconf->modes |= UMODE_SERVNOTICE; |
| 1241 |
|
} | T_INVISIBLE |
| 1242 |
|
{ |
| 1243 |
< |
if (ypass == 2) |
| 1243 |
> |
if (conf_parser_ctx.pass == 2) |
| 1244 |
|
yy_aconf->modes |= UMODE_INVISIBLE; |
| 1245 |
|
} | T_WALLOP |
| 1246 |
|
{ |
| 1247 |
< |
if (ypass == 2) |
| 1247 |
> |
if (conf_parser_ctx.pass == 2) |
| 1248 |
|
yy_aconf->modes |= UMODE_WALLOP; |
| 1249 |
|
} | T_SOFTCALLERID |
| 1250 |
|
{ |
| 1251 |
< |
if (ypass == 2) |
| 1251 |
> |
if (conf_parser_ctx.pass == 2) |
| 1252 |
|
yy_aconf->modes |= UMODE_SOFTCALLERID; |
| 1253 |
|
} | T_CALLERID |
| 1254 |
|
{ |
| 1255 |
< |
if (ypass == 2) |
| 1255 |
> |
if (conf_parser_ctx.pass == 2) |
| 1256 |
|
yy_aconf->modes |= UMODE_CALLERID; |
| 1257 |
|
} | T_LOCOPS |
| 1258 |
|
{ |
| 1259 |
< |
if (ypass == 2) |
| 1259 |
> |
if (conf_parser_ctx.pass == 2) |
| 1260 |
|
yy_aconf->modes |= UMODE_LOCOPS; |
| 1261 |
|
}; |
| 1262 |
|
|
| 1263 |
|
oper_global_kill: GLOBAL_KILL '=' TBOOL ';' |
| 1264 |
|
{ |
| 1265 |
< |
if (ypass == 2) |
| 1265 |
> |
if (conf_parser_ctx.pass == 2) |
| 1266 |
|
{ |
| 1267 |
|
if (yylval.number) |
| 1268 |
|
yy_aconf->port |= OPER_FLAG_GLOBAL_KILL; |
| 1273 |
|
|
| 1274 |
|
oper_remote: REMOTE '=' TBOOL ';' |
| 1275 |
|
{ |
| 1276 |
< |
if (ypass == 2) |
| 1276 |
> |
if (conf_parser_ctx.pass == 2) |
| 1277 |
|
{ |
| 1278 |
|
if (yylval.number) |
| 1279 |
|
yy_aconf->port |= OPER_FLAG_REMOTE; |
| 1284 |
|
|
| 1285 |
|
oper_remoteban: REMOTEBAN '=' TBOOL ';' |
| 1286 |
|
{ |
| 1287 |
< |
if (ypass == 2) |
| 1287 |
> |
if (conf_parser_ctx.pass == 2) |
| 1288 |
|
{ |
| 1289 |
|
if (yylval.number) |
| 1290 |
|
yy_aconf->port |= OPER_FLAG_REMOTEBAN; |
| 1295 |
|
|
| 1296 |
|
oper_kline: KLINE '=' TBOOL ';' |
| 1297 |
|
{ |
| 1298 |
< |
if (ypass == 2) |
| 1298 |
> |
if (conf_parser_ctx.pass == 2) |
| 1299 |
|
{ |
| 1300 |
|
if (yylval.number) |
| 1301 |
|
yy_aconf->port |= OPER_FLAG_K; |
| 1306 |
|
|
| 1307 |
|
oper_xline: XLINE '=' TBOOL ';' |
| 1308 |
|
{ |
| 1309 |
< |
if (ypass == 2) |
| 1309 |
> |
if (conf_parser_ctx.pass == 2) |
| 1310 |
|
{ |
| 1311 |
|
if (yylval.number) |
| 1312 |
|
yy_aconf->port |= OPER_FLAG_X; |
| 1317 |
|
|
| 1318 |
|
oper_unkline: UNKLINE '=' TBOOL ';' |
| 1319 |
|
{ |
| 1320 |
< |
if (ypass == 2) |
| 1320 |
> |
if (conf_parser_ctx.pass == 2) |
| 1321 |
|
{ |
| 1322 |
|
if (yylval.number) |
| 1323 |
|
yy_aconf->port |= OPER_FLAG_UNKLINE; |
| 1328 |
|
|
| 1329 |
|
oper_gline: GLINE '=' TBOOL ';' |
| 1330 |
|
{ |
| 1331 |
< |
if (ypass == 2) |
| 1331 |
> |
if (conf_parser_ctx.pass == 2) |
| 1332 |
|
{ |
| 1333 |
|
if (yylval.number) |
| 1334 |
|
yy_aconf->port |= OPER_FLAG_GLINE; |
| 1339 |
|
|
| 1340 |
|
oper_nick_changes: NICK_CHANGES '=' TBOOL ';' |
| 1341 |
|
{ |
| 1342 |
< |
if (ypass == 2) |
| 1342 |
> |
if (conf_parser_ctx.pass == 2) |
| 1343 |
|
{ |
| 1344 |
|
if (yylval.number) |
| 1345 |
|
yy_aconf->port |= OPER_FLAG_N; |
| 1350 |
|
|
| 1351 |
|
oper_die: DIE '=' TBOOL ';' |
| 1352 |
|
{ |
| 1353 |
< |
if (ypass == 2) |
| 1353 |
> |
if (conf_parser_ctx.pass == 2) |
| 1354 |
|
{ |
| 1355 |
|
if (yylval.number) |
| 1356 |
|
yy_aconf->port |= OPER_FLAG_DIE; |
| 1361 |
|
|
| 1362 |
|
oper_rehash: REHASH '=' TBOOL ';' |
| 1363 |
|
{ |
| 1364 |
< |
if (ypass == 2) |
| 1364 |
> |
if (conf_parser_ctx.pass == 2) |
| 1365 |
|
{ |
| 1366 |
|
if (yylval.number) |
| 1367 |
|
yy_aconf->port |= OPER_FLAG_REHASH; |
| 1372 |
|
|
| 1373 |
|
oper_admin: ADMIN '=' TBOOL ';' |
| 1374 |
|
{ |
| 1375 |
< |
if (ypass == 2) |
| 1375 |
> |
if (conf_parser_ctx.pass == 2) |
| 1376 |
|
{ |
| 1377 |
|
if (yylval.number) |
| 1378 |
|
yy_aconf->port |= OPER_FLAG_ADMIN; |
| 1383 |
|
|
| 1384 |
|
oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';' |
| 1385 |
|
{ |
| 1386 |
< |
if (ypass == 2) |
| 1386 |
> |
if (conf_parser_ctx.pass == 2) |
| 1387 |
|
{ |
| 1388 |
|
if (yylval.number) |
| 1389 |
|
yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN; |
| 1394 |
|
|
| 1395 |
|
oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';' |
| 1396 |
|
{ |
| 1397 |
< |
if (ypass == 2) |
| 1397 |
> |
if (conf_parser_ctx.pass == 2) |
| 1398 |
|
{ |
| 1399 |
|
if (yylval.number) |
| 1400 |
|
yy_aconf->port |= OPER_FLAG_HIDDEN_OPER; |
| 1405 |
|
|
| 1406 |
|
oper_operwall: T_OPERWALL '=' TBOOL ';' |
| 1407 |
|
{ |
| 1408 |
< |
if (ypass == 2) |
| 1408 |
> |
if (conf_parser_ctx.pass == 2) |
| 1409 |
|
{ |
| 1410 |
|
if (yylval.number) |
| 1411 |
|
yy_aconf->port |= OPER_FLAG_OPERWALL; |
| 1424 |
|
|
| 1425 |
|
oper_flags_item_atom: GLOBAL_KILL |
| 1426 |
|
{ |
| 1427 |
< |
if (ypass == 2) |
| 1427 |
> |
if (conf_parser_ctx.pass == 2) |
| 1428 |
|
{ |
| 1429 |
|
if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL; |
| 1430 |
|
else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL; |
| 1431 |
|
} |
| 1432 |
|
} | REMOTE |
| 1433 |
|
{ |
| 1434 |
< |
if (ypass == 2) |
| 1434 |
> |
if (conf_parser_ctx.pass == 2) |
| 1435 |
|
{ |
| 1436 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE; |
| 1437 |
|
else yy_aconf->port |= OPER_FLAG_REMOTE; |
| 1438 |
|
} |
| 1439 |
|
} | KLINE |
| 1440 |
|
{ |
| 1441 |
< |
if (ypass == 2) |
| 1441 |
> |
if (conf_parser_ctx.pass == 2) |
| 1442 |
|
{ |
| 1443 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_K; |
| 1444 |
|
else yy_aconf->port |= OPER_FLAG_K; |
| 1445 |
|
} |
| 1446 |
|
} | UNKLINE |
| 1447 |
|
{ |
| 1448 |
< |
if (ypass == 2) |
| 1448 |
> |
if (conf_parser_ctx.pass == 2) |
| 1449 |
|
{ |
| 1450 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE; |
| 1451 |
|
else yy_aconf->port |= OPER_FLAG_UNKLINE; |
| 1452 |
|
} |
| 1453 |
|
} | XLINE |
| 1454 |
|
{ |
| 1455 |
< |
if (ypass == 2) |
| 1455 |
> |
if (conf_parser_ctx.pass == 2) |
| 1456 |
|
{ |
| 1457 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_X; |
| 1458 |
|
else yy_aconf->port |= OPER_FLAG_X; |
| 1459 |
|
} |
| 1460 |
|
} | GLINE |
| 1461 |
|
{ |
| 1462 |
< |
if (ypass == 2) |
| 1462 |
> |
if (conf_parser_ctx.pass == 2) |
| 1463 |
|
{ |
| 1464 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE; |
| 1465 |
|
else yy_aconf->port |= OPER_FLAG_GLINE; |
| 1466 |
|
} |
| 1467 |
|
} | DIE |
| 1468 |
|
{ |
| 1469 |
< |
if (ypass == 2) |
| 1469 |
> |
if (conf_parser_ctx.pass == 2) |
| 1470 |
|
{ |
| 1471 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE; |
| 1472 |
|
else yy_aconf->port |= OPER_FLAG_DIE; |
| 1473 |
|
} |
| 1474 |
|
} | REHASH |
| 1475 |
|
{ |
| 1476 |
< |
if (ypass == 2) |
| 1476 |
> |
if (conf_parser_ctx.pass == 2) |
| 1477 |
|
{ |
| 1478 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH; |
| 1479 |
|
else yy_aconf->port |= OPER_FLAG_REHASH; |
| 1480 |
|
} |
| 1481 |
|
} | ADMIN |
| 1482 |
|
{ |
| 1483 |
< |
if (ypass == 2) |
| 1483 |
> |
if (conf_parser_ctx.pass == 2) |
| 1484 |
|
{ |
| 1485 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN; |
| 1486 |
|
else yy_aconf->port |= OPER_FLAG_ADMIN; |
| 1487 |
|
} |
| 1488 |
|
} | HIDDEN_ADMIN |
| 1489 |
|
{ |
| 1490 |
< |
if (ypass == 2) |
| 1490 |
> |
if (conf_parser_ctx.pass == 2) |
| 1491 |
|
{ |
| 1492 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN; |
| 1493 |
|
else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN; |
| 1494 |
|
} |
| 1495 |
|
} | NICK_CHANGES |
| 1496 |
|
{ |
| 1497 |
< |
if (ypass == 2) |
| 1497 |
> |
if (conf_parser_ctx.pass == 2) |
| 1498 |
|
{ |
| 1499 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_N; |
| 1500 |
|
else yy_aconf->port |= OPER_FLAG_N; |
| 1501 |
|
} |
| 1502 |
|
} | T_OPERWALL |
| 1503 |
|
{ |
| 1504 |
< |
if (ypass == 2) |
| 1504 |
> |
if (conf_parser_ctx.pass == 2) |
| 1505 |
|
{ |
| 1506 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL; |
| 1507 |
|
else yy_aconf->port |= OPER_FLAG_OPERWALL; |
| 1508 |
|
} |
| 1509 |
|
} | OPER_SPY_T |
| 1510 |
|
{ |
| 1511 |
< |
if (ypass == 2) |
| 1511 |
> |
if (conf_parser_ctx.pass == 2) |
| 1512 |
|
{ |
| 1513 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY; |
| 1514 |
|
else yy_aconf->port |= OPER_FLAG_OPER_SPY; |
| 1515 |
|
} |
| 1516 |
|
} | HIDDEN_OPER |
| 1517 |
|
{ |
| 1518 |
< |
if (ypass == 2) |
| 1518 |
> |
if (conf_parser_ctx.pass == 2) |
| 1519 |
|
{ |
| 1520 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER; |
| 1521 |
|
else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER; |
| 1522 |
|
} |
| 1523 |
|
} | REMOTEBAN |
| 1524 |
|
{ |
| 1525 |
< |
if (ypass == 2) |
| 1525 |
> |
if (conf_parser_ctx.pass == 2) |
| 1526 |
|
{ |
| 1527 |
|
if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN; |
| 1528 |
|
else yy_aconf->port |= OPER_FLAG_REMOTEBAN; |
| 1529 |
|
} |
| 1530 |
|
} | ENCRYPTED |
| 1531 |
|
{ |
| 1532 |
< |
if (ypass == 2) |
| 1532 |
> |
if (conf_parser_ctx.pass == 2) |
| 1533 |
|
{ |
| 1534 |
|
if (not_atom) ClearConfEncrypted(yy_aconf); |
| 1535 |
|
else SetConfEncrypted(yy_aconf); |
| 1542 |
|
***************************************************************************/ |
| 1543 |
|
class_entry: CLASS |
| 1544 |
|
{ |
| 1545 |
< |
if (ypass == 1) |
| 1545 |
> |
if (conf_parser_ctx.pass == 1) |
| 1546 |
|
{ |
| 1547 |
|
yy_conf = make_conf_item(CLASS_TYPE); |
| 1548 |
< |
yy_class = (struct ClassItem *)map_to_conf(yy_conf); |
| 1548 |
> |
yy_class = map_to_conf(yy_conf); |
| 1549 |
|
} |
| 1550 |
|
} class_name_b '{' class_items '}' ';' |
| 1551 |
|
{ |
| 1552 |
< |
if (ypass == 1) |
| 1552 |
> |
if (conf_parser_ctx.pass == 1) |
| 1553 |
|
{ |
| 1554 |
< |
struct ConfItem *cconf; |
| 1554 |
> |
struct ConfItem *cconf = NULL; |
| 1555 |
|
struct ClassItem *class = NULL; |
| 1556 |
|
|
| 1557 |
|
if (yy_class_name == NULL) |
| 1547 |
– |
{ |
| 1558 |
|
delete_conf_item(yy_conf); |
| 1549 |
– |
} |
| 1559 |
|
else |
| 1560 |
|
{ |
| 1561 |
|
cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL); |
| 1562 |
|
|
| 1563 |
|
if (cconf != NULL) /* The class existed already */ |
| 1564 |
|
{ |
| 1565 |
+ |
int user_count = 0; |
| 1566 |
+ |
|
| 1567 |
|
rebuild_cidr_class(cconf, yy_class); |
| 1568 |
< |
class = (struct ClassItem *) map_to_conf(cconf); |
| 1569 |
< |
*class = *yy_class; |
| 1568 |
> |
|
| 1569 |
> |
class = map_to_conf(cconf); |
| 1570 |
> |
|
| 1571 |
> |
user_count = class->curr_user_count; |
| 1572 |
> |
memcpy(class, yy_class, sizeof(*class)); |
| 1573 |
> |
class->curr_user_count = user_count; |
| 1574 |
> |
class->active = 1; |
| 1575 |
> |
|
| 1576 |
|
delete_conf_item(yy_conf); |
| 1577 |
|
|
| 1578 |
|
MyFree(cconf->name); /* Allows case change of class name */ |
| 1582 |
|
{ |
| 1583 |
|
MyFree(yy_conf->name); /* just in case it was allocated */ |
| 1584 |
|
yy_conf->name = yy_class_name; |
| 1585 |
+ |
yy_class->active = 1; |
| 1586 |
|
} |
| 1587 |
|
} |
| 1588 |
+ |
|
| 1589 |
|
yy_class_name = NULL; |
| 1590 |
|
} |
| 1591 |
|
}; |
| 1609 |
|
|
| 1610 |
|
class_name: NAME '=' QSTRING ';' |
| 1611 |
|
{ |
| 1612 |
< |
if (ypass == 1) |
| 1612 |
> |
if (conf_parser_ctx.pass == 1) |
| 1613 |
|
{ |
| 1614 |
|
MyFree(yy_class_name); |
| 1615 |
|
DupString(yy_class_name, yylval.string); |
| 1618 |
|
|
| 1619 |
|
class_name_t: QSTRING |
| 1620 |
|
{ |
| 1621 |
< |
if (ypass == 1) |
| 1621 |
> |
if (conf_parser_ctx.pass == 1) |
| 1622 |
|
{ |
| 1623 |
|
MyFree(yy_class_name); |
| 1624 |
|
DupString(yy_class_name, yylval.string); |
| 1627 |
|
|
| 1628 |
|
class_ping_time: PING_TIME '=' timespec ';' |
| 1629 |
|
{ |
| 1630 |
< |
if (ypass == 1) |
| 1630 |
> |
if (conf_parser_ctx.pass == 1) |
| 1631 |
|
PingFreq(yy_class) = $3; |
| 1632 |
|
}; |
| 1633 |
|
|
| 1634 |
|
class_ping_warning: PING_WARNING '=' timespec ';' |
| 1635 |
|
{ |
| 1636 |
< |
if (ypass == 1) |
| 1636 |
> |
if (conf_parser_ctx.pass == 1) |
| 1637 |
|
PingWarning(yy_class) = $3; |
| 1638 |
|
}; |
| 1639 |
|
|
| 1640 |
|
class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';' |
| 1641 |
|
{ |
| 1642 |
< |
if (ypass == 1) |
| 1642 |
> |
if (conf_parser_ctx.pass == 1) |
| 1643 |
|
MaxPerIp(yy_class) = $3; |
| 1644 |
|
}; |
| 1645 |
|
|
| 1646 |
|
class_connectfreq: CONNECTFREQ '=' timespec ';' |
| 1647 |
|
{ |
| 1648 |
< |
if (ypass == 1) |
| 1648 |
> |
if (conf_parser_ctx.pass == 1) |
| 1649 |
|
ConFreq(yy_class) = $3; |
| 1650 |
|
}; |
| 1651 |
|
|
| 1652 |
|
class_max_number: MAX_NUMBER '=' NUMBER ';' |
| 1653 |
|
{ |
| 1654 |
< |
if (ypass == 1) |
| 1654 |
> |
if (conf_parser_ctx.pass == 1) |
| 1655 |
|
MaxTotal(yy_class) = $3; |
| 1656 |
|
}; |
| 1657 |
|
|
| 1658 |
|
class_max_global: MAX_GLOBAL '=' NUMBER ';' |
| 1659 |
|
{ |
| 1660 |
< |
if (ypass == 1) |
| 1660 |
> |
if (conf_parser_ctx.pass == 1) |
| 1661 |
|
MaxGlobal(yy_class) = $3; |
| 1662 |
|
}; |
| 1663 |
|
|
| 1664 |
|
class_max_local: MAX_LOCAL '=' NUMBER ';' |
| 1665 |
|
{ |
| 1666 |
< |
if (ypass == 1) |
| 1666 |
> |
if (conf_parser_ctx.pass == 1) |
| 1667 |
|
MaxLocal(yy_class) = $3; |
| 1668 |
|
}; |
| 1669 |
|
|
| 1670 |
|
class_max_ident: MAX_IDENT '=' NUMBER ';' |
| 1671 |
|
{ |
| 1672 |
< |
if (ypass == 1) |
| 1672 |
> |
if (conf_parser_ctx.pass == 1) |
| 1673 |
|
MaxIdent(yy_class) = $3; |
| 1674 |
|
}; |
| 1675 |
|
|
| 1676 |
|
class_sendq: SENDQ '=' sizespec ';' |
| 1677 |
|
{ |
| 1678 |
< |
if (ypass == 1) |
| 1678 |
> |
if (conf_parser_ctx.pass == 1) |
| 1679 |
|
MaxSendq(yy_class) = $3; |
| 1680 |
|
}; |
| 1681 |
|
|
| 1682 |
|
class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';' |
| 1683 |
|
{ |
| 1684 |
< |
if (ypass == 1) |
| 1684 |
> |
if (conf_parser_ctx.pass == 1) |
| 1685 |
|
CidrBitlenIPV4(yy_class) = $3; |
| 1686 |
|
}; |
| 1687 |
|
|
| 1688 |
|
class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';' |
| 1689 |
|
{ |
| 1690 |
< |
if (ypass == 1) |
| 1690 |
> |
if (conf_parser_ctx.pass == 1) |
| 1691 |
|
CidrBitlenIPV6(yy_class) = $3; |
| 1692 |
|
}; |
| 1693 |
|
|
| 1694 |
|
class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';' |
| 1695 |
|
{ |
| 1696 |
< |
if (ypass == 1) |
| 1696 |
> |
if (conf_parser_ctx.pass == 1) |
| 1697 |
|
NumberPerCidr(yy_class) = $3; |
| 1698 |
|
}; |
| 1699 |
|
|
| 1702 |
|
***************************************************************************/ |
| 1703 |
|
listen_entry: LISTEN |
| 1704 |
|
{ |
| 1705 |
< |
if (ypass == 2) |
| 1705 |
> |
if (conf_parser_ctx.pass == 2) |
| 1706 |
|
{ |
| 1707 |
|
listener_address = NULL; |
| 1708 |
|
listener_flags = 0; |
| 1709 |
|
} |
| 1710 |
|
} '{' listen_items '}' ';' |
| 1711 |
|
{ |
| 1712 |
< |
if (ypass == 2) |
| 1712 |
> |
if (conf_parser_ctx.pass == 2) |
| 1713 |
|
{ |
| 1714 |
|
MyFree(listener_address); |
| 1715 |
|
listener_address = NULL; |
| 1718 |
|
|
| 1719 |
|
listen_flags: IRCD_FLAGS |
| 1720 |
|
{ |
| 1721 |
+ |
listener_flags = 0; |
| 1722 |
|
} '=' listen_flags_items ';'; |
| 1723 |
|
|
| 1724 |
|
listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item; |
| 1725 |
|
listen_flags_item: T_SSL |
| 1726 |
|
{ |
| 1727 |
< |
if (ypass == 2) |
| 1727 |
> |
if (conf_parser_ctx.pass == 2) |
| 1728 |
|
listener_flags |= LISTENER_SSL; |
| 1729 |
|
} | HIDDEN |
| 1730 |
|
{ |
| 1731 |
< |
if (ypass == 2) |
| 1731 |
> |
if (conf_parser_ctx.pass == 2) |
| 1732 |
|
listener_flags |= LISTENER_HIDDEN; |
| 1733 |
+ |
} | T_SERVER |
| 1734 |
+ |
{ |
| 1735 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1736 |
+ |
listener_flags |= LISTENER_SERVER; |
| 1737 |
|
}; |
| 1738 |
|
|
| 1739 |
+ |
|
| 1740 |
+ |
|
| 1741 |
|
listen_items: listen_items listen_item | listen_item; |
| 1742 |
< |
listen_item: listen_port | listen_flags | listen_address | listen_host | error ';' ; |
| 1742 |
> |
listen_item: listen_port | listen_flags | listen_address | listen_host | error ';'; |
| 1743 |
|
|
| 1744 |
< |
listen_port: PORT '=' port_items ';' ; |
| 1744 |
> |
listen_port: PORT '=' port_items { listener_flags = 0; } ';'; |
| 1745 |
|
|
| 1746 |
|
port_items: port_items ',' port_item | port_item; |
| 1747 |
|
|
| 1748 |
|
port_item: NUMBER |
| 1749 |
|
{ |
| 1750 |
< |
if (ypass == 2) |
| 1750 |
> |
if (conf_parser_ctx.pass == 2) |
| 1751 |
|
{ |
| 1752 |
|
if ((listener_flags & LISTENER_SSL)) |
| 1753 |
|
#ifdef HAVE_LIBCRYPTO |
| 1754 |
< |
if (!ServerInfo.ctx) |
| 1754 |
> |
if (!ServerInfo.server_ctx) |
| 1755 |
|
#endif |
| 1756 |
|
{ |
| 1757 |
|
yyerror("SSL not available - port closed"); |
| 1758 |
|
break; |
| 1759 |
|
} |
| 1760 |
|
add_listener($1, listener_address, listener_flags); |
| 1735 |
– |
listener_flags = 0; |
| 1761 |
|
} |
| 1762 |
|
} | NUMBER TWODOTS NUMBER |
| 1763 |
|
{ |
| 1764 |
< |
if (ypass == 2) |
| 1764 |
> |
if (conf_parser_ctx.pass == 2) |
| 1765 |
|
{ |
| 1766 |
|
int i; |
| 1767 |
|
|
| 1768 |
|
if ((listener_flags & LISTENER_SSL)) |
| 1769 |
|
#ifdef HAVE_LIBCRYPTO |
| 1770 |
< |
if (!ServerInfo.ctx) |
| 1770 |
> |
if (!ServerInfo.server_ctx) |
| 1771 |
|
#endif |
| 1772 |
|
{ |
| 1773 |
|
yyerror("SSL not available - port closed"); |
| 1776 |
|
|
| 1777 |
|
for (i = $1; i <= $3; ++i) |
| 1778 |
|
add_listener(i, listener_address, listener_flags); |
| 1754 |
– |
|
| 1755 |
– |
listener_flags = 0; |
| 1779 |
|
} |
| 1780 |
|
}; |
| 1781 |
|
|
| 1782 |
|
listen_address: IP '=' QSTRING ';' |
| 1783 |
|
{ |
| 1784 |
< |
if (ypass == 2) |
| 1784 |
> |
if (conf_parser_ctx.pass == 2) |
| 1785 |
|
{ |
| 1786 |
|
MyFree(listener_address); |
| 1787 |
|
DupString(listener_address, yylval.string); |
| 1790 |
|
|
| 1791 |
|
listen_host: HOST '=' QSTRING ';' |
| 1792 |
|
{ |
| 1793 |
< |
if (ypass == 2) |
| 1793 |
> |
if (conf_parser_ctx.pass == 2) |
| 1794 |
|
{ |
| 1795 |
|
MyFree(listener_address); |
| 1796 |
|
DupString(listener_address, yylval.string); |
| 1802 |
|
***************************************************************************/ |
| 1803 |
|
auth_entry: IRCD_AUTH |
| 1804 |
|
{ |
| 1805 |
< |
if (ypass == 2) |
| 1805 |
> |
if (conf_parser_ctx.pass == 2) |
| 1806 |
|
{ |
| 1807 |
|
yy_conf = make_conf_item(CLIENT_TYPE); |
| 1808 |
|
yy_aconf = map_to_conf(yy_conf); |
| 1814 |
|
} |
| 1815 |
|
} '{' auth_items '}' ';' |
| 1816 |
|
{ |
| 1817 |
< |
if (ypass == 2) |
| 1817 |
> |
if (conf_parser_ctx.pass == 2) |
| 1818 |
|
{ |
| 1819 |
|
struct CollectItem *yy_tmp = NULL; |
| 1820 |
|
dlink_node *ptr = NULL, *next_ptr = NULL; |
| 1879 |
|
|
| 1880 |
|
auth_user: USER '=' QSTRING ';' |
| 1881 |
|
{ |
| 1882 |
< |
if (ypass == 2) |
| 1882 |
> |
if (conf_parser_ctx.pass == 2) |
| 1883 |
|
{ |
| 1884 |
< |
struct CollectItem *yy_tmp; |
| 1884 |
> |
struct CollectItem *yy_tmp = NULL; |
| 1885 |
> |
struct split_nuh_item nuh; |
| 1886 |
> |
|
| 1887 |
> |
nuh.nuhmask = yylval.string; |
| 1888 |
> |
nuh.nickptr = NULL; |
| 1889 |
> |
nuh.userptr = userbuf; |
| 1890 |
> |
nuh.hostptr = hostbuf; |
| 1891 |
> |
|
| 1892 |
> |
nuh.nicksize = 0; |
| 1893 |
> |
nuh.usersize = sizeof(userbuf); |
| 1894 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 1895 |
> |
|
| 1896 |
> |
split_nuh(&nuh); |
| 1897 |
|
|
| 1898 |
|
if (yy_aconf->user == NULL) |
| 1899 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 1899 |
> |
{ |
| 1900 |
> |
DupString(yy_aconf->user, userbuf); |
| 1901 |
> |
DupString(yy_aconf->host, hostbuf); |
| 1902 |
> |
} |
| 1903 |
|
else |
| 1904 |
|
{ |
| 1905 |
|
yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 1906 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 1906 |
> |
|
| 1907 |
> |
DupString(yy_tmp->user, userbuf); |
| 1908 |
> |
DupString(yy_tmp->host, hostbuf); |
| 1909 |
> |
|
| 1910 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 1911 |
|
} |
| 1912 |
|
} |
| 1916 |
|
|
| 1917 |
|
auth_passwd: PASSWORD '=' QSTRING ';' |
| 1918 |
|
{ |
| 1919 |
< |
if (ypass == 2) |
| 1919 |
> |
if (conf_parser_ctx.pass == 2) |
| 1920 |
|
{ |
| 1921 |
|
/* be paranoid */ |
| 1922 |
|
if (yy_aconf->passwd != NULL) |
| 1929 |
|
|
| 1930 |
|
auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';' |
| 1931 |
|
{ |
| 1932 |
< |
if (ypass == 2) |
| 1932 |
> |
if (conf_parser_ctx.pass == 2) |
| 1933 |
|
{ |
| 1934 |
|
if (yylval.number) |
| 1935 |
|
yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE; |
| 1940 |
|
|
| 1941 |
|
auth_class: CLASS '=' QSTRING ';' |
| 1942 |
|
{ |
| 1943 |
< |
if (ypass == 2) |
| 1943 |
> |
if (conf_parser_ctx.pass == 2) |
| 1944 |
|
{ |
| 1945 |
|
MyFree(class_name); |
| 1946 |
|
DupString(class_name, yylval.string); |
| 1949 |
|
|
| 1950 |
|
auth_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1951 |
|
{ |
| 1952 |
< |
if (ypass == 2) |
| 1952 |
> |
if (conf_parser_ctx.pass == 2) |
| 1953 |
|
{ |
| 1954 |
|
if (yylval.number) |
| 1955 |
|
SetConfEncrypted(yy_aconf); |
| 1968 |
|
|
| 1969 |
|
auth_flags_item_atom: SPOOF_NOTICE |
| 1970 |
|
{ |
| 1971 |
< |
if (ypass == 2) |
| 1971 |
> |
if (conf_parser_ctx.pass == 2) |
| 1972 |
|
{ |
| 1973 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE; |
| 1974 |
|
else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE; |
| 1976 |
|
|
| 1977 |
|
} | EXCEED_LIMIT |
| 1978 |
|
{ |
| 1979 |
< |
if (ypass == 2) |
| 1979 |
> |
if (conf_parser_ctx.pass == 2) |
| 1980 |
|
{ |
| 1981 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT; |
| 1982 |
|
else yy_aconf->flags |= CONF_FLAGS_NOLIMIT; |
| 1983 |
|
} |
| 1984 |
|
} | KLINE_EXEMPT |
| 1985 |
|
{ |
| 1986 |
< |
if (ypass == 2) |
| 1986 |
> |
if (conf_parser_ctx.pass == 2) |
| 1987 |
|
{ |
| 1988 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE; |
| 1989 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE; |
| 1990 |
|
} |
| 1991 |
|
} | NEED_IDENT |
| 1992 |
|
{ |
| 1993 |
< |
if (ypass == 2) |
| 1993 |
> |
if (conf_parser_ctx.pass == 2) |
| 1994 |
|
{ |
| 1995 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD; |
| 1996 |
|
else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD; |
| 1997 |
|
} |
| 1998 |
|
} | CAN_FLOOD |
| 1999 |
|
{ |
| 2000 |
< |
if (ypass == 2) |
| 2000 |
> |
if (conf_parser_ctx.pass == 2) |
| 2001 |
|
{ |
| 2002 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD; |
| 2003 |
|
else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD; |
| 2004 |
|
} |
| 2005 |
|
} | CAN_IDLE |
| 2006 |
|
{ |
| 2007 |
< |
if (ypass == 2) |
| 2007 |
> |
if (conf_parser_ctx.pass == 2) |
| 2008 |
|
{ |
| 2009 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED; |
| 2010 |
|
else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED; |
| 2011 |
|
} |
| 2012 |
|
} | NO_TILDE |
| 2013 |
|
{ |
| 2014 |
< |
if (ypass == 2) |
| 2014 |
> |
if (conf_parser_ctx.pass == 2) |
| 2015 |
|
{ |
| 2016 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE; |
| 2017 |
|
else yy_aconf->flags |= CONF_FLAGS_NO_TILDE; |
| 2018 |
|
} |
| 2019 |
|
} | GLINE_EXEMPT |
| 2020 |
|
{ |
| 2021 |
< |
if (ypass == 2) |
| 2021 |
> |
if (conf_parser_ctx.pass == 2) |
| 2022 |
|
{ |
| 2023 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE; |
| 2024 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE; |
| 2025 |
|
} |
| 2026 |
|
} | RESV_EXEMPT |
| 2027 |
|
{ |
| 2028 |
< |
if (ypass == 2) |
| 2028 |
> |
if (conf_parser_ctx.pass == 2) |
| 2029 |
|
{ |
| 2030 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV; |
| 2031 |
|
else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV; |
| 2032 |
|
} |
| 2033 |
|
} | NEED_PASSWORD |
| 2034 |
|
{ |
| 2035 |
< |
if (ypass == 2) |
| 2035 |
> |
if (conf_parser_ctx.pass == 2) |
| 2036 |
|
{ |
| 2037 |
|
if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD; |
| 2038 |
|
else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD; |
| 2041 |
|
|
| 2042 |
|
auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';' |
| 2043 |
|
{ |
| 2044 |
< |
if (ypass == 2) |
| 2044 |
> |
if (conf_parser_ctx.pass == 2) |
| 2045 |
|
{ |
| 2046 |
|
if (yylval.number) |
| 2047 |
|
yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE; |
| 2052 |
|
|
| 2053 |
|
auth_need_ident: NEED_IDENT '=' TBOOL ';' |
| 2054 |
|
{ |
| 2055 |
< |
if (ypass == 2) |
| 2055 |
> |
if (conf_parser_ctx.pass == 2) |
| 2056 |
|
{ |
| 2057 |
|
if (yylval.number) |
| 2058 |
|
yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD; |
| 2063 |
|
|
| 2064 |
|
auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';' |
| 2065 |
|
{ |
| 2066 |
< |
if (ypass == 2) |
| 2066 |
> |
if (conf_parser_ctx.pass == 2) |
| 2067 |
|
{ |
| 2068 |
|
if (yylval.number) |
| 2069 |
|
yy_aconf->flags |= CONF_FLAGS_NOLIMIT; |
| 2074 |
|
|
| 2075 |
|
auth_can_flood: CAN_FLOOD '=' TBOOL ';' |
| 2076 |
|
{ |
| 2077 |
< |
if (ypass == 2) |
| 2077 |
> |
if (conf_parser_ctx.pass == 2) |
| 2078 |
|
{ |
| 2079 |
|
if (yylval.number) |
| 2080 |
|
yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD; |
| 2085 |
|
|
| 2086 |
|
auth_no_tilde: NO_TILDE '=' TBOOL ';' |
| 2087 |
|
{ |
| 2088 |
< |
if (ypass == 2) |
| 2088 |
> |
if (conf_parser_ctx.pass == 2) |
| 2089 |
|
{ |
| 2090 |
|
if (yylval.number) |
| 2091 |
|
yy_aconf->flags |= CONF_FLAGS_NO_TILDE; |
| 2096 |
|
|
| 2097 |
|
auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';' |
| 2098 |
|
{ |
| 2099 |
< |
if (ypass == 2) |
| 2099 |
> |
if (conf_parser_ctx.pass == 2) |
| 2100 |
|
{ |
| 2101 |
|
if (yylval.number) |
| 2102 |
|
yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE; |
| 2108 |
|
/* XXX - need check for illegal hostnames here */ |
| 2109 |
|
auth_spoof: SPOOF '=' QSTRING ';' |
| 2110 |
|
{ |
| 2111 |
< |
if (ypass == 2) |
| 2111 |
> |
if (conf_parser_ctx.pass == 2) |
| 2112 |
|
{ |
| 2113 |
|
MyFree(yy_conf->name); |
| 2114 |
|
|
| 2127 |
|
|
| 2128 |
|
auth_redir_serv: REDIRSERV '=' QSTRING ';' |
| 2129 |
|
{ |
| 2130 |
< |
if (ypass == 2) |
| 2130 |
> |
if (conf_parser_ctx.pass == 2) |
| 2131 |
|
{ |
| 2132 |
|
yy_aconf->flags |= CONF_FLAGS_REDIR; |
| 2133 |
|
MyFree(yy_conf->name); |
| 2137 |
|
|
| 2138 |
|
auth_redir_port: REDIRPORT '=' NUMBER ';' |
| 2139 |
|
{ |
| 2140 |
< |
if (ypass == 2) |
| 2140 |
> |
if (conf_parser_ctx.pass == 2) |
| 2141 |
|
{ |
| 2142 |
|
yy_aconf->flags |= CONF_FLAGS_REDIR; |
| 2143 |
|
yy_aconf->port = $3; |
| 2146 |
|
|
| 2147 |
|
auth_need_password: NEED_PASSWORD '=' TBOOL ';' |
| 2148 |
|
{ |
| 2149 |
< |
if (ypass == 2) |
| 2149 |
> |
if (conf_parser_ctx.pass == 2) |
| 2150 |
|
{ |
| 2151 |
|
if (yylval.number) |
| 2152 |
|
yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD; |
| 2161 |
|
***************************************************************************/ |
| 2162 |
|
resv_entry: RESV |
| 2163 |
|
{ |
| 2164 |
< |
if (ypass == 2) |
| 2164 |
> |
if (conf_parser_ctx.pass == 2) |
| 2165 |
|
{ |
| 2166 |
|
MyFree(resv_reason); |
| 2167 |
|
resv_reason = NULL; |
| 2168 |
|
} |
| 2169 |
|
} '{' resv_items '}' ';' |
| 2170 |
|
{ |
| 2171 |
< |
if (ypass == 2) |
| 2171 |
> |
if (conf_parser_ctx.pass == 2) |
| 2172 |
|
{ |
| 2173 |
|
MyFree(resv_reason); |
| 2174 |
|
resv_reason = NULL; |
| 2180 |
|
|
| 2181 |
|
resv_creason: REASON '=' QSTRING ';' |
| 2182 |
|
{ |
| 2183 |
< |
if (ypass == 2) |
| 2183 |
> |
if (conf_parser_ctx.pass == 2) |
| 2184 |
|
{ |
| 2185 |
|
MyFree(resv_reason); |
| 2186 |
|
DupString(resv_reason, yylval.string); |
| 2189 |
|
|
| 2190 |
|
resv_channel: CHANNEL '=' QSTRING ';' |
| 2191 |
|
{ |
| 2192 |
< |
if (ypass == 2) |
| 2192 |
> |
if (conf_parser_ctx.pass == 2) |
| 2193 |
|
{ |
| 2194 |
|
if (IsChanPrefix(*yylval.string)) |
| 2195 |
|
{ |
| 2204 |
|
|
| 2205 |
|
resv_nick: NICK '=' QSTRING ';' |
| 2206 |
|
{ |
| 2207 |
< |
if (ypass == 2) |
| 2207 |
> |
if (conf_parser_ctx.pass == 2) |
| 2208 |
|
{ |
| 2209 |
|
char def_reason[] = "No reason"; |
| 2210 |
|
|
| 2217 |
|
***************************************************************************/ |
| 2218 |
|
shared_entry: T_SHARED |
| 2219 |
|
{ |
| 2220 |
< |
if (ypass == 2) |
| 2220 |
> |
if (conf_parser_ctx.pass == 2) |
| 2221 |
|
{ |
| 2222 |
|
yy_conf = make_conf_item(ULINE_TYPE); |
| 2223 |
|
yy_match_item = map_to_conf(yy_conf); |
| 2225 |
|
} |
| 2226 |
|
} '{' shared_items '}' ';' |
| 2227 |
|
{ |
| 2228 |
< |
if (ypass == 2) |
| 2228 |
> |
if (conf_parser_ctx.pass == 2) |
| 2229 |
|
{ |
| 2230 |
|
yy_conf = NULL; |
| 2231 |
|
} |
| 2236 |
|
|
| 2237 |
|
shared_name: NAME '=' QSTRING ';' |
| 2238 |
|
{ |
| 2239 |
< |
if (ypass == 2) |
| 2239 |
> |
if (conf_parser_ctx.pass == 2) |
| 2240 |
|
{ |
| 2241 |
|
MyFree(yy_conf->name); |
| 2242 |
|
DupString(yy_conf->name, yylval.string); |
| 2245 |
|
|
| 2246 |
|
shared_user: USER '=' QSTRING ';' |
| 2247 |
|
{ |
| 2248 |
< |
if (ypass == 2) |
| 2248 |
> |
if (conf_parser_ctx.pass == 2) |
| 2249 |
|
{ |
| 2250 |
< |
split_nuh(yylval.string, NULL, &yy_match_item->user, &yy_match_item->host); |
| 2250 |
> |
struct split_nuh_item nuh; |
| 2251 |
> |
|
| 2252 |
> |
nuh.nuhmask = yylval.string; |
| 2253 |
> |
nuh.nickptr = NULL; |
| 2254 |
> |
nuh.userptr = userbuf; |
| 2255 |
> |
nuh.hostptr = hostbuf; |
| 2256 |
> |
|
| 2257 |
> |
nuh.nicksize = 0; |
| 2258 |
> |
nuh.usersize = sizeof(userbuf); |
| 2259 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 2260 |
> |
|
| 2261 |
> |
split_nuh(&nuh); |
| 2262 |
> |
|
| 2263 |
> |
DupString(yy_match_item->user, userbuf); |
| 2264 |
> |
DupString(yy_match_item->host, hostbuf); |
| 2265 |
|
} |
| 2266 |
|
}; |
| 2267 |
|
|
| 2268 |
|
shared_type: TYPE |
| 2269 |
|
{ |
| 2270 |
< |
if (ypass == 2) |
| 2270 |
> |
if (conf_parser_ctx.pass == 2) |
| 2271 |
|
yy_match_item->action = 0; |
| 2272 |
|
} '=' shared_types ';' ; |
| 2273 |
|
|
| 2274 |
|
shared_types: shared_types ',' shared_type_item | shared_type_item; |
| 2275 |
|
shared_type_item: KLINE |
| 2276 |
|
{ |
| 2277 |
< |
if (ypass == 2) |
| 2277 |
> |
if (conf_parser_ctx.pass == 2) |
| 2278 |
|
yy_match_item->action |= SHARED_KLINE; |
| 2279 |
|
} | TKLINE |
| 2280 |
|
{ |
| 2281 |
< |
if (ypass == 2) |
| 2281 |
> |
if (conf_parser_ctx.pass == 2) |
| 2282 |
|
yy_match_item->action |= SHARED_TKLINE; |
| 2283 |
|
} | UNKLINE |
| 2284 |
|
{ |
| 2285 |
< |
if (ypass == 2) |
| 2285 |
> |
if (conf_parser_ctx.pass == 2) |
| 2286 |
|
yy_match_item->action |= SHARED_UNKLINE; |
| 2287 |
|
} | XLINE |
| 2288 |
|
{ |
| 2289 |
< |
if (ypass == 2) |
| 2289 |
> |
if (conf_parser_ctx.pass == 2) |
| 2290 |
|
yy_match_item->action |= SHARED_XLINE; |
| 2291 |
|
} | TXLINE |
| 2292 |
|
{ |
| 2293 |
< |
if (ypass == 2) |
| 2293 |
> |
if (conf_parser_ctx.pass == 2) |
| 2294 |
|
yy_match_item->action |= SHARED_TXLINE; |
| 2295 |
|
} | T_UNXLINE |
| 2296 |
|
{ |
| 2297 |
< |
if (ypass == 2) |
| 2297 |
> |
if (conf_parser_ctx.pass == 2) |
| 2298 |
|
yy_match_item->action |= SHARED_UNXLINE; |
| 2299 |
|
} | RESV |
| 2300 |
|
{ |
| 2301 |
< |
if (ypass == 2) |
| 2301 |
> |
if (conf_parser_ctx.pass == 2) |
| 2302 |
|
yy_match_item->action |= SHARED_RESV; |
| 2303 |
|
} | TRESV |
| 2304 |
|
{ |
| 2305 |
< |
if (ypass == 2) |
| 2305 |
> |
if (conf_parser_ctx.pass == 2) |
| 2306 |
|
yy_match_item->action |= SHARED_TRESV; |
| 2307 |
|
} | T_UNRESV |
| 2308 |
|
{ |
| 2309 |
< |
if (ypass == 2) |
| 2309 |
> |
if (conf_parser_ctx.pass == 2) |
| 2310 |
|
yy_match_item->action |= SHARED_UNRESV; |
| 2311 |
|
} | T_LOCOPS |
| 2312 |
|
{ |
| 2313 |
< |
if (ypass == 2) |
| 2313 |
> |
if (conf_parser_ctx.pass == 2) |
| 2314 |
|
yy_match_item->action |= SHARED_LOCOPS; |
| 2315 |
|
} | T_ALL |
| 2316 |
|
{ |
| 2317 |
< |
if (ypass == 2) |
| 2317 |
> |
if (conf_parser_ctx.pass == 2) |
| 2318 |
|
yy_match_item->action = SHARED_ALL; |
| 2319 |
|
}; |
| 2320 |
|
|
| 2323 |
|
***************************************************************************/ |
| 2324 |
|
cluster_entry: T_CLUSTER |
| 2325 |
|
{ |
| 2326 |
< |
if (ypass == 2) |
| 2326 |
> |
if (conf_parser_ctx.pass == 2) |
| 2327 |
|
{ |
| 2328 |
|
yy_conf = make_conf_item(CLUSTER_TYPE); |
| 2329 |
|
yy_conf->flags = SHARED_ALL; |
| 2330 |
|
} |
| 2331 |
|
} '{' cluster_items '}' ';' |
| 2332 |
|
{ |
| 2333 |
< |
if (ypass == 2) |
| 2333 |
> |
if (conf_parser_ctx.pass == 2) |
| 2334 |
|
{ |
| 2335 |
|
if (yy_conf->name == NULL) |
| 2336 |
|
DupString(yy_conf->name, "*"); |
| 2343 |
|
|
| 2344 |
|
cluster_name: NAME '=' QSTRING ';' |
| 2345 |
|
{ |
| 2346 |
< |
if (ypass == 2) |
| 2346 |
> |
if (conf_parser_ctx.pass == 2) |
| 2347 |
|
DupString(yy_conf->name, yylval.string); |
| 2348 |
|
}; |
| 2349 |
|
|
| 2350 |
|
cluster_type: TYPE |
| 2351 |
|
{ |
| 2352 |
< |
if (ypass == 2) |
| 2352 |
> |
if (conf_parser_ctx.pass == 2) |
| 2353 |
|
yy_conf->flags = 0; |
| 2354 |
|
} '=' cluster_types ';' ; |
| 2355 |
|
|
| 2356 |
|
cluster_types: cluster_types ',' cluster_type_item | cluster_type_item; |
| 2357 |
|
cluster_type_item: KLINE |
| 2358 |
|
{ |
| 2359 |
< |
if (ypass == 2) |
| 2359 |
> |
if (conf_parser_ctx.pass == 2) |
| 2360 |
|
yy_conf->flags |= SHARED_KLINE; |
| 2361 |
|
} | TKLINE |
| 2362 |
|
{ |
| 2363 |
< |
if (ypass == 2) |
| 2363 |
> |
if (conf_parser_ctx.pass == 2) |
| 2364 |
|
yy_conf->flags |= SHARED_TKLINE; |
| 2365 |
|
} | UNKLINE |
| 2366 |
|
{ |
| 2367 |
< |
if (ypass == 2) |
| 2367 |
> |
if (conf_parser_ctx.pass == 2) |
| 2368 |
|
yy_conf->flags |= SHARED_UNKLINE; |
| 2369 |
|
} | XLINE |
| 2370 |
|
{ |
| 2371 |
< |
if (ypass == 2) |
| 2371 |
> |
if (conf_parser_ctx.pass == 2) |
| 2372 |
|
yy_conf->flags |= SHARED_XLINE; |
| 2373 |
|
} | TXLINE |
| 2374 |
|
{ |
| 2375 |
< |
if (ypass == 2) |
| 2375 |
> |
if (conf_parser_ctx.pass == 2) |
| 2376 |
|
yy_conf->flags |= SHARED_TXLINE; |
| 2377 |
|
} | T_UNXLINE |
| 2378 |
|
{ |
| 2379 |
< |
if (ypass == 2) |
| 2379 |
> |
if (conf_parser_ctx.pass == 2) |
| 2380 |
|
yy_conf->flags |= SHARED_UNXLINE; |
| 2381 |
|
} | RESV |
| 2382 |
|
{ |
| 2383 |
< |
if (ypass == 2) |
| 2383 |
> |
if (conf_parser_ctx.pass == 2) |
| 2384 |
|
yy_conf->flags |= SHARED_RESV; |
| 2385 |
|
} | TRESV |
| 2386 |
|
{ |
| 2387 |
< |
if (ypass == 2) |
| 2387 |
> |
if (conf_parser_ctx.pass == 2) |
| 2388 |
|
yy_conf->flags |= SHARED_TRESV; |
| 2389 |
|
} | T_UNRESV |
| 2390 |
|
{ |
| 2391 |
< |
if (ypass == 2) |
| 2391 |
> |
if (conf_parser_ctx.pass == 2) |
| 2392 |
|
yy_conf->flags |= SHARED_UNRESV; |
| 2393 |
|
} | T_LOCOPS |
| 2394 |
|
{ |
| 2395 |
< |
if (ypass == 2) |
| 2395 |
> |
if (conf_parser_ctx.pass == 2) |
| 2396 |
|
yy_conf->flags |= SHARED_LOCOPS; |
| 2397 |
|
} | T_ALL |
| 2398 |
|
{ |
| 2399 |
< |
if (ypass == 2) |
| 2399 |
> |
if (conf_parser_ctx.pass == 2) |
| 2400 |
|
yy_conf->flags = SHARED_ALL; |
| 2401 |
|
}; |
| 2402 |
|
|
| 2405 |
|
***************************************************************************/ |
| 2406 |
|
connect_entry: CONNECT |
| 2407 |
|
{ |
| 2408 |
< |
if (ypass == 2) |
| 2408 |
> |
if (conf_parser_ctx.pass == 2) |
| 2409 |
|
{ |
| 2410 |
|
yy_conf = make_conf_item(SERVER_TYPE); |
| 2411 |
|
yy_aconf = (struct AccessItem *)map_to_conf(yy_conf); |
| 2423 |
|
} |
| 2424 |
|
} connect_name_b '{' connect_items '}' ';' |
| 2425 |
|
{ |
| 2426 |
< |
if (ypass == 2) |
| 2426 |
> |
if (conf_parser_ctx.pass == 2) |
| 2427 |
|
{ |
| 2428 |
|
struct CollectItem *yy_hconf=NULL; |
| 2429 |
|
struct CollectItem *yy_lconf=NULL; |
| 2438 |
|
yy_aconf->passwd && yy_aconf->spasswd) |
| 2439 |
|
#endif /* !HAVE_LIBCRYPTO */ |
| 2440 |
|
{ |
| 2441 |
< |
if (conf_add_server(yy_conf, scount, class_name) >= 0) |
| 2387 |
< |
{ |
| 2388 |
< |
++scount; |
| 2389 |
< |
} |
| 2390 |
< |
else |
| 2441 |
> |
if (conf_add_server(yy_conf, class_name) == -1) |
| 2442 |
|
{ |
| 2443 |
|
delete_conf_item(yy_conf); |
| 2444 |
|
yy_conf = NULL; |
| 2562 |
|
|
| 2563 |
|
connect_name: NAME '=' QSTRING ';' |
| 2564 |
|
{ |
| 2565 |
< |
if (ypass == 2) |
| 2565 |
> |
if (conf_parser_ctx.pass == 2) |
| 2566 |
|
{ |
| 2567 |
|
if (yy_conf->name != NULL) |
| 2568 |
|
yyerror("Multiple connect name entry"); |
| 2574 |
|
|
| 2575 |
|
connect_name_t: QSTRING |
| 2576 |
|
{ |
| 2577 |
< |
if (ypass == 2) |
| 2577 |
> |
if (conf_parser_ctx.pass == 2) |
| 2578 |
|
{ |
| 2579 |
|
if (yy_conf->name != NULL) |
| 2580 |
|
yyerror("Multiple connect name entry"); |
| 2586 |
|
|
| 2587 |
|
connect_host: HOST '=' QSTRING ';' |
| 2588 |
|
{ |
| 2589 |
< |
if (ypass == 2) |
| 2589 |
> |
if (conf_parser_ctx.pass == 2) |
| 2590 |
|
{ |
| 2591 |
|
MyFree(yy_aconf->host); |
| 2592 |
|
DupString(yy_aconf->host, yylval.string); |
| 2595 |
|
|
| 2596 |
|
connect_vhost: VHOST '=' QSTRING ';' |
| 2597 |
|
{ |
| 2598 |
< |
if (ypass == 2) |
| 2598 |
> |
if (conf_parser_ctx.pass == 2) |
| 2599 |
|
{ |
| 2600 |
|
struct addrinfo hints, *res; |
| 2601 |
|
|
| 2621 |
|
|
| 2622 |
|
connect_send_password: SEND_PASSWORD '=' QSTRING ';' |
| 2623 |
|
{ |
| 2624 |
< |
if (ypass == 2) |
| 2624 |
> |
if (conf_parser_ctx.pass == 2) |
| 2625 |
|
{ |
| 2626 |
|
if ($3[0] == ':') |
| 2627 |
|
yyerror("Server passwords cannot begin with a colon"); |
| 2639 |
|
|
| 2640 |
|
connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';' |
| 2641 |
|
{ |
| 2642 |
< |
if (ypass == 2) |
| 2642 |
> |
if (conf_parser_ctx.pass == 2) |
| 2643 |
|
{ |
| 2644 |
|
if ($3[0] == ':') |
| 2645 |
|
yyerror("Server passwords cannot begin with a colon"); |
| 2657 |
|
|
| 2658 |
|
connect_port: PORT '=' NUMBER ';' |
| 2659 |
|
{ |
| 2660 |
< |
if (ypass == 2) |
| 2660 |
> |
if (conf_parser_ctx.pass == 2) |
| 2661 |
|
yy_aconf->port = $3; |
| 2662 |
|
}; |
| 2663 |
|
|
| 2664 |
|
connect_aftype: AFTYPE '=' T_IPV4 ';' |
| 2665 |
|
{ |
| 2666 |
< |
if (ypass == 2) |
| 2666 |
> |
if (conf_parser_ctx.pass == 2) |
| 2667 |
|
yy_aconf->aftype = AF_INET; |
| 2668 |
|
} | AFTYPE '=' T_IPV6 ';' |
| 2669 |
|
{ |
| 2670 |
|
#ifdef IPV6 |
| 2671 |
< |
if (ypass == 2) |
| 2671 |
> |
if (conf_parser_ctx.pass == 2) |
| 2672 |
|
yy_aconf->aftype = AF_INET6; |
| 2673 |
|
#endif |
| 2674 |
|
}; |
| 2675 |
|
|
| 2676 |
|
connect_fakename: FAKENAME '=' QSTRING ';' |
| 2677 |
|
{ |
| 2678 |
< |
if (ypass == 2) |
| 2678 |
> |
if (conf_parser_ctx.pass == 2) |
| 2679 |
|
{ |
| 2680 |
|
MyFree(yy_aconf->fakename); |
| 2681 |
|
DupString(yy_aconf->fakename, yylval.string); |
| 2690 |
|
connect_flags_item: NOT { not_atom = 1; } connect_flags_item_atom |
| 2691 |
|
| { not_atom = 0; } connect_flags_item_atom; |
| 2692 |
|
|
| 2693 |
< |
connect_flags_item_atom: LAZYLINK |
| 2693 |
> |
connect_flags_item_atom: COMPRESSED |
| 2694 |
|
{ |
| 2695 |
< |
if (ypass == 2) |
| 2645 |
< |
{ |
| 2646 |
< |
if (not_atom)ClearConfLazyLink(yy_aconf); |
| 2647 |
< |
else SetConfLazyLink(yy_aconf); |
| 2648 |
< |
} |
| 2649 |
< |
} | COMPRESSED |
| 2650 |
< |
{ |
| 2651 |
< |
if (ypass == 2) |
| 2695 |
> |
if (conf_parser_ctx.pass == 2) |
| 2696 |
|
#ifndef HAVE_LIBZ |
| 2697 |
|
yyerror("Ignoring flags = compressed; -- no zlib support"); |
| 2698 |
|
#else |
| 2703 |
|
#endif |
| 2704 |
|
} | CRYPTLINK |
| 2705 |
|
{ |
| 2706 |
< |
if (ypass == 2) |
| 2706 |
> |
if (conf_parser_ctx.pass == 2) |
| 2707 |
|
{ |
| 2708 |
|
if (not_atom)ClearConfCryptLink(yy_aconf); |
| 2709 |
|
else SetConfCryptLink(yy_aconf); |
| 2710 |
|
} |
| 2711 |
|
} | AUTOCONN |
| 2712 |
|
{ |
| 2713 |
< |
if (ypass == 2) |
| 2713 |
> |
if (conf_parser_ctx.pass == 2) |
| 2714 |
|
{ |
| 2715 |
|
if (not_atom)ClearConfAllowAutoConn(yy_aconf); |
| 2716 |
|
else SetConfAllowAutoConn(yy_aconf); |
| 2717 |
|
} |
| 2718 |
|
} | BURST_AWAY |
| 2719 |
|
{ |
| 2720 |
< |
if (ypass == 2) |
| 2720 |
> |
if (conf_parser_ctx.pass == 2) |
| 2721 |
|
{ |
| 2722 |
|
if (not_atom)ClearConfAwayBurst(yy_aconf); |
| 2723 |
|
else SetConfAwayBurst(yy_aconf); |
| 2724 |
|
} |
| 2725 |
|
} | TOPICBURST |
| 2726 |
|
{ |
| 2727 |
< |
if (ypass == 2) |
| 2727 |
> |
if (conf_parser_ctx.pass == 2) |
| 2728 |
|
{ |
| 2729 |
|
if (not_atom)ClearConfTopicBurst(yy_aconf); |
| 2730 |
|
else SetConfTopicBurst(yy_aconf); |
| 2735 |
|
connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 2736 |
|
{ |
| 2737 |
|
#ifdef HAVE_LIBCRYPTO |
| 2738 |
< |
if (ypass == 2) |
| 2738 |
> |
if (conf_parser_ctx.pass == 2) |
| 2739 |
|
{ |
| 2740 |
|
BIO *file; |
| 2741 |
|
|
| 2775 |
|
|
| 2776 |
|
connect_encrypted: ENCRYPTED '=' TBOOL ';' |
| 2777 |
|
{ |
| 2778 |
< |
if (ypass == 2) |
| 2778 |
> |
if (conf_parser_ctx.pass == 2) |
| 2779 |
|
{ |
| 2780 |
|
if (yylval.number) |
| 2781 |
|
yy_aconf->flags |= CONF_FLAGS_ENCRYPTED; |
| 2786 |
|
|
| 2787 |
|
connect_cryptlink: CRYPTLINK '=' TBOOL ';' |
| 2788 |
|
{ |
| 2789 |
< |
if (ypass == 2) |
| 2789 |
> |
if (conf_parser_ctx.pass == 2) |
| 2790 |
|
{ |
| 2791 |
|
if (yylval.number) |
| 2792 |
|
yy_aconf->flags |= CONF_FLAGS_CRYPTLINK; |
| 2797 |
|
|
| 2798 |
|
connect_compressed: COMPRESSED '=' TBOOL ';' |
| 2799 |
|
{ |
| 2800 |
< |
if (ypass == 2) |
| 2800 |
> |
if (conf_parser_ctx.pass == 2) |
| 2801 |
|
{ |
| 2802 |
|
if (yylval.number) |
| 2803 |
|
#ifndef HAVE_LIBZ |
| 2812 |
|
|
| 2813 |
|
connect_auto: AUTOCONN '=' TBOOL ';' |
| 2814 |
|
{ |
| 2815 |
< |
if (ypass == 2) |
| 2815 |
> |
if (conf_parser_ctx.pass == 2) |
| 2816 |
|
{ |
| 2817 |
|
if (yylval.number) |
| 2818 |
|
yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN; |
| 2823 |
|
|
| 2824 |
|
connect_topicburst: TOPICBURST '=' TBOOL ';' |
| 2825 |
|
{ |
| 2826 |
< |
if (ypass == 2) |
| 2826 |
> |
if (conf_parser_ctx.pass == 2) |
| 2827 |
|
{ |
| 2828 |
|
if (yylval.number) |
| 2829 |
< |
SetConfTopicBurst(yy_aconf) |
| 2829 |
> |
SetConfTopicBurst(yy_aconf); |
| 2830 |
|
else |
| 2831 |
|
ClearConfTopicBurst(yy_aconf); |
| 2832 |
|
} |
| 2834 |
|
|
| 2835 |
|
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2836 |
|
{ |
| 2837 |
< |
if (ypass == 2) |
| 2837 |
> |
if (conf_parser_ctx.pass == 2) |
| 2838 |
|
{ |
| 2839 |
|
struct CollectItem *yy_tmp; |
| 2840 |
|
|
| 2847 |
|
|
| 2848 |
|
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2849 |
|
{ |
| 2850 |
< |
if (ypass == 2) |
| 2850 |
> |
if (conf_parser_ctx.pass == 2) |
| 2851 |
|
{ |
| 2852 |
|
struct CollectItem *yy_tmp; |
| 2853 |
|
|
| 2860 |
|
|
| 2861 |
|
connect_class: CLASS '=' QSTRING ';' |
| 2862 |
|
{ |
| 2863 |
< |
if (ypass == 2) |
| 2863 |
> |
if (conf_parser_ctx.pass == 2) |
| 2864 |
|
{ |
| 2865 |
|
MyFree(class_name); |
| 2866 |
|
DupString(class_name, yylval.string); |
| 2870 |
|
connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';' |
| 2871 |
|
{ |
| 2872 |
|
#ifdef HAVE_LIBCRYPTO |
| 2873 |
< |
if (ypass == 2) |
| 2873 |
> |
if (conf_parser_ctx.pass == 2) |
| 2874 |
|
{ |
| 2875 |
|
struct EncCapability *ecap; |
| 2876 |
|
const char *cipher_name; |
| 2894 |
|
yyerror("Invalid cipher"); |
| 2895 |
|
} |
| 2896 |
|
#else |
| 2897 |
< |
if (ypass == 2) |
| 2897 |
> |
if (conf_parser_ctx.pass == 2) |
| 2898 |
|
yyerror("Ignoring cipher_preference -- no OpenSSL support"); |
| 2899 |
|
#endif |
| 2900 |
|
}; |
| 2904 |
|
***************************************************************************/ |
| 2905 |
|
kill_entry: KILL |
| 2906 |
|
{ |
| 2907 |
< |
if (ypass == 2) |
| 2907 |
> |
if (conf_parser_ctx.pass == 2) |
| 2908 |
|
{ |
| 2909 |
|
userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0'; |
| 2910 |
|
regex_ban = 0; |
| 2911 |
|
} |
| 2912 |
|
} '{' kill_items '}' ';' |
| 2913 |
|
{ |
| 2914 |
< |
if (ypass == 2) |
| 2914 |
> |
if (conf_parser_ctx.pass == 2) |
| 2915 |
|
{ |
| 2916 |
|
if (userbuf[0] && hostbuf[0]) |
| 2917 |
|
{ |
| 2924 |
|
if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) || |
| 2925 |
|
!(exp_host = ircd_pcre_compile(hostbuf, &errptr))) |
| 2926 |
|
{ |
| 2927 |
< |
ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", errptr); |
| 2927 |
> |
ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", |
| 2928 |
> |
errptr); |
| 2929 |
|
break; |
| 2930 |
|
} |
| 2931 |
|
|
| 2932 |
|
yy_conf = make_conf_item(RKLINE_TYPE); |
| 2933 |
+ |
yy_aconf = map_to_conf(yy_conf); |
| 2934 |
+ |
|
| 2935 |
|
yy_aconf->regexuser = exp_user; |
| 2936 |
|
yy_aconf->regexhost = exp_host; |
| 2937 |
|
|
| 2973 |
|
kill_type_items: kill_type_items ',' kill_type_item | kill_type_item; |
| 2974 |
|
kill_type_item: REGEX_T |
| 2975 |
|
{ |
| 2976 |
< |
if (ypass == 2) |
| 2976 |
> |
if (conf_parser_ctx.pass == 2) |
| 2977 |
|
regex_ban = 1; |
| 2978 |
|
}; |
| 2979 |
|
|
| 2982 |
|
|
| 2983 |
|
kill_user: USER '=' QSTRING ';' |
| 2984 |
|
{ |
| 2985 |
< |
if (ypass == 2) |
| 2985 |
> |
if (conf_parser_ctx.pass == 2) |
| 2986 |
|
{ |
| 2987 |
< |
char *user = NULL, *host = NULL; |
| 2987 |
> |
struct split_nuh_item nuh; |
| 2988 |
|
|
| 2989 |
< |
split_nuh(yylval.string, NULL, &user, &host); |
| 2989 |
> |
nuh.nuhmask = yylval.string; |
| 2990 |
> |
nuh.nickptr = NULL; |
| 2991 |
> |
nuh.userptr = userbuf; |
| 2992 |
> |
nuh.hostptr = hostbuf; |
| 2993 |
|
|
| 2994 |
< |
strlcpy(userbuf, user, sizeof(userbuf)); |
| 2995 |
< |
strlcpy(hostbuf, host, sizeof(hostbuf)); |
| 2994 |
> |
nuh.nicksize = 0; |
| 2995 |
> |
nuh.usersize = sizeof(userbuf); |
| 2996 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 2997 |
|
|
| 2998 |
< |
MyFree(user); |
| 2948 |
< |
MyFree(host); |
| 2998 |
> |
split_nuh(&nuh); |
| 2999 |
|
} |
| 3000 |
|
}; |
| 3001 |
|
|
| 3002 |
|
kill_reason: REASON '=' QSTRING ';' |
| 3003 |
|
{ |
| 3004 |
< |
if (ypass == 2) |
| 3004 |
> |
if (conf_parser_ctx.pass == 2) |
| 3005 |
|
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf)); |
| 3006 |
|
}; |
| 3007 |
|
|
| 3010 |
|
***************************************************************************/ |
| 3011 |
|
deny_entry: DENY |
| 3012 |
|
{ |
| 3013 |
< |
if (ypass == 2) |
| 3013 |
> |
if (conf_parser_ctx.pass == 2) |
| 3014 |
|
{ |
| 3015 |
|
yy_conf = make_conf_item(DLINE_TYPE); |
| 3016 |
|
yy_aconf = map_to_conf(yy_conf); |
| 3019 |
|
} |
| 3020 |
|
} '{' deny_items '}' ';' |
| 3021 |
|
{ |
| 3022 |
< |
if (ypass == 2) |
| 3022 |
> |
if (conf_parser_ctx.pass == 2) |
| 3023 |
|
{ |
| 3024 |
|
if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST) |
| 3025 |
|
add_conf_by_address(CONF_DLINE, yy_aconf); |
| 3035 |
|
|
| 3036 |
|
deny_ip: IP '=' QSTRING ';' |
| 3037 |
|
{ |
| 3038 |
< |
if (ypass == 2) |
| 3038 |
> |
if (conf_parser_ctx.pass == 2) |
| 3039 |
|
{ |
| 3040 |
|
MyFree(yy_aconf->host); |
| 3041 |
|
DupString(yy_aconf->host, yylval.string); |
| 3044 |
|
|
| 3045 |
|
deny_reason: REASON '=' QSTRING ';' |
| 3046 |
|
{ |
| 3047 |
< |
if (ypass == 2) |
| 3047 |
> |
if (conf_parser_ctx.pass == 2) |
| 3048 |
|
{ |
| 3049 |
|
MyFree(yy_aconf->reason); |
| 3050 |
|
DupString(yy_aconf->reason, yylval.string); |
| 3061 |
|
|
| 3062 |
|
exempt_ip: IP '=' QSTRING ';' |
| 3063 |
|
{ |
| 3064 |
< |
if (ypass == 2) |
| 3064 |
> |
if (conf_parser_ctx.pass == 2) |
| 3065 |
|
{ |
| 3066 |
|
if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) |
| 3067 |
|
{ |
| 3082 |
|
***************************************************************************/ |
| 3083 |
|
gecos_entry: GECOS |
| 3084 |
|
{ |
| 3085 |
< |
if (ypass == 2) |
| 3085 |
> |
if (conf_parser_ctx.pass == 2) |
| 3086 |
|
{ |
| 3087 |
|
regex_ban = 0; |
| 3088 |
|
reasonbuf[0] = gecos_name[0] = '\0'; |
| 3089 |
|
} |
| 3090 |
|
} '{' gecos_items '}' ';' |
| 3091 |
|
{ |
| 3092 |
< |
if (ypass == 2) |
| 3092 |
> |
if (conf_parser_ctx.pass == 2) |
| 3093 |
|
{ |
| 3094 |
|
if (gecos_name[0]) |
| 3095 |
|
{ |
| 3100 |
|
|
| 3101 |
|
if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr))) |
| 3102 |
|
{ |
| 3103 |
< |
ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", errptr); |
| 3103 |
> |
ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", |
| 3104 |
> |
errptr); |
| 3105 |
|
break; |
| 3106 |
|
} |
| 3107 |
|
|
| 3129 |
|
gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item; |
| 3130 |
|
gecos_flags_item: REGEX_T |
| 3131 |
|
{ |
| 3132 |
< |
if (ypass == 2) |
| 3132 |
> |
if (conf_parser_ctx.pass == 2) |
| 3133 |
|
regex_ban = 1; |
| 3134 |
|
}; |
| 3135 |
|
|
| 3138 |
|
|
| 3139 |
|
gecos_name: NAME '=' QSTRING ';' |
| 3140 |
|
{ |
| 3141 |
< |
if (ypass == 2) |
| 3141 |
> |
if (conf_parser_ctx.pass == 2) |
| 3142 |
|
strlcpy(gecos_name, yylval.string, sizeof(gecos_name)); |
| 3143 |
|
}; |
| 3144 |
|
|
| 3145 |
|
gecos_reason: REASON '=' QSTRING ';' |
| 3146 |
|
{ |
| 3147 |
< |
if (ypass == 2) |
| 3147 |
> |
if (conf_parser_ctx.pass == 2) |
| 3148 |
|
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf)); |
| 3149 |
|
}; |
| 3150 |
|
|
| 3182 |
|
general_disable_auth | general_burst_away | |
| 3183 |
|
general_tkline_expire_notices | general_gline_min_cidr | |
| 3184 |
|
general_gline_min_cidr6 | general_use_whois_actually | |
| 3185 |
< |
general_reject_hold_time | |
| 3185 |
> |
general_reject_hold_time | general_stats_e_disabled | |
| 3186 |
> |
general_max_watch | |
| 3187 |
|
error; |
| 3188 |
|
|
| 3189 |
|
|
| 3190 |
+ |
general_max_watch: MAX_WATCH '=' NUMBER ';' |
| 3191 |
+ |
{ |
| 3192 |
+ |
ConfigFileEntry.max_watch = $3; |
| 3193 |
+ |
}; |
| 3194 |
|
|
| 3195 |
|
general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';' |
| 3196 |
|
{ |
| 3279 |
|
|
| 3280 |
|
general_ts_max_delta: TS_MAX_DELTA '=' timespec ';' |
| 3281 |
|
{ |
| 3282 |
< |
if (ypass == 2) |
| 3282 |
> |
if (conf_parser_ctx.pass == 2) |
| 3283 |
|
ConfigFileEntry.ts_max_delta = $3; |
| 3284 |
|
}; |
| 3285 |
|
|
| 3286 |
|
general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';' |
| 3287 |
|
{ |
| 3288 |
< |
if (($3 > 0) && ypass == 1) |
| 3288 |
> |
if (($3 > 0) && conf_parser_ctx.pass == 1) |
| 3289 |
|
{ |
| 3290 |
|
ilog(L_CRIT, "You haven't read your config file properly."); |
| 3291 |
|
ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed."); |
| 3301 |
|
|
| 3302 |
|
general_kline_reason: KLINE_REASON '=' QSTRING ';' |
| 3303 |
|
{ |
| 3304 |
< |
if (ypass == 2) |
| 3304 |
> |
if (conf_parser_ctx.pass == 2) |
| 3305 |
|
{ |
| 3306 |
|
MyFree(ConfigFileEntry.kline_reason); |
| 3307 |
|
DupString(ConfigFileEntry.kline_reason, yylval.string); |
| 3318 |
|
ConfigFileEntry.warn_no_nline = yylval.number; |
| 3319 |
|
}; |
| 3320 |
|
|
| 3321 |
+ |
general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';' |
| 3322 |
+ |
{ |
| 3323 |
+ |
ConfigFileEntry.stats_e_disabled = yylval.number; |
| 3324 |
+ |
}; |
| 3325 |
+ |
|
| 3326 |
|
general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';' |
| 3327 |
|
{ |
| 3328 |
|
ConfigFileEntry.stats_o_oper_only = yylval.number; |
| 3391 |
|
|
| 3392 |
|
general_message_locale: MESSAGE_LOCALE '=' QSTRING ';' |
| 3393 |
|
{ |
| 3394 |
< |
if (ypass == 2) |
| 3394 |
> |
if (conf_parser_ctx.pass == 2) |
| 3395 |
|
{ |
| 3396 |
|
if (strlen(yylval.string) > LOCALE_LENGTH-2) |
| 3397 |
|
yylval.string[LOCALE_LENGTH-1] = '\0'; |
| 3417 |
|
|
| 3418 |
|
general_servlink_path: SERVLINK_PATH '=' QSTRING ';' |
| 3419 |
|
{ |
| 3420 |
< |
if (ypass == 2) |
| 3420 |
> |
if (conf_parser_ctx.pass == 2) |
| 3421 |
|
{ |
| 3422 |
|
MyFree(ConfigFileEntry.servlink_path); |
| 3423 |
|
DupString(ConfigFileEntry.servlink_path, yylval.string); |
| 3427 |
|
general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';' |
| 3428 |
|
{ |
| 3429 |
|
#ifdef HAVE_LIBCRYPTO |
| 3430 |
< |
if (ypass == 2) |
| 3430 |
> |
if (conf_parser_ctx.pass == 2) |
| 3431 |
|
{ |
| 3432 |
|
struct EncCapability *ecap; |
| 3433 |
|
const char *cipher_name; |
| 3451 |
|
yyerror("Invalid cipher"); |
| 3452 |
|
} |
| 3453 |
|
#else |
| 3454 |
< |
if (ypass == 2) |
| 3454 |
> |
if (conf_parser_ctx.pass == 2) |
| 3455 |
|
yyerror("Ignoring default_cipher_preference -- no OpenSSL support"); |
| 3456 |
|
#endif |
| 3457 |
|
}; |
| 3458 |
|
|
| 3459 |
|
general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';' |
| 3460 |
|
{ |
| 3461 |
< |
if (ypass == 2) |
| 3461 |
> |
if (conf_parser_ctx.pass == 2) |
| 3462 |
|
{ |
| 3463 |
|
ConfigFileEntry.compression_level = $3; |
| 3464 |
|
#ifndef HAVE_LIBZ |
| 3481 |
|
|
| 3482 |
|
general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';' |
| 3483 |
|
{ |
| 3484 |
< |
if (ypass == 2) |
| 3484 |
> |
if (conf_parser_ctx.pass == 2) |
| 3485 |
|
{ |
| 3486 |
|
MyFree(ConfigFileEntry.egdpool_path); |
| 3487 |
|
DupString(ConfigFileEntry.egdpool_path, yylval.string); |
| 3515 |
|
} | T_CCONN |
| 3516 |
|
{ |
| 3517 |
|
ConfigFileEntry.oper_umodes |= UMODE_CCONN; |
| 3518 |
+ |
} | T_CCONN_FULL |
| 3519 |
+ |
{ |
| 3520 |
+ |
ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL; |
| 3521 |
|
} | T_DEAF |
| 3522 |
|
{ |
| 3523 |
|
ConfigFileEntry.oper_umodes |= UMODE_DEAF; |
| 3580 |
|
} | T_CCONN |
| 3581 |
|
{ |
| 3582 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; |
| 3583 |
+ |
} | T_CCONN_FULL |
| 3584 |
+ |
{ |
| 3585 |
+ |
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL; |
| 3586 |
|
} | T_DEAF |
| 3587 |
|
{ |
| 3588 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; |
| 3663 |
|
***************************************************************************/ |
| 3664 |
|
gline_entry: GLINES |
| 3665 |
|
{ |
| 3666 |
< |
if (ypass == 2) |
| 3666 |
> |
if (conf_parser_ctx.pass == 2) |
| 3667 |
|
{ |
| 3668 |
|
yy_conf = make_conf_item(GDENY_TYPE); |
| 3669 |
|
yy_aconf = map_to_conf(yy_conf); |
| 3670 |
|
} |
| 3671 |
|
} '{' gline_items '}' ';' |
| 3672 |
|
{ |
| 3673 |
< |
if (ypass == 2) |
| 3673 |
> |
if (conf_parser_ctx.pass == 2) |
| 3674 |
|
{ |
| 3675 |
|
/* |
| 3676 |
|
* since we re-allocate yy_conf/yy_aconf after the end of action=, at the |
| 3696 |
|
|
| 3697 |
|
gline_enable: ENABLE '=' TBOOL ';' |
| 3698 |
|
{ |
| 3699 |
< |
if (ypass == 2) |
| 3699 |
> |
if (conf_parser_ctx.pass == 2) |
| 3700 |
|
ConfigFileEntry.glines = yylval.number; |
| 3701 |
|
}; |
| 3702 |
|
|
| 3703 |
|
gline_duration: DURATION '=' timespec ';' |
| 3704 |
|
{ |
| 3705 |
< |
if (ypass == 2) |
| 3705 |
> |
if (conf_parser_ctx.pass == 2) |
| 3706 |
|
ConfigFileEntry.gline_time = $3; |
| 3707 |
|
}; |
| 3708 |
|
|
| 3709 |
|
gline_logging: LOGGING |
| 3710 |
|
{ |
| 3711 |
< |
if (ypass == 2) |
| 3711 |
> |
if (conf_parser_ctx.pass == 2) |
| 3712 |
|
ConfigFileEntry.gline_logging = 0; |
| 3713 |
|
} '=' gline_logging_types ';'; |
| 3714 |
|
gline_logging_types: gline_logging_types ',' gline_logging_type_item | gline_logging_type_item; |
| 3715 |
|
gline_logging_type_item: T_REJECT |
| 3716 |
|
{ |
| 3717 |
< |
if (ypass == 2) |
| 3717 |
> |
if (conf_parser_ctx.pass == 2) |
| 3718 |
|
ConfigFileEntry.gline_logging |= GDENY_REJECT; |
| 3719 |
|
} | T_BLOCK |
| 3720 |
|
{ |
| 3721 |
< |
if (ypass == 2) |
| 3721 |
> |
if (conf_parser_ctx.pass == 2) |
| 3722 |
|
ConfigFileEntry.gline_logging |= GDENY_BLOCK; |
| 3723 |
|
}; |
| 3724 |
|
|
| 3725 |
|
gline_user: USER '=' QSTRING ';' |
| 3726 |
|
{ |
| 3727 |
< |
if (ypass == 2) |
| 3727 |
> |
if (conf_parser_ctx.pass == 2) |
| 3728 |
|
{ |
| 3729 |
< |
struct CollectItem *yy_tmp = NULL; |
| 3729 |
> |
struct split_nuh_item nuh; |
| 3730 |
> |
|
| 3731 |
> |
nuh.nuhmask = yylval.string; |
| 3732 |
> |
nuh.nickptr = NULL; |
| 3733 |
> |
nuh.userptr = userbuf; |
| 3734 |
> |
nuh.hostptr = hostbuf; |
| 3735 |
> |
|
| 3736 |
> |
nuh.nicksize = 0; |
| 3737 |
> |
nuh.usersize = sizeof(userbuf); |
| 3738 |
> |
nuh.hostsize = sizeof(hostbuf); |
| 3739 |
> |
|
| 3740 |
> |
split_nuh(&nuh); |
| 3741 |
|
|
| 3742 |
|
if (yy_aconf->user == NULL) |
| 3743 |
|
{ |
| 3744 |
< |
split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host); |
| 3744 |
> |
DupString(yy_aconf->user, userbuf); |
| 3745 |
> |
DupString(yy_aconf->host, hostbuf); |
| 3746 |
|
} |
| 3747 |
|
else |
| 3748 |
|
{ |
| 3749 |
< |
yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 3750 |
< |
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
| 3749 |
> |
struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
| 3750 |
> |
|
| 3751 |
> |
DupString(yy_tmp->user, userbuf); |
| 3752 |
> |
DupString(yy_tmp->host, hostbuf); |
| 3753 |
> |
|
| 3754 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
| 3755 |
|
} |
| 3756 |
|
} |
| 3758 |
|
|
| 3759 |
|
gline_server: NAME '=' QSTRING ';' |
| 3760 |
|
{ |
| 3761 |
< |
if (ypass == 2) |
| 3761 |
> |
if (conf_parser_ctx.pass == 2) |
| 3762 |
|
{ |
| 3763 |
|
MyFree(yy_conf->name); |
| 3764 |
|
DupString(yy_conf->name, yylval.string); |
| 3767 |
|
|
| 3768 |
|
gline_action: ACTION |
| 3769 |
|
{ |
| 3770 |
< |
if (ypass == 2) |
| 3770 |
> |
if (conf_parser_ctx.pass == 2) |
| 3771 |
|
yy_aconf->flags = 0; |
| 3772 |
|
} '=' gdeny_types ';' |
| 3773 |
|
{ |
| 3774 |
< |
if (ypass == 2) |
| 3774 |
> |
if (conf_parser_ctx.pass == 2) |
| 3775 |
|
{ |
| 3776 |
|
struct CollectItem *yy_tmp = NULL; |
| 3777 |
|
dlink_node *ptr, *next_ptr; |
| 3818 |
|
gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item; |
| 3819 |
|
gdeny_type_item: T_REJECT |
| 3820 |
|
{ |
| 3821 |
< |
if (ypass == 2) |
| 3821 |
> |
if (conf_parser_ctx.pass == 2) |
| 3822 |
|
yy_aconf->flags |= GDENY_REJECT; |
| 3823 |
|
} | T_BLOCK |
| 3824 |
|
{ |
| 3825 |
< |
if (ypass == 2) |
| 3825 |
> |
if (conf_parser_ctx.pass == 2) |
| 3826 |
|
yy_aconf->flags |= GDENY_BLOCK; |
| 3827 |
|
}; |
| 3828 |
|
|
| 3842 |
|
channel_no_create_on_split | channel_restrict_channels | |
| 3843 |
|
channel_no_join_on_split | channel_burst_topicwho | |
| 3844 |
|
channel_jflood_count | channel_jflood_time | |
| 3845 |
< |
error; |
| 3845 |
> |
channel_disable_fake_channels | error; |
| 3846 |
> |
|
| 3847 |
> |
channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';' |
| 3848 |
> |
{ |
| 3849 |
> |
ConfigChannel.disable_fake_channels = yylval.number; |
| 3850 |
> |
}; |
| 3851 |
|
|
| 3852 |
|
channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';' |
| 3853 |
|
{ |
| 3950 |
|
|
| 3951 |
|
serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';' |
| 3952 |
|
{ |
| 3953 |
< |
if (ypass == 2) |
| 3953 |
> |
if (conf_parser_ctx.pass == 2) |
| 3954 |
|
ConfigServerHide.flatten_links = yylval.number; |
| 3955 |
|
}; |
| 3956 |
|
|
| 3957 |
|
serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';' |
| 3958 |
|
{ |
| 3959 |
< |
if (ypass == 2) |
| 3959 |
> |
if (conf_parser_ctx.pass == 2) |
| 3960 |
|
ConfigServerHide.hide_servers = yylval.number; |
| 3961 |
|
}; |
| 3962 |
|
|
| 3963 |
|
serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';' |
| 3964 |
|
{ |
| 3965 |
< |
if (ypass == 2) |
| 3965 |
> |
if (conf_parser_ctx.pass == 2) |
| 3966 |
|
{ |
| 3967 |
|
MyFree(ConfigServerHide.hidden_name); |
| 3968 |
|
DupString(ConfigServerHide.hidden_name, yylval.string); |
| 3971 |
|
|
| 3972 |
|
serverhide_links_delay: LINKS_DELAY '=' timespec ';' |
| 3973 |
|
{ |
| 3974 |
< |
if (ypass == 2) |
| 3974 |
> |
if (conf_parser_ctx.pass == 2) |
| 3975 |
|
{ |
| 3976 |
|
if (($3 > 0) && ConfigServerHide.links_disabled == 1) |
| 3977 |
|
{ |
| 3985 |
|
|
| 3986 |
|
serverhide_hidden: HIDDEN '=' TBOOL ';' |
| 3987 |
|
{ |
| 3988 |
< |
if (ypass == 2) |
| 3988 |
> |
if (conf_parser_ctx.pass == 2) |
| 3989 |
|
ConfigServerHide.hidden = yylval.number; |
| 3990 |
|
}; |
| 3991 |
|
|
| 3992 |
|
serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';' |
| 3993 |
|
{ |
| 3994 |
< |
if (ypass == 2) |
| 3994 |
> |
if (conf_parser_ctx.pass == 2) |
| 3995 |
|
ConfigServerHide.disable_hidden = yylval.number; |
| 3996 |
|
}; |
| 3997 |
|
|
| 3998 |
|
serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';' |
| 3999 |
|
{ |
| 4000 |
< |
if (ypass == 2) |
| 4000 |
> |
if (conf_parser_ctx.pass == 2) |
| 4001 |
|
ConfigServerHide.hide_server_ips = yylval.number; |
| 4002 |
|
}; |