| 1 |
|
/* |
| 2 |
< |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
< |
* conf_parser.y: Parses the ircd configuration file. |
| 2 |
> |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (C) 2005 by the past and present ircd coders, and others. |
| 4 |
> |
* Copyright (c) 2000-2020 ircd-hybrid development team |
| 5 |
|
* |
| 6 |
|
* This program is free software; you can redistribute it and/or modify |
| 7 |
|
* it under the terms of the GNU General Public License as published by |
| 15 |
|
* |
| 16 |
|
* You should have received a copy of the GNU General Public License |
| 17 |
|
* along with this program; if not, write to the Free Software |
| 18 |
< |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 18 |
> |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 19 |
|
* USA |
| 21 |
– |
* |
| 22 |
– |
* $Id$ |
| 20 |
|
*/ |
| 21 |
|
|
| 22 |
< |
%{ |
| 22 |
> |
/*! \file conf_parser.y |
| 23 |
> |
* \brief Parses the ircd configuration file. |
| 24 |
> |
* \version $Id$ |
| 25 |
> |
*/ |
| 26 |
|
|
| 27 |
< |
#define YY_NO_UNPUT |
| 28 |
< |
#include <sys/types.h> |
| 29 |
< |
#include <string.h> |
| 27 |
> |
|
| 28 |
> |
%{ |
| 29 |
|
|
| 30 |
|
#include "config.h" |
| 31 |
|
#include "stdinc.h" |
| 32 |
|
#include "ircd.h" |
| 33 |
|
#include "list.h" |
| 34 |
+ |
#include "parse.h" |
| 35 |
|
#include "conf.h" |
| 36 |
|
#include "conf_class.h" |
| 37 |
+ |
#include "conf_cluster.h" |
| 38 |
+ |
#include "conf_gecos.h" |
| 39 |
+ |
#include "conf_pseudo.h" |
| 40 |
+ |
#include "conf_resv.h" |
| 41 |
+ |
#include "conf_service.h" |
| 42 |
+ |
#include "conf_shared.h" |
| 43 |
|
#include "event.h" |
| 44 |
+ |
#include "id.h" |
| 45 |
|
#include "log.h" |
| 39 |
– |
#include "client.h" /* for UMODE_ALL only */ |
| 46 |
|
#include "irc_string.h" |
| 47 |
|
#include "memory.h" |
| 48 |
|
#include "modules.h" |
| 49 |
< |
#include "s_serv.h" |
| 49 |
> |
#include "server.h" |
| 50 |
|
#include "hostmask.h" |
| 45 |
– |
#include "send.h" |
| 51 |
|
#include "listener.h" |
| 52 |
< |
#include "resv.h" |
| 48 |
< |
#include "numeric.h" |
| 49 |
< |
#include "s_user.h" |
| 52 |
> |
#include "user.h" |
| 53 |
|
#include "motd.h" |
| 54 |
|
|
| 52 |
– |
#ifdef HAVE_LIBCRYPTO |
| 53 |
– |
#include <openssl/rsa.h> |
| 54 |
– |
#include <openssl/bio.h> |
| 55 |
– |
#include <openssl/pem.h> |
| 56 |
– |
#include <openssl/dh.h> |
| 57 |
– |
#endif |
| 58 |
– |
|
| 59 |
– |
#include "rsa.h" |
| 60 |
– |
|
| 55 |
|
int yylex(void); |
| 56 |
|
|
| 57 |
|
static struct |
| 58 |
|
{ |
| 59 |
< |
struct { |
| 59 |
> |
struct |
| 60 |
> |
{ |
| 61 |
|
dlink_list list; |
| 62 |
|
} mask, |
| 63 |
|
leaf, |
| 64 |
|
hub; |
| 65 |
|
|
| 66 |
< |
struct { |
| 66 |
> |
struct |
| 67 |
> |
{ |
| 68 |
|
char buf[IRCD_BUFSIZE]; |
| 69 |
|
} name, |
| 70 |
+ |
nick, |
| 71 |
|
user, |
| 72 |
|
host, |
| 73 |
|
addr, |
| 77 |
|
cert, |
| 78 |
|
rpass, |
| 79 |
|
spass, |
| 80 |
< |
class; |
| 80 |
> |
whois, |
| 81 |
> |
class, |
| 82 |
> |
target, |
| 83 |
> |
prepend, |
| 84 |
> |
command; |
| 85 |
|
|
| 86 |
< |
struct { |
| 86 |
> |
struct |
| 87 |
> |
{ |
| 88 |
|
unsigned int value; |
| 89 |
|
} flags, |
| 90 |
|
modes, |
| 91 |
|
size, |
| 92 |
|
type, |
| 93 |
|
port, |
| 94 |
+ |
timeout, |
| 95 |
|
aftype, |
| 96 |
|
ping_freq, |
| 97 |
< |
max_perip, |
| 97 |
> |
max_perip_local, |
| 98 |
> |
max_perip_global, |
| 99 |
|
con_freq, |
| 100 |
|
min_idle, |
| 101 |
|
max_idle, |
| 102 |
|
max_total, |
| 99 |
– |
max_global, |
| 100 |
– |
max_local, |
| 101 |
– |
max_ident, |
| 103 |
|
max_sendq, |
| 104 |
|
max_recvq, |
| 105 |
+ |
max_channels, |
| 106 |
|
cidr_bitlen_ipv4, |
| 107 |
|
cidr_bitlen_ipv6, |
| 108 |
|
number_per_cidr; |
| 111 |
|
static void |
| 112 |
|
reset_block_state(void) |
| 113 |
|
{ |
| 114 |
< |
dlink_node *ptr = NULL, *ptr_next = NULL; |
| 115 |
< |
|
| 116 |
< |
DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head) |
| 115 |
< |
{ |
| 116 |
< |
MyFree(ptr->data); |
| 117 |
< |
dlinkDelete(ptr, &block_state.mask.list); |
| 118 |
< |
free_dlink_node(ptr); |
| 119 |
< |
} |
| 120 |
< |
|
| 121 |
< |
DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head) |
| 122 |
< |
{ |
| 123 |
< |
MyFree(ptr->data); |
| 124 |
< |
dlinkDelete(ptr, &block_state.leaf.list); |
| 125 |
< |
free_dlink_node(ptr); |
| 126 |
< |
} |
| 114 |
> |
dlink_node *node, *node_next; |
| 115 |
> |
dlink_list *tab[] = { &block_state.mask.list, |
| 116 |
> |
&block_state.leaf.list, &block_state.hub.list, NULL }; |
| 117 |
|
|
| 118 |
< |
DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head) |
| 118 |
> |
for (dlink_list **list = tab; *list; ++list) |
| 119 |
|
{ |
| 120 |
< |
MyFree(ptr->data); |
| 121 |
< |
dlinkDelete(ptr, &block_state.hub.list); |
| 122 |
< |
free_dlink_node(ptr); |
| 120 |
> |
DLINK_FOREACH_SAFE(node, node_next, (*list)->head) |
| 121 |
> |
{ |
| 122 |
> |
xfree(node->data); |
| 123 |
> |
dlinkDelete(node, *list); |
| 124 |
> |
free_dlink_node(node); |
| 125 |
> |
} |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
memset(&block_state, 0, sizeof(block_state)); |
| 141 |
|
%token ANTI_NICK_FLOOD |
| 142 |
|
%token ANTI_SPAM_EXIT_MESSAGE_TIME |
| 143 |
|
%token AUTOCONN |
| 144 |
+ |
%token AWAY_COUNT |
| 145 |
+ |
%token AWAY_TIME |
| 146 |
|
%token BYTES KBYTES MBYTES |
| 147 |
|
%token CALLER_ID_WAIT |
| 148 |
|
%token CAN_FLOOD |
| 150 |
|
%token CIDR_BITLEN_IPV4 |
| 151 |
|
%token CIDR_BITLEN_IPV6 |
| 152 |
|
%token CLASS |
| 153 |
+ |
%token CLOSE |
| 154 |
|
%token CONNECT |
| 155 |
|
%token CONNECTFREQ |
| 156 |
+ |
%token CYCLE_ON_HOST_CHANGE |
| 157 |
|
%token DEFAULT_FLOODCOUNT |
| 158 |
< |
%token DEFAULT_SPLIT_SERVER_COUNT |
| 159 |
< |
%token DEFAULT_SPLIT_USER_COUNT |
| 158 |
> |
%token DEFAULT_FLOODTIME |
| 159 |
> |
%token DEFAULT_JOIN_FLOOD_COUNT |
| 160 |
> |
%token DEFAULT_JOIN_FLOOD_TIME |
| 161 |
> |
%token DEFAULT_MAX_CLIENTS |
| 162 |
|
%token DENY |
| 163 |
|
%token DESCRIPTION |
| 164 |
|
%token DIE |
| 165 |
|
%token DISABLE_AUTH |
| 166 |
|
%token DISABLE_FAKE_CHANNELS |
| 167 |
|
%token DISABLE_REMOTE_COMMANDS |
| 168 |
+ |
%token DLINE_MIN_CIDR |
| 169 |
+ |
%token DLINE_MIN_CIDR6 |
| 170 |
|
%token DOTS_IN_IDENT |
| 170 |
– |
%token EGDPOOL_PATH |
| 171 |
|
%token EMAIL |
| 172 |
|
%token ENCRYPTED |
| 173 |
|
%token EXCEED_LIMIT |
| 174 |
|
%token EXEMPT |
| 175 |
+ |
%token EXPIRATION |
| 176 |
|
%token FAILED_OPER_NOTICE |
| 177 |
|
%token FLATTEN_LINKS |
| 178 |
+ |
%token FLATTEN_LINKS_DELAY |
| 179 |
+ |
%token FLATTEN_LINKS_FILE |
| 180 |
|
%token GECOS |
| 181 |
|
%token GENERAL |
| 179 |
– |
%token GLINE |
| 180 |
– |
%token GLINE_DURATION |
| 181 |
– |
%token GLINE_ENABLE |
| 182 |
– |
%token GLINE_EXEMPT |
| 183 |
– |
%token GLINE_MIN_CIDR |
| 184 |
– |
%token GLINE_MIN_CIDR6 |
| 185 |
– |
%token GLINE_REQUEST_DURATION |
| 186 |
– |
%token GLOBAL_KILL |
| 187 |
– |
%token HAVENT_READ_CONF |
| 182 |
|
%token HIDDEN |
| 183 |
|
%token HIDDEN_NAME |
| 184 |
+ |
%token HIDE_CHANS |
| 185 |
+ |
%token HIDE_IDLE |
| 186 |
|
%token HIDE_IDLE_FROM_OPERS |
| 187 |
|
%token HIDE_SERVER_IPS |
| 188 |
|
%token HIDE_SERVERS |
| 189 |
|
%token HIDE_SERVICES |
| 194 |
– |
%token HIDE_SPOOF_IPS |
| 190 |
|
%token HOST |
| 191 |
|
%token HUB |
| 192 |
|
%token HUB_MASK |
| 198 |
– |
%token IGNORE_BOGUS_TS |
| 193 |
|
%token INVISIBLE_ON_CONNECT |
| 194 |
+ |
%token INVITE_CLIENT_COUNT |
| 195 |
+ |
%token INVITE_CLIENT_TIME |
| 196 |
+ |
%token INVITE_DELAY_CHANNEL |
| 197 |
+ |
%token INVITE_EXPIRE_TIME |
| 198 |
|
%token IP |
| 199 |
|
%token IRCD_AUTH |
| 200 |
|
%token IRCD_FLAGS |
| 201 |
|
%token IRCD_SID |
| 202 |
< |
%token JOIN_FLOOD_COUNT |
| 205 |
< |
%token JOIN_FLOOD_TIME |
| 202 |
> |
%token JOIN |
| 203 |
|
%token KILL |
| 204 |
|
%token KILL_CHASE_TIME_LIMIT |
| 205 |
|
%token KLINE |
| 206 |
|
%token KLINE_EXEMPT |
| 207 |
< |
%token KNOCK_DELAY |
| 207 |
> |
%token KLINE_MIN_CIDR |
| 208 |
> |
%token KLINE_MIN_CIDR6 |
| 209 |
> |
%token KNOCK_CLIENT_COUNT |
| 210 |
> |
%token KNOCK_CLIENT_TIME |
| 211 |
|
%token KNOCK_DELAY_CHANNEL |
| 212 |
|
%token LEAF_MASK |
| 213 |
– |
%token LINKS_DELAY |
| 213 |
|
%token LISTEN |
| 214 |
|
%token MASK |
| 215 |
|
%token MAX_ACCEPT |
| 216 |
|
%token MAX_BANS |
| 217 |
< |
%token MAX_CHANS_PER_OPER |
| 218 |
< |
%token MAX_CHANS_PER_USER |
| 220 |
< |
%token MAX_GLOBAL |
| 221 |
< |
%token MAX_IDENT |
| 217 |
> |
%token MAX_BANS_LARGE |
| 218 |
> |
%token MAX_CHANNELS |
| 219 |
|
%token MAX_IDLE |
| 220 |
< |
%token MAX_LOCAL |
| 220 |
> |
%token MAX_INVITES |
| 221 |
|
%token MAX_NICK_CHANGES |
| 222 |
|
%token MAX_NICK_LENGTH |
| 223 |
|
%token MAX_NICK_TIME |
| 237 |
|
%token NETWORK_DESC |
| 238 |
|
%token NETWORK_NAME |
| 239 |
|
%token NICK |
| 243 |
– |
%token NO_CREATE_ON_SPLIT |
| 244 |
– |
%token NO_JOIN_ON_SPLIT |
| 240 |
|
%token NO_OPER_FLOOD |
| 241 |
|
%token NO_TILDE |
| 242 |
|
%token NUMBER |
| 243 |
|
%token NUMBER_PER_CIDR |
| 244 |
< |
%token NUMBER_PER_IP |
| 244 |
> |
%token NUMBER_PER_IP_GLOBAL |
| 245 |
> |
%token NUMBER_PER_IP_LOCAL |
| 246 |
|
%token OPER_ONLY_UMODES |
| 251 |
– |
%token OPER_PASS_RESV |
| 247 |
|
%token OPER_UMODES |
| 248 |
|
%token OPERATOR |
| 249 |
|
%token OPERS_BYPASS_CALLERID |
| 265 |
|
%token RESV |
| 266 |
|
%token RESV_EXEMPT |
| 267 |
|
%token RSA_PRIVATE_KEY_FILE |
| 273 |
– |
%token RSA_PUBLIC_KEY_FILE |
| 268 |
|
%token SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS |
| 269 |
|
%token SEND_PASSWORD |
| 270 |
|
%token SENDQ |
| 277 |
|
%token SSL_CERTIFICATE_FILE |
| 278 |
|
%token SSL_CERTIFICATE_FINGERPRINT |
| 279 |
|
%token SSL_CONNECTION_REQUIRED |
| 280 |
+ |
%token SSL_DH_ELLIPTIC_CURVE |
| 281 |
|
%token SSL_DH_PARAM_FILE |
| 282 |
+ |
%token SSL_MESSAGE_DIGEST_ALGORITHM |
| 283 |
|
%token STATS_E_DISABLED |
| 284 |
|
%token STATS_I_OPER_ONLY |
| 285 |
|
%token STATS_K_OPER_ONLY |
| 286 |
+ |
%token STATS_M_OPER_ONLY |
| 287 |
|
%token STATS_O_OPER_ONLY |
| 288 |
|
%token STATS_P_OPER_ONLY |
| 289 |
+ |
%token STATS_U_OPER_ONLY |
| 290 |
|
%token T_ALL |
| 291 |
+ |
%token T_BIND |
| 292 |
|
%token T_BOTS |
| 293 |
|
%token T_CALLERID |
| 294 |
|
%token T_CCONN |
| 295 |
+ |
%token T_COMMAND |
| 296 |
|
%token T_CLUSTER |
| 297 |
|
%token T_DEAF |
| 298 |
|
%token T_DEBUG |
| 307 |
|
%token T_IPV6 |
| 308 |
|
%token T_LOCOPS |
| 309 |
|
%token T_LOG |
| 310 |
– |
%token T_MAX_CLIENTS |
| 310 |
|
%token T_NCHANGE |
| 311 |
|
%token T_NONONREG |
| 312 |
< |
%token T_OPERWALL |
| 312 |
> |
%token T_OPME |
| 313 |
> |
%token T_PREPEND |
| 314 |
> |
%token T_PSEUDO |
| 315 |
|
%token T_RECVQ |
| 316 |
|
%token T_REJ |
| 317 |
|
%token T_RESTART |
| 318 |
|
%token T_SERVER |
| 319 |
|
%token T_SERVICE |
| 319 |
– |
%token T_SERVICES_NAME |
| 320 |
|
%token T_SERVNOTICE |
| 321 |
|
%token T_SET |
| 322 |
|
%token T_SHARED |
| 326 |
|
%token T_SPY |
| 327 |
|
%token T_SSL |
| 328 |
|
%token T_SSL_CIPHER_LIST |
| 329 |
< |
%token T_SSL_CLIENT_METHOD |
| 330 |
< |
%token T_SSL_SERVER_METHOD |
| 331 |
< |
%token T_SSLV3 |
| 332 |
< |
%token T_TLSV1 |
| 329 |
> |
%token T_TARGET |
| 330 |
|
%token T_UMODES |
| 331 |
|
%token T_UNAUTH |
| 332 |
|
%token T_UNDLINE |
| 337 |
|
%token T_WALLOPS |
| 338 |
|
%token T_WEBIRC |
| 339 |
|
%token TBOOL |
| 340 |
+ |
%token THROTTLE_COUNT |
| 341 |
|
%token THROTTLE_TIME |
| 342 |
< |
%token TKLINE_EXPIRE_NOTICES |
| 342 |
> |
%token TIMEOUT |
| 343 |
> |
%token TLS_CIPHER_SUITES |
| 344 |
|
%token TMASKED |
| 346 |
– |
%token TRUE_NO_OPER_FLOOD |
| 345 |
|
%token TS_MAX_DELTA |
| 346 |
|
%token TS_WARN_DELTA |
| 347 |
|
%token TWODOTS |
| 348 |
|
%token TYPE |
| 349 |
|
%token UNKLINE |
| 352 |
– |
%token USE_EGD |
| 350 |
|
%token USE_LOGGING |
| 351 |
|
%token USER |
| 352 |
|
%token VHOST |
| 353 |
|
%token VHOST6 |
| 354 |
< |
%token WARN_NO_NLINE |
| 354 |
> |
%token WARN_NO_CONNECT_BLOCK |
| 355 |
> |
%token WHOIS |
| 356 |
> |
%token WHOWAS_HISTORY_LENGTH |
| 357 |
|
%token XLINE |
| 358 |
+ |
%token XLINE_EXEMPT |
| 359 |
|
|
| 360 |
|
%type <string> QSTRING |
| 361 |
|
%type <number> NUMBER |
| 365 |
|
%type <number> sizespec_ |
| 366 |
|
|
| 367 |
|
%% |
| 368 |
< |
conf: |
| 368 |
> |
conf: |
| 369 |
|
| conf conf_item |
| 370 |
|
; |
| 371 |
|
|
| 372 |
|
conf_item: admin_entry |
| 373 |
|
| logging_entry |
| 374 |
|
| oper_entry |
| 375 |
< |
| channel_entry |
| 376 |
< |
| class_entry |
| 375 |
> |
| channel_entry |
| 376 |
> |
| class_entry |
| 377 |
|
| listen_entry |
| 378 |
|
| auth_entry |
| 379 |
|
| serverinfo_entry |
| 380 |
< |
| serverhide_entry |
| 380 |
> |
| serverhide_entry |
| 381 |
|
| resv_entry |
| 382 |
|
| service_entry |
| 383 |
|
| shared_entry |
| 384 |
< |
| cluster_entry |
| 384 |
> |
| cluster_entry |
| 385 |
|
| connect_entry |
| 386 |
|
| kill_entry |
| 387 |
|
| deny_entry |
| 388 |
< |
| exempt_entry |
| 389 |
< |
| general_entry |
| 388 |
> |
| exempt_entry |
| 389 |
> |
| general_entry |
| 390 |
|
| gecos_entry |
| 391 |
|
| modules_entry |
| 392 |
|
| motd_entry |
| 393 |
+ |
| pseudo_entry |
| 394 |
|
| error ';' |
| 395 |
|
| error '}' |
| 396 |
|
; |
| 397 |
|
|
| 398 |
|
|
| 399 |
|
timespec_: { $$ = 0; } | timespec; |
| 400 |
< |
timespec: NUMBER timespec_ |
| 401 |
< |
{ |
| 402 |
< |
$$ = $1 + $2; |
| 403 |
< |
} |
| 404 |
< |
| NUMBER SECONDS timespec_ |
| 405 |
< |
{ |
| 406 |
< |
$$ = $1 + $3; |
| 407 |
< |
} |
| 408 |
< |
| NUMBER MINUTES timespec_ |
| 409 |
< |
{ |
| 410 |
< |
$$ = $1 * 60 + $3; |
| 411 |
< |
} |
| 412 |
< |
| NUMBER HOURS timespec_ |
| 413 |
< |
{ |
| 414 |
< |
$$ = $1 * 60 * 60 + $3; |
| 415 |
< |
} |
| 415 |
< |
| NUMBER DAYS timespec_ |
| 416 |
< |
{ |
| 417 |
< |
$$ = $1 * 60 * 60 * 24 + $3; |
| 418 |
< |
} |
| 419 |
< |
| NUMBER WEEKS timespec_ |
| 420 |
< |
{ |
| 421 |
< |
$$ = $1 * 60 * 60 * 24 * 7 + $3; |
| 422 |
< |
} |
| 423 |
< |
| NUMBER MONTHS timespec_ |
| 424 |
< |
{ |
| 425 |
< |
$$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; |
| 426 |
< |
} |
| 427 |
< |
| NUMBER YEARS timespec_ |
| 428 |
< |
{ |
| 429 |
< |
$$ = $1 * 60 * 60 * 24 * 365 + $3; |
| 430 |
< |
} |
| 431 |
< |
; |
| 432 |
< |
|
| 433 |
< |
sizespec_: { $$ = 0; } | sizespec; |
| 434 |
< |
sizespec: NUMBER sizespec_ { $$ = $1 + $2; } |
| 435 |
< |
| NUMBER BYTES sizespec_ { $$ = $1 + $3; } |
| 436 |
< |
| NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } |
| 437 |
< |
| NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; } |
| 438 |
< |
; |
| 400 |
> |
timespec: NUMBER timespec_ { $$ = $1 + $2; } | |
| 401 |
> |
NUMBER SECONDS timespec_ { $$ = $1 + $3; } | |
| 402 |
> |
NUMBER MINUTES timespec_ { $$ = $1 * 60 + $3; } | |
| 403 |
> |
NUMBER HOURS timespec_ { $$ = $1 * 60 * 60 + $3; } | |
| 404 |
> |
NUMBER DAYS timespec_ { $$ = $1 * 60 * 60 * 24 + $3; } | |
| 405 |
> |
NUMBER WEEKS timespec_ { $$ = $1 * 60 * 60 * 24 * 7 + $3; } | |
| 406 |
> |
NUMBER MONTHS timespec_ { $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; } | |
| 407 |
> |
NUMBER YEARS timespec_ { $$ = $1 * 60 * 60 * 24 * 365 + $3; } |
| 408 |
> |
; |
| 409 |
> |
|
| 410 |
> |
sizespec_: { $$ = 0; } | sizespec; |
| 411 |
> |
sizespec: NUMBER sizespec_ { $$ = $1 + $2; } | |
| 412 |
> |
NUMBER BYTES sizespec_ { $$ = $1 + $3; } | |
| 413 |
> |
NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } | |
| 414 |
> |
NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; } |
| 415 |
> |
; |
| 416 |
|
|
| 417 |
|
|
| 418 |
|
/*************************************************************************** |
| 419 |
< |
* section modules |
| 419 |
> |
* modules {} section |
| 420 |
|
***************************************************************************/ |
| 421 |
< |
modules_entry: MODULES |
| 445 |
< |
'{' modules_items '}' ';'; |
| 421 |
> |
modules_entry: MODULES '{' modules_items '}' ';'; |
| 422 |
|
|
| 423 |
|
modules_items: modules_items modules_item | modules_item; |
| 424 |
|
modules_item: modules_module | modules_path | error ';' ; |
| 436 |
|
}; |
| 437 |
|
|
| 438 |
|
|
| 439 |
+ |
/*************************************************************************** |
| 440 |
+ |
* serverinfo {} section |
| 441 |
+ |
***************************************************************************/ |
| 442 |
|
serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';'; |
| 443 |
|
|
| 444 |
|
serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ; |
| 445 |
< |
serverinfo_item: serverinfo_name | serverinfo_vhost | |
| 446 |
< |
serverinfo_hub | serverinfo_description | |
| 447 |
< |
serverinfo_network_name | serverinfo_network_desc | |
| 448 |
< |
serverinfo_max_clients | serverinfo_max_nick_length | |
| 449 |
< |
serverinfo_max_topic_length | serverinfo_ssl_dh_param_file | |
| 450 |
< |
serverinfo_rsa_private_key_file | serverinfo_vhost6 | |
| 451 |
< |
serverinfo_sid | serverinfo_ssl_certificate_file | |
| 452 |
< |
serverinfo_ssl_client_method | serverinfo_ssl_server_method | |
| 445 |
> |
serverinfo_item: serverinfo_name | |
| 446 |
> |
serverinfo_hub | |
| 447 |
> |
serverinfo_description | |
| 448 |
> |
serverinfo_network_name | |
| 449 |
> |
serverinfo_network_desc | |
| 450 |
> |
serverinfo_default_max_clients | |
| 451 |
> |
serverinfo_max_nick_length | |
| 452 |
> |
serverinfo_max_topic_length | |
| 453 |
> |
serverinfo_ssl_dh_param_file | |
| 454 |
> |
serverinfo_ssl_dh_elliptic_curve | |
| 455 |
> |
serverinfo_rsa_private_key_file | |
| 456 |
> |
serverinfo_sid | |
| 457 |
> |
serverinfo_ssl_certificate_file | |
| 458 |
|
serverinfo_ssl_cipher_list | |
| 459 |
< |
error ';' ; |
| 460 |
< |
|
| 461 |
< |
|
| 478 |
< |
serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ; |
| 479 |
< |
serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ; |
| 480 |
< |
|
| 481 |
< |
client_method_types: client_method_types ',' client_method_type_item | client_method_type_item; |
| 482 |
< |
client_method_type_item: T_SSLV3 |
| 483 |
< |
{ |
| 484 |
< |
#ifdef HAVE_LIBCRYPTO |
| 485 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) |
| 486 |
< |
SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3); |
| 487 |
< |
#endif |
| 488 |
< |
} | T_TLSV1 |
| 489 |
< |
{ |
| 490 |
< |
#ifdef HAVE_LIBCRYPTO |
| 491 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) |
| 492 |
< |
SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1); |
| 493 |
< |
#endif |
| 494 |
< |
}; |
| 459 |
> |
serverinfo_tls_cipher_suites | |
| 460 |
> |
serverinfo_ssl_message_digest_algorithm | |
| 461 |
> |
error ';' ; |
| 462 |
|
|
| 496 |
– |
server_method_types: server_method_types ',' server_method_type_item | server_method_type_item; |
| 497 |
– |
server_method_type_item: T_SSLV3 |
| 498 |
– |
{ |
| 499 |
– |
#ifdef HAVE_LIBCRYPTO |
| 500 |
– |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 501 |
– |
SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3); |
| 502 |
– |
#endif |
| 503 |
– |
} | T_TLSV1 |
| 504 |
– |
{ |
| 505 |
– |
#ifdef HAVE_LIBCRYPTO |
| 506 |
– |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 507 |
– |
SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); |
| 508 |
– |
#endif |
| 509 |
– |
}; |
| 463 |
|
|
| 464 |
|
serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' |
| 465 |
|
{ |
| 466 |
< |
#ifdef HAVE_LIBCRYPTO |
| 514 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 466 |
> |
if (conf_parser_ctx.pass == 2) |
| 467 |
|
{ |
| 468 |
< |
if (!ServerInfo.rsa_private_key_file) |
| 469 |
< |
{ |
| 518 |
< |
conf_error_report("No rsa_private_key_file specified, SSL disabled"); |
| 519 |
< |
break; |
| 520 |
< |
} |
| 521 |
< |
|
| 522 |
< |
if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string, |
| 523 |
< |
SSL_FILETYPE_PEM) <= 0 || |
| 524 |
< |
SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string, |
| 525 |
< |
SSL_FILETYPE_PEM) <= 0) |
| 526 |
< |
{ |
| 527 |
< |
report_crypto_errors(); |
| 528 |
< |
conf_error_report("Could not open/read certificate file"); |
| 529 |
< |
break; |
| 530 |
< |
} |
| 531 |
< |
|
| 532 |
< |
if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file, |
| 533 |
< |
SSL_FILETYPE_PEM) <= 0 || |
| 534 |
< |
SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file, |
| 535 |
< |
SSL_FILETYPE_PEM) <= 0) |
| 536 |
< |
{ |
| 537 |
< |
report_crypto_errors(); |
| 538 |
< |
conf_error_report("Could not read RSA private key"); |
| 539 |
< |
break; |
| 540 |
< |
} |
| 541 |
< |
|
| 542 |
< |
if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) || |
| 543 |
< |
!SSL_CTX_check_private_key(ServerInfo.client_ctx)) |
| 544 |
< |
{ |
| 545 |
< |
report_crypto_errors(); |
| 546 |
< |
conf_error_report("Could not read RSA private key"); |
| 547 |
< |
break; |
| 548 |
< |
} |
| 468 |
> |
xfree(ConfigServerInfo.ssl_certificate_file); |
| 469 |
> |
ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string); |
| 470 |
|
} |
| 550 |
– |
#endif |
| 471 |
|
}; |
| 472 |
|
|
| 473 |
|
serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';' |
| 474 |
|
{ |
| 475 |
< |
#ifdef HAVE_LIBCRYPTO |
| 556 |
< |
BIO *file = NULL; |
| 557 |
< |
|
| 558 |
< |
if (conf_parser_ctx.pass != 1) |
| 559 |
< |
break; |
| 560 |
< |
|
| 561 |
< |
if (ServerInfo.rsa_private_key) |
| 562 |
< |
{ |
| 563 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 564 |
< |
ServerInfo.rsa_private_key = NULL; |
| 565 |
< |
} |
| 566 |
< |
|
| 567 |
< |
if (ServerInfo.rsa_private_key_file) |
| 568 |
< |
{ |
| 569 |
< |
MyFree(ServerInfo.rsa_private_key_file); |
| 570 |
< |
ServerInfo.rsa_private_key_file = NULL; |
| 571 |
< |
} |
| 572 |
< |
|
| 573 |
< |
ServerInfo.rsa_private_key_file = xstrdup(yylval.string); |
| 574 |
< |
|
| 575 |
< |
if ((file = BIO_new_file(yylval.string, "r")) == NULL) |
| 475 |
> |
if (conf_parser_ctx.pass == 2) |
| 476 |
|
{ |
| 477 |
< |
conf_error_report("File open failed, ignoring"); |
| 478 |
< |
break; |
| 477 |
> |
xfree(ConfigServerInfo.rsa_private_key_file); |
| 478 |
> |
ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string); |
| 479 |
|
} |
| 480 |
+ |
}; |
| 481 |
|
|
| 482 |
< |
ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); |
| 483 |
< |
|
| 484 |
< |
BIO_set_close(file, BIO_CLOSE); |
| 584 |
< |
BIO_free(file); |
| 585 |
< |
|
| 586 |
< |
if (ServerInfo.rsa_private_key == NULL) |
| 482 |
> |
serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';' |
| 483 |
> |
{ |
| 484 |
> |
if (conf_parser_ctx.pass == 2) |
| 485 |
|
{ |
| 486 |
< |
conf_error_report("Couldn't extract key, ignoring"); |
| 487 |
< |
break; |
| 486 |
> |
xfree(ConfigServerInfo.ssl_dh_param_file); |
| 487 |
> |
ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string); |
| 488 |
|
} |
| 489 |
+ |
}; |
| 490 |
|
|
| 491 |
< |
if (!RSA_check_key(ServerInfo.rsa_private_key)) |
| 491 |
> |
serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' |
| 492 |
> |
{ |
| 493 |
> |
if (conf_parser_ctx.pass == 2) |
| 494 |
|
{ |
| 495 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 496 |
< |
ServerInfo.rsa_private_key = NULL; |
| 596 |
< |
|
| 597 |
< |
conf_error_report("Invalid key, ignoring"); |
| 598 |
< |
break; |
| 495 |
> |
xfree(ConfigServerInfo.ssl_cipher_list); |
| 496 |
> |
ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string); |
| 497 |
|
} |
| 498 |
+ |
}; |
| 499 |
|
|
| 500 |
< |
/* require 2048 bit (256 byte) key */ |
| 501 |
< |
if (RSA_size(ServerInfo.rsa_private_key) != 256) |
| 500 |
> |
serverinfo_tls_cipher_suites: TLS_CIPHER_SUITES '=' QSTRING ';' |
| 501 |
> |
{ |
| 502 |
> |
if (conf_parser_ctx.pass == 2) |
| 503 |
|
{ |
| 504 |
< |
RSA_free(ServerInfo.rsa_private_key); |
| 505 |
< |
ServerInfo.rsa_private_key = NULL; |
| 606 |
< |
|
| 607 |
< |
conf_error_report("Not a 2048 bit key, ignoring"); |
| 504 |
> |
xfree(ConfigServerInfo.tls_cipher_suites); |
| 505 |
> |
ConfigServerInfo.tls_cipher_suites = xstrdup(yylval.string); |
| 506 |
|
} |
| 609 |
– |
#endif |
| 507 |
|
}; |
| 508 |
|
|
| 509 |
< |
serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';' |
| 509 |
> |
serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';' |
| 510 |
|
{ |
| 511 |
< |
/* TBD - XXX: error reporting */ |
| 615 |
< |
#ifdef HAVE_LIBCRYPTO |
| 616 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 511 |
> |
if (conf_parser_ctx.pass == 2) |
| 512 |
|
{ |
| 513 |
< |
BIO *file = BIO_new_file(yylval.string, "r"); |
| 514 |
< |
|
| 620 |
< |
if (file) |
| 621 |
< |
{ |
| 622 |
< |
DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL); |
| 623 |
< |
|
| 624 |
< |
BIO_free(file); |
| 625 |
< |
|
| 626 |
< |
if (dh) |
| 627 |
< |
{ |
| 628 |
< |
if (DH_size(dh) < 128) |
| 629 |
< |
conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size"); |
| 630 |
< |
else |
| 631 |
< |
SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh); |
| 632 |
< |
|
| 633 |
< |
DH_free(dh); |
| 634 |
< |
} |
| 635 |
< |
} |
| 513 |
> |
xfree(ConfigServerInfo.ssl_message_digest_algorithm); |
| 514 |
> |
ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string); |
| 515 |
|
} |
| 516 |
< |
#endif |
| 638 |
< |
}; |
| 516 |
> |
} |
| 517 |
|
|
| 518 |
< |
serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' |
| 518 |
> |
serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';' |
| 519 |
|
{ |
| 520 |
< |
#ifdef HAVE_LIBCRYPTO |
| 521 |
< |
if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) |
| 522 |
< |
SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string); |
| 523 |
< |
#endif |
| 520 |
> |
if (conf_parser_ctx.pass == 2) |
| 521 |
> |
{ |
| 522 |
> |
xfree(ConfigServerInfo.ssl_dh_elliptic_curve); |
| 523 |
> |
ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string); |
| 524 |
> |
} |
| 525 |
|
}; |
| 526 |
|
|
| 527 |
< |
serverinfo_name: NAME '=' QSTRING ';' |
| 527 |
> |
serverinfo_name: NAME '=' QSTRING ';' |
| 528 |
|
{ |
| 529 |
< |
/* this isn't rehashable */ |
| 530 |
< |
if (conf_parser_ctx.pass == 2 && !ServerInfo.name) |
| 529 |
> |
/* This isn't rehashable */ |
| 530 |
> |
if (conf_parser_ctx.pass == 2 && ConfigServerInfo.name == NULL) |
| 531 |
|
{ |
| 532 |
< |
if (valid_servname(yylval.string)) |
| 533 |
< |
ServerInfo.name = xstrdup(yylval.string); |
| 532 |
> |
if (server_valid_name(yylval.string) == true) |
| 533 |
> |
ConfigServerInfo.name = xstrdup(yylval.string); |
| 534 |
|
else |
| 535 |
|
{ |
| 536 |
|
conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting."); |
| 537 |
< |
exit(0); |
| 537 |
> |
exit(EXIT_FAILURE); |
| 538 |
|
} |
| 539 |
|
} |
| 540 |
|
}; |
| 541 |
|
|
| 542 |
< |
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 542 |
> |
serverinfo_sid: IRCD_SID '=' QSTRING ';' |
| 543 |
|
{ |
| 544 |
< |
/* this isn't rehashable */ |
| 545 |
< |
if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) |
| 544 |
> |
/* This isn't rehashable */ |
| 545 |
> |
if (conf_parser_ctx.pass == 2 && ConfigServerInfo.sid == NULL) |
| 546 |
|
{ |
| 547 |
|
if (valid_sid(yylval.string)) |
| 548 |
< |
ServerInfo.sid = xstrdup(yylval.string); |
| 548 |
> |
ConfigServerInfo.sid = xstrdup(yylval.string); |
| 549 |
|
else |
| 550 |
|
{ |
| 551 |
|
conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting."); |
| 552 |
< |
exit(0); |
| 552 |
> |
exit(EXIT_FAILURE); |
| 553 |
|
} |
| 554 |
|
} |
| 555 |
|
}; |
| 558 |
|
{ |
| 559 |
|
if (conf_parser_ctx.pass == 2) |
| 560 |
|
{ |
| 561 |
< |
MyFree(ServerInfo.description); |
| 562 |
< |
ServerInfo.description = xstrdup(yylval.string); |
| 561 |
> |
xfree(ConfigServerInfo.description); |
| 562 |
> |
ConfigServerInfo.description = xstrdup(yylval.string); |
| 563 |
> |
strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info)); |
| 564 |
|
} |
| 565 |
|
}; |
| 566 |
|
|
| 570 |
|
{ |
| 571 |
|
char *p; |
| 572 |
|
|
| 573 |
< |
if ((p = strchr(yylval.string, ' ')) != NULL) |
| 574 |
< |
p = '\0'; |
| 573 |
> |
if ((p = strchr(yylval.string, ' '))) |
| 574 |
> |
*p = '\0'; |
| 575 |
|
|
| 576 |
< |
MyFree(ServerInfo.network_name); |
| 577 |
< |
ServerInfo.network_name = xstrdup(yylval.string); |
| 576 |
> |
xfree(ConfigServerInfo.network_name); |
| 577 |
> |
ConfigServerInfo.network_name = xstrdup(yylval.string); |
| 578 |
|
} |
| 579 |
|
}; |
| 580 |
|
|
| 583 |
|
if (conf_parser_ctx.pass != 2) |
| 584 |
|
break; |
| 585 |
|
|
| 586 |
< |
MyFree(ServerInfo.network_desc); |
| 587 |
< |
ServerInfo.network_desc = xstrdup(yylval.string); |
| 586 |
> |
xfree(ConfigServerInfo.network_desc); |
| 587 |
> |
ConfigServerInfo.network_desc = xstrdup(yylval.string); |
| 588 |
|
}; |
| 589 |
|
|
| 590 |
< |
serverinfo_vhost: VHOST '=' QSTRING ';' |
| 711 |
< |
{ |
| 712 |
< |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 713 |
< |
{ |
| 714 |
< |
struct addrinfo hints, *res; |
| 715 |
< |
|
| 716 |
< |
memset(&hints, 0, sizeof(hints)); |
| 717 |
< |
|
| 718 |
< |
hints.ai_family = AF_UNSPEC; |
| 719 |
< |
hints.ai_socktype = SOCK_STREAM; |
| 720 |
< |
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 721 |
< |
|
| 722 |
< |
if (getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 723 |
< |
ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string); |
| 724 |
< |
else |
| 725 |
< |
{ |
| 726 |
< |
assert(res != NULL); |
| 727 |
< |
|
| 728 |
< |
memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen); |
| 729 |
< |
ServerInfo.ip.ss.ss_family = res->ai_family; |
| 730 |
< |
ServerInfo.ip.ss_len = res->ai_addrlen; |
| 731 |
< |
freeaddrinfo(res); |
| 732 |
< |
|
| 733 |
< |
ServerInfo.specific_ipv4_vhost = 1; |
| 734 |
< |
} |
| 735 |
< |
} |
| 736 |
< |
}; |
| 737 |
< |
|
| 738 |
< |
serverinfo_vhost6: VHOST6 '=' QSTRING ';' |
| 739 |
< |
{ |
| 740 |
< |
#ifdef IPV6 |
| 741 |
< |
if (conf_parser_ctx.pass == 2 && *yylval.string != '*') |
| 742 |
< |
{ |
| 743 |
< |
struct addrinfo hints, *res; |
| 744 |
< |
|
| 745 |
< |
memset(&hints, 0, sizeof(hints)); |
| 746 |
< |
|
| 747 |
< |
hints.ai_family = AF_UNSPEC; |
| 748 |
< |
hints.ai_socktype = SOCK_STREAM; |
| 749 |
< |
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 750 |
< |
|
| 751 |
< |
if (getaddrinfo(yylval.string, NULL, &hints, &res)) |
| 752 |
< |
ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string); |
| 753 |
< |
else |
| 754 |
< |
{ |
| 755 |
< |
assert(res != NULL); |
| 756 |
< |
|
| 757 |
< |
memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen); |
| 758 |
< |
ServerInfo.ip6.ss.ss_family = res->ai_family; |
| 759 |
< |
ServerInfo.ip6.ss_len = res->ai_addrlen; |
| 760 |
< |
freeaddrinfo(res); |
| 761 |
< |
|
| 762 |
< |
ServerInfo.specific_ipv6_vhost = 1; |
| 763 |
< |
} |
| 764 |
< |
} |
| 765 |
< |
#endif |
| 766 |
< |
}; |
| 767 |
< |
|
| 768 |
< |
serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';' |
| 590 |
> |
serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';' |
| 591 |
|
{ |
| 592 |
|
if (conf_parser_ctx.pass != 2) |
| 593 |
|
break; |
| 594 |
|
|
| 595 |
< |
if ($3 < MAXCLIENTS_MIN) |
| 595 |
> |
if ($3 < 1) |
| 596 |
|
{ |
| 597 |
< |
char buf[IRCD_BUFSIZE]; |
| 598 |
< |
|
| 777 |
< |
snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); |
| 778 |
< |
conf_error_report(buf); |
| 779 |
< |
ServerInfo.max_clients = MAXCLIENTS_MIN; |
| 597 |
> |
conf_error_report("default_max_clients too low, setting to 1"); |
| 598 |
> |
ConfigServerInfo.default_max_clients = 1; |
| 599 |
|
} |
| 600 |
|
else if ($3 > MAXCLIENTS_MAX) |
| 601 |
|
{ |
| 602 |
< |
char buf[IRCD_BUFSIZE]; |
| 602 |
> |
char buf[IRCD_BUFSIZE] = ""; |
| 603 |
|
|
| 604 |
< |
snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); |
| 604 |
> |
snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MAXCLIENTS_MAX); |
| 605 |
|
conf_error_report(buf); |
| 606 |
< |
ServerInfo.max_clients = MAXCLIENTS_MAX; |
| 606 |
> |
|
| 607 |
> |
ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX; |
| 608 |
|
} |
| 609 |
|
else |
| 610 |
< |
ServerInfo.max_clients = $3; |
| 610 |
> |
ConfigServerInfo.default_max_clients = $3; |
| 611 |
|
}; |
| 612 |
|
|
| 613 |
|
serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';' |
| 618 |
|
if ($3 < 9) |
| 619 |
|
{ |
| 620 |
|
conf_error_report("max_nick_length too low, setting to 9"); |
| 621 |
< |
ServerInfo.max_nick_length = 9; |
| 621 |
> |
ConfigServerInfo.max_nick_length = 9; |
| 622 |
|
} |
| 623 |
|
else if ($3 > NICKLEN) |
| 624 |
|
{ |
| 625 |
< |
char buf[IRCD_BUFSIZE]; |
| 625 |
> |
char buf[IRCD_BUFSIZE] = ""; |
| 626 |
|
|
| 627 |
|
snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN); |
| 628 |
|
conf_error_report(buf); |
| 629 |
< |
ServerInfo.max_nick_length = NICKLEN; |
| 629 |
> |
|
| 630 |
> |
ConfigServerInfo.max_nick_length = NICKLEN; |
| 631 |
|
} |
| 632 |
|
else |
| 633 |
< |
ServerInfo.max_nick_length = $3; |
| 633 |
> |
ConfigServerInfo.max_nick_length = $3; |
| 634 |
|
}; |
| 635 |
|
|
| 636 |
|
serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';' |
| 641 |
|
if ($3 < 80) |
| 642 |
|
{ |
| 643 |
|
conf_error_report("max_topic_length too low, setting to 80"); |
| 644 |
< |
ServerInfo.max_topic_length = 80; |
| 644 |
> |
ConfigServerInfo.max_topic_length = 80; |
| 645 |
|
} |
| 646 |
|
else if ($3 > TOPICLEN) |
| 647 |
|
{ |
| 648 |
< |
char buf[IRCD_BUFSIZE]; |
| 648 |
> |
char buf[IRCD_BUFSIZE] = ""; |
| 649 |
|
|
| 650 |
|
snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN); |
| 651 |
|
conf_error_report(buf); |
| 652 |
< |
ServerInfo.max_topic_length = TOPICLEN; |
| 652 |
> |
|
| 653 |
> |
ConfigServerInfo.max_topic_length = TOPICLEN; |
| 654 |
|
} |
| 655 |
|
else |
| 656 |
< |
ServerInfo.max_topic_length = $3; |
| 656 |
> |
ConfigServerInfo.max_topic_length = $3; |
| 657 |
|
}; |
| 658 |
|
|
| 659 |
< |
serverinfo_hub: HUB '=' TBOOL ';' |
| 659 |
> |
serverinfo_hub: HUB '=' TBOOL ';' |
| 660 |
|
{ |
| 661 |
|
if (conf_parser_ctx.pass == 2) |
| 662 |
< |
ServerInfo.hub = yylval.number; |
| 662 |
> |
ConfigServerInfo.hub = yylval.number; |
| 663 |
|
}; |
| 664 |
|
|
| 665 |
+ |
|
| 666 |
|
/*************************************************************************** |
| 667 |
< |
* admin section |
| 667 |
> |
* admin {} section |
| 668 |
|
***************************************************************************/ |
| 669 |
< |
admin_entry: ADMIN '{' admin_items '}' ';' ; |
| 669 |
> |
admin_entry: ADMIN '{' admin_items '}' ';' ; |
| 670 |
|
|
| 671 |
|
admin_items: admin_items admin_item | admin_item; |
| 672 |
< |
admin_item: admin_name | admin_description | |
| 673 |
< |
admin_email | error ';' ; |
| 672 |
> |
admin_item: admin_name | |
| 673 |
> |
admin_description | |
| 674 |
> |
admin_email | |
| 675 |
> |
error ';' ; |
| 676 |
|
|
| 677 |
< |
admin_name: NAME '=' QSTRING ';' |
| 677 |
> |
admin_name: NAME '=' QSTRING ';' |
| 678 |
|
{ |
| 679 |
|
if (conf_parser_ctx.pass != 2) |
| 680 |
|
break; |
| 681 |
|
|
| 682 |
< |
MyFree(AdminInfo.name); |
| 683 |
< |
AdminInfo.name = xstrdup(yylval.string); |
| 682 |
> |
xfree(ConfigAdminInfo.name); |
| 683 |
> |
ConfigAdminInfo.name = xstrdup(yylval.string); |
| 684 |
|
}; |
| 685 |
|
|
| 686 |
|
admin_email: EMAIL '=' QSTRING ';' |
| 688 |
|
if (conf_parser_ctx.pass != 2) |
| 689 |
|
break; |
| 690 |
|
|
| 691 |
< |
MyFree(AdminInfo.email); |
| 692 |
< |
AdminInfo.email = xstrdup(yylval.string); |
| 691 |
> |
xfree(ConfigAdminInfo.email); |
| 692 |
> |
ConfigAdminInfo.email = xstrdup(yylval.string); |
| 693 |
|
}; |
| 694 |
|
|
| 695 |
|
admin_description: DESCRIPTION '=' QSTRING ';' |
| 697 |
|
if (conf_parser_ctx.pass != 2) |
| 698 |
|
break; |
| 699 |
|
|
| 700 |
< |
MyFree(AdminInfo.description); |
| 701 |
< |
AdminInfo.description = xstrdup(yylval.string); |
| 700 |
> |
xfree(ConfigAdminInfo.description); |
| 701 |
> |
ConfigAdminInfo.description = xstrdup(yylval.string); |
| 702 |
|
}; |
| 703 |
|
|
| 704 |
+ |
|
| 705 |
|
/*************************************************************************** |
| 706 |
< |
* motd section |
| 706 |
> |
* motd {} section |
| 707 |
|
***************************************************************************/ |
| 708 |
< |
motd_entry: MOTD |
| 708 |
> |
motd_entry: MOTD |
| 709 |
|
{ |
| 710 |
|
if (conf_parser_ctx.pass == 2) |
| 711 |
|
reset_block_state(); |
| 712 |
|
} '{' motd_items '}' ';' |
| 713 |
|
{ |
| 714 |
< |
dlink_node *ptr = NULL; |
| 714 |
> |
dlink_node *node = NULL; |
| 715 |
|
|
| 716 |
|
if (conf_parser_ctx.pass != 2) |
| 717 |
|
break; |
| 719 |
|
if (!block_state.file.buf[0]) |
| 720 |
|
break; |
| 721 |
|
|
| 722 |
< |
DLINK_FOREACH(ptr, block_state.mask.list.head) |
| 723 |
< |
motd_add(ptr->data, block_state.file.buf); |
| 722 |
> |
DLINK_FOREACH(node, block_state.mask.list.head) |
| 723 |
> |
motd_add(node->data, block_state.file.buf); |
| 724 |
|
}; |
| 725 |
|
|
| 726 |
|
motd_items: motd_items motd_item | motd_item; |
| 727 |
|
motd_item: motd_mask | motd_file | error ';' ; |
| 728 |
|
|
| 729 |
< |
motd_mask: MASK '=' QSTRING ';' |
| 729 |
> |
motd_mask: MASK '=' QSTRING ';' |
| 730 |
|
{ |
| 731 |
|
if (conf_parser_ctx.pass == 2) |
| 732 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); |
| 738 |
|
strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); |
| 739 |
|
}; |
| 740 |
|
|
| 741 |
+ |
|
| 742 |
+ |
/*************************************************************************** |
| 743 |
+ |
* pseudo {} section |
| 744 |
+ |
***************************************************************************/ |
| 745 |
+ |
pseudo_entry: T_PSEUDO |
| 746 |
+ |
{ |
| 747 |
+ |
if (conf_parser_ctx.pass == 2) |
| 748 |
+ |
reset_block_state(); |
| 749 |
+ |
} '{' pseudo_items '}' ';' |
| 750 |
+ |
{ |
| 751 |
+ |
if (conf_parser_ctx.pass != 2) |
| 752 |
+ |
break; |
| 753 |
+ |
|
| 754 |
+ |
if (!block_state.command.buf[0] || |
| 755 |
+ |
!block_state.name.buf[0] || |
| 756 |
+ |
!block_state.nick.buf[0] || |
| 757 |
+ |
!block_state.host.buf[0]) |
| 758 |
+ |
break; |
| 759 |
+ |
|
| 760 |
+ |
pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf, |
| 761 |
+ |
block_state.prepend.buf, block_state.command.buf); |
| 762 |
+ |
}; |
| 763 |
+ |
|
| 764 |
+ |
pseudo_items: pseudo_items pseudo_item | pseudo_item; |
| 765 |
+ |
pseudo_item: pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ; |
| 766 |
+ |
|
| 767 |
+ |
pseudo_command: T_COMMAND '=' QSTRING ';' |
| 768 |
+ |
{ |
| 769 |
+ |
if (conf_parser_ctx.pass == 2) |
| 770 |
+ |
strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf)); |
| 771 |
+ |
}; |
| 772 |
+ |
|
| 773 |
+ |
pseudo_name: NAME '=' QSTRING ';' |
| 774 |
+ |
{ |
| 775 |
+ |
if (conf_parser_ctx.pass == 2) |
| 776 |
+ |
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 777 |
+ |
}; |
| 778 |
+ |
|
| 779 |
+ |
pseudo_prepend: T_PREPEND '=' QSTRING ';' |
| 780 |
+ |
{ |
| 781 |
+ |
if (conf_parser_ctx.pass == 2) |
| 782 |
+ |
strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf)); |
| 783 |
+ |
}; |
| 784 |
+ |
|
| 785 |
+ |
pseudo_target: T_TARGET '=' QSTRING ';' |
| 786 |
+ |
{ |
| 787 |
+ |
if (conf_parser_ctx.pass == 2) |
| 788 |
+ |
{ |
| 789 |
+ |
struct split_nuh_item nuh; |
| 790 |
+ |
|
| 791 |
+ |
nuh.nuhmask = yylval.string; |
| 792 |
+ |
nuh.nickptr = NULL; |
| 793 |
+ |
nuh.userptr = block_state.nick.buf; |
| 794 |
+ |
nuh.hostptr = block_state.host.buf; |
| 795 |
+ |
nuh.nicksize = 0; |
| 796 |
+ |
nuh.usersize = sizeof(block_state.nick.buf); |
| 797 |
+ |
nuh.hostsize = sizeof(block_state.host.buf); |
| 798 |
+ |
|
| 799 |
+ |
split_nuh(&nuh); |
| 800 |
+ |
} |
| 801 |
+ |
}; |
| 802 |
+ |
|
| 803 |
+ |
|
| 804 |
|
/*************************************************************************** |
| 805 |
< |
* section logging |
| 805 |
> |
* log {} section |
| 806 |
|
***************************************************************************/ |
| 807 |
|
logging_entry: T_LOG '{' logging_items '}' ';' ; |
| 808 |
|
logging_items: logging_items logging_item | logging_item ; |
| 809 |
|
|
| 810 |
< |
logging_item: logging_use_logging | logging_file_entry | |
| 811 |
< |
error ';' ; |
| 810 |
> |
logging_item: logging_use_logging | logging_file_entry | |
| 811 |
> |
error ';' ; |
| 812 |
|
|
| 813 |
|
logging_use_logging: USE_LOGGING '=' TBOOL ';' |
| 814 |
|
{ |
| 815 |
|
if (conf_parser_ctx.pass == 2) |
| 816 |
< |
ConfigLoggingEntry.use_logging = yylval.number; |
| 816 |
> |
ConfigLog.use_logging = yylval.number; |
| 817 |
|
}; |
| 818 |
|
|
| 819 |
|
logging_file_entry: |
| 867 |
|
{ |
| 868 |
|
if (conf_parser_ctx.pass == 2) |
| 869 |
|
block_state.type.value = LOG_TYPE_OPER; |
| 870 |
< |
} | GLINE |
| 870 |
> |
} | XLINE |
| 871 |
|
{ |
| 872 |
|
if (conf_parser_ctx.pass == 2) |
| 873 |
< |
block_state.type.value = LOG_TYPE_GLINE; |
| 873 |
> |
block_state.type.value = LOG_TYPE_XLINE; |
| 874 |
> |
} | RESV |
| 875 |
> |
{ |
| 876 |
> |
if (conf_parser_ctx.pass == 2) |
| 877 |
> |
block_state.type.value = LOG_TYPE_RESV; |
| 878 |
|
} | T_DLINE |
| 879 |
|
{ |
| 880 |
|
if (conf_parser_ctx.pass == 2) |
| 895 |
|
|
| 896 |
|
|
| 897 |
|
/*************************************************************************** |
| 898 |
< |
* section oper |
| 898 |
> |
* operator {} section |
| 899 |
|
***************************************************************************/ |
| 900 |
< |
oper_entry: OPERATOR |
| 900 |
> |
oper_entry: OPERATOR |
| 901 |
|
{ |
| 902 |
|
if (conf_parser_ctx.pass != 2) |
| 903 |
|
break; |
| 906 |
|
block_state.flags.value |= CONF_FLAGS_ENCRYPTED; |
| 907 |
|
} '{' oper_items '}' ';' |
| 908 |
|
{ |
| 909 |
< |
dlink_node *ptr = NULL; |
| 909 |
> |
dlink_node *node = NULL; |
| 910 |
|
|
| 911 |
|
if (conf_parser_ctx.pass != 2) |
| 912 |
|
break; |
| 913 |
|
|
| 914 |
|
if (!block_state.name.buf[0]) |
| 915 |
|
break; |
| 916 |
< |
#ifdef HAVE_LIBCRYPTO |
| 1024 |
< |
if (!block_state.file.buf[0] && |
| 1025 |
< |
!block_state.rpass.buf[0]) |
| 1026 |
< |
break; |
| 1027 |
< |
#else |
| 916 |
> |
|
| 917 |
|
if (!block_state.rpass.buf[0]) |
| 918 |
|
break; |
| 1030 |
– |
#endif |
| 919 |
|
|
| 920 |
< |
DLINK_FOREACH(ptr, block_state.mask.list.head) |
| 920 |
> |
DLINK_FOREACH(node, block_state.mask.list.head) |
| 921 |
|
{ |
| 1034 |
– |
struct MaskItem *conf = NULL; |
| 922 |
|
struct split_nuh_item nuh; |
| 923 |
+ |
char *s = node->data; |
| 924 |
|
|
| 925 |
< |
nuh.nuhmask = ptr->data; |
| 925 |
> |
if (EmptyString(s)) |
| 926 |
> |
continue; |
| 927 |
> |
|
| 928 |
> |
nuh.nuhmask = s; |
| 929 |
|
nuh.nickptr = NULL; |
| 930 |
|
nuh.userptr = block_state.user.buf; |
| 931 |
|
nuh.hostptr = block_state.host.buf; |
| 932 |
+ |
|
| 933 |
|
nuh.nicksize = 0; |
| 934 |
|
nuh.usersize = sizeof(block_state.user.buf); |
| 935 |
|
nuh.hostsize = sizeof(block_state.host.buf); |
| 936 |
+ |
|
| 937 |
|
split_nuh(&nuh); |
| 938 |
|
|
| 939 |
< |
conf = conf_make(CONF_OPER); |
| 940 |
< |
conf->name = xstrdup(block_state.name.buf); |
| 941 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 942 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 939 |
> |
struct MaskItem *conf = conf_make(CONF_OPER); |
| 940 |
> |
conf->addr = xcalloc(sizeof(*conf->addr)); |
| 941 |
> |
conf->name = xstrdup(block_state.name.buf); |
| 942 |
> |
conf->user = xstrdup(block_state.user.buf); |
| 943 |
> |
conf->host = xstrdup(block_state.host.buf); |
| 944 |
|
|
| 945 |
|
if (block_state.cert.buf[0]) |
| 946 |
|
conf->certfp = xstrdup(block_state.cert.buf); |
| 948 |
|
if (block_state.rpass.buf[0]) |
| 949 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
| 950 |
|
|
| 951 |
+ |
if (block_state.whois.buf[0]) |
| 952 |
+ |
conf->whois = xstrdup(block_state.whois.buf); |
| 953 |
+ |
|
| 954 |
|
conf->flags = block_state.flags.value; |
| 955 |
|
conf->modes = block_state.modes.value; |
| 956 |
|
conf->port = block_state.port.value; |
| 957 |
< |
conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits); |
| 957 |
> |
conf->htype = parse_netmask(conf->host, conf->addr, &conf->bits); |
| 958 |
|
|
| 959 |
|
conf_add_class_to_conf(conf, block_state.class.buf); |
| 1063 |
– |
|
| 1064 |
– |
#ifdef HAVE_LIBCRYPTO |
| 1065 |
– |
if (block_state.file.buf[0]) |
| 1066 |
– |
{ |
| 1067 |
– |
BIO *file = NULL; |
| 1068 |
– |
RSA *pkey = NULL; |
| 1069 |
– |
|
| 1070 |
– |
if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL) |
| 1071 |
– |
{ |
| 1072 |
– |
conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist"); |
| 1073 |
– |
break; |
| 1074 |
– |
} |
| 1075 |
– |
|
| 1076 |
– |
if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL) |
| 1077 |
– |
conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax."); |
| 1078 |
– |
|
| 1079 |
– |
conf->rsa_public_key = pkey; |
| 1080 |
– |
BIO_set_close(file, BIO_CLOSE); |
| 1081 |
– |
BIO_free(file); |
| 1082 |
– |
} |
| 1083 |
– |
#endif /* HAVE_LIBCRYPTO */ |
| 960 |
|
} |
| 961 |
|
}; |
| 962 |
|
|
| 963 |
|
oper_items: oper_items oper_item | oper_item; |
| 964 |
< |
oper_item: oper_name | oper_user | oper_password | |
| 965 |
< |
oper_umodes | oper_class | oper_encrypted | |
| 966 |
< |
oper_rsa_public_key_file | oper_ssl_certificate_fingerprint | |
| 967 |
< |
oper_ssl_connection_required | |
| 968 |
< |
oper_flags | error ';' ; |
| 964 |
> |
oper_item: oper_name | |
| 965 |
> |
oper_user | |
| 966 |
> |
oper_password | |
| 967 |
> |
oper_whois | |
| 968 |
> |
oper_umodes | |
| 969 |
> |
oper_class | |
| 970 |
> |
oper_encrypted | |
| 971 |
> |
oper_ssl_certificate_fingerprint | |
| 972 |
> |
oper_ssl_connection_required | |
| 973 |
> |
oper_flags | |
| 974 |
> |
error ';' ; |
| 975 |
|
|
| 976 |
|
oper_name: NAME '=' QSTRING ';' |
| 977 |
|
{ |
| 991 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 992 |
|
}; |
| 993 |
|
|
| 994 |
+ |
oper_whois: WHOIS '=' QSTRING ';' |
| 995 |
+ |
{ |
| 996 |
+ |
if (conf_parser_ctx.pass == 2) |
| 997 |
+ |
strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf)); |
| 998 |
+ |
}; |
| 999 |
+ |
|
| 1000 |
|
oper_encrypted: ENCRYPTED '=' TBOOL ';' |
| 1001 |
|
{ |
| 1002 |
|
if (conf_parser_ctx.pass != 2) |
| 1008 |
|
block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; |
| 1009 |
|
}; |
| 1010 |
|
|
| 1123 |
– |
oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' |
| 1124 |
– |
{ |
| 1125 |
– |
if (conf_parser_ctx.pass == 2) |
| 1126 |
– |
strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); |
| 1127 |
– |
}; |
| 1128 |
– |
|
| 1011 |
|
oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';' |
| 1012 |
|
{ |
| 1013 |
|
if (conf_parser_ctx.pass == 2) |
| 1062 |
|
{ |
| 1063 |
|
if (conf_parser_ctx.pass == 2) |
| 1064 |
|
block_state.modes.value |= UMODE_HIDDEN; |
| 1065 |
+ |
} | HIDE_CHANS |
| 1066 |
+ |
{ |
| 1067 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1068 |
+ |
block_state.modes.value |= UMODE_HIDECHANS; |
| 1069 |
+ |
} | HIDE_IDLE |
| 1070 |
+ |
{ |
| 1071 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1072 |
+ |
block_state.modes.value |= UMODE_HIDEIDLE; |
| 1073 |
|
} | T_SKILL |
| 1074 |
|
{ |
| 1075 |
|
if (conf_parser_ctx.pass == 2) |
| 1094 |
|
{ |
| 1095 |
|
if (conf_parser_ctx.pass == 2) |
| 1096 |
|
block_state.modes.value |= UMODE_EXTERNAL; |
| 1207 |
– |
} | T_OPERWALL |
| 1208 |
– |
{ |
| 1209 |
– |
if (conf_parser_ctx.pass == 2) |
| 1210 |
– |
block_state.modes.value |= UMODE_OPERWALL; |
| 1097 |
|
} | T_SERVNOTICE |
| 1098 |
|
{ |
| 1099 |
|
if (conf_parser_ctx.pass == 2) |
| 1126 |
|
{ |
| 1127 |
|
if (conf_parser_ctx.pass == 2) |
| 1128 |
|
block_state.modes.value |= UMODE_FARCONNECT; |
| 1129 |
+ |
} | EXPIRATION |
| 1130 |
+ |
{ |
| 1131 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1132 |
+ |
block_state.modes.value |= UMODE_EXPIRATION; |
| 1133 |
|
}; |
| 1134 |
|
|
| 1135 |
|
oper_flags: IRCD_FLAGS |
| 1166 |
|
} | KLINE |
| 1167 |
|
{ |
| 1168 |
|
if (conf_parser_ctx.pass == 2) |
| 1169 |
< |
block_state.port.value |= OPER_FLAG_K; |
| 1169 |
> |
block_state.port.value |= OPER_FLAG_KLINE; |
| 1170 |
|
} | UNKLINE |
| 1171 |
|
{ |
| 1172 |
|
if (conf_parser_ctx.pass == 2) |
| 1182 |
|
} | XLINE |
| 1183 |
|
{ |
| 1184 |
|
if (conf_parser_ctx.pass == 2) |
| 1185 |
< |
block_state.port.value |= OPER_FLAG_X; |
| 1186 |
< |
} | GLINE |
| 1185 |
> |
block_state.port.value |= OPER_FLAG_XLINE; |
| 1186 |
> |
} | T_UNXLINE |
| 1187 |
|
{ |
| 1188 |
|
if (conf_parser_ctx.pass == 2) |
| 1189 |
< |
block_state.port.value |= OPER_FLAG_GLINE; |
| 1189 |
> |
block_state.port.value |= OPER_FLAG_UNXLINE; |
| 1190 |
|
} | DIE |
| 1191 |
|
{ |
| 1192 |
|
if (conf_parser_ctx.pass == 2) |
| 1195 |
|
{ |
| 1196 |
|
if (conf_parser_ctx.pass == 2) |
| 1197 |
|
block_state.port.value |= OPER_FLAG_RESTART; |
| 1198 |
+ |
} | REHASH ':' REMOTE |
| 1199 |
+ |
{ |
| 1200 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1201 |
+ |
block_state.port.value |= OPER_FLAG_REHASH_REMOTE; |
| 1202 |
|
} | REHASH |
| 1203 |
|
{ |
| 1204 |
|
if (conf_parser_ctx.pass == 2) |
| 1207 |
|
{ |
| 1208 |
|
if (conf_parser_ctx.pass == 2) |
| 1209 |
|
block_state.port.value |= OPER_FLAG_ADMIN; |
| 1316 |
– |
} | T_OPERWALL |
| 1317 |
– |
{ |
| 1318 |
– |
if (conf_parser_ctx.pass == 2) |
| 1319 |
– |
block_state.port.value |= OPER_FLAG_OPERWALL; |
| 1210 |
|
} | T_GLOBOPS |
| 1211 |
|
{ |
| 1212 |
|
if (conf_parser_ctx.pass == 2) |
| 1231 |
|
{ |
| 1232 |
|
if (conf_parser_ctx.pass == 2) |
| 1233 |
|
block_state.port.value |= OPER_FLAG_MODULE; |
| 1234 |
+ |
} | T_OPME |
| 1235 |
+ |
{ |
| 1236 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1237 |
+ |
block_state.port.value |= OPER_FLAG_OPME; |
| 1238 |
+ |
} | NICK ':' RESV |
| 1239 |
+ |
{ |
| 1240 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1241 |
+ |
block_state.port.value |= OPER_FLAG_NICK_RESV; |
| 1242 |
+ |
} | JOIN ':' RESV |
| 1243 |
+ |
{ |
| 1244 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1245 |
+ |
block_state.port.value |= OPER_FLAG_JOIN_RESV; |
| 1246 |
+ |
} | RESV |
| 1247 |
+ |
{ |
| 1248 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1249 |
+ |
block_state.port.value |= OPER_FLAG_RESV; |
| 1250 |
+ |
} | T_UNRESV |
| 1251 |
+ |
{ |
| 1252 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1253 |
+ |
block_state.port.value |= OPER_FLAG_UNRESV; |
| 1254 |
+ |
} | CLOSE |
| 1255 |
+ |
{ |
| 1256 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1257 |
+ |
block_state.port.value |= OPER_FLAG_CLOSE; |
| 1258 |
|
}; |
| 1259 |
|
|
| 1260 |
|
|
| 1261 |
|
/*************************************************************************** |
| 1262 |
< |
* section class |
| 1262 |
> |
* class {} section |
| 1263 |
|
***************************************************************************/ |
| 1264 |
|
class_entry: CLASS |
| 1265 |
|
{ |
| 1275 |
|
block_state.max_recvq.value = DEFAULT_RECVQ; |
| 1276 |
|
} '{' class_items '}' ';' |
| 1277 |
|
{ |
| 1364 |
– |
struct ClassItem *class = NULL; |
| 1365 |
– |
|
| 1278 |
|
if (conf_parser_ctx.pass != 1) |
| 1279 |
|
break; |
| 1280 |
|
|
| 1281 |
|
if (!block_state.class.buf[0]) |
| 1282 |
|
break; |
| 1283 |
|
|
| 1284 |
< |
if (!(class = class_find(block_state.class.buf, 0))) |
| 1284 |
> |
struct ClassItem *class = class_find(block_state.class.buf, false); |
| 1285 |
> |
if (class == NULL) |
| 1286 |
|
class = class_make(); |
| 1287 |
|
|
| 1288 |
< |
class->active = 1; |
| 1289 |
< |
MyFree(class->name); |
| 1288 |
> |
class->active = true; |
| 1289 |
> |
xfree(class->name); |
| 1290 |
|
class->name = xstrdup(block_state.class.buf); |
| 1291 |
|
class->ping_freq = block_state.ping_freq.value; |
| 1292 |
< |
class->max_perip = block_state.max_perip.value; |
| 1292 |
> |
class->max_perip_local = block_state.max_perip_local.value; |
| 1293 |
> |
class->max_perip_global = block_state.max_perip_global.value; |
| 1294 |
|
class->con_freq = block_state.con_freq.value; |
| 1295 |
|
class->max_total = block_state.max_total.value; |
| 1382 |
– |
class->max_global = block_state.max_global.value; |
| 1383 |
– |
class->max_local = block_state.max_local.value; |
| 1384 |
– |
class->max_ident = block_state.max_ident.value; |
| 1296 |
|
class->max_sendq = block_state.max_sendq.value; |
| 1297 |
|
class->max_recvq = block_state.max_recvq.value; |
| 1298 |
+ |
class->max_channels = block_state.max_channels.value; |
| 1299 |
|
|
| 1300 |
|
if (block_state.min_idle.value > block_state.max_idle.value) |
| 1301 |
|
{ |
| 1308 |
|
class->min_idle = block_state.min_idle.value; |
| 1309 |
|
class->max_idle = block_state.max_idle.value; |
| 1310 |
|
|
| 1311 |
< |
if (class->number_per_cidr && block_state.number_per_cidr.value) |
| 1312 |
< |
if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) || |
| 1401 |
< |
(class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value)) |
| 1402 |
< |
if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) || |
| 1403 |
< |
(class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value)) |
| 1404 |
< |
rebuild_cidr_list(class); |
| 1405 |
< |
|
| 1311 |
> |
bool diff = (class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value || |
| 1312 |
> |
class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value); |
| 1313 |
|
class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value; |
| 1314 |
|
class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value; |
| 1315 |
|
class->number_per_cidr = block_state.number_per_cidr.value; |
| 1316 |
+ |
|
| 1317 |
+ |
if (diff) |
| 1318 |
+ |
class_ip_limit_rebuild(class); |
| 1319 |
|
}; |
| 1320 |
|
|
| 1321 |
|
class_items: class_items class_item | class_item; |
| 1322 |
|
class_item: class_name | |
| 1323 |
< |
class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 | |
| 1323 |
> |
class_cidr_bitlen_ipv4 | |
| 1324 |
> |
class_cidr_bitlen_ipv6 | |
| 1325 |
|
class_ping_time | |
| 1326 |
< |
class_number_per_cidr | |
| 1327 |
< |
class_number_per_ip | |
| 1326 |
> |
class_number_per_cidr | |
| 1327 |
> |
class_number_per_ip_local | |
| 1328 |
> |
class_number_per_ip_global | |
| 1329 |
|
class_connectfreq | |
| 1330 |
+ |
class_max_channels | |
| 1331 |
|
class_max_number | |
| 1332 |
< |
class_max_global | |
| 1333 |
< |
class_max_local | |
| 1421 |
< |
class_max_ident | |
| 1422 |
< |
class_sendq | class_recvq | |
| 1332 |
> |
class_sendq | |
| 1333 |
> |
class_recvq | |
| 1334 |
|
class_min_idle | |
| 1335 |
|
class_max_idle | |
| 1336 |
|
class_flags | |
| 1337 |
< |
error ';' ; |
| 1337 |
> |
error ';' ; |
| 1338 |
|
|
| 1339 |
< |
class_name: NAME '=' QSTRING ';' |
| 1339 |
> |
class_name: NAME '=' QSTRING ';' |
| 1340 |
|
{ |
| 1341 |
|
if (conf_parser_ctx.pass == 1) |
| 1342 |
|
strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); |
| 1348 |
|
block_state.ping_freq.value = $3; |
| 1349 |
|
}; |
| 1350 |
|
|
| 1351 |
< |
class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';' |
| 1351 |
> |
class_number_per_ip_local: NUMBER_PER_IP_LOCAL '=' NUMBER ';' |
| 1352 |
|
{ |
| 1353 |
|
if (conf_parser_ctx.pass == 1) |
| 1354 |
< |
block_state.max_perip.value = $3; |
| 1354 |
> |
block_state.max_perip_local.value = $3; |
| 1355 |
|
}; |
| 1356 |
|
|
| 1357 |
< |
class_connectfreq: CONNECTFREQ '=' timespec ';' |
| 1357 |
> |
class_number_per_ip_global: NUMBER_PER_IP_GLOBAL '=' NUMBER ';' |
| 1358 |
|
{ |
| 1359 |
|
if (conf_parser_ctx.pass == 1) |
| 1360 |
< |
block_state.con_freq.value = $3; |
| 1360 |
> |
block_state.max_perip_global.value = $3; |
| 1361 |
|
}; |
| 1362 |
|
|
| 1363 |
< |
class_max_number: MAX_NUMBER '=' NUMBER ';' |
| 1453 |
< |
{ |
| 1454 |
< |
if (conf_parser_ctx.pass == 1) |
| 1455 |
< |
block_state.max_total.value = $3; |
| 1456 |
< |
}; |
| 1457 |
< |
|
| 1458 |
< |
class_max_global: MAX_GLOBAL '=' NUMBER ';' |
| 1363 |
> |
class_connectfreq: CONNECTFREQ '=' timespec ';' |
| 1364 |
|
{ |
| 1365 |
|
if (conf_parser_ctx.pass == 1) |
| 1366 |
< |
block_state.max_global.value = $3; |
| 1366 |
> |
block_state.con_freq.value = $3; |
| 1367 |
|
}; |
| 1368 |
|
|
| 1369 |
< |
class_max_local: MAX_LOCAL '=' NUMBER ';' |
| 1369 |
> |
class_max_channels: MAX_CHANNELS '=' NUMBER ';' |
| 1370 |
|
{ |
| 1371 |
|
if (conf_parser_ctx.pass == 1) |
| 1372 |
< |
block_state.max_local.value = $3; |
| 1372 |
> |
block_state.max_channels.value = $3; |
| 1373 |
|
}; |
| 1374 |
|
|
| 1375 |
< |
class_max_ident: MAX_IDENT '=' NUMBER ';' |
| 1375 |
> |
class_max_number: MAX_NUMBER '=' NUMBER ';' |
| 1376 |
|
{ |
| 1377 |
|
if (conf_parser_ctx.pass == 1) |
| 1378 |
< |
block_state.max_ident.value = $3; |
| 1378 |
> |
block_state.max_total.value = $3; |
| 1379 |
|
}; |
| 1380 |
|
|
| 1381 |
|
class_sendq: SENDQ '=' sizespec ';' |
| 1446 |
|
|
| 1447 |
|
|
| 1448 |
|
/*************************************************************************** |
| 1449 |
< |
* section listen |
| 1449 |
> |
* listen {} section |
| 1450 |
|
***************************************************************************/ |
| 1451 |
|
listen_entry: LISTEN |
| 1452 |
|
{ |
| 1485 |
|
{ |
| 1486 |
|
if (conf_parser_ctx.pass == 2) |
| 1487 |
|
{ |
| 1488 |
+ |
#ifndef HAVE_TLS |
| 1489 |
|
if (block_state.flags.value & LISTENER_SSL) |
| 1490 |
< |
#ifdef HAVE_LIBCRYPTO |
| 1491 |
< |
if (!ServerInfo.server_ctx) |
| 1490 |
> |
{ |
| 1491 |
> |
conf_error_report("TLS not available - port closed"); |
| 1492 |
> |
break; |
| 1493 |
> |
} |
| 1494 |
|
#endif |
| 1495 |
< |
{ |
| 1588 |
< |
conf_error_report("SSL not available - port closed"); |
| 1589 |
< |
break; |
| 1590 |
< |
} |
| 1591 |
< |
add_listener($1, block_state.addr.buf, block_state.flags.value); |
| 1495 |
> |
listener_add($1, block_state.addr.buf, block_state.flags.value); |
| 1496 |
|
} |
| 1497 |
|
} | NUMBER TWODOTS NUMBER |
| 1498 |
|
{ |
| 1499 |
|
if (conf_parser_ctx.pass == 2) |
| 1500 |
|
{ |
| 1501 |
< |
int i; |
| 1598 |
< |
|
| 1501 |
> |
#ifndef HAVE_TLS |
| 1502 |
|
if (block_state.flags.value & LISTENER_SSL) |
| 1503 |
< |
#ifdef HAVE_LIBCRYPTO |
| 1504 |
< |
if (!ServerInfo.server_ctx) |
| 1503 |
> |
{ |
| 1504 |
> |
conf_error_report("TLS not available - port closed"); |
| 1505 |
> |
break; |
| 1506 |
> |
} |
| 1507 |
|
#endif |
| 1603 |
– |
{ |
| 1604 |
– |
conf_error_report("SSL not available - port closed"); |
| 1605 |
– |
break; |
| 1606 |
– |
} |
| 1508 |
|
|
| 1509 |
< |
for (i = $1; i <= $3; ++i) |
| 1510 |
< |
add_listener(i, block_state.addr.buf, block_state.flags.value); |
| 1509 |
> |
for (int i = $1; i <= $3; ++i) |
| 1510 |
> |
listener_add(i, block_state.addr.buf, block_state.flags.value); |
| 1511 |
|
} |
| 1512 |
|
}; |
| 1513 |
|
|
| 1523 |
|
strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); |
| 1524 |
|
}; |
| 1525 |
|
|
| 1526 |
+ |
|
| 1527 |
|
/*************************************************************************** |
| 1528 |
< |
* section auth |
| 1528 |
> |
* auth {} section |
| 1529 |
|
***************************************************************************/ |
| 1530 |
|
auth_entry: IRCD_AUTH |
| 1531 |
|
{ |
| 1533 |
|
reset_block_state(); |
| 1534 |
|
} '{' auth_items '}' ';' |
| 1535 |
|
{ |
| 1536 |
< |
dlink_node *ptr = NULL; |
| 1536 |
> |
dlink_node *node = NULL; |
| 1537 |
|
|
| 1538 |
|
if (conf_parser_ctx.pass != 2) |
| 1539 |
|
break; |
| 1540 |
|
|
| 1541 |
< |
DLINK_FOREACH(ptr, block_state.mask.list.head) |
| 1541 |
> |
DLINK_FOREACH(node, block_state.mask.list.head) |
| 1542 |
|
{ |
| 1641 |
– |
struct MaskItem *conf = NULL; |
| 1543 |
|
struct split_nuh_item nuh; |
| 1544 |
+ |
char *s = node->data; |
| 1545 |
+ |
|
| 1546 |
+ |
if (EmptyString(s)) |
| 1547 |
+ |
continue; |
| 1548 |
|
|
| 1549 |
< |
nuh.nuhmask = ptr->data; |
| 1549 |
> |
nuh.nuhmask = s; |
| 1550 |
|
nuh.nickptr = NULL; |
| 1551 |
|
nuh.userptr = block_state.user.buf; |
| 1552 |
|
nuh.hostptr = block_state.host.buf; |
| 1553 |
+ |
|
| 1554 |
|
nuh.nicksize = 0; |
| 1555 |
|
nuh.usersize = sizeof(block_state.user.buf); |
| 1556 |
|
nuh.hostsize = sizeof(block_state.host.buf); |
| 1557 |
+ |
|
| 1558 |
|
split_nuh(&nuh); |
| 1559 |
|
|
| 1560 |
< |
conf = conf_make(CONF_CLIENT); |
| 1561 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 1562 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 1560 |
> |
struct MaskItem *conf = conf_make(CONF_CLIENT); |
| 1561 |
> |
conf->user = xstrdup(block_state.user.buf); |
| 1562 |
> |
conf->host = xstrdup(block_state.host.buf); |
| 1563 |
|
|
| 1564 |
|
if (block_state.rpass.buf[0]) |
| 1565 |
|
conf->passwd = xstrdup(block_state.rpass.buf); |
| 1572 |
|
conf_add_class_to_conf(conf, block_state.class.buf); |
| 1573 |
|
add_conf_by_address(CONF_CLIENT, conf); |
| 1574 |
|
} |
| 1575 |
< |
}; |
| 1575 |
> |
}; |
| 1576 |
|
|
| 1577 |
|
auth_items: auth_items auth_item | auth_item; |
| 1578 |
< |
auth_item: auth_user | auth_passwd | auth_class | auth_flags | |
| 1579 |
< |
auth_spoof | auth_redir_serv | auth_redir_port | |
| 1580 |
< |
auth_encrypted | error ';' ; |
| 1578 |
> |
auth_item: auth_user | |
| 1579 |
> |
auth_passwd | |
| 1580 |
> |
auth_class | |
| 1581 |
> |
auth_flags | |
| 1582 |
> |
auth_spoof | |
| 1583 |
> |
auth_redir_serv | |
| 1584 |
> |
auth_redir_port | |
| 1585 |
> |
auth_encrypted | |
| 1586 |
> |
error ';' ; |
| 1587 |
|
|
| 1588 |
|
auth_user: USER '=' QSTRING ';' |
| 1589 |
|
{ |
| 1618 |
|
{ |
| 1619 |
|
if (conf_parser_ctx.pass == 2) |
| 1620 |
|
block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP); |
| 1621 |
< |
} '=' auth_flags_items ';'; |
| 1621 |
> |
} '=' auth_flags_items ';'; |
| 1622 |
|
|
| 1623 |
|
auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item; |
| 1624 |
|
auth_flags_item: SPOOF_NOTICE |
| 1633 |
|
{ |
| 1634 |
|
if (conf_parser_ctx.pass == 2) |
| 1635 |
|
block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE; |
| 1636 |
+ |
} | XLINE_EXEMPT |
| 1637 |
+ |
{ |
| 1638 |
+ |
if (conf_parser_ctx.pass == 2) |
| 1639 |
+ |
block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE; |
| 1640 |
|
} | NEED_IDENT |
| 1641 |
|
{ |
| 1642 |
|
if (conf_parser_ctx.pass == 2) |
| 1649 |
|
{ |
| 1650 |
|
if (conf_parser_ctx.pass == 2) |
| 1651 |
|
block_state.flags.value |= CONF_FLAGS_NO_TILDE; |
| 1735 |
– |
} | GLINE_EXEMPT |
| 1736 |
– |
{ |
| 1737 |
– |
if (conf_parser_ctx.pass == 2) |
| 1738 |
– |
block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE; |
| 1652 |
|
} | RESV_EXEMPT |
| 1653 |
|
{ |
| 1654 |
|
if (conf_parser_ctx.pass == 2) |
| 1663 |
|
block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD; |
| 1664 |
|
}; |
| 1665 |
|
|
| 1666 |
< |
auth_spoof: SPOOF '=' QSTRING ';' |
| 1666 |
> |
auth_spoof: SPOOF '=' QSTRING ';' |
| 1667 |
|
{ |
| 1668 |
|
if (conf_parser_ctx.pass != 2) |
| 1669 |
|
break; |
| 1670 |
|
|
| 1671 |
< |
if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string)) |
| 1671 |
> |
if (valid_hostname(yylval.string)) |
| 1672 |
|
{ |
| 1673 |
|
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 1674 |
|
block_state.flags.value |= CONF_FLAGS_SPOOF_IP; |
| 1697 |
|
|
| 1698 |
|
|
| 1699 |
|
/*************************************************************************** |
| 1700 |
< |
* section resv |
| 1700 |
> |
* resv {} section |
| 1701 |
|
***************************************************************************/ |
| 1702 |
|
resv_entry: RESV |
| 1703 |
|
{ |
| 1711 |
|
if (conf_parser_ctx.pass != 2) |
| 1712 |
|
break; |
| 1713 |
|
|
| 1714 |
< |
create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); |
| 1714 |
> |
resv_make(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); |
| 1715 |
|
}; |
| 1716 |
|
|
| 1717 |
< |
resv_items: resv_items resv_item | resv_item; |
| 1718 |
< |
resv_item: resv_mask | resv_reason | resv_exempt | error ';' ; |
| 1717 |
> |
resv_items: resv_items resv_item | resv_item; |
| 1718 |
> |
resv_item: resv_mask | resv_reason | resv_exempt | error ';' ; |
| 1719 |
|
|
| 1720 |
|
resv_mask: MASK '=' QSTRING ';' |
| 1721 |
|
{ |
| 1737 |
|
|
| 1738 |
|
|
| 1739 |
|
/*************************************************************************** |
| 1740 |
< |
* section service |
| 1740 |
> |
* service {} section |
| 1741 |
|
***************************************************************************/ |
| 1742 |
|
service_entry: T_SERVICE '{' service_items '}' ';'; |
| 1743 |
|
|
| 1749 |
|
if (conf_parser_ctx.pass != 2) |
| 1750 |
|
break; |
| 1751 |
|
|
| 1752 |
< |
if (valid_servname(yylval.string)) |
| 1752 |
> |
if (server_valid_name(yylval.string) == true) |
| 1753 |
|
{ |
| 1754 |
< |
struct MaskItem *conf = conf_make(CONF_SERVICE); |
| 1755 |
< |
conf->name = xstrdup(yylval.string); |
| 1754 |
> |
struct ServiceItem *service = service_make(); |
| 1755 |
> |
service->name = xstrdup(yylval.string); |
| 1756 |
|
} |
| 1757 |
|
}; |
| 1758 |
|
|
| 1759 |
+ |
|
| 1760 |
|
/*************************************************************************** |
| 1761 |
< |
* section shared, for sharing remote klines etc. |
| 1761 |
> |
* shared {} section, for sharing remote klines etc. |
| 1762 |
|
***************************************************************************/ |
| 1763 |
|
shared_entry: T_SHARED |
| 1764 |
|
{ |
| 1773 |
|
block_state.flags.value = SHARED_ALL; |
| 1774 |
|
} '{' shared_items '}' ';' |
| 1775 |
|
{ |
| 1862 |
– |
struct MaskItem *conf = NULL; |
| 1863 |
– |
|
| 1776 |
|
if (conf_parser_ctx.pass != 2) |
| 1777 |
|
break; |
| 1778 |
|
|
| 1779 |
< |
conf = conf_make(CONF_ULINE); |
| 1780 |
< |
conf->flags = block_state.flags.value; |
| 1781 |
< |
conf->name = xstrdup(block_state.name.buf); |
| 1782 |
< |
conf->user = xstrdup(block_state.user.buf); |
| 1783 |
< |
conf->host = xstrdup(block_state.host.buf); |
| 1779 |
> |
struct SharedItem *shared = shared_make(); |
| 1780 |
> |
shared->type = block_state.flags.value; |
| 1781 |
> |
shared->server = xstrdup(block_state.name.buf); |
| 1782 |
> |
shared->user = xstrdup(block_state.user.buf); |
| 1783 |
> |
shared->host = xstrdup(block_state.host.buf); |
| 1784 |
|
}; |
| 1785 |
|
|
| 1786 |
|
shared_items: shared_items shared_item | shared_item; |
| 1860 |
|
block_state.flags.value = SHARED_ALL; |
| 1861 |
|
}; |
| 1862 |
|
|
| 1863 |
+ |
|
| 1864 |
|
/*************************************************************************** |
| 1865 |
< |
* section cluster |
| 1865 |
> |
* cluster {} section |
| 1866 |
|
***************************************************************************/ |
| 1867 |
|
cluster_entry: T_CLUSTER |
| 1868 |
|
{ |
| 1872 |
|
reset_block_state(); |
| 1873 |
|
|
| 1874 |
|
strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf)); |
| 1875 |
< |
block_state.flags.value = SHARED_ALL; |
| 1875 |
> |
block_state.flags.value = CLUSTER_ALL; |
| 1876 |
|
} '{' cluster_items '}' ';' |
| 1877 |
|
{ |
| 1965 |
– |
struct MaskItem *conf = NULL; |
| 1966 |
– |
|
| 1878 |
|
if (conf_parser_ctx.pass != 2) |
| 1879 |
|
break; |
| 1880 |
|
|
| 1881 |
< |
conf = conf_make(CONF_CLUSTER); |
| 1882 |
< |
conf->flags = block_state.flags.value; |
| 1883 |
< |
conf->name = xstrdup(block_state.name.buf); |
| 1881 |
> |
struct ClusterItem *cluster = cluster_make(); |
| 1882 |
> |
cluster->type = block_state.flags.value; |
| 1883 |
> |
cluster->server = xstrdup(block_state.name.buf); |
| 1884 |
|
}; |
| 1885 |
|
|
| 1886 |
< |
cluster_items: cluster_items cluster_item | cluster_item; |
| 1887 |
< |
cluster_item: cluster_name | cluster_type | error ';' ; |
| 1886 |
> |
cluster_items: cluster_items cluster_item | cluster_item; |
| 1887 |
> |
cluster_item: cluster_name | cluster_type | error ';' ; |
| 1888 |
|
|
| 1889 |
|
cluster_name: NAME '=' QSTRING ';' |
| 1890 |
|
{ |
| 1898 |
|
block_state.flags.value = 0; |
| 1899 |
|
} '=' cluster_types ';' ; |
| 1900 |
|
|
| 1901 |
< |
cluster_types: cluster_types ',' cluster_type_item | cluster_type_item; |
| 1901 |
> |
cluster_types: cluster_types ',' cluster_type_item | cluster_type_item; |
| 1902 |
|
cluster_type_item: KLINE |
| 1903 |
|
{ |
| 1904 |
|
if (conf_parser_ctx.pass == 2) |
| 1905 |
< |
block_state.flags.value |= SHARED_KLINE; |
| 1905 |
> |
block_state.flags.value |= CLUSTER_KLINE; |
| 1906 |
|
} | UNKLINE |
| 1907 |
|
{ |
| 1908 |
|
if (conf_parser_ctx.pass == 2) |
| 1909 |
< |
block_state.flags.value |= SHARED_UNKLINE; |
| 1909 |
> |
block_state.flags.value |= CLUSTER_UNKLINE; |
| 1910 |
|
} | T_DLINE |
| 1911 |
|
{ |
| 1912 |
|
if (conf_parser_ctx.pass == 2) |
| 1913 |
< |
block_state.flags.value |= SHARED_DLINE; |
| 1913 |
> |
block_state.flags.value |= CLUSTER_DLINE; |
| 1914 |
|
} | T_UNDLINE |
| 1915 |
|
{ |
| 1916 |
|
if (conf_parser_ctx.pass == 2) |
| 1917 |
< |
block_state.flags.value |= SHARED_UNDLINE; |
| 1917 |
> |
block_state.flags.value |= CLUSTER_UNDLINE; |
| 1918 |
|
} | XLINE |
| 1919 |
|
{ |
| 1920 |
|
if (conf_parser_ctx.pass == 2) |
| 1921 |
< |
block_state.flags.value |= SHARED_XLINE; |
| 1921 |
> |
block_state.flags.value |= CLUSTER_XLINE; |
| 1922 |
|
} | T_UNXLINE |
| 1923 |
|
{ |
| 1924 |
|
if (conf_parser_ctx.pass == 2) |
| 1925 |
< |
block_state.flags.value |= SHARED_UNXLINE; |
| 1925 |
> |
block_state.flags.value |= CLUSTER_UNXLINE; |
| 1926 |
|
} | RESV |
| 1927 |
|
{ |
| 1928 |
|
if (conf_parser_ctx.pass == 2) |
| 1929 |
< |
block_state.flags.value |= SHARED_RESV; |
| 1929 |
> |
block_state.flags.value |= CLUSTER_RESV; |
| 1930 |
|
} | T_UNRESV |
| 1931 |
|
{ |
| 1932 |
|
if (conf_parser_ctx.pass == 2) |
| 1933 |
< |
block_state.flags.value |= SHARED_UNRESV; |
| 1933 |
> |
block_state.flags.value |= CLUSTER_UNRESV; |
| 1934 |
|
} | T_LOCOPS |
| 1935 |
|
{ |
| 1936 |
|
if (conf_parser_ctx.pass == 2) |
| 1937 |
< |
block_state.flags.value |= SHARED_LOCOPS; |
| 1937 |
> |
block_state.flags.value |= CLUSTER_LOCOPS; |
| 1938 |
|
} | T_ALL |
| 1939 |
|
{ |
| 1940 |
|
if (conf_parser_ctx.pass == 2) |
| 1941 |
< |
block_state.flags.value = SHARED_ALL; |
| 1941 |
> |
block_state.flags.value = CLUSTER_ALL; |
| 1942 |
|
}; |
| 1943 |
|
|
| 1944 |
+ |
|
| 1945 |
|
/*************************************************************************** |
| 1946 |
< |
* section connect |
| 1946 |
> |
* connect {} section |
| 1947 |
|
***************************************************************************/ |
| 1948 |
< |
connect_entry: CONNECT |
| 1948 |
> |
connect_entry: CONNECT |
| 1949 |
|
{ |
| 1950 |
|
|
| 1951 |
|
if (conf_parser_ctx.pass != 2) |
| 1952 |
|
break; |
| 1953 |
|
|
| 1954 |
|
reset_block_state(); |
| 1955 |
+ |
block_state.aftype.value = AF_INET; |
| 1956 |
|
block_state.port.value = PORTNUM; |
| 1957 |
+ |
block_state.timeout.value = CONNECTTIMEOUT; |
| 1958 |
|
} '{' connect_items '}' ';' |
| 1959 |
|
{ |
| 2046 |
– |
struct MaskItem *conf = NULL; |
| 1960 |
|
struct addrinfo hints, *res; |
| 1961 |
|
|
| 1962 |
|
if (conf_parser_ctx.pass != 2) |
| 1970 |
|
!block_state.spass.buf[0]) |
| 1971 |
|
break; |
| 1972 |
|
|
| 1973 |
+ |
if (server_valid_name(block_state.name.buf) == false) |
| 1974 |
+ |
break; |
| 1975 |
+ |
|
| 1976 |
|
if (has_wildcards(block_state.name.buf) || |
| 1977 |
|
has_wildcards(block_state.host.buf)) |
| 1978 |
|
break; |
| 1979 |
|
|
| 1980 |
< |
conf = conf_make(CONF_SERVER); |
| 1980 |
> |
struct MaskItem *conf = conf_make(CONF_SERVER); |
| 1981 |
> |
conf->addr = xcalloc(sizeof(*conf->addr)); |
| 1982 |
|
conf->port = block_state.port.value; |
| 1983 |
+ |
conf->timeout = block_state.timeout.value; |
| 1984 |
|
conf->flags = block_state.flags.value; |
| 1985 |
|
conf->aftype = block_state.aftype.value; |
| 1986 |
|
conf->host = xstrdup(block_state.host.buf); |
| 2006 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
| 2007 |
|
|
| 2008 |
|
if (getaddrinfo(block_state.bind.buf, NULL, &hints, &res)) |
| 2009 |
< |
ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf); |
| 2009 |
> |
ilog(LOG_TYPE_IRCD, "Invalid netmask for server bind(%s)", block_state.bind.buf); |
| 2010 |
|
else |
| 2011 |
|
{ |
| 2012 |
< |
assert(res != NULL); |
| 2012 |
> |
assert(res); |
| 2013 |
> |
|
| 2014 |
> |
conf->bind = xcalloc(sizeof(*conf->bind)); |
| 2015 |
|
|
| 2016 |
< |
memcpy(&conf->bind, res->ai_addr, res->ai_addrlen); |
| 2017 |
< |
conf->bind.ss.ss_family = res->ai_family; |
| 2098 |
< |
conf->bind.ss_len = res->ai_addrlen; |
| 2016 |
> |
memcpy(conf->bind, res->ai_addr, res->ai_addrlen); |
| 2017 |
> |
conf->bind->ss_len = res->ai_addrlen; |
| 2018 |
|
freeaddrinfo(res); |
| 2019 |
|
} |
| 2020 |
|
} |
| 2021 |
|
|
| 2022 |
|
conf_add_class_to_conf(conf, block_state.class.buf); |
| 2023 |
< |
lookup_confhost(conf); |
| 2023 |
> |
conf_dns_lookup(conf); |
| 2024 |
|
}; |
| 2025 |
|
|
| 2026 |
|
connect_items: connect_items connect_item | connect_item; |
| 2027 |
< |
connect_item: connect_name | connect_host | connect_vhost | |
| 2028 |
< |
connect_send_password | connect_accept_password | |
| 2029 |
< |
connect_ssl_certificate_fingerprint | |
| 2030 |
< |
connect_aftype | connect_port | connect_ssl_cipher_list | |
| 2031 |
< |
connect_flags | connect_hub_mask | connect_leaf_mask | |
| 2032 |
< |
connect_class | connect_encrypted | |
| 2027 |
> |
connect_item: connect_name | |
| 2028 |
> |
connect_host | |
| 2029 |
> |
connect_timeout | |
| 2030 |
> |
connect_bind | |
| 2031 |
> |
connect_send_password | |
| 2032 |
> |
connect_accept_password | |
| 2033 |
> |
connect_ssl_certificate_fingerprint | |
| 2034 |
> |
connect_aftype | |
| 2035 |
> |
connect_port | |
| 2036 |
> |
connect_ssl_cipher_list | |
| 2037 |
> |
connect_flags | |
| 2038 |
> |
connect_hub_mask | |
| 2039 |
> |
connect_leaf_mask | |
| 2040 |
> |
connect_class | |
| 2041 |
> |
connect_encrypted | |
| 2042 |
|
error ';' ; |
| 2043 |
|
|
| 2044 |
|
connect_name: NAME '=' QSTRING ';' |
| 2047 |
|
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 2048 |
|
}; |
| 2049 |
|
|
| 2050 |
< |
connect_host: HOST '=' QSTRING ';' |
| 2050 |
> |
connect_host: HOST '=' QSTRING ';' |
| 2051 |
|
{ |
| 2052 |
|
if (conf_parser_ctx.pass == 2) |
| 2053 |
|
strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf)); |
| 2054 |
|
}; |
| 2055 |
|
|
| 2056 |
< |
connect_vhost: VHOST '=' QSTRING ';' |
| 2056 |
> |
connect_timeout: TIMEOUT '=' timespec ';' |
| 2057 |
> |
{ |
| 2058 |
> |
if (conf_parser_ctx.pass == 2) |
| 2059 |
> |
block_state.timeout.value = $3; |
| 2060 |
> |
}; |
| 2061 |
> |
|
| 2062 |
> |
connect_bind: T_BIND '=' QSTRING ';' |
| 2063 |
|
{ |
| 2064 |
|
if (conf_parser_ctx.pass == 2) |
| 2065 |
|
strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf)); |
| 2066 |
|
}; |
| 2067 |
< |
|
| 2067 |
> |
|
| 2068 |
|
connect_send_password: SEND_PASSWORD '=' QSTRING ';' |
| 2069 |
|
{ |
| 2070 |
|
if (conf_parser_ctx.pass != 2) |
| 2071 |
|
break; |
| 2072 |
|
|
| 2073 |
< |
if ($3[0] == ':') |
| 2073 |
> |
if (*yylval.string == ':') |
| 2074 |
|
conf_error_report("Server passwords cannot begin with a colon"); |
| 2075 |
< |
else if (strchr($3, ' ') != NULL) |
| 2075 |
> |
else if (strchr(yylval.string, ' ')) |
| 2076 |
|
conf_error_report("Server passwords cannot contain spaces"); |
| 2077 |
|
else |
| 2078 |
|
strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf)); |
| 2083 |
|
if (conf_parser_ctx.pass != 2) |
| 2084 |
|
break; |
| 2085 |
|
|
| 2086 |
< |
if ($3[0] == ':') |
| 2086 |
> |
if (*yylval.string == ':') |
| 2087 |
|
conf_error_report("Server passwords cannot begin with a colon"); |
| 2088 |
< |
else if (strchr($3, ' ') != NULL) |
| 2088 |
> |
else if (strchr(yylval.string, ' ')) |
| 2089 |
|
conf_error_report("Server passwords cannot contain spaces"); |
| 2090 |
|
else |
| 2091 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2109 |
|
block_state.aftype.value = AF_INET; |
| 2110 |
|
} | AFTYPE '=' T_IPV6 ';' |
| 2111 |
|
{ |
| 2178 |
– |
#ifdef IPV6 |
| 2112 |
|
if (conf_parser_ctx.pass == 2) |
| 2113 |
|
block_state.aftype.value = AF_INET6; |
| 2181 |
– |
#endif |
| 2114 |
|
}; |
| 2115 |
|
|
| 2116 |
|
connect_flags: IRCD_FLAGS |
| 2117 |
|
{ |
| 2118 |
|
block_state.flags.value &= CONF_FLAGS_ENCRYPTED; |
| 2119 |
< |
} '=' connect_flags_items ';'; |
| 2119 |
> |
} '=' connect_flags_items ';'; |
| 2120 |
|
|
| 2121 |
|
connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item; |
| 2122 |
|
connect_flags_item: AUTOCONN |
| 2140 |
|
} |
| 2141 |
|
}; |
| 2142 |
|
|
| 2143 |
< |
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2143 |
> |
connect_hub_mask: HUB_MASK '=' QSTRING ';' |
| 2144 |
|
{ |
| 2145 |
|
if (conf_parser_ctx.pass == 2) |
| 2146 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list); |
| 2147 |
|
}; |
| 2148 |
|
|
| 2149 |
< |
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2149 |
> |
connect_leaf_mask: LEAF_MASK '=' QSTRING ';' |
| 2150 |
|
{ |
| 2151 |
|
if (conf_parser_ctx.pass == 2) |
| 2152 |
|
dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list); |
| 2160 |
|
|
| 2161 |
|
connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' |
| 2162 |
|
{ |
| 2163 |
< |
#ifdef HAVE_LIBCRYPTO |
| 2163 |
> |
#ifdef HAVE_TLS |
| 2164 |
|
if (conf_parser_ctx.pass == 2) |
| 2165 |
|
strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf)); |
| 2166 |
|
#else |
| 2167 |
|
if (conf_parser_ctx.pass == 2) |
| 2168 |
< |
conf_error_report("Ignoring connect::ciphers -- no OpenSSL support"); |
| 2168 |
> |
conf_error_report("Ignoring connect::ciphers -- no TLS support"); |
| 2169 |
|
#endif |
| 2170 |
|
}; |
| 2171 |
|
|
| 2172 |
|
|
| 2173 |
|
/*************************************************************************** |
| 2174 |
< |
* section kill |
| 2174 |
> |
* kill {} section |
| 2175 |
|
***************************************************************************/ |
| 2176 |
|
kill_entry: KILL |
| 2177 |
|
{ |
| 2179 |
|
reset_block_state(); |
| 2180 |
|
} '{' kill_items '}' ';' |
| 2181 |
|
{ |
| 2250 |
– |
struct MaskItem *conf = NULL; |
| 2251 |
– |
|
| 2182 |
|
if (conf_parser_ctx.pass != 2) |
| 2183 |
|
break; |
| 2184 |
|
|
| 2186 |
|
!block_state.host.buf[0]) |
| 2187 |
|
break; |
| 2188 |
|
|
| 2189 |
< |
conf = conf_make(CONF_KLINE); |
| 2189 |
> |
struct MaskItem *conf = conf_make(CONF_KLINE); |
| 2190 |
|
conf->user = xstrdup(block_state.user.buf); |
| 2191 |
|
conf->host = xstrdup(block_state.host.buf); |
| 2192 |
|
|
| 2195 |
|
else |
| 2196 |
|
conf->reason = xstrdup(CONF_NOREASON); |
| 2197 |
|
add_conf_by_address(CONF_KLINE, conf); |
| 2198 |
< |
}; |
| 2198 |
> |
}; |
| 2199 |
|
|
| 2200 |
|
kill_items: kill_items kill_item | kill_item; |
| 2201 |
|
kill_item: kill_user | kill_reason | error; |
| 2220 |
|
} |
| 2221 |
|
}; |
| 2222 |
|
|
| 2223 |
< |
kill_reason: REASON '=' QSTRING ';' |
| 2223 |
> |
kill_reason: REASON '=' QSTRING ';' |
| 2224 |
|
{ |
| 2225 |
|
if (conf_parser_ctx.pass == 2) |
| 2226 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2227 |
|
}; |
| 2228 |
|
|
| 2229 |
+ |
|
| 2230 |
|
/*************************************************************************** |
| 2231 |
< |
* section deny |
| 2231 |
> |
* deny {} section |
| 2232 |
|
***************************************************************************/ |
| 2233 |
< |
deny_entry: DENY |
| 2233 |
> |
deny_entry: DENY |
| 2234 |
|
{ |
| 2235 |
|
if (conf_parser_ctx.pass == 2) |
| 2236 |
|
reset_block_state(); |
| 2237 |
|
} '{' deny_items '}' ';' |
| 2238 |
|
{ |
| 2308 |
– |
struct MaskItem *conf = NULL; |
| 2309 |
– |
|
| 2239 |
|
if (conf_parser_ctx.pass != 2) |
| 2240 |
|
break; |
| 2241 |
|
|
| 2244 |
|
|
| 2245 |
|
if (parse_netmask(block_state.addr.buf, NULL, NULL) != HM_HOST) |
| 2246 |
|
{ |
| 2247 |
< |
conf = conf_make(CONF_DLINE); |
| 2247 |
> |
struct MaskItem *conf = conf_make(CONF_DLINE); |
| 2248 |
|
conf->host = xstrdup(block_state.addr.buf); |
| 2249 |
|
|
| 2250 |
|
if (block_state.rpass.buf[0]) |
| 2253 |
|
conf->reason = xstrdup(CONF_NOREASON); |
| 2254 |
|
add_conf_by_address(CONF_DLINE, conf); |
| 2255 |
|
} |
| 2256 |
< |
}; |
| 2256 |
> |
}; |
| 2257 |
|
|
| 2258 |
|
deny_items: deny_items deny_item | deny_item; |
| 2259 |
|
deny_item: deny_ip | deny_reason | error; |
| 2264 |
|
strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); |
| 2265 |
|
}; |
| 2266 |
|
|
| 2267 |
< |
deny_reason: REASON '=' QSTRING ';' |
| 2267 |
> |
deny_reason: REASON '=' QSTRING ';' |
| 2268 |
|
{ |
| 2269 |
|
if (conf_parser_ctx.pass == 2) |
| 2270 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2271 |
|
}; |
| 2272 |
|
|
| 2273 |
+ |
|
| 2274 |
|
/*************************************************************************** |
| 2275 |
< |
* section exempt |
| 2275 |
> |
* exempt {} section |
| 2276 |
|
***************************************************************************/ |
| 2277 |
|
exempt_entry: EXEMPT '{' exempt_items '}' ';'; |
| 2278 |
|
|
| 2279 |
< |
exempt_items: exempt_items exempt_item | exempt_item; |
| 2280 |
< |
exempt_item: exempt_ip | error; |
| 2279 |
> |
exempt_items: exempt_items exempt_item | exempt_item; |
| 2280 |
> |
exempt_item: exempt_ip | error; |
| 2281 |
|
|
| 2282 |
|
exempt_ip: IP '=' QSTRING ';' |
| 2283 |
|
{ |
| 2284 |
|
if (conf_parser_ctx.pass == 2) |
| 2285 |
|
{ |
| 2286 |
< |
if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) |
| 2286 |
> |
if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) |
| 2287 |
|
{ |
| 2288 |
|
struct MaskItem *conf = conf_make(CONF_EXEMPT); |
| 2289 |
|
conf->host = xstrdup(yylval.string); |
| 2294 |
|
}; |
| 2295 |
|
|
| 2296 |
|
/*************************************************************************** |
| 2297 |
< |
* section gecos |
| 2297 |
> |
* gecos {} section |
| 2298 |
|
***************************************************************************/ |
| 2299 |
|
gecos_entry: GECOS |
| 2300 |
|
{ |
| 2302 |
|
reset_block_state(); |
| 2303 |
|
} '{' gecos_items '}' ';' |
| 2304 |
|
{ |
| 2375 |
– |
struct MaskItem *conf = NULL; |
| 2376 |
– |
|
| 2305 |
|
if (conf_parser_ctx.pass != 2) |
| 2306 |
|
break; |
| 2307 |
|
|
| 2308 |
|
if (!block_state.name.buf[0]) |
| 2309 |
|
break; |
| 2310 |
|
|
| 2311 |
< |
conf = conf_make(CONF_XLINE); |
| 2312 |
< |
conf->name = xstrdup(block_state.name.buf); |
| 2311 |
> |
struct GecosItem *gecos = gecos_make(); |
| 2312 |
> |
gecos->mask = xstrdup(block_state.name.buf); |
| 2313 |
|
|
| 2314 |
|
if (block_state.rpass.buf[0]) |
| 2315 |
< |
conf->reason = xstrdup(block_state.rpass.buf); |
| 2315 |
> |
gecos->reason = xstrdup(block_state.rpass.buf); |
| 2316 |
|
else |
| 2317 |
< |
conf->reason = xstrdup(CONF_NOREASON); |
| 2317 |
> |
gecos->reason = xstrdup(CONF_NOREASON); |
| 2318 |
|
}; |
| 2319 |
|
|
| 2320 |
|
gecos_items: gecos_items gecos_item | gecos_item; |
| 2321 |
|
gecos_item: gecos_name | gecos_reason | error; |
| 2322 |
|
|
| 2323 |
< |
gecos_name: NAME '=' QSTRING ';' |
| 2323 |
> |
gecos_name: NAME '=' QSTRING ';' |
| 2324 |
|
{ |
| 2325 |
|
if (conf_parser_ctx.pass == 2) |
| 2326 |
|
strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); |
| 2327 |
|
}; |
| 2328 |
|
|
| 2329 |
< |
gecos_reason: REASON '=' QSTRING ';' |
| 2329 |
> |
gecos_reason: REASON '=' QSTRING ';' |
| 2330 |
|
{ |
| 2331 |
|
if (conf_parser_ctx.pass == 2) |
| 2332 |
|
strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); |
| 2333 |
|
}; |
| 2334 |
|
|
| 2335 |
+ |
|
| 2336 |
|
/*************************************************************************** |
| 2337 |
< |
* section general |
| 2337 |
> |
* general {} section |
| 2338 |
|
***************************************************************************/ |
| 2339 |
< |
general_entry: GENERAL |
| 2411 |
< |
'{' general_items '}' ';'; |
| 2339 |
> |
general_entry: GENERAL '{' general_items '}' ';'; |
| 2340 |
|
|
| 2341 |
|
general_items: general_items general_item | general_item; |
| 2342 |
< |
general_item: general_hide_spoof_ips | general_ignore_bogus_ts | |
| 2343 |
< |
general_failed_oper_notice | general_anti_nick_flood | |
| 2344 |
< |
general_max_nick_time | general_max_nick_changes | |
| 2345 |
< |
general_max_accept | general_anti_spam_exit_message_time | |
| 2346 |
< |
general_ts_warn_delta | general_ts_max_delta | |
| 2342 |
> |
general_item: general_away_count | |
| 2343 |
> |
general_away_time | |
| 2344 |
> |
general_failed_oper_notice | |
| 2345 |
> |
general_anti_nick_flood | |
| 2346 |
> |
general_max_nick_time | |
| 2347 |
> |
general_max_nick_changes | |
| 2348 |
> |
general_max_accept | |
| 2349 |
> |
general_whowas_history_length | |
| 2350 |
> |
general_anti_spam_exit_message_time | |
| 2351 |
> |
general_ts_warn_delta | |
| 2352 |
> |
general_ts_max_delta | |
| 2353 |
|
general_kill_chase_time_limit | |
| 2354 |
|
general_invisible_on_connect | |
| 2355 |
< |
general_warn_no_nline | general_dots_in_ident | |
| 2356 |
< |
general_stats_o_oper_only | general_stats_k_oper_only | |
| 2357 |
< |
general_pace_wait | general_stats_i_oper_only | |
| 2358 |
< |
general_pace_wait_simple | general_stats_P_oper_only | |
| 2359 |
< |
general_short_motd | general_no_oper_flood | |
| 2360 |
< |
general_true_no_oper_flood | general_oper_pass_resv | |
| 2361 |
< |
general_oper_only_umodes | general_max_targets | |
| 2362 |
< |
general_use_egd | general_egdpool_path | |
| 2363 |
< |
general_oper_umodes | general_caller_id_wait | |
| 2364 |
< |
general_opers_bypass_callerid | general_default_floodcount | |
| 2365 |
< |
general_min_nonwildcard | general_min_nonwildcard_simple | |
| 2366 |
< |
general_throttle_time | general_havent_read_conf | |
| 2355 |
> |
general_warn_no_connect_block | |
| 2356 |
> |
general_dots_in_ident | |
| 2357 |
> |
general_stats_i_oper_only | |
| 2358 |
> |
general_stats_k_oper_only | |
| 2359 |
> |
general_stats_m_oper_only | |
| 2360 |
> |
general_stats_o_oper_only | |
| 2361 |
> |
general_stats_P_oper_only | |
| 2362 |
> |
general_stats_u_oper_only | |
| 2363 |
> |
general_pace_wait | |
| 2364 |
> |
general_pace_wait_simple | |
| 2365 |
> |
general_short_motd | |
| 2366 |
> |
general_no_oper_flood | |
| 2367 |
> |
general_oper_only_umodes | |
| 2368 |
> |
general_max_targets | |
| 2369 |
> |
general_oper_umodes | |
| 2370 |
> |
general_caller_id_wait | |
| 2371 |
> |
general_opers_bypass_callerid | |
| 2372 |
> |
general_default_floodcount | |
| 2373 |
> |
general_default_floodtime | |
| 2374 |
> |
general_min_nonwildcard | |
| 2375 |
> |
general_min_nonwildcard_simple | |
| 2376 |
> |
general_throttle_count | |
| 2377 |
> |
general_throttle_time | |
| 2378 |
|
general_ping_cookie | |
| 2379 |
< |
general_disable_auth | |
| 2380 |
< |
general_tkline_expire_notices | general_gline_enable | |
| 2381 |
< |
general_gline_duration | general_gline_request_duration | |
| 2382 |
< |
general_gline_min_cidr | |
| 2383 |
< |
general_gline_min_cidr6 | |
| 2384 |
< |
general_stats_e_disabled | |
| 2385 |
< |
general_max_watch | general_services_name | |
| 2386 |
< |
error; |
| 2379 |
> |
general_disable_auth | |
| 2380 |
> |
general_dline_min_cidr | |
| 2381 |
> |
general_dline_min_cidr6 | |
| 2382 |
> |
general_kline_min_cidr | |
| 2383 |
> |
general_kline_min_cidr6 | |
| 2384 |
> |
general_stats_e_disabled | |
| 2385 |
> |
general_max_watch | |
| 2386 |
> |
general_cycle_on_host_change | |
| 2387 |
> |
error; |
| 2388 |
|
|
| 2389 |
|
|
| 2390 |
< |
general_max_watch: MAX_WATCH '=' NUMBER ';' |
| 2390 |
> |
general_away_count: AWAY_COUNT '=' NUMBER ';' |
| 2391 |
|
{ |
| 2392 |
< |
ConfigFileEntry.max_watch = $3; |
| 2392 |
> |
ConfigGeneral.away_count = $3; |
| 2393 |
|
}; |
| 2394 |
|
|
| 2395 |
< |
general_gline_enable: GLINE_ENABLE '=' TBOOL ';' |
| 2395 |
> |
general_away_time: AWAY_TIME '=' timespec ';' |
| 2396 |
|
{ |
| 2397 |
< |
if (conf_parser_ctx.pass == 2) |
| 2452 |
< |
ConfigFileEntry.glines = yylval.number; |
| 2397 |
> |
ConfigGeneral.away_time = $3; |
| 2398 |
|
}; |
| 2399 |
|
|
| 2400 |
< |
general_gline_duration: GLINE_DURATION '=' timespec ';' |
| 2400 |
> |
general_max_watch: MAX_WATCH '=' NUMBER ';' |
| 2401 |
|
{ |
| 2402 |
< |
if (conf_parser_ctx.pass == 2) |
| 2458 |
< |
ConfigFileEntry.gline_time = $3; |
| 2402 |
> |
ConfigGeneral.max_watch = $3; |
| 2403 |
|
}; |
| 2404 |
|
|
| 2405 |
< |
general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';' |
| 2405 |
> |
general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';' |
| 2406 |
|
{ |
| 2407 |
< |
if (conf_parser_ctx.pass == 2) |
| 2464 |
< |
ConfigFileEntry.gline_request_time = $3; |
| 2407 |
> |
ConfigGeneral.whowas_history_length = $3; |
| 2408 |
|
}; |
| 2409 |
|
|
| 2410 |
< |
general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';' |
| 2410 |
> |
general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';' |
| 2411 |
|
{ |
| 2412 |
< |
ConfigFileEntry.gline_min_cidr = $3; |
| 2412 |
> |
ConfigGeneral.cycle_on_host_change = yylval.number; |
| 2413 |
|
}; |
| 2414 |
|
|
| 2415 |
< |
general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';' |
| 2415 |
> |
general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';' |
| 2416 |
|
{ |
| 2417 |
< |
ConfigFileEntry.gline_min_cidr6 = $3; |
| 2417 |
> |
ConfigGeneral.dline_min_cidr = $3; |
| 2418 |
|
}; |
| 2419 |
|
|
| 2420 |
< |
general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';' |
| 2420 |
> |
general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';' |
| 2421 |
|
{ |
| 2422 |
< |
ConfigFileEntry.tkline_expire_notices = yylval.number; |
| 2422 |
> |
ConfigGeneral.dline_min_cidr6 = $3; |
| 2423 |
|
}; |
| 2424 |
|
|
| 2425 |
< |
general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';' |
| 2425 |
> |
general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';' |
| 2426 |
|
{ |
| 2427 |
< |
ConfigFileEntry.kill_chase_time_limit = $3; |
| 2427 |
> |
ConfigGeneral.kline_min_cidr = $3; |
| 2428 |
|
}; |
| 2429 |
|
|
| 2430 |
< |
general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';' |
| 2430 |
> |
general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';' |
| 2431 |
|
{ |
| 2432 |
< |
ConfigFileEntry.hide_spoof_ips = yylval.number; |
| 2432 |
> |
ConfigGeneral.kline_min_cidr6 = $3; |
| 2433 |
|
}; |
| 2434 |
|
|
| 2435 |
< |
general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';' |
| 2435 |
> |
general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';' |
| 2436 |
|
{ |
| 2437 |
< |
ConfigFileEntry.ignore_bogus_ts = yylval.number; |
| 2437 |
> |
ConfigGeneral.kill_chase_time_limit = $3; |
| 2438 |
|
}; |
| 2439 |
|
|
| 2440 |
|
general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';' |
| 2441 |
|
{ |
| 2442 |
< |
ConfigFileEntry.failed_oper_notice = yylval.number; |
| 2442 |
> |
ConfigGeneral.failed_oper_notice = yylval.number; |
| 2443 |
|
}; |
| 2444 |
|
|
| 2445 |
|
general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';' |
| 2446 |
|
{ |
| 2447 |
< |
ConfigFileEntry.anti_nick_flood = yylval.number; |
| 2447 |
> |
ConfigGeneral.anti_nick_flood = yylval.number; |
| 2448 |
|
}; |
| 2449 |
|
|
| 2450 |
|
general_max_nick_time: MAX_NICK_TIME '=' timespec ';' |
| 2451 |
|
{ |
| 2452 |
< |
ConfigFileEntry.max_nick_time = $3; |
| 2452 |
> |
ConfigGeneral.max_nick_time = $3; |
| 2453 |
|
}; |
| 2454 |
|
|
| 2455 |
|
general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';' |
| 2456 |
|
{ |
| 2457 |
< |
ConfigFileEntry.max_nick_changes = $3; |
| 2457 |
> |
ConfigGeneral.max_nick_changes = $3; |
| 2458 |
|
}; |
| 2459 |
|
|
| 2460 |
|
general_max_accept: MAX_ACCEPT '=' NUMBER ';' |
| 2461 |
|
{ |
| 2462 |
< |
ConfigFileEntry.max_accept = $3; |
| 2462 |
> |
ConfigGeneral.max_accept = $3; |
| 2463 |
|
}; |
| 2464 |
|
|
| 2465 |
|
general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';' |
| 2466 |
|
{ |
| 2467 |
< |
ConfigFileEntry.anti_spam_exit_message_time = $3; |
| 2467 |
> |
ConfigGeneral.anti_spam_exit_message_time = $3; |
| 2468 |
|
}; |
| 2469 |
|
|
| 2470 |
|
general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';' |
| 2471 |
|
{ |
| 2472 |
< |
ConfigFileEntry.ts_warn_delta = $3; |
| 2472 |
> |
ConfigGeneral.ts_warn_delta = $3; |
| 2473 |
|
}; |
| 2474 |
|
|
| 2475 |
|
general_ts_max_delta: TS_MAX_DELTA '=' timespec ';' |
| 2476 |
|
{ |
| 2477 |
< |
if (conf_parser_ctx.pass == 2) |
| 2535 |
< |
ConfigFileEntry.ts_max_delta = $3; |
| 2477 |
> |
ConfigGeneral.ts_max_delta = $3; |
| 2478 |
|
}; |
| 2479 |
|
|
| 2480 |
< |
general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';' |
| 2480 |
> |
general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';' |
| 2481 |
|
{ |
| 2482 |
< |
if (($3 > 0) && conf_parser_ctx.pass == 1) |
| 2541 |
< |
{ |
| 2542 |
< |
ilog(LOG_TYPE_IRCD, "You haven't read your config file properly."); |
| 2543 |
< |
ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed."); |
| 2544 |
< |
ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line."); |
| 2545 |
< |
exit(0); |
| 2546 |
< |
} |
| 2482 |
> |
ConfigGeneral.invisible_on_connect = yylval.number; |
| 2483 |
|
}; |
| 2484 |
|
|
| 2485 |
< |
general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';' |
| 2485 |
> |
general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';' |
| 2486 |
|
{ |
| 2487 |
< |
ConfigFileEntry.invisible_on_connect = yylval.number; |
| 2487 |
> |
ConfigGeneral.warn_no_connect_block = yylval.number; |
| 2488 |
|
}; |
| 2489 |
|
|
| 2490 |
< |
general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';' |
| 2490 |
> |
general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';' |
| 2491 |
|
{ |
| 2492 |
< |
ConfigFileEntry.warn_no_nline = yylval.number; |
| 2492 |
> |
ConfigGeneral.stats_e_disabled = yylval.number; |
| 2493 |
|
}; |
| 2494 |
|
|
| 2495 |
< |
general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';' |
| 2495 |
> |
general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';' |
| 2496 |
|
{ |
| 2497 |
< |
ConfigFileEntry.stats_e_disabled = yylval.number; |
| 2497 |
> |
ConfigGeneral.stats_m_oper_only = yylval.number; |
| 2498 |
|
}; |
| 2499 |
|
|
| 2500 |
|
general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';' |
| 2501 |
|
{ |
| 2502 |
< |
ConfigFileEntry.stats_o_oper_only = yylval.number; |
| 2502 |
> |
ConfigGeneral.stats_o_oper_only = yylval.number; |
| 2503 |
|
}; |
| 2504 |
|
|
| 2505 |
|
general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';' |
| 2506 |
|
{ |
| 2507 |
< |
ConfigFileEntry.stats_P_oper_only = yylval.number; |
| 2507 |
> |
ConfigGeneral.stats_P_oper_only = yylval.number; |
| 2508 |
> |
}; |
| 2509 |
> |
|
| 2510 |
> |
general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';' |
| 2511 |
> |
{ |
| 2512 |
> |
ConfigGeneral.stats_u_oper_only = yylval.number; |
| 2513 |
|
}; |
| 2514 |
|
|
| 2515 |
|
general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';' |
| 2516 |
|
{ |
| 2517 |
< |
ConfigFileEntry.stats_k_oper_only = 2 * yylval.number; |
| 2517 |
> |
ConfigGeneral.stats_k_oper_only = 2 * yylval.number; |
| 2518 |
|
} | STATS_K_OPER_ONLY '=' TMASKED ';' |
| 2519 |
|
{ |
| 2520 |
< |
ConfigFileEntry.stats_k_oper_only = 1; |
| 2520 |
> |
ConfigGeneral.stats_k_oper_only = 1; |
| 2521 |
|
}; |
| 2522 |
|
|
| 2523 |
|
general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';' |
| 2524 |
|
{ |
| 2525 |
< |
ConfigFileEntry.stats_i_oper_only = 2 * yylval.number; |
| 2525 |
> |
ConfigGeneral.stats_i_oper_only = 2 * yylval.number; |
| 2526 |
|
} | STATS_I_OPER_ONLY '=' TMASKED ';' |
| 2527 |
|
{ |
| 2528 |
< |
ConfigFileEntry.stats_i_oper_only = 1; |
| 2528 |
> |
ConfigGeneral.stats_i_oper_only = 1; |
| 2529 |
|
}; |
| 2530 |
|
|
| 2531 |
|
general_pace_wait: PACE_WAIT '=' timespec ';' |
| 2532 |
|
{ |
| 2533 |
< |
ConfigFileEntry.pace_wait = $3; |
| 2533 |
> |
ConfigGeneral.pace_wait = $3; |
| 2534 |
|
}; |
| 2535 |
|
|
| 2536 |
|
general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';' |
| 2537 |
|
{ |
| 2538 |
< |
ConfigFileEntry.caller_id_wait = $3; |
| 2538 |
> |
ConfigGeneral.caller_id_wait = $3; |
| 2539 |
|
}; |
| 2540 |
|
|
| 2541 |
|
general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';' |
| 2542 |
|
{ |
| 2543 |
< |
ConfigFileEntry.opers_bypass_callerid = yylval.number; |
| 2543 |
> |
ConfigGeneral.opers_bypass_callerid = yylval.number; |
| 2544 |
|
}; |
| 2545 |
|
|
| 2546 |
|
general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';' |
| 2547 |
|
{ |
| 2548 |
< |
ConfigFileEntry.pace_wait_simple = $3; |
| 2548 |
> |
ConfigGeneral.pace_wait_simple = $3; |
| 2549 |
|
}; |
| 2550 |
|
|
| 2551 |
|
general_short_motd: SHORT_MOTD '=' TBOOL ';' |
| 2552 |
|
{ |
| 2553 |
< |
ConfigFileEntry.short_motd = yylval.number; |
| 2613 |
< |
}; |
| 2614 |
< |
|
| 2615 |
< |
general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';' |
| 2616 |
< |
{ |
| 2617 |
< |
ConfigFileEntry.no_oper_flood = yylval.number; |
| 2553 |
> |
ConfigGeneral.short_motd = yylval.number; |
| 2554 |
|
}; |
| 2555 |
|
|
| 2556 |
< |
general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';' |
| 2621 |
< |
{ |
| 2622 |
< |
ConfigFileEntry.true_no_oper_flood = yylval.number; |
| 2623 |
< |
}; |
| 2624 |
< |
|
| 2625 |
< |
general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';' |
| 2556 |
> |
general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';' |
| 2557 |
|
{ |
| 2558 |
< |
ConfigFileEntry.oper_pass_resv = yylval.number; |
| 2558 |
> |
ConfigGeneral.no_oper_flood = yylval.number; |
| 2559 |
|
}; |
| 2560 |
|
|
| 2561 |
|
general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';' |
| 2562 |
|
{ |
| 2563 |
< |
ConfigFileEntry.dots_in_ident = $3; |
| 2563 |
> |
ConfigGeneral.dots_in_ident = $3; |
| 2564 |
|
}; |
| 2565 |
|
|
| 2566 |
|
general_max_targets: MAX_TARGETS '=' NUMBER ';' |
| 2567 |
|
{ |
| 2568 |
< |
ConfigFileEntry.max_targets = $3; |
| 2638 |
< |
}; |
| 2639 |
< |
|
| 2640 |
< |
general_use_egd: USE_EGD '=' TBOOL ';' |
| 2641 |
< |
{ |
| 2642 |
< |
ConfigFileEntry.use_egd = yylval.number; |
| 2568 |
> |
ConfigGeneral.max_targets = $3; |
| 2569 |
|
}; |
| 2570 |
|
|
| 2571 |
< |
general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';' |
| 2646 |
< |
{ |
| 2647 |
< |
if (conf_parser_ctx.pass == 2) |
| 2648 |
< |
{ |
| 2649 |
< |
MyFree(ConfigFileEntry.egdpool_path); |
| 2650 |
< |
ConfigFileEntry.egdpool_path = xstrdup(yylval.string); |
| 2651 |
< |
} |
| 2652 |
< |
}; |
| 2653 |
< |
|
| 2654 |
< |
general_services_name: T_SERVICES_NAME '=' QSTRING ';' |
| 2571 |
> |
general_ping_cookie: PING_COOKIE '=' TBOOL ';' |
| 2572 |
|
{ |
| 2573 |
< |
if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string)) |
| 2657 |
< |
{ |
| 2658 |
< |
MyFree(ConfigFileEntry.service_name); |
| 2659 |
< |
ConfigFileEntry.service_name = xstrdup(yylval.string); |
| 2660 |
< |
} |
| 2573 |
> |
ConfigGeneral.ping_cookie = yylval.number; |
| 2574 |
|
}; |
| 2575 |
|
|
| 2576 |
< |
general_ping_cookie: PING_COOKIE '=' TBOOL ';' |
| 2576 |
> |
general_disable_auth: DISABLE_AUTH '=' TBOOL ';' |
| 2577 |
|
{ |
| 2578 |
< |
ConfigFileEntry.ping_cookie = yylval.number; |
| 2578 |
> |
ConfigGeneral.disable_auth = yylval.number; |
| 2579 |
|
}; |
| 2580 |
|
|
| 2581 |
< |
general_disable_auth: DISABLE_AUTH '=' TBOOL ';' |
| 2581 |
> |
general_throttle_count: THROTTLE_COUNT '=' NUMBER ';' |
| 2582 |
|
{ |
| 2583 |
< |
ConfigFileEntry.disable_auth = yylval.number; |
| 2583 |
> |
ConfigGeneral.throttle_count = $3; |
| 2584 |
|
}; |
| 2585 |
|
|
| 2586 |
|
general_throttle_time: THROTTLE_TIME '=' timespec ';' |
| 2587 |
|
{ |
| 2588 |
< |
ConfigFileEntry.throttle_time = yylval.number; |
| 2588 |
> |
ConfigGeneral.throttle_time = $3; |
| 2589 |
|
}; |
| 2590 |
|
|
| 2591 |
|
general_oper_umodes: OPER_UMODES |
| 2592 |
|
{ |
| 2593 |
< |
ConfigFileEntry.oper_umodes = 0; |
| 2594 |
< |
} '=' umode_oitems ';' ; |
| 2593 |
> |
ConfigGeneral.oper_umodes = 0; |
| 2594 |
> |
} '=' umode_oitems ';' ; |
| 2595 |
|
|
| 2596 |
|
umode_oitems: umode_oitems ',' umode_oitem | umode_oitem; |
| 2597 |
|
umode_oitem: T_BOTS |
| 2598 |
|
{ |
| 2599 |
< |
ConfigFileEntry.oper_umodes |= UMODE_BOTS; |
| 2599 |
> |
ConfigGeneral.oper_umodes |= UMODE_BOTS; |
| 2600 |
|
} | T_CCONN |
| 2601 |
|
{ |
| 2602 |
< |
ConfigFileEntry.oper_umodes |= UMODE_CCONN; |
| 2602 |
> |
ConfigGeneral.oper_umodes |= UMODE_CCONN; |
| 2603 |
|
} | T_DEAF |
| 2604 |
|
{ |
| 2605 |
< |
ConfigFileEntry.oper_umodes |= UMODE_DEAF; |
| 2605 |
> |
ConfigGeneral.oper_umodes |= UMODE_DEAF; |
| 2606 |
|
} | T_DEBUG |
| 2607 |
|
{ |
| 2608 |
< |
ConfigFileEntry.oper_umodes |= UMODE_DEBUG; |
| 2608 |
> |
ConfigGeneral.oper_umodes |= UMODE_DEBUG; |
| 2609 |
|
} | T_FULL |
| 2610 |
|
{ |
| 2611 |
< |
ConfigFileEntry.oper_umodes |= UMODE_FULL; |
| 2611 |
> |
ConfigGeneral.oper_umodes |= UMODE_FULL; |
| 2612 |
|
} | HIDDEN |
| 2613 |
|
{ |
| 2614 |
< |
ConfigFileEntry.oper_umodes |= UMODE_HIDDEN; |
| 2614 |
> |
ConfigGeneral.oper_umodes |= UMODE_HIDDEN; |
| 2615 |
> |
} | HIDE_CHANS |
| 2616 |
> |
{ |
| 2617 |
> |
ConfigGeneral.oper_umodes |= UMODE_HIDECHANS; |
| 2618 |
> |
} | HIDE_IDLE |
| 2619 |
> |
{ |
| 2620 |
> |
ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE; |
| 2621 |
|
} | T_SKILL |
| 2622 |
|
{ |
| 2623 |
< |
ConfigFileEntry.oper_umodes |= UMODE_SKILL; |
| 2623 |
> |
ConfigGeneral.oper_umodes |= UMODE_SKILL; |
| 2624 |
|
} | T_NCHANGE |
| 2625 |
|
{ |
| 2626 |
< |
ConfigFileEntry.oper_umodes |= UMODE_NCHANGE; |
| 2626 |
> |
ConfigGeneral.oper_umodes |= UMODE_NCHANGE; |
| 2627 |
|
} | T_REJ |
| 2628 |
|
{ |
| 2629 |
< |
ConfigFileEntry.oper_umodes |= UMODE_REJ; |
| 2629 |
> |
ConfigGeneral.oper_umodes |= UMODE_REJ; |
| 2630 |
|
} | T_UNAUTH |
| 2631 |
|
{ |
| 2632 |
< |
ConfigFileEntry.oper_umodes |= UMODE_UNAUTH; |
| 2632 |
> |
ConfigGeneral.oper_umodes |= UMODE_UNAUTH; |
| 2633 |
|
} | T_SPY |
| 2634 |
|
{ |
| 2635 |
< |
ConfigFileEntry.oper_umodes |= UMODE_SPY; |
| 2635 |
> |
ConfigGeneral.oper_umodes |= UMODE_SPY; |
| 2636 |
|
} | T_EXTERNAL |
| 2637 |
|
{ |
| 2638 |
< |
ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL; |
| 2720 |
< |
} | T_OPERWALL |
| 2721 |
< |
{ |
| 2722 |
< |
ConfigFileEntry.oper_umodes |= UMODE_OPERWALL; |
| 2638 |
> |
ConfigGeneral.oper_umodes |= UMODE_EXTERNAL; |
| 2639 |
|
} | T_SERVNOTICE |
| 2640 |
|
{ |
| 2641 |
< |
ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE; |
| 2641 |
> |
ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE; |
| 2642 |
|
} | T_INVISIBLE |
| 2643 |
|
{ |
| 2644 |
< |
ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE; |
| 2644 |
> |
ConfigGeneral.oper_umodes |= UMODE_INVISIBLE; |
| 2645 |
|
} | T_WALLOP |
| 2646 |
|
{ |
| 2647 |
< |
ConfigFileEntry.oper_umodes |= UMODE_WALLOP; |
| 2647 |
> |
ConfigGeneral.oper_umodes |= UMODE_WALLOP; |
| 2648 |
|
} | T_SOFTCALLERID |
| 2649 |
|
{ |
| 2650 |
< |
ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID; |
| 2650 |
> |
ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID; |
| 2651 |
|
} | T_CALLERID |
| 2652 |
|
{ |
| 2653 |
< |
ConfigFileEntry.oper_umodes |= UMODE_CALLERID; |
| 2653 |
> |
ConfigGeneral.oper_umodes |= UMODE_CALLERID; |
| 2654 |
|
} | T_LOCOPS |
| 2655 |
|
{ |
| 2656 |
< |
ConfigFileEntry.oper_umodes |= UMODE_LOCOPS; |
| 2656 |
> |
ConfigGeneral.oper_umodes |= UMODE_LOCOPS; |
| 2657 |
|
} | T_NONONREG |
| 2658 |
|
{ |
| 2659 |
< |
ConfigFileEntry.oper_umodes |= UMODE_REGONLY; |
| 2659 |
> |
ConfigGeneral.oper_umodes |= UMODE_REGONLY; |
| 2660 |
|
} | T_FARCONNECT |
| 2661 |
|
{ |
| 2662 |
< |
ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; |
| 2662 |
> |
ConfigGeneral.oper_umodes |= UMODE_FARCONNECT; |
| 2663 |
> |
} | EXPIRATION |
| 2664 |
> |
{ |
| 2665 |
> |
ConfigGeneral.oper_umodes |= UMODE_EXPIRATION; |
| 2666 |
|
}; |
| 2667 |
|
|
| 2668 |
< |
general_oper_only_umodes: OPER_ONLY_UMODES |
| 2668 |
> |
general_oper_only_umodes: OPER_ONLY_UMODES |
| 2669 |
|
{ |
| 2670 |
< |
ConfigFileEntry.oper_only_umodes = 0; |
| 2671 |
< |
} '=' umode_items ';' ; |
| 2670 |
> |
ConfigGeneral.oper_only_umodes = 0; |
| 2671 |
> |
} '=' umode_items ';' ; |
| 2672 |
|
|
| 2673 |
< |
umode_items: umode_items ',' umode_item | umode_item; |
| 2674 |
< |
umode_item: T_BOTS |
| 2673 |
> |
umode_items: umode_items ',' umode_item | umode_item; |
| 2674 |
> |
umode_item: T_BOTS |
| 2675 |
|
{ |
| 2676 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_BOTS; |
| 2676 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_BOTS; |
| 2677 |
|
} | T_CCONN |
| 2678 |
|
{ |
| 2679 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; |
| 2679 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_CCONN; |
| 2680 |
|
} | T_DEAF |
| 2681 |
|
{ |
| 2682 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; |
| 2682 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_DEAF; |
| 2683 |
|
} | T_DEBUG |
| 2684 |
|
{ |
| 2685 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG; |
| 2685 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_DEBUG; |
| 2686 |
|
} | T_FULL |
| 2687 |
< |
{ |
| 2688 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_FULL; |
| 2687 |
> |
{ |
| 2688 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_FULL; |
| 2689 |
|
} | T_SKILL |
| 2690 |
|
{ |
| 2691 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_SKILL; |
| 2691 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_SKILL; |
| 2692 |
|
} | HIDDEN |
| 2693 |
|
{ |
| 2694 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN; |
| 2694 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN; |
| 2695 |
|
} | T_NCHANGE |
| 2696 |
|
{ |
| 2697 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE; |
| 2697 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE; |
| 2698 |
|
} | T_REJ |
| 2699 |
|
{ |
| 2700 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_REJ; |
| 2700 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_REJ; |
| 2701 |
|
} | T_UNAUTH |
| 2702 |
|
{ |
| 2703 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH; |
| 2703 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH; |
| 2704 |
|
} | T_SPY |
| 2705 |
|
{ |
| 2706 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_SPY; |
| 2706 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_SPY; |
| 2707 |
|
} | T_EXTERNAL |
| 2708 |
|
{ |
| 2709 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL; |
| 2791 |
< |
} | T_OPERWALL |
| 2792 |
< |
{ |
| 2793 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL; |
| 2709 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL; |
| 2710 |
|
} | T_SERVNOTICE |
| 2711 |
|
{ |
| 2712 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE; |
| 2712 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE; |
| 2713 |
|
} | T_INVISIBLE |
| 2714 |
|
{ |
| 2715 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE; |
| 2715 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE; |
| 2716 |
|
} | T_WALLOP |
| 2717 |
|
{ |
| 2718 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP; |
| 2718 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_WALLOP; |
| 2719 |
|
} | T_SOFTCALLERID |
| 2720 |
|
{ |
| 2721 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID; |
| 2721 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID; |
| 2722 |
|
} | T_CALLERID |
| 2723 |
|
{ |
| 2724 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID; |
| 2724 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_CALLERID; |
| 2725 |
|
} | T_LOCOPS |
| 2726 |
|
{ |
| 2727 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS; |
| 2727 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS; |
| 2728 |
|
} | T_NONONREG |
| 2729 |
|
{ |
| 2730 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY; |
| 2730 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_REGONLY; |
| 2731 |
|
} | T_FARCONNECT |
| 2732 |
|
{ |
| 2733 |
< |
ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT; |
| 2733 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT; |
| 2734 |
> |
} | EXPIRATION |
| 2735 |
> |
{ |
| 2736 |
> |
ConfigGeneral.oper_only_umodes |= UMODE_EXPIRATION; |
| 2737 |
|
}; |
| 2738 |
|
|
| 2739 |
|
general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';' |
| 2740 |
|
{ |
| 2741 |
< |
ConfigFileEntry.min_nonwildcard = $3; |
| 2741 |
> |
ConfigGeneral.min_nonwildcard = $3; |
| 2742 |
|
}; |
| 2743 |
|
|
| 2744 |
|
general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';' |
| 2745 |
|
{ |
| 2746 |
< |
ConfigFileEntry.min_nonwildcard_simple = $3; |
| 2746 |
> |
ConfigGeneral.min_nonwildcard_simple = $3; |
| 2747 |
|
}; |
| 2748 |
|
|
| 2749 |
|
general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';' |
| 2750 |
|
{ |
| 2751 |
< |
ConfigFileEntry.default_floodcount = $3; |
| 2751 |
> |
ConfigGeneral.default_floodcount = $3; |
| 2752 |
> |
}; |
| 2753 |
> |
|
| 2754 |
> |
general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';' |
| 2755 |
> |
{ |
| 2756 |
> |
ConfigGeneral.default_floodtime = $3; |
| 2757 |
|
}; |
| 2758 |
|
|
| 2759 |
|
|
| 2760 |
|
/*************************************************************************** |
| 2761 |
< |
* section channel |
| 2761 |
> |
* channel {} section |
| 2762 |
|
***************************************************************************/ |
| 2763 |
< |
channel_entry: CHANNEL |
| 2840 |
< |
'{' channel_items '}' ';'; |
| 2763 |
> |
channel_entry: CHANNEL '{' channel_items '}' ';'; |
| 2764 |
|
|
| 2765 |
|
channel_items: channel_items channel_item | channel_item; |
| 2766 |
|
channel_item: channel_max_bans | |
| 2767 |
< |
channel_knock_delay | channel_knock_delay_channel | |
| 2768 |
< |
channel_max_chans_per_user | channel_max_chans_per_oper | |
| 2769 |
< |
channel_default_split_user_count | |
| 2770 |
< |
channel_default_split_server_count | |
| 2771 |
< |
channel_no_create_on_split | |
| 2772 |
< |
channel_no_join_on_split | |
| 2773 |
< |
channel_jflood_count | channel_jflood_time | |
| 2774 |
< |
channel_disable_fake_channels | error; |
| 2767 |
> |
channel_max_bans_large | |
| 2768 |
> |
channel_invite_client_count | |
| 2769 |
> |
channel_invite_client_time | |
| 2770 |
> |
channel_invite_delay_channel | |
| 2771 |
> |
channel_invite_expire_time | |
| 2772 |
> |
channel_knock_client_count | |
| 2773 |
> |
channel_knock_client_time | |
| 2774 |
> |
channel_knock_delay_channel | |
| 2775 |
> |
channel_max_channels | |
| 2776 |
> |
channel_max_invites | |
| 2777 |
> |
channel_default_join_flood_count | |
| 2778 |
> |
channel_default_join_flood_time | |
| 2779 |
> |
channel_disable_fake_channels | |
| 2780 |
> |
error; |
| 2781 |
|
|
| 2782 |
|
channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';' |
| 2783 |
|
{ |
| 2784 |
|
ConfigChannel.disable_fake_channels = yylval.number; |
| 2785 |
|
}; |
| 2786 |
|
|
| 2787 |
< |
channel_knock_delay: KNOCK_DELAY '=' timespec ';' |
| 2787 |
> |
channel_invite_client_count: INVITE_CLIENT_COUNT '=' NUMBER ';' |
| 2788 |
|
{ |
| 2789 |
< |
ConfigChannel.knock_delay = $3; |
| 2789 |
> |
ConfigChannel.invite_client_count = $3; |
| 2790 |
|
}; |
| 2791 |
|
|
| 2792 |
< |
channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';' |
| 2792 |
> |
channel_invite_client_time: INVITE_CLIENT_TIME '=' timespec ';' |
| 2793 |
|
{ |
| 2794 |
< |
ConfigChannel.knock_delay_channel = $3; |
| 2794 |
> |
ConfigChannel.invite_client_time = $3; |
| 2795 |
|
}; |
| 2796 |
|
|
| 2797 |
< |
channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';' |
| 2797 |
> |
channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';' |
| 2798 |
|
{ |
| 2799 |
< |
ConfigChannel.max_chans_per_user = $3; |
| 2799 |
> |
ConfigChannel.invite_delay_channel = $3; |
| 2800 |
|
}; |
| 2801 |
|
|
| 2802 |
< |
channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';' |
| 2802 |
> |
channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';' |
| 2803 |
|
{ |
| 2804 |
< |
ConfigChannel.max_chans_per_oper = $3; |
| 2804 |
> |
ConfigChannel.invite_expire_time = $3; |
| 2805 |
|
}; |
| 2806 |
|
|
| 2807 |
< |
channel_max_bans: MAX_BANS '=' NUMBER ';' |
| 2807 |
> |
channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';' |
| 2808 |
|
{ |
| 2809 |
< |
ConfigChannel.max_bans = $3; |
| 2809 |
> |
ConfigChannel.knock_client_count = $3; |
| 2810 |
|
}; |
| 2811 |
|
|
| 2812 |
< |
channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';' |
| 2812 |
> |
channel_knock_client_time: KNOCK_CLIENT_TIME '=' timespec ';' |
| 2813 |
|
{ |
| 2814 |
< |
ConfigChannel.default_split_user_count = $3; |
| 2814 |
> |
ConfigChannel.knock_client_time = $3; |
| 2815 |
|
}; |
| 2816 |
|
|
| 2817 |
< |
channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';' |
| 2817 |
> |
channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';' |
| 2818 |
|
{ |
| 2819 |
< |
ConfigChannel.default_split_server_count = $3; |
| 2819 |
> |
ConfigChannel.knock_delay_channel = $3; |
| 2820 |
|
}; |
| 2821 |
|
|
| 2822 |
< |
channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';' |
| 2822 |
> |
channel_max_channels: MAX_CHANNELS '=' NUMBER ';' |
| 2823 |
|
{ |
| 2824 |
< |
ConfigChannel.no_create_on_split = yylval.number; |
| 2824 |
> |
ConfigChannel.max_channels = $3; |
| 2825 |
|
}; |
| 2826 |
|
|
| 2827 |
< |
channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';' |
| 2827 |
> |
channel_max_invites: MAX_INVITES '=' NUMBER ';' |
| 2828 |
|
{ |
| 2829 |
< |
ConfigChannel.no_join_on_split = yylval.number; |
| 2829 |
> |
ConfigChannel.max_invites = $3; |
| 2830 |
|
}; |
| 2831 |
|
|
| 2832 |
< |
channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';' |
| 2832 |
> |
channel_max_bans: MAX_BANS '=' NUMBER ';' |
| 2833 |
|
{ |
| 2834 |
< |
GlobalSetOptions.joinfloodcount = yylval.number; |
| 2834 |
> |
ConfigChannel.max_bans = $3; |
| 2835 |
|
}; |
| 2836 |
|
|
| 2837 |
< |
channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';' |
| 2837 |
> |
channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';' |
| 2838 |
|
{ |
| 2839 |
< |
GlobalSetOptions.joinfloodtime = yylval.number; |
| 2839 |
> |
ConfigChannel.max_bans_large = $3; |
| 2840 |
|
}; |
| 2841 |
|
|
| 2842 |
+ |
channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';' |
| 2843 |
+ |
{ |
| 2844 |
+ |
ConfigChannel.default_join_flood_count = yylval.number; |
| 2845 |
+ |
}; |
| 2846 |
+ |
|
| 2847 |
+ |
channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';' |
| 2848 |
+ |
{ |
| 2849 |
+ |
ConfigChannel.default_join_flood_time = $3; |
| 2850 |
+ |
}; |
| 2851 |
+ |
|
| 2852 |
+ |
|
| 2853 |
|
/*************************************************************************** |
| 2854 |
< |
* section serverhide |
| 2854 |
> |
* serverhide {} section |
| 2855 |
|
***************************************************************************/ |
| 2856 |
< |
serverhide_entry: SERVERHIDE |
| 2917 |
< |
'{' serverhide_items '}' ';'; |
| 2856 |
> |
serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';'; |
| 2857 |
|
|
| 2858 |
|
serverhide_items: serverhide_items serverhide_item | serverhide_item; |
| 2859 |
< |
serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | |
| 2859 |
> |
serverhide_item: serverhide_flatten_links | |
| 2860 |
> |
serverhide_flatten_links_delay | |
| 2861 |
> |
serverhide_flatten_links_file | |
| 2862 |
> |
serverhide_disable_remote_commands | |
| 2863 |
|
serverhide_hide_servers | |
| 2864 |
< |
serverhide_hide_services | |
| 2865 |
< |
serverhide_links_delay | |
| 2866 |
< |
serverhide_hidden | serverhide_hidden_name | |
| 2867 |
< |
serverhide_hide_server_ips | |
| 2864 |
> |
serverhide_hide_services | |
| 2865 |
> |
serverhide_hidden | |
| 2866 |
> |
serverhide_hidden_name | |
| 2867 |
> |
serverhide_hide_server_ips | |
| 2868 |
|
error; |
| 2869 |
|
|
| 2870 |
|
serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';' |
| 2873 |
|
ConfigServerHide.flatten_links = yylval.number; |
| 2874 |
|
}; |
| 2875 |
|
|
| 2876 |
+ |
serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';' |
| 2877 |
+ |
{ |
| 2878 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2879 |
+ |
{ |
| 2880 |
+ |
if ($3 > 0) |
| 2881 |
+ |
{ |
| 2882 |
+ |
event_write_links_file.when = $3; |
| 2883 |
+ |
event_add(&event_write_links_file, NULL); |
| 2884 |
+ |
} |
| 2885 |
+ |
else |
| 2886 |
+ |
event_delete(&event_write_links_file); |
| 2887 |
+ |
|
| 2888 |
+ |
ConfigServerHide.flatten_links_delay = $3; |
| 2889 |
+ |
} |
| 2890 |
+ |
}; |
| 2891 |
+ |
|
| 2892 |
+ |
serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';' |
| 2893 |
+ |
{ |
| 2894 |
+ |
if (conf_parser_ctx.pass == 2) |
| 2895 |
+ |
{ |
| 2896 |
+ |
xfree(ConfigServerHide.flatten_links_file); |
| 2897 |
+ |
ConfigServerHide.flatten_links_file = xstrdup(yylval.string); |
| 2898 |
+ |
} |
| 2899 |
+ |
}; |
| 2900 |
+ |
|
| 2901 |
|
serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';' |
| 2902 |
|
{ |
| 2903 |
|
if (conf_parser_ctx.pass == 2) |
| 2920 |
|
{ |
| 2921 |
|
if (conf_parser_ctx.pass == 2) |
| 2922 |
|
{ |
| 2923 |
< |
MyFree(ConfigServerHide.hidden_name); |
| 2923 |
> |
xfree(ConfigServerHide.hidden_name); |
| 2924 |
|
ConfigServerHide.hidden_name = xstrdup(yylval.string); |
| 2925 |
|
} |
| 2926 |
|
}; |
| 2927 |
|
|
| 2961 |
– |
serverhide_links_delay: LINKS_DELAY '=' timespec ';' |
| 2962 |
– |
{ |
| 2963 |
– |
if (conf_parser_ctx.pass == 2) |
| 2964 |
– |
{ |
| 2965 |
– |
if (($3 > 0) && ConfigServerHide.links_disabled == 1) |
| 2966 |
– |
{ |
| 2967 |
– |
eventAddIsh("write_links_file", write_links_file, NULL, $3); |
| 2968 |
– |
ConfigServerHide.links_disabled = 0; |
| 2969 |
– |
} |
| 2970 |
– |
|
| 2971 |
– |
ConfigServerHide.links_delay = $3; |
| 2972 |
– |
} |
| 2973 |
– |
}; |
| 2974 |
– |
|
| 2928 |
|
serverhide_hidden: HIDDEN '=' TBOOL ';' |
| 2929 |
|
{ |
| 2930 |
|
if (conf_parser_ctx.pass == 2) |