| 47 |
|
#include "resv.h" |
| 48 |
|
#include "numeric.h" |
| 49 |
|
#include "s_user.h" |
| 50 |
+ |
#include "motd.h" |
| 51 |
|
|
| 52 |
|
#ifdef HAVE_LIBCRYPTO |
| 53 |
|
#include <openssl/rsa.h> |
| 77 |
|
bind, |
| 78 |
|
file, |
| 79 |
|
ciph, |
| 80 |
+ |
cert, |
| 81 |
|
rpass, |
| 82 |
|
spass, |
| 83 |
|
class; |
| 152 |
|
%token CALLER_ID_WAIT |
| 153 |
|
%token CAN_FLOOD |
| 154 |
|
%token CHANNEL |
| 155 |
< |
%token CIDR_BITLEN_IPV4 |
| 156 |
< |
%token CIDR_BITLEN_IPV6 |
| 155 |
> |
%token CIDR_BITLEN_IPV4 |
| 156 |
> |
%token CIDR_BITLEN_IPV6 |
| 157 |
|
%token CLASS |
| 158 |
|
%token CONNECT |
| 159 |
|
%token CONNECTFREQ |
| 160 |
+ |
%token CYCLE_ON_HOST_CHANGE |
| 161 |
|
%token DEFAULT_FLOODCOUNT |
| 162 |
|
%token DEFAULT_SPLIT_SERVER_COUNT |
| 163 |
|
%token DEFAULT_SPLIT_USER_COUNT |
| 174 |
|
%token EXCEED_LIMIT |
| 175 |
|
%token EXEMPT |
| 176 |
|
%token FAILED_OPER_NOTICE |
| 174 |
– |
%token IRCD_FLAGS |
| 177 |
|
%token FLATTEN_LINKS |
| 178 |
|
%token GECOS |
| 179 |
|
%token GENERAL |
| 181 |
|
%token GLINE_DURATION |
| 182 |
|
%token GLINE_ENABLE |
| 183 |
|
%token GLINE_EXEMPT |
| 182 |
– |
%token GLINE_REQUEST_DURATION |
| 184 |
|
%token GLINE_MIN_CIDR |
| 185 |
|
%token GLINE_MIN_CIDR6 |
| 186 |
+ |
%token GLINE_REQUEST_DURATION |
| 187 |
|
%token GLOBAL_KILL |
| 186 |
– |
%token IRCD_AUTH |
| 187 |
– |
%token NEED_IDENT |
| 188 |
|
%token HAVENT_READ_CONF |
| 189 |
|
%token HIDDEN |
| 190 |
< |
%token HIDDEN_NAME |
| 190 |
> |
%token HIDDEN_NAME |
| 191 |
> |
%token HIDE_IDLE_FROM_OPERS |
| 192 |
|
%token HIDE_SERVER_IPS |
| 193 |
|
%token HIDE_SERVERS |
| 194 |
|
%token HIDE_SERVICES |
| 195 |
< |
%token HIDE_SPOOF_IPS |
| 195 |
> |
%token HIDE_SPOOF_IPS |
| 196 |
|
%token HOST |
| 197 |
|
%token HUB |
| 198 |
|
%token HUB_MASK |
| 199 |
|
%token IGNORE_BOGUS_TS |
| 200 |
|
%token INVISIBLE_ON_CONNECT |
| 201 |
|
%token IP |
| 202 |
+ |
%token IRCD_AUTH |
| 203 |
+ |
%token IRCD_FLAGS |
| 204 |
+ |
%token IRCD_SID |
| 205 |
+ |
%token JOIN_FLOOD_COUNT |
| 206 |
+ |
%token JOIN_FLOOD_TIME |
| 207 |
|
%token KILL |
| 208 |
< |
%token KILL_CHASE_TIME_LIMIT |
| 208 |
> |
%token KILL_CHASE_TIME_LIMIT |
| 209 |
|
%token KLINE |
| 210 |
|
%token KLINE_EXEMPT |
| 211 |
|
%token KNOCK_DELAY |
| 213 |
|
%token LEAF_MASK |
| 214 |
|
%token LINKS_DELAY |
| 215 |
|
%token LISTEN |
| 210 |
– |
%token T_LOG |
| 216 |
|
%token MASK |
| 217 |
|
%token MAX_ACCEPT |
| 218 |
|
%token MAX_BANS |
| 220 |
|
%token MAX_CHANS_PER_USER |
| 221 |
|
%token MAX_GLOBAL |
| 222 |
|
%token MAX_IDENT |
| 223 |
+ |
%token MAX_IDLE |
| 224 |
|
%token MAX_LOCAL |
| 225 |
|
%token MAX_NICK_CHANGES |
| 226 |
|
%token MAX_NICK_LENGTH |
| 229 |
|
%token MAX_TARGETS |
| 230 |
|
%token MAX_TOPIC_LENGTH |
| 231 |
|
%token MAX_WATCH |
| 232 |
+ |
%token MIN_IDLE |
| 233 |
|
%token MIN_NONWILDCARD |
| 234 |
|
%token MIN_NONWILDCARD_SIMPLE |
| 228 |
– |
%token MIN_IDLE |
| 229 |
– |
%token MAX_IDLE |
| 230 |
– |
%token RANDOM_IDLE |
| 231 |
– |
%token HIDE_IDLE_FROM_OPERS |
| 235 |
|
%token MODULE |
| 236 |
|
%token MODULES |
| 237 |
+ |
%token MOTD |
| 238 |
|
%token NAME |
| 239 |
+ |
%token NEED_IDENT |
| 240 |
|
%token NEED_PASSWORD |
| 241 |
|
%token NETWORK_DESC |
| 242 |
|
%token NETWORK_NAME |
| 248 |
|
%token NUMBER |
| 249 |
|
%token NUMBER_PER_CIDR |
| 250 |
|
%token NUMBER_PER_IP |
| 246 |
– |
%token OPERATOR |
| 247 |
– |
%token OPERS_BYPASS_CALLERID |
| 251 |
|
%token OPER_ONLY_UMODES |
| 252 |
|
%token OPER_PASS_RESV |
| 253 |
|
%token OPER_UMODES |
| 254 |
< |
%token JOIN_FLOOD_COUNT |
| 255 |
< |
%token JOIN_FLOOD_TIME |
| 254 |
> |
%token OPERATOR |
| 255 |
> |
%token OPERS_BYPASS_CALLERID |
| 256 |
|
%token PACE_WAIT |
| 257 |
|
%token PACE_WAIT_SIMPLE |
| 258 |
|
%token PASSWORD |
| 261 |
|
%token PING_TIME |
| 262 |
|
%token PORT |
| 263 |
|
%token QSTRING |
| 264 |
+ |
%token RANDOM_IDLE |
| 265 |
|
%token REASON |
| 266 |
|
%token REDIRPORT |
| 267 |
|
%token REDIRSERV |
| 268 |
|
%token REHASH |
| 269 |
|
%token REMOTE |
| 270 |
|
%token REMOTEBAN |
| 267 |
– |
%token RSA_PRIVATE_KEY_FILE |
| 268 |
– |
%token RSA_PUBLIC_KEY_FILE |
| 269 |
– |
%token SSL_CERTIFICATE_FILE |
| 270 |
– |
%token SSL_DH_PARAM_FILE |
| 271 |
– |
%token T_SSL_CLIENT_METHOD |
| 272 |
– |
%token T_SSL_SERVER_METHOD |
| 273 |
– |
%token T_SSLV3 |
| 274 |
– |
%token T_TLSV1 |
| 271 |
|
%token RESV |
| 272 |
|
%token RESV_EXEMPT |
| 273 |
+ |
%token RSA_PRIVATE_KEY_FILE |
| 274 |
+ |
%token RSA_PUBLIC_KEY_FILE |
| 275 |
|
%token SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS |
| 278 |
– |
%token SENDQ |
| 276 |
|
%token SEND_PASSWORD |
| 277 |
+ |
%token SENDQ |
| 278 |
|
%token SERVERHIDE |
| 279 |
|
%token SERVERINFO |
| 282 |
– |
%token SQUIT |
| 283 |
– |
%token IRCD_SID |
| 284 |
– |
%token TKLINE_EXPIRE_NOTICES |
| 285 |
– |
%token T_SHARED |
| 286 |
– |
%token T_CLUSTER |
| 287 |
– |
%token TYPE |
| 280 |
|
%token SHORT_MOTD |
| 281 |
|
%token SPOOF |
| 282 |
|
%token SPOOF_NOTICE |
| 283 |
+ |
%token SQUIT |
| 284 |
+ |
%token SSL_CERTIFICATE_FILE |
| 285 |
+ |
%token SSL_CERTIFICATE_FINGERPRINT |
| 286 |
+ |
%token SSL_CONNECTION_REQUIRED |
| 287 |
+ |
%token SSL_DH_PARAM_FILE |
| 288 |
|
%token STATS_E_DISABLED |
| 289 |
|
%token STATS_I_OPER_ONLY |
| 290 |
|
%token STATS_K_OPER_ONLY |
| 291 |
|
%token STATS_O_OPER_ONLY |
| 292 |
|
%token STATS_P_OPER_ONLY |
| 293 |
< |
%token TBOOL |
| 297 |
< |
%token TMASKED |
| 298 |
< |
%token TS_MAX_DELTA |
| 299 |
< |
%token TS_WARN_DELTA |
| 300 |
< |
%token TWODOTS |
| 293 |
> |
%token STATS_U_OPER_ONLY |
| 294 |
|
%token T_ALL |
| 295 |
|
%token T_BOTS |
| 303 |
– |
%token T_SOFTCALLERID |
| 296 |
|
%token T_CALLERID |
| 297 |
|
%token T_CCONN |
| 298 |
< |
%token T_CCONN_FULL |
| 307 |
< |
%token T_SSL_CIPHER_LIST |
| 298 |
> |
%token T_CLUSTER |
| 299 |
|
%token T_DEAF |
| 300 |
|
%token T_DEBUG |
| 301 |
|
%token T_DLINE |
| 302 |
|
%token T_EXTERNAL |
| 303 |
|
%token T_FARCONNECT |
| 304 |
+ |
%token T_FILE |
| 305 |
|
%token T_FULL |
| 306 |
+ |
%token T_GLOBOPS |
| 307 |
|
%token T_INVISIBLE |
| 308 |
|
%token T_IPV4 |
| 309 |
|
%token T_IPV6 |
| 310 |
|
%token T_LOCOPS |
| 311 |
+ |
%token T_LOG |
| 312 |
|
%token T_MAX_CLIENTS |
| 313 |
|
%token T_NCHANGE |
| 314 |
|
%token T_NONONREG |
| 315 |
|
%token T_OPERWALL |
| 316 |
|
%token T_RECVQ |
| 317 |
|
%token T_REJ |
| 318 |
+ |
%token T_RESTART |
| 319 |
|
%token T_SERVER |
| 320 |
+ |
%token T_SERVICE |
| 321 |
+ |
%token T_SERVICES_NAME |
| 322 |
|
%token T_SERVNOTICE |
| 323 |
|
%token T_SET |
| 324 |
+ |
%token T_SHARED |
| 325 |
+ |
%token T_SIZE |
| 326 |
|
%token T_SKILL |
| 327 |
+ |
%token T_SOFTCALLERID |
| 328 |
|
%token T_SPY |
| 329 |
|
%token T_SSL |
| 330 |
+ |
%token T_SSL_CIPHER_LIST |
| 331 |
+ |
%token T_SSL_CLIENT_METHOD |
| 332 |
+ |
%token T_SSL_SERVER_METHOD |
| 333 |
+ |
%token T_SSLV3 |
| 334 |
+ |
%token T_TLSV1 |
| 335 |
|
%token T_UMODES |
| 336 |
|
%token T_UNAUTH |
| 337 |
|
%token T_UNDLINE |
| 338 |
|
%token T_UNLIMITED |
| 339 |
|
%token T_UNRESV |
| 340 |
|
%token T_UNXLINE |
| 336 |
– |
%token T_GLOBOPS |
| 341 |
|
%token T_WALLOP |
| 342 |
|
%token T_WALLOPS |
| 343 |
|
%token T_WEBIRC |
| 344 |
< |
%token T_RESTART |
| 341 |
< |
%token T_SERVICE |
| 342 |
< |
%token T_SERVICES_NAME |
| 344 |
> |
%token TBOOL |
| 345 |
|
%token THROTTLE_TIME |
| 346 |
+ |
%token TKLINE_EXPIRE_NOTICES |
| 347 |
+ |
%token TMASKED |
| 348 |
|
%token TRUE_NO_OPER_FLOOD |
| 349 |
+ |
%token TS_MAX_DELTA |
| 350 |
+ |
%token TS_WARN_DELTA |
| 351 |
+ |
%token TWODOTS |
| 352 |
+ |
%token TYPE |
| 353 |
|
%token UNKLINE |
| 346 |
– |
%token USER |
| 354 |
|
%token USE_EGD |
| 355 |
|
%token USE_LOGGING |
| 356 |
+ |
%token USER |
| 357 |
|
%token VHOST |
| 358 |
|
%token VHOST6 |
| 351 |
– |
%token XLINE |
| 359 |
|
%token WARN_NO_NLINE |
| 360 |
< |
%token T_SIZE |
| 354 |
< |
%token T_FILE |
| 360 |
> |
%token XLINE |
| 361 |
|
|
| 362 |
< |
%type <string> QSTRING |
| 363 |
< |
%type <number> NUMBER |
| 364 |
< |
%type <number> timespec |
| 365 |
< |
%type <number> timespec_ |
| 366 |
< |
%type <number> sizespec |
| 367 |
< |
%type <number> sizespec_ |
| 362 |
> |
%type <string> QSTRING |
| 363 |
> |
%type <number> NUMBER |
| 364 |
> |
%type <number> timespec |
| 365 |
> |
%type <number> timespec_ |
| 366 |
> |
%type <number> sizespec |
| 367 |
> |
%type <number> sizespec_ |
| 368 |
|
|
| 369 |
|
%% |
| 370 |
|
conf: |
| 391 |
|
| general_entry |
| 392 |
|
| gecos_entry |
| 393 |
|
| modules_entry |
| 394 |
+ |
| motd_entry |
| 395 |
|
| error ';' |
| 396 |
|
| error '}' |
| 397 |
|
; |
| 555 |
|
serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';' |
| 556 |
|
{ |
| 557 |
|
#ifdef HAVE_LIBCRYPTO |
| 558 |
< |
if (conf_parser_ctx.pass == 1) |
| 552 |
< |
{ |
| 553 |
< |
BIO *file; |
| 558 |
> |
BIO *file = NULL; |
| 559 |
|
|
| 560 |
< |
if (ServerInfo.rsa_private_key) |
| 561 |
< |
{ |
| 557 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 558 |
< |
ServerInfo.rsa_private_key = NULL; |
| 559 |
< |
} |
| 560 |
> |
if (conf_parser_ctx.pass != 1) |
| 561 |
> |
break; |
| 562 |
|
|
| 563 |
< |
if (ServerInfo.rsa_private_key_file) |
| 564 |
< |
{ |
| 565 |
< |
MyFree(ServerInfo.rsa_private_key_file); |
| 566 |
< |
ServerInfo.rsa_private_key_file = NULL; |
| 567 |
< |
} |
| 563 |
> |
if (ServerInfo.rsa_private_key) |
| 564 |
> |
{ |
| 565 |
> |
RSA_free(ServerInfo.rsa_private_key); |
| 566 |
> |
ServerInfo.rsa_private_key = NULL; |
| 567 |
> |
} |
| 568 |
|
|
| 569 |
< |
ServerInfo.rsa_private_key_file = xstrdup(yylval.string); |
| 569 |
> |
if (ServerInfo.rsa_private_key_file) |
| 570 |
> |
{ |
| 571 |
> |
MyFree(ServerInfo.rsa_private_key_file); |
| 572 |
> |
ServerInfo.rsa_private_key_file = NULL; |
| 573 |
> |
} |
| 574 |
|
|
| 575 |
< |
if ((file = BIO_new_file(yylval.string, "r")) == NULL) |
| 570 |
< |
{ |
| 571 |
< |
conf_error_report("File open failed, ignoring"); |
| 572 |
< |
break; |
| 573 |
< |
} |
| 575 |
> |
ServerInfo.rsa_private_key_file = xstrdup(yylval.string); |
| 576 |
|
|
| 577 |
< |
ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); |
| 577 |
> |
if ((file = BIO_new_file(yylval.string, "r")) == NULL) |
| 578 |
> |
{ |
| 579 |
> |
conf_error_report("File open failed, ignoring"); |
| 580 |
> |
break; |
| 581 |
> |
} |
| 582 |
|
|
| 583 |
< |
BIO_set_close(file, BIO_CLOSE); |
| 578 |
< |
BIO_free(file); |
| 583 |
> |
ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); |
| 584 |
|
|
| 585 |
< |
if (ServerInfo.rsa_private_key == NULL) |
| 586 |
< |
{ |
| 582 |
< |
conf_error_report("Couldn't extract key, ignoring"); |
| 583 |
< |
break; |
| 584 |
< |
} |
| 585 |
> |
BIO_set_close(file, BIO_CLOSE); |
| 586 |
> |
BIO_free(file); |
| 587 |
|
|
| 588 |
< |
if (!RSA_check_key(ServerInfo.rsa_private_key)) |
| 589 |
< |
{ |
| 590 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 591 |
< |
ServerInfo.rsa_private_key = NULL; |
| 588 |
> |
if (ServerInfo.rsa_private_key == NULL) |
| 589 |
> |
{ |
| 590 |
> |
conf_error_report("Couldn't extract key, ignoring"); |
| 591 |
> |
break; |
| 592 |
> |
} |
| 593 |
|
|
| 594 |
< |
conf_error_report("Invalid key, ignoring"); |
| 595 |
< |
break; |
| 596 |
< |
} |
| 594 |
> |
if (!RSA_check_key(ServerInfo.rsa_private_key)) |
| 595 |
> |
{ |
| 596 |
> |
RSA_free(ServerInfo.rsa_private_key); |
| 597 |
> |
ServerInfo.rsa_private_key = NULL; |
| 598 |
|
|
| 599 |
< |
/* require 2048 bit (256 byte) key */ |
| 600 |
< |
if (RSA_size(ServerInfo.rsa_private_key) != 256) |
| 601 |
< |
{ |
| 598 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 599 |
< |
ServerInfo.rsa_private_key = NULL; |
| 599 |
> |
conf_error_report("Invalid key, ignoring"); |
| 600 |
> |
break; |
| 601 |
> |
} |
| 602 |
|
|
| 603 |
< |
conf_error_report("Not a 2048 bit key, ignoring"); |
| 604 |
< |
} |
| 603 |
> |
/* require 2048 bit (256 byte) key */ |
| 604 |
> |
if (RSA_size(ServerInfo.rsa_private_key) != 256) |
| 605 |
> |
{ |
| 606 |
> |
RSA_free(ServerInfo.rsa_private_key); |
| 607 |
> |
ServerInfo.rsa_private_key = NULL; |
| 608 |
> |
|
| 609 |
> |
conf_error_report("Not a 2048 bit key, ignoring"); |
| 610 |
|
} |
| 611 |
|
#endif |
| 612 |
|
}; |
| 702 |
|
|
| 703 |
|
serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';' |
| 704 |
|
{ |
| 705 |
< |
if (conf_parser_ctx.pass == 2) |
| 706 |
< |
{ |
| 707 |
< |
MyFree(ServerInfo.network_desc); |
| 708 |
< |
ServerInfo.network_desc = xstrdup(yylval.string); |
| 709 |
< |
} |
| 705 |
> |
if (conf_parser_ctx.pass != 2) |
| 706 |
> |
break; |
| 707 |
> |
|
| 708 |
> |
MyFree(ServerInfo.network_desc); |
| 709 |
> |
ServerInfo.network_desc = xstrdup(yylval.string); |
| 710 |
|
}; |
| 711 |
|
|
| 712 |
|
serverinfo_vhost: VHOST '=' QSTRING ';' |
| 853 |
|
|
| 854 |
|
admin_name: NAME '=' QSTRING ';' |
| 855 |
|
{ |
| 856 |
< |
if (conf_parser_ctx.pass == 2) |
| 857 |
< |
{ |
| 858 |
< |
MyFree(AdminInfo.name); |
| 859 |
< |
AdminInfo.name = xstrdup(yylval.string); |
| 860 |
< |
} |
| 856 |
> |
if (conf_parser_ctx.pass != 2) |
| 857 |
> |
break; |
| 858 |
> |
|
| 859 |
> |
MyFree(AdminInfo.name); |
| 860 |
> |
AdminInfo.name = xstrdup(yylval.string); |
| 861 |
|
}; |
| 862 |
|
|
| 863 |
|
admin_email: EMAIL '=' QSTRING ';' |
| 864 |
|
{ |
| 865 |
< |
if (conf_parser_ctx.pass == 2) |
| 866 |
< |
{ |
| 867 |
< |
MyFree(AdminInfo.email); |
| 868 |
< |
AdminInfo.email = xstrdup(yylval.string); |
| 869 |
< |
} |
| 865 |
> |
if (conf_parser_ctx.pass != 2) |
| 866 |
> |
break; |
| 867 |
> |
|
| 868 |
> |
MyFree(AdminInfo.email); |
| 869 |
> |
AdminInfo.email = xstrdup(yylval.string); |
| 870 |
|
}; |
| 871 |
|
|
| 872 |
|
admin_description: DESCRIPTION '=' QSTRING ';' |
| 873 |
|
{ |
| 874 |
+ |
if (conf_parser_ctx.pass != 2) |
| 875 |
+ |
break; |
| 876 |
+ |
|
| 877 |
+ |
MyFree(AdminInfo.description); |
| 878 |
+ |
AdminInfo.description = xstrdup(yylval.string); |
| 879 |
+ |
}; |
| 880 |
+ |
|
| 881 |
+ |
/*************************************************************************** |
| 882 |
+ |
* motd section |
| 883 |
+ |
***************************************************************************/ |
| 884 |
+ |
motd_entry: MOTD |
| 885 |
+ |
{ |
| 886 |
|
if (conf_parser_ctx.pass == 2) |
| 887 |
< |
{ |
| 888 |
< |
MyFree(AdminInfo.description); |
| 889 |
< |
AdminInfo.description = xstrdup(yylval.string); |
| 890 |
< |
} |
| 887 |
> |
reset_block_state(); |
| 888 |
> |
} '{' motd_items '}' ';' |
| 889 |
> |
{ |
| 890 |
> |
dlink_node *ptr = NULL; |
| 891 |
> |
|
| 892 |
> |
if (conf_parser_ctx.pass != 2) |
| 893 |
> |
break; |
| 894 |
> |
|
| 895 |
> |
if (!block_state.file.buf[0]) |
| 896 |
> |
break; |
| 897 |
> |
|
| 898 |
> |
DLINK_FOREACH(ptr, block_state.mask.list.head) |
| 899 |
> |
motd_add(ptr->data, block_state.file.buf); |
| 900 |
> |
}; |
| 901 |
> |
|
| 902 |
> |
motd_items: motd_items motd_item | motd_item; |
| 903 |
> |
motd_item: motd_mask | motd_file | error ';' ; |
| 904 |
> |
|
| 905 |
> |
motd_mask: MASK '=' QSTRING ';' |
| 906 |
> |
{ |
| 907 |
> |
if (conf_parser_ctx.pass == 2) |
| 908 |
> |
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); |
| 909 |
> |
}; |
| 910 |
> |
|
| 911 |
> |
motd_file: T_FILE '=' QSTRING ';' |
| 912 |
> |
{ |
| 913 |
> |
if (conf_parser_ctx.pass == 2) |
| 914 |
> |
strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); |
| 915 |
|
}; |
| 916 |
|
|
| 917 |
|
/*************************************************************************** |
| 984 |
|
{ |
| 985 |
|
if (conf_parser_ctx.pass == 2) |
| 986 |
|
block_state.type.value = LOG_TYPE_GLINE; |
| 987 |
+ |
} | XLINE |
| 988 |
+ |
{ |
| 989 |
+ |
if (conf_parser_ctx.pass == 2) |
| 990 |
+ |
block_state.type.value = LOG_TYPE_XLINE; |
| 991 |
+ |
} | RESV |
| 992 |
+ |
{ |
| 993 |
+ |
if (conf_parser_ctx.pass == 2) |
| 994 |
+ |
block_state.type.value = LOG_TYPE_RESV; |
| 995 |
|
} | T_DLINE |
| 996 |
|
{ |
| 997 |
|
if (conf_parser_ctx.pass == 2) |
| 1031 |
|
if (!block_state.name.buf[0]) |
| 1032 |
|
break; |
| 1033 |
|
#ifdef HAVE_LIBCRYPTO |
| 1034 |
< |
if (!(block_state.file.buf[0] || |
| 1035 |
< |
block_state.rpass.buf[0])) |
| 1034 |
> |
if (!block_state.file.buf[0] && |
| 1035 |
> |
!block_state.rpass.buf[0]) |
| 1036 |
|
break; |
| 1037 |
|
#else |
| 1038 |
|
if (!block_state.rpass.buf[0]) |
| 1053 |
|
nuh.hostsize = sizeof(block_state.host.buf); |
| 1054 |
|
split_nuh(&nuh); |
| 1055 |
|
|
| 1056 |
< |
conf = conf_make(CONF_OPER); |
| 1057 |
< |
conf->name = xstrdup(block_state.name.buf); |
| 1058 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 1059 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 1056 |
> |
conf = conf_make(CONF_OPER); |
| 1057 |
> |
conf->name = xstrdup(block_state.name.buf); |
| 1058 |
> |
conf->user = xstrdup(block_state.user.buf); |
| 1059 |
> |
conf->host = xstrdup(block_state.host.buf); |
| 1060 |
> |
|
| 1061 |
> |
if (block_state.cert.buf[0]) |
| 1062 |
> |
conf->certfp = xstrdup(block_state.cert.buf); |
| 1063 |
|
|
| 1064 |
|
if (block_state.rpass.buf[0]) |
| 1065 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
| 1097 |
|
oper_items: oper_items oper_item | oper_item; |
| 1098 |
|
oper_item: oper_name | oper_user | oper_password | |
| 1099 |
|
oper_umodes | oper_class | oper_encrypted | |
| 1100 |
< |
oper_rsa_public_key_file | oper_flags | error ';' ; |
| 1100 |
> |
oper_rsa_public_key_file | oper_ssl_certificate_fingerprint | |
| 1101 |
> |
oper_ssl_connection_required | |
| 1102 |
> |
oper_flags | error ';' ; |
| 1103 |
|
|
| 1104 |
|
oper_name: NAME '=' QSTRING ';' |
| 1105 |
|
{ |
| 1121 |
|
|
| 1122 |
|
oper_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1123 |
|
{ |
| 1124 |
< |
if (conf_parser_ctx.pass == 2) |
| 1125 |
< |
{ |
| 1126 |
< |
if (yylval.number) |
| 1127 |
< |
block_state.flags.value |= CONF_FLAGS_ENCRYPTED; |
| 1128 |
< |
else |
| 1129 |
< |
block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; |
| 1130 |
< |
} |
| 1124 |
> |
if (conf_parser_ctx.pass != 2) |
| 1125 |
> |
break; |
| 1126 |
> |
|
| 1127 |
> |
if (yylval.number) |
| 1128 |
> |
block_state.flags.value |= CONF_FLAGS_ENCRYPTED; |
| 1129 |
> |
else |
| 1130 |
> |
block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; |
| 1131 |
|
}; |
| 1132 |
|
|
| 1133 |
|
oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 1136 |
|
strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); |
| 1137 |
|
}; |
| 1138 |
|
|
| 1139 |
+ |
oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';' |
| 1140 |
+ |
{ |
| 1141 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1142 |
+ |
strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); |
| 1143 |
+ |
}; |
| 1144 |
+ |
|
| 1145 |
+ |
oper_ssl_connection_required: SSL_CONNECTION_REQUIRED '=' TBOOL ';' |
| 1146 |
+ |
{ |
| 1147 |
+ |
if (conf_parser_ctx.pass != 2) |
| 1148 |
+ |
break; |
| 1149 |
+ |
|
| 1150 |
+ |
if (yylval.number) |
| 1151 |
+ |
block_state.flags.value |= CONF_FLAGS_SSL; |
| 1152 |
+ |
else |
| 1153 |
+ |
block_state.flags.value &= ~CONF_FLAGS_SSL; |
| 1154 |
+ |
}; |
| 1155 |
+ |
|
| 1156 |
|
oper_class: CLASS '=' QSTRING ';' |
| 1157 |
|
{ |
| 1158 |
|
if (conf_parser_ctx.pass == 2) |
| 1174 |
|
{ |
| 1175 |
|
if (conf_parser_ctx.pass == 2) |
| 1176 |
|
block_state.modes.value |= UMODE_CCONN; |
| 1104 |
– |
} | T_CCONN_FULL |
| 1105 |
– |
{ |
| 1106 |
– |
if (conf_parser_ctx.pass == 2) |
| 1107 |
– |
block_state.modes.value |= UMODE_CCONN_FULL; |
| 1177 |
|
} | T_DEAF |
| 1178 |
|
{ |
| 1179 |
|
if (conf_parser_ctx.pass == 2) |
| 1661 |
|
split_nuh(&nuh); |
| 1662 |
|
|
| 1663 |
|
conf = conf_make(CONF_CLIENT); |
| 1664 |
< |
conf->user = xstrdup(collapse(block_state.user.buf)); |
| 1665 |
< |
conf->host = xstrdup(collapse(block_state.host.buf)); |
| 1664 |
> |
conf->user = xstrdup(block_state.user.buf); |
| 1665 |
> |
conf->host = xstrdup(block_state.host.buf); |
| 1666 |
|
|
| 1667 |
|
if (block_state.rpass.buf[0]) |
| 1668 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
| 1843 |
|
|
| 1844 |
|
service_name: NAME '=' QSTRING ';' |
| 1845 |
|
{ |
| 1846 |
< |
if (conf_parser_ctx.pass == 2) |
| 1846 |
> |
if (conf_parser_ctx.pass != 2) |
| 1847 |
> |
break; |
| 1848 |
> |
|
| 1849 |
> |
if (valid_servname(yylval.string)) |
| 1850 |
|
{ |
| 1851 |
< |
if (valid_servname(yylval.string)) |
| 1852 |
< |
{ |
| 1781 |
< |
struct MaskItem *conf = conf_make(CONF_SERVICE); |
| 1782 |
< |
conf->name = xstrdup(yylval.string); |
| 1783 |
< |
} |
| 1851 |
> |
struct MaskItem *conf = conf_make(CONF_SERVICE); |
| 1852 |
> |
conf->name = xstrdup(yylval.string); |
| 1853 |
|
} |
| 1854 |
|
}; |
| 1855 |
|
|
| 2063 |
|
!block_state.host.buf[0]) |
| 2064 |
|
break; |
| 2065 |
|
|
| 2066 |
< |
if (!(block_state.rpass.buf[0] || |
| 2067 |
< |
block_state.spass.buf[0])) |
| 2066 |
> |
if (!block_state.rpass.buf[0] || |
| 2067 |
> |
!block_state.spass.buf[0]) |
| 2068 |
|
break; |
| 2069 |
|
|
| 2070 |
|
if (has_wildcards(block_state.name.buf) || |
| 2079 |
|
conf->name = xstrdup(block_state.name.buf); |
| 2080 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
| 2081 |
|
conf->spasswd = xstrdup(block_state.spass.buf); |
| 2082 |
< |
conf->cipher_list = xstrdup(block_state.ciph.buf); |
| 2082 |
> |
|
| 2083 |
> |
if (block_state.cert.buf[0]) |
| 2084 |
> |
conf->certfp = xstrdup(block_state.cert.buf); |
| 2085 |
> |
|
| 2086 |
> |
if (block_state.ciph.buf[0]) |
| 2087 |
> |
conf->cipher_list = xstrdup(block_state.ciph.buf); |
| 2088 |
|
|
| 2089 |
|
dlinkMoveList(&block_state.leaf.list, &conf->leaf_list); |
| 2090 |
|
dlinkMoveList(&block_state.hub.list, &conf->hub_list); |
| 2117 |
|
connect_items: connect_items connect_item | connect_item; |
| 2118 |
|
connect_item: connect_name | connect_host | connect_vhost | |
| 2119 |
|
connect_send_password | connect_accept_password | |
| 2120 |
+ |
connect_ssl_certificate_fingerprint | |
| 2121 |
|
connect_aftype | connect_port | connect_ssl_cipher_list | |
| 2122 |
|
connect_flags | connect_hub_mask | connect_leaf_mask | |
| 2123 |
|
connect_class | connect_encrypted | |
| 2167 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2168 |
|
}; |
| 2169 |
|
|
| 2170 |
+ |
connect_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';' |
| 2171 |
+ |
{ |
| 2172 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2173 |
+ |
strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); |
| 2174 |
+ |
}; |
| 2175 |
+ |
|
| 2176 |
|
connect_port: PORT '=' NUMBER ';' |
| 2177 |
|
{ |
| 2178 |
|
if (conf_parser_ctx.pass == 2) |
| 2432 |
|
general_stats_o_oper_only | general_stats_k_oper_only | |
| 2433 |
|
general_pace_wait | general_stats_i_oper_only | |
| 2434 |
|
general_pace_wait_simple | general_stats_P_oper_only | |
| 2435 |
+ |
general_stats_u_oper_only | |
| 2436 |
|
general_short_motd | general_no_oper_flood | |
| 2437 |
|
general_true_no_oper_flood | general_oper_pass_resv | |
| 2438 |
|
general_oper_only_umodes | general_max_targets | |
| 2440 |
|
general_oper_umodes | general_caller_id_wait | |
| 2441 |
|
general_opers_bypass_callerid | general_default_floodcount | |
| 2442 |
|
general_min_nonwildcard | general_min_nonwildcard_simple | |
| 2361 |
– |
general_disable_remote_commands | |
| 2443 |
|
general_throttle_time | general_havent_read_conf | |
| 2444 |
|
general_ping_cookie | |
| 2445 |
|
general_disable_auth | |
| 2449 |
|
general_gline_min_cidr6 | |
| 2450 |
|
general_stats_e_disabled | |
| 2451 |
|
general_max_watch | general_services_name | |
| 2452 |
+ |
general_cycle_on_host_change | |
| 2453 |
|
error; |
| 2454 |
|
|
| 2455 |
|
|
| 2458 |
|
ConfigFileEntry.max_watch = $3; |
| 2459 |
|
}; |
| 2460 |
|
|
| 2461 |
+ |
general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';' |
| 2462 |
+ |
{ |
| 2463 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2464 |
+ |
ConfigFileEntry.cycle_on_host_change = yylval.number; |
| 2465 |
+ |
}; |
| 2466 |
+ |
|
| 2467 |
|
general_gline_enable: GLINE_ENABLE '=' TBOOL ';' |
| 2468 |
|
{ |
| 2469 |
|
if (conf_parser_ctx.pass == 2) |
| 2512 |
|
ConfigFileEntry.ignore_bogus_ts = yylval.number; |
| 2513 |
|
}; |
| 2514 |
|
|
| 2427 |
– |
general_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';' |
| 2428 |
– |
{ |
| 2429 |
– |
ConfigFileEntry.disable_remote = yylval.number; |
| 2430 |
– |
}; |
| 2431 |
– |
|
| 2515 |
|
general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';' |
| 2516 |
|
{ |
| 2517 |
|
ConfigFileEntry.failed_oper_notice = yylval.number; |
| 2589 |
|
ConfigFileEntry.stats_P_oper_only = yylval.number; |
| 2590 |
|
}; |
| 2591 |
|
|
| 2592 |
+ |
general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';' |
| 2593 |
+ |
{ |
| 2594 |
+ |
ConfigFileEntry.stats_u_oper_only = yylval.number; |
| 2595 |
+ |
}; |
| 2596 |
+ |
|
| 2597 |
|
general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';' |
| 2598 |
|
{ |
| 2599 |
|
ConfigFileEntry.stats_k_oper_only = 2 * yylval.number; |
| 2710 |
|
} | T_CCONN |
| 2711 |
|
{ |
| 2712 |
|
ConfigFileEntry.oper_umodes |= UMODE_CCONN; |
| 2625 |
– |
} | T_CCONN_FULL |
| 2626 |
– |
{ |
| 2627 |
– |
ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL; |
| 2713 |
|
} | T_DEAF |
| 2714 |
|
{ |
| 2715 |
|
ConfigFileEntry.oper_umodes |= UMODE_DEAF; |
| 2781 |
|
} | T_CCONN |
| 2782 |
|
{ |
| 2783 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; |
| 2699 |
– |
} | T_CCONN_FULL |
| 2700 |
– |
{ |
| 2701 |
– |
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL; |
| 2784 |
|
} | T_DEAF |
| 2785 |
|
{ |
| 2786 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; |
| 2940 |
|
'{' serverhide_items '}' ';'; |
| 2941 |
|
|
| 2942 |
|
serverhide_items: serverhide_items serverhide_item | serverhide_item; |
| 2943 |
< |
serverhide_item: serverhide_flatten_links | serverhide_hide_servers | |
| 2943 |
> |
serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | |
| 2944 |
> |
serverhide_hide_servers | |
| 2945 |
|
serverhide_hide_services | |
| 2946 |
|
serverhide_links_delay | |
| 2947 |
|
serverhide_hidden | serverhide_hidden_name | |
| 2954 |
|
ConfigServerHide.flatten_links = yylval.number; |
| 2955 |
|
}; |
| 2956 |
|
|
| 2957 |
+ |
serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';' |
| 2958 |
+ |
{ |
| 2959 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2960 |
+ |
ConfigServerHide.disable_remote_commands = yylval.number; |
| 2961 |
+ |
}; |
| 2962 |
+ |
|
| 2963 |
|
serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';' |
| 2964 |
|
{ |
| 2965 |
|
if (conf_parser_ctx.pass == 2) |