| 38 |
|
#include "log.h" |
| 39 |
|
#include "client.h" /* for UMODE_ALL only */ |
| 40 |
|
#include "irc_string.h" |
| 41 |
– |
#include "sprintf_irc.h" |
| 41 |
|
#include "memory.h" |
| 42 |
|
#include "modules.h" |
| 43 |
|
#include "s_serv.h" |
| 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 |
| 175 |
– |
%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 |
| 183 |
– |
%token GLINE_REQUEST_DURATION |
| 184 |
|
%token GLINE_MIN_CIDR |
| 185 |
|
%token GLINE_MIN_CIDR6 |
| 186 |
+ |
%token GLINE_REQUEST_DURATION |
| 187 |
|
%token GLOBAL_KILL |
| 187 |
– |
%token IRCD_AUTH |
| 188 |
– |
%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_SPOOF_IPS |
| 194 |
> |
%token HIDE_SERVICES |
| 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 |
| 216 |
< |
%token T_LOG |
| 216 |
> |
%token MASK |
| 217 |
|
%token MAX_ACCEPT |
| 218 |
|
%token MAX_BANS |
| 219 |
|
%token MAX_CHANS_PER_OPER |
| 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 MESSAGE_LOCALE |
| 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 |
| 243 |
|
%token NICK |
| 239 |
– |
%token NICK_CHANGES |
| 244 |
|
%token NO_CREATE_ON_SPLIT |
| 245 |
|
%token NO_JOIN_ON_SPLIT |
| 246 |
|
%token NO_OPER_FLOOD |
| 248 |
|
%token NUMBER |
| 249 |
|
%token NUMBER_PER_CIDR |
| 250 |
|
%token NUMBER_PER_IP |
| 247 |
– |
%token OPERATOR |
| 248 |
– |
%token OPERS_BYPASS_CALLERID |
| 251 |
|
%token OPER_ONLY_UMODES |
| 252 |
|
%token OPER_PASS_RESV |
| 251 |
– |
%token OPER_SPY_T |
| 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 QUIET_ON_BAN |
| 264 |
> |
%token RANDOM_IDLE |
| 265 |
|
%token REASON |
| 266 |
|
%token REDIRPORT |
| 267 |
|
%token REDIRSERV |
| 267 |
– |
%token REGEX_T |
| 268 |
|
%token REHASH |
| 269 |
|
%token REMOTE |
| 270 |
|
%token REMOTEBAN |
| 271 |
– |
%token RESTRICT_CHANNELS |
| 272 |
– |
%token RSA_PRIVATE_KEY_FILE |
| 273 |
– |
%token RSA_PUBLIC_KEY_FILE |
| 274 |
– |
%token SSL_CERTIFICATE_FILE |
| 275 |
– |
%token SSL_DH_PARAM_FILE |
| 276 |
– |
%token T_SSL_CLIENT_METHOD |
| 277 |
– |
%token T_SSL_SERVER_METHOD |
| 278 |
– |
%token T_SSLV3 |
| 279 |
– |
%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 |
| 283 |
– |
%token SENDQ |
| 276 |
|
%token SEND_PASSWORD |
| 277 |
+ |
%token SENDQ |
| 278 |
|
%token SERVERHIDE |
| 279 |
|
%token SERVERINFO |
| 287 |
– |
%token IRCD_SID |
| 288 |
– |
%token TKLINE_EXPIRE_NOTICES |
| 289 |
– |
%token T_SHARED |
| 290 |
– |
%token T_CLUSTER |
| 291 |
– |
%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 |
| 301 |
< |
%token TMASKED |
| 302 |
< |
%token TS_MAX_DELTA |
| 303 |
< |
%token TS_WARN_DELTA |
| 304 |
< |
%token TWODOTS |
| 293 |
> |
%token STATS_U_OPER_ONLY |
| 294 |
|
%token T_ALL |
| 295 |
|
%token T_BOTS |
| 307 |
– |
%token T_SOFTCALLERID |
| 296 |
|
%token T_CALLERID |
| 297 |
|
%token T_CCONN |
| 298 |
< |
%token T_CCONN_FULL |
| 311 |
< |
%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 |
| 338 |
– |
%token T_GLOBOPS |
| 341 |
|
%token T_WALLOP |
| 342 |
+ |
%token T_WALLOPS |
| 343 |
|
%token T_WEBIRC |
| 344 |
< |
%token T_RESTART |
| 342 |
< |
%token T_SERVICE |
| 343 |
< |
%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 |
| 347 |
– |
%token USER |
| 354 |
|
%token USE_EGD |
| 355 |
|
%token USE_LOGGING |
| 356 |
+ |
%token USER |
| 357 |
|
%token VHOST |
| 358 |
|
%token VHOST6 |
| 352 |
– |
%token XLINE |
| 359 |
|
%token WARN_NO_NLINE |
| 360 |
< |
%token T_SIZE |
| 355 |
< |
%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) |
| 553 |
< |
{ |
| 554 |
< |
BIO *file; |
| 558 |
> |
BIO *file = NULL; |
| 559 |
|
|
| 560 |
< |
if (ServerInfo.rsa_private_key) |
| 561 |
< |
{ |
| 558 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 559 |
< |
ServerInfo.rsa_private_key = NULL; |
| 560 |
< |
} |
| 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) |
| 571 |
< |
{ |
| 572 |
< |
conf_error_report("File open failed, ignoring"); |
| 573 |
< |
break; |
| 574 |
< |
} |
| 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); |
| 579 |
< |
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 |
< |
{ |
| 583 |
< |
conf_error_report("Couldn't extract key, ignoring"); |
| 584 |
< |
break; |
| 585 |
< |
} |
| 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 |
< |
{ |
| 599 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 600 |
< |
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 |
|
/*************************************************************************** |
| 939 |
|
break; |
| 940 |
|
|
| 941 |
|
if (block_state.type.value && block_state.file.buf[0]) |
| 942 |
< |
log_add_file(block_state.type.value, block_state.size.value, |
| 942 |
> |
log_set_file(block_state.type.value, block_state.size.value, |
| 943 |
|
block_state.file.buf); |
| 944 |
|
}; |
| 945 |
|
|
| 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; |
| 1105 |
– |
} | T_CCONN_FULL |
| 1106 |
– |
{ |
| 1107 |
– |
if (conf_parser_ctx.pass == 2) |
| 1108 |
– |
block_state.modes.value |= UMODE_CCONN_FULL; |
| 1177 |
|
} | T_DEAF |
| 1178 |
|
{ |
| 1179 |
|
if (conf_parser_ctx.pass == 2) |
| 1242 |
|
{ |
| 1243 |
|
if (conf_parser_ctx.pass == 2) |
| 1244 |
|
block_state.modes.value |= UMODE_LOCOPS; |
| 1245 |
+ |
} | T_NONONREG |
| 1246 |
+ |
{ |
| 1247 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1248 |
+ |
block_state.modes.value |= UMODE_REGONLY; |
| 1249 |
+ |
} | T_FARCONNECT |
| 1250 |
+ |
{ |
| 1251 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1252 |
+ |
block_state.modes.value |= UMODE_FARCONNECT; |
| 1253 |
|
}; |
| 1254 |
|
|
| 1255 |
|
oper_flags: IRCD_FLAGS |
| 1259 |
|
} '=' oper_flags_items ';'; |
| 1260 |
|
|
| 1261 |
|
oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item; |
| 1262 |
< |
oper_flags_item: GLOBAL_KILL |
| 1262 |
> |
oper_flags_item: KILL ':' REMOTE |
| 1263 |
|
{ |
| 1264 |
|
if (conf_parser_ctx.pass == 2) |
| 1265 |
< |
block_state.port.value |= OPER_FLAG_GLOBAL_KILL; |
| 1266 |
< |
} | REMOTE |
| 1265 |
> |
block_state.port.value |= OPER_FLAG_KILL_REMOTE; |
| 1266 |
> |
} | KILL |
| 1267 |
> |
{ |
| 1268 |
> |
if (conf_parser_ctx.pass == 2) |
| 1269 |
> |
block_state.port.value |= OPER_FLAG_KILL; |
| 1270 |
> |
} | CONNECT ':' REMOTE |
| 1271 |
|
{ |
| 1272 |
|
if (conf_parser_ctx.pass == 2) |
| 1273 |
< |
block_state.port.value |= OPER_FLAG_REMOTE; |
| 1273 |
> |
block_state.port.value |= OPER_FLAG_CONNECT_REMOTE; |
| 1274 |
> |
} | CONNECT |
| 1275 |
> |
{ |
| 1276 |
> |
if (conf_parser_ctx.pass == 2) |
| 1277 |
> |
block_state.port.value |= OPER_FLAG_CONNECT; |
| 1278 |
> |
} | SQUIT ':' REMOTE |
| 1279 |
> |
{ |
| 1280 |
> |
if (conf_parser_ctx.pass == 2) |
| 1281 |
> |
block_state.port.value |= OPER_FLAG_SQUIT_REMOTE; |
| 1282 |
> |
} | SQUIT |
| 1283 |
> |
{ |
| 1284 |
> |
if (conf_parser_ctx.pass == 2) |
| 1285 |
> |
block_state.port.value |= OPER_FLAG_SQUIT; |
| 1286 |
|
} | KLINE |
| 1287 |
|
{ |
| 1288 |
|
if (conf_parser_ctx.pass == 2) |
| 1323 |
|
{ |
| 1324 |
|
if (conf_parser_ctx.pass == 2) |
| 1325 |
|
block_state.port.value |= OPER_FLAG_ADMIN; |
| 1234 |
– |
} | NICK_CHANGES |
| 1235 |
– |
{ |
| 1236 |
– |
if (conf_parser_ctx.pass == 2) |
| 1237 |
– |
block_state.port.value |= OPER_FLAG_N; |
| 1326 |
|
} | T_OPERWALL |
| 1327 |
|
{ |
| 1328 |
|
if (conf_parser_ctx.pass == 2) |
| 1331 |
|
{ |
| 1332 |
|
if (conf_parser_ctx.pass == 2) |
| 1333 |
|
block_state.port.value |= OPER_FLAG_GLOBOPS; |
| 1334 |
< |
} | OPER_SPY_T |
| 1334 |
> |
} | T_WALLOPS |
| 1335 |
|
{ |
| 1336 |
|
if (conf_parser_ctx.pass == 2) |
| 1337 |
< |
block_state.port.value |= OPER_FLAG_OPER_SPY; |
| 1337 |
> |
block_state.port.value |= OPER_FLAG_WALLOPS; |
| 1338 |
> |
} | T_LOCOPS |
| 1339 |
> |
{ |
| 1340 |
> |
if (conf_parser_ctx.pass == 2) |
| 1341 |
> |
block_state.port.value |= OPER_FLAG_LOCOPS; |
| 1342 |
|
} | REMOTEBAN |
| 1343 |
|
{ |
| 1344 |
|
if (conf_parser_ctx.pass == 2) |
| 1385 |
|
class->active = 1; |
| 1386 |
|
MyFree(class->name); |
| 1387 |
|
class->name = xstrdup(block_state.class.buf); |
| 1296 |
– |
class->flags = block_state.flags.value; |
| 1388 |
|
class->ping_freq = block_state.ping_freq.value; |
| 1389 |
|
class->max_perip = block_state.max_perip.value; |
| 1390 |
|
class->con_freq = block_state.con_freq.value; |
| 1300 |
– |
class->min_idle = block_state.min_idle.value; |
| 1301 |
– |
class->max_idle = block_state.max_idle.value; |
| 1391 |
|
class->max_total = block_state.max_total.value; |
| 1392 |
|
class->max_global = block_state.max_global.value; |
| 1393 |
|
class->max_local = block_state.max_local.value; |
| 1395 |
|
class->max_sendq = block_state.max_sendq.value; |
| 1396 |
|
class->max_recvq = block_state.max_recvq.value; |
| 1397 |
|
|
| 1398 |
+ |
if (block_state.min_idle.value > block_state.max_idle.value) |
| 1399 |
+ |
{ |
| 1400 |
+ |
block_state.min_idle.value = 0; |
| 1401 |
+ |
block_state.max_idle.value = 0; |
| 1402 |
+ |
block_state.flags.value &= ~CLASS_FLAGS_FAKE_IDLE; |
| 1403 |
+ |
} |
| 1404 |
+ |
|
| 1405 |
+ |
class->flags = block_state.flags.value; |
| 1406 |
+ |
class->min_idle = block_state.min_idle.value; |
| 1407 |
+ |
class->max_idle = block_state.max_idle.value; |
| 1408 |
+ |
|
| 1409 |
|
if (class->number_per_cidr && block_state.number_per_cidr.value) |
| 1410 |
|
if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) || |
| 1411 |
|
(class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value)) |
| 1516 |
|
|
| 1517 |
|
class_min_idle: MIN_IDLE '=' timespec ';' |
| 1518 |
|
{ |
| 1519 |
< |
if (conf_parser_ctx.pass == 1) |
| 1520 |
< |
block_state.min_idle.value = $3; |
| 1519 |
> |
if (conf_parser_ctx.pass != 1) |
| 1520 |
> |
break; |
| 1521 |
> |
|
| 1522 |
> |
block_state.min_idle.value = $3; |
| 1523 |
> |
block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; |
| 1524 |
|
}; |
| 1525 |
|
|
| 1526 |
|
class_max_idle: MAX_IDLE '=' timespec ';' |
| 1527 |
|
{ |
| 1528 |
< |
if (conf_parser_ctx.pass == 1) |
| 1529 |
< |
block_state.max_idle.value = $3; |
| 1528 |
> |
if (conf_parser_ctx.pass != 1) |
| 1529 |
> |
break; |
| 1530 |
> |
|
| 1531 |
> |
block_state.max_idle.value = $3; |
| 1532 |
> |
block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; |
| 1533 |
|
}; |
| 1534 |
|
|
| 1535 |
|
class_flags: IRCD_FLAGS |
| 1536 |
|
{ |
| 1537 |
|
if (conf_parser_ctx.pass == 1) |
| 1538 |
< |
block_state.flags.value = 0; |
| 1538 |
> |
block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE; |
| 1539 |
|
} '=' class_flags_items ';'; |
| 1540 |
|
|
| 1541 |
|
class_flags_items: class_flags_items ',' class_flags_item | class_flags_item; |
| 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); |
| 1669 |
|
if (block_state.name.buf[0]) |
| 1670 |
< |
conf->passwd = xstrdup(block_state.name.buf); |
| 1670 |
> |
conf->name = xstrdup(block_state.name.buf); |
| 1671 |
|
|
| 1672 |
|
conf->flags = block_state.flags.value; |
| 1673 |
|
conf->port = block_state.port.value; |
| 1714 |
|
auth_flags: IRCD_FLAGS |
| 1715 |
|
{ |
| 1716 |
|
if (conf_parser_ctx.pass == 2) |
| 1717 |
< |
block_state.flags.value &= CONF_FLAGS_ENCRYPTED; |
| 1717 |
> |
block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP); |
| 1718 |
|
} '=' auth_flags_items ';'; |
| 1719 |
|
|
| 1720 |
|
auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item; |
| 1803 |
|
|
| 1804 |
|
reset_block_state(); |
| 1805 |
|
strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf)); |
| 1806 |
< |
} '{' resv_items '}' ';'; |
| 1806 |
> |
} '{' resv_items '}' ';' |
| 1807 |
> |
{ |
| 1808 |
> |
if (conf_parser_ctx.pass != 2) |
| 1809 |
> |
break; |
| 1810 |
> |
|
| 1811 |
> |
create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); |
| 1812 |
> |
}; |
| 1813 |
|
|
| 1814 |
|
resv_items: resv_items resv_item | resv_item; |
| 1815 |
< |
resv_item: resv_creason | resv_channel | resv_nick | error ';' ; |
| 1815 |
> |
resv_item: resv_mask | resv_reason | resv_exempt | error ';' ; |
| 1816 |
|
|
| 1817 |
< |
resv_creason: REASON '=' QSTRING ';' |
| 1817 |
> |
resv_mask: MASK '=' QSTRING ';' |
| 1818 |
|
{ |
| 1819 |
|
if (conf_parser_ctx.pass == 2) |
| 1820 |
< |
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 1820 |
> |
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 1821 |
|
}; |
| 1822 |
|
|
| 1823 |
< |
resv_channel: CHANNEL '=' QSTRING ';' |
| 1823 |
> |
resv_reason: REASON '=' QSTRING ';' |
| 1824 |
|
{ |
| 1825 |
< |
if (conf_parser_ctx.pass != 2) |
| 1826 |
< |
break; |
| 1715 |
< |
|
| 1716 |
< |
if (IsChanPrefix(*yylval.string)) |
| 1717 |
< |
create_channel_resv(yylval.string, block_state.rpass.buf, 1); |
| 1825 |
> |
if (conf_parser_ctx.pass == 2) |
| 1826 |
> |
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 1827 |
|
}; |
| 1828 |
|
|
| 1829 |
< |
resv_nick: NICK '=' QSTRING ';' |
| 1829 |
> |
resv_exempt: EXEMPT '=' QSTRING ';' |
| 1830 |
|
{ |
| 1831 |
|
if (conf_parser_ctx.pass == 2) |
| 1832 |
< |
create_nick_resv(yylval.string, block_state.rpass.buf, 1); |
| 1832 |
> |
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); |
| 1833 |
|
}; |
| 1834 |
|
|
| 1835 |
+ |
|
| 1836 |
|
/*************************************************************************** |
| 1837 |
|
* section service |
| 1838 |
|
***************************************************************************/ |
| 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 |
< |
{ |
| 1740 |
< |
struct MaskItem *conf = conf_make(CONF_SERVICE); |
| 1741 |
< |
conf->name = xstrdup(yylval.string); |
| 1742 |
< |
} |
| 1851 |
> |
struct MaskItem *conf = conf_make(CONF_SERVICE); |
| 1852 |
> |
conf->name = xstrdup(yylval.string); |
| 1853 |
|
} |
| 1854 |
|
}; |
| 1855 |
|
|
| 1878 |
|
conf->flags = block_state.flags.value; |
| 1879 |
|
conf->name = xstrdup(block_state.name.buf); |
| 1880 |
|
conf->user = xstrdup(block_state.user.buf); |
| 1881 |
< |
conf->user = xstrdup(block_state.host.buf); |
| 1881 |
> |
conf->host = xstrdup(block_state.host.buf); |
| 1882 |
|
}; |
| 1883 |
|
|
| 1884 |
|
shared_items: shared_items shared_item | shared_item; |
| 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) |
| 2266 |
|
!block_state.host.buf[0]) |
| 2267 |
|
break; |
| 2268 |
|
|
| 2269 |
+ |
conf = conf_make(CONF_KLINE); |
| 2270 |
+ |
conf->user = xstrdup(block_state.user.buf); |
| 2271 |
+ |
conf->host = xstrdup(block_state.host.buf); |
| 2272 |
|
|
| 2273 |
< |
if (block_state.port.value == 1) |
| 2274 |
< |
{ |
| 2150 |
< |
#ifdef HAVE_LIBPCRE |
| 2151 |
< |
void *exp_user = NULL; |
| 2152 |
< |
void *exp_host = NULL; |
| 2153 |
< |
const char *errptr = NULL; |
| 2154 |
< |
|
| 2155 |
< |
if (!(exp_user = ircd_pcre_compile(block_state.user.buf, &errptr)) || |
| 2156 |
< |
!(exp_host = ircd_pcre_compile(block_state.host.buf, &errptr))) |
| 2157 |
< |
{ |
| 2158 |
< |
ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s", |
| 2159 |
< |
errptr); |
| 2160 |
< |
break; |
| 2161 |
< |
} |
| 2162 |
< |
|
| 2163 |
< |
conf = conf_make(CONF_RKLINE); |
| 2164 |
< |
conf->regexuser = exp_user; |
| 2165 |
< |
conf->regexhost = exp_host; |
| 2166 |
< |
|
| 2167 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 2168 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 2169 |
< |
|
| 2170 |
< |
if (block_state.rpass.buf[0]) |
| 2171 |
< |
conf->reason = xstrdup(block_state.rpass.buf); |
| 2172 |
< |
else |
| 2173 |
< |
conf->reason = xstrdup(CONF_NOREASON); |
| 2174 |
< |
#else |
| 2175 |
< |
ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support"); |
| 2176 |
< |
break; |
| 2177 |
< |
#endif |
| 2178 |
< |
} |
| 2273 |
> |
if (block_state.rpass.buf[0]) |
| 2274 |
> |
conf->reason = xstrdup(block_state.rpass.buf); |
| 2275 |
|
else |
| 2276 |
< |
{ |
| 2277 |
< |
conf = conf_make(CONF_KLINE); |
| 2182 |
< |
|
| 2183 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 2184 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 2185 |
< |
|
| 2186 |
< |
if (block_state.rpass.buf[0]) |
| 2187 |
< |
conf->reason = xstrdup(block_state.rpass.buf); |
| 2188 |
< |
else |
| 2189 |
< |
conf->reason = xstrdup(CONF_NOREASON); |
| 2190 |
< |
add_conf_by_address(CONF_KLINE, conf); |
| 2191 |
< |
} |
| 2276 |
> |
conf->reason = xstrdup(CONF_NOREASON); |
| 2277 |
> |
add_conf_by_address(CONF_KLINE, conf); |
| 2278 |
|
}; |
| 2279 |
|
|
| 2194 |
– |
kill_type: TYPE |
| 2195 |
– |
{ |
| 2196 |
– |
if (conf_parser_ctx.pass == 2) |
| 2197 |
– |
block_state.port.value = 0; |
| 2198 |
– |
} '=' kill_type_items ';'; |
| 2199 |
– |
|
| 2200 |
– |
kill_type_items: kill_type_items ',' kill_type_item | kill_type_item; |
| 2201 |
– |
kill_type_item: REGEX_T |
| 2202 |
– |
{ |
| 2203 |
– |
if (conf_parser_ctx.pass == 2) |
| 2204 |
– |
block_state.port.value = 1; |
| 2205 |
– |
}; |
| 2206 |
– |
|
| 2280 |
|
kill_items: kill_items kill_item | kill_item; |
| 2281 |
< |
kill_item: kill_user | kill_reason | kill_type | error; |
| 2281 |
> |
kill_item: kill_user | kill_reason | error; |
| 2282 |
|
|
| 2283 |
|
kill_user: USER '=' QSTRING ';' |
| 2284 |
|
{ |
| 2390 |
|
if (!block_state.name.buf[0]) |
| 2391 |
|
break; |
| 2392 |
|
|
| 2393 |
< |
if (block_state.port.value == 1) |
| 2321 |
< |
{ |
| 2322 |
< |
#ifdef HAVE_LIBPCRE |
| 2323 |
< |
void *exp_p = NULL; |
| 2324 |
< |
const char *errptr = NULL; |
| 2325 |
< |
|
| 2326 |
< |
if (!(exp_p = ircd_pcre_compile(block_state.name.buf, &errptr))) |
| 2327 |
< |
{ |
| 2328 |
< |
ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s", |
| 2329 |
< |
errptr); |
| 2330 |
< |
break; |
| 2331 |
< |
} |
| 2332 |
< |
|
| 2333 |
< |
conf = conf_make(CONF_RXLINE); |
| 2334 |
< |
conf->regexuser = exp_p; |
| 2335 |
< |
#else |
| 2336 |
< |
conf_error_report("Failed to add regular expression based X-Line: no PCRE support"); |
| 2337 |
< |
break; |
| 2338 |
< |
#endif |
| 2339 |
< |
} |
| 2340 |
< |
else |
| 2341 |
< |
conf = conf_make(CONF_XLINE); |
| 2342 |
< |
|
| 2393 |
> |
conf = conf_make(CONF_XLINE); |
| 2394 |
|
conf->name = xstrdup(block_state.name.buf); |
| 2395 |
|
|
| 2396 |
|
if (block_state.rpass.buf[0]) |
| 2399 |
|
conf->reason = xstrdup(CONF_NOREASON); |
| 2400 |
|
}; |
| 2401 |
|
|
| 2351 |
– |
gecos_flags: TYPE |
| 2352 |
– |
{ |
| 2353 |
– |
if (conf_parser_ctx.pass == 2) |
| 2354 |
– |
block_state.port.value = 0; |
| 2355 |
– |
} '=' gecos_flags_items ';'; |
| 2356 |
– |
|
| 2357 |
– |
gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item; |
| 2358 |
– |
gecos_flags_item: REGEX_T |
| 2359 |
– |
{ |
| 2360 |
– |
if (conf_parser_ctx.pass == 2) |
| 2361 |
– |
block_state.port.value = 1; |
| 2362 |
– |
}; |
| 2363 |
– |
|
| 2402 |
|
gecos_items: gecos_items gecos_item | gecos_item; |
| 2403 |
< |
gecos_item: gecos_name | gecos_reason | gecos_flags | error; |
| 2403 |
> |
gecos_item: gecos_name | gecos_reason | error; |
| 2404 |
|
|
| 2405 |
|
gecos_name: NAME '=' QSTRING ';' |
| 2406 |
|
{ |
| 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 | |
| 2399 |
– |
general_message_locale | |
| 2438 |
|
general_oper_only_umodes | general_max_targets | |
| 2439 |
|
general_use_egd | general_egdpool_path | |
| 2440 |
|
general_oper_umodes | general_caller_id_wait | |
| 2441 |
|
general_opers_bypass_callerid | general_default_floodcount | |
| 2442 |
|
general_min_nonwildcard | general_min_nonwildcard_simple | |
| 2405 |
– |
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 |
|
|
| 2471 |
– |
general_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';' |
| 2472 |
– |
{ |
| 2473 |
– |
ConfigFileEntry.disable_remote = yylval.number; |
| 2474 |
– |
}; |
| 2475 |
– |
|
| 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; |
| 2650 |
|
ConfigFileEntry.oper_pass_resv = yylval.number; |
| 2651 |
|
}; |
| 2652 |
|
|
| 2609 |
– |
general_message_locale: MESSAGE_LOCALE '=' QSTRING ';' |
| 2610 |
– |
{ |
| 2611 |
– |
if (conf_parser_ctx.pass == 2) |
| 2612 |
– |
{ |
| 2613 |
– |
if (strlen(yylval.string) > LOCALE_LENGTH-2) |
| 2614 |
– |
yylval.string[LOCALE_LENGTH-1] = '\0'; |
| 2615 |
– |
|
| 2616 |
– |
set_locale(yylval.string); |
| 2617 |
– |
} |
| 2618 |
– |
}; |
| 2619 |
– |
|
| 2653 |
|
general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';' |
| 2654 |
|
{ |
| 2655 |
|
ConfigFileEntry.dots_in_ident = $3; |
| 2710 |
|
} | T_CCONN |
| 2711 |
|
{ |
| 2712 |
|
ConfigFileEntry.oper_umodes |= UMODE_CCONN; |
| 2680 |
– |
} | T_CCONN_FULL |
| 2681 |
– |
{ |
| 2682 |
– |
ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL; |
| 2713 |
|
} | T_DEAF |
| 2714 |
|
{ |
| 2715 |
|
ConfigFileEntry.oper_umodes |= UMODE_DEAF; |
| 2761 |
|
} | T_LOCOPS |
| 2762 |
|
{ |
| 2763 |
|
ConfigFileEntry.oper_umodes |= UMODE_LOCOPS; |
| 2764 |
+ |
} | T_NONONREG |
| 2765 |
+ |
{ |
| 2766 |
+ |
ConfigFileEntry.oper_umodes |= UMODE_REGONLY; |
| 2767 |
+ |
} | T_FARCONNECT |
| 2768 |
+ |
{ |
| 2769 |
+ |
ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; |
| 2770 |
|
}; |
| 2771 |
|
|
| 2772 |
|
general_oper_only_umodes: OPER_ONLY_UMODES |
| 2781 |
|
} | T_CCONN |
| 2782 |
|
{ |
| 2783 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; |
| 2748 |
– |
} | T_CCONN_FULL |
| 2749 |
– |
{ |
| 2750 |
– |
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL; |
| 2784 |
|
} | T_DEAF |
| 2785 |
|
{ |
| 2786 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; |
| 2832 |
|
} | T_LOCOPS |
| 2833 |
|
{ |
| 2834 |
|
ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS; |
| 2835 |
+ |
} | T_NONONREG |
| 2836 |
+ |
{ |
| 2837 |
+ |
ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY; |
| 2838 |
+ |
} | T_FARCONNECT |
| 2839 |
+ |
{ |
| 2840 |
+ |
ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT; |
| 2841 |
|
}; |
| 2842 |
|
|
| 2843 |
|
general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';' |
| 2866 |
|
channel_item: channel_max_bans | |
| 2867 |
|
channel_knock_delay | channel_knock_delay_channel | |
| 2868 |
|
channel_max_chans_per_user | channel_max_chans_per_oper | |
| 2869 |
< |
channel_quiet_on_ban | channel_default_split_user_count | |
| 2869 |
> |
channel_default_split_user_count | |
| 2870 |
|
channel_default_split_server_count | |
| 2871 |
< |
channel_no_create_on_split | channel_restrict_channels | |
| 2871 |
> |
channel_no_create_on_split | |
| 2872 |
|
channel_no_join_on_split | |
| 2873 |
|
channel_jflood_count | channel_jflood_time | |
| 2874 |
|
channel_disable_fake_channels | error; |
| 2878 |
|
ConfigChannel.disable_fake_channels = yylval.number; |
| 2879 |
|
}; |
| 2880 |
|
|
| 2842 |
– |
channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';' |
| 2843 |
– |
{ |
| 2844 |
– |
ConfigChannel.restrict_channels = yylval.number; |
| 2845 |
– |
}; |
| 2846 |
– |
|
| 2881 |
|
channel_knock_delay: KNOCK_DELAY '=' timespec ';' |
| 2882 |
|
{ |
| 2883 |
|
ConfigChannel.knock_delay = $3; |
| 2898 |
|
ConfigChannel.max_chans_per_oper = $3; |
| 2899 |
|
}; |
| 2900 |
|
|
| 2867 |
– |
channel_quiet_on_ban: QUIET_ON_BAN '=' TBOOL ';' |
| 2868 |
– |
{ |
| 2869 |
– |
ConfigChannel.quiet_on_ban = yylval.number; |
| 2870 |
– |
}; |
| 2871 |
– |
|
| 2901 |
|
channel_max_bans: MAX_BANS '=' NUMBER ';' |
| 2902 |
|
{ |
| 2903 |
|
ConfigChannel.max_bans = $3; |
| 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 | |
| 2948 |
|
serverhide_hide_server_ips | |
| 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) |
| 2966 |
|
ConfigServerHide.hide_servers = yylval.number; |
| 2967 |
|
}; |
| 2968 |
|
|
| 2969 |
+ |
serverhide_hide_services: HIDE_SERVICES '=' TBOOL ';' |
| 2970 |
+ |
{ |
| 2971 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2972 |
+ |
ConfigServerHide.hide_services = yylval.number; |
| 2973 |
+ |
}; |
| 2974 |
+ |
|
| 2975 |
|
serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';' |
| 2976 |
|
{ |
| 2977 |
|
if (conf_parser_ctx.pass == 2) |