ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf_parser.y
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf_parser.y (file contents):
Revision 2252 by michael, Sun Jun 16 13:29:13 2013 UTC vs.
Revision 7105 by michael, Sat Jan 23 20:11:27 2016 UTC

# Line 1 | Line 1
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-2016 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
# Line 16 | Line 15
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 + /*! \file conf_parser.y
23 + * \brief Parses the ircd configuration file.
24 + * \version $Id$
25 + */
26 +
27 +
28   %{
29  
27 #define YY_NO_UNPUT
30   #include <sys/types.h>
31   #include <string.h>
32  
# Line 34 | Line 36
36   #include "list.h"
37   #include "conf.h"
38   #include "conf_class.h"
39 + #include "conf_pseudo.h"
40   #include "event.h"
41 + #include "id.h"
42   #include "log.h"
43 < #include "client.h"     /* for UMODE_ALL only */
43 > #include "client.h"     /* for UMODE_SERVNOTICE only */
44   #include "irc_string.h"
45   #include "memory.h"
46   #include "modules.h"
47 < #include "s_serv.h"
47 > #include "server.h"
48   #include "hostmask.h"
49   #include "send.h"
50   #include "listener.h"
51   #include "resv.h"
52   #include "numeric.h"
53 < #include "s_user.h"
53 > #include "user.h"
54   #include "motd.h"
55  
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
56   int yylex(void);
57  
58   static struct
59   {
60 <  struct {
60 >  struct
61 >  {
62      dlink_list list;
63    } mask,
64      leaf,
65      hub;
66  
67 <  struct {
67 >  struct
68 >  {
69      char buf[IRCD_BUFSIZE];
70    } name,
71 +    nick,
72      user,
73      host,
74      addr,
# Line 80 | Line 78 | static struct
78      cert,
79      rpass,
80      spass,
81 <    class;
81 >    whois,
82 >    class,
83 >    target,
84 >    prepend,
85 >    command;
86  
87 <  struct {
87 >  struct
88 >  {
89      unsigned int value;
90    } flags,
91      modes,
# Line 101 | Line 104 | static struct
104      max_ident,
105      max_sendq,
106      max_recvq,
107 +    max_channels,
108      cidr_bitlen_ipv4,
109      cidr_bitlen_ipv6,
110      number_per_cidr;
# Line 109 | Line 113 | static struct
113   static void
114   reset_block_state(void)
115   {
116 <  dlink_node *ptr = NULL, *ptr_next = NULL;
116 >  dlink_node *node = NULL, *node_next = NULL;
117  
118 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head)
118 >  DLINK_FOREACH_SAFE(node, node_next, block_state.mask.list.head)
119    {
120 <    MyFree(ptr->data);
121 <    dlinkDelete(ptr, &block_state.mask.list);
122 <    free_dlink_node(ptr);
120 >    xfree(node->data);
121 >    dlinkDelete(node, &block_state.mask.list);
122 >    free_dlink_node(node);
123    }
124  
125 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head)
125 >  DLINK_FOREACH_SAFE(node, node_next, block_state.leaf.list.head)
126    {
127 <    MyFree(ptr->data);
128 <    dlinkDelete(ptr, &block_state.leaf.list);
129 <    free_dlink_node(ptr);
127 >    xfree(node->data);
128 >    dlinkDelete(node, &block_state.leaf.list);
129 >    free_dlink_node(node);
130    }
131  
132 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head)
132 >  DLINK_FOREACH_SAFE(node, node_next, block_state.hub.list.head)
133    {
134 <    MyFree(ptr->data);
135 <    dlinkDelete(ptr, &block_state.hub.list);
136 <    free_dlink_node(ptr);
134 >    xfree(node->data);
135 >    dlinkDelete(node, &block_state.hub.list);
136 >    free_dlink_node(node);
137    }
138  
139    memset(&block_state, 0, sizeof(block_state));
# Line 148 | Line 152 | reset_block_state(void)
152   %token  ANTI_NICK_FLOOD
153   %token  ANTI_SPAM_EXIT_MESSAGE_TIME
154   %token  AUTOCONN
155 + %token  AWAY_COUNT
156 + %token  AWAY_TIME
157   %token  BYTES KBYTES MBYTES
158   %token  CALLER_ID_WAIT
159   %token  CAN_FLOOD
# Line 155 | Line 161 | reset_block_state(void)
161   %token  CIDR_BITLEN_IPV4
162   %token  CIDR_BITLEN_IPV6
163   %token  CLASS
164 + %token  CLOSE
165   %token  CONNECT
166   %token  CONNECTFREQ
167 + %token  CYCLE_ON_HOST_CHANGE
168   %token  DEFAULT_FLOODCOUNT
169 < %token  DEFAULT_SPLIT_SERVER_COUNT
170 < %token  DEFAULT_SPLIT_USER_COUNT
169 > %token  DEFAULT_JOIN_FLOOD_COUNT
170 > %token  DEFAULT_JOIN_FLOOD_TIME
171 > %token  DEFAULT_MAX_CLIENTS
172   %token  DENY
173   %token  DESCRIPTION
174   %token  DIE
175   %token  DISABLE_AUTH
176   %token  DISABLE_FAKE_CHANNELS
177   %token  DISABLE_REMOTE_COMMANDS
178 + %token  DLINE_MIN_CIDR
179 + %token  DLINE_MIN_CIDR6
180   %token  DOTS_IN_IDENT
170 %token  EGDPOOL_PATH
181   %token  EMAIL
182   %token  ENCRYPTED
183   %token  EXCEED_LIMIT
184   %token  EXEMPT
185   %token  FAILED_OPER_NOTICE
186   %token  FLATTEN_LINKS
187 + %token  FLATTEN_LINKS_DELAY
188 + %token  FLATTEN_LINKS_FILE
189   %token  GECOS
190   %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
191   %token  HIDDEN
192   %token  HIDDEN_NAME
193 + %token  HIDE_CHANS
194 + %token  HIDE_IDLE
195   %token  HIDE_IDLE_FROM_OPERS
196   %token  HIDE_SERVER_IPS
197   %token  HIDE_SERVERS
198   %token  HIDE_SERVICES
194 %token  HIDE_SPOOF_IPS
199   %token  HOST
200   %token  HUB
201   %token  HUB_MASK
202   %token  IGNORE_BOGUS_TS
203   %token  INVISIBLE_ON_CONNECT
204 + %token  INVITE_CLIENT_COUNT
205 + %token  INVITE_CLIENT_TIME
206 + %token  INVITE_DELAY_CHANNEL
207   %token  IP
208   %token  IRCD_AUTH
209   %token  IRCD_FLAGS
210   %token  IRCD_SID
211 < %token  JOIN_FLOOD_COUNT
205 < %token  JOIN_FLOOD_TIME
211 > %token  JOIN
212   %token  KILL
213   %token  KILL_CHASE_TIME_LIMIT
214   %token  KLINE
215   %token  KLINE_EXEMPT
216 < %token  KNOCK_DELAY
216 > %token  KLINE_MIN_CIDR
217 > %token  KLINE_MIN_CIDR6
218 > %token  KNOCK_CLIENT_COUNT
219 > %token  KNOCK_CLIENT_TIME
220   %token  KNOCK_DELAY_CHANNEL
221   %token  LEAF_MASK
213 %token  LINKS_DELAY
222   %token  LISTEN
223   %token  MASK
224   %token  MAX_ACCEPT
225   %token  MAX_BANS
226 < %token  MAX_CHANS_PER_OPER
219 < %token  MAX_CHANS_PER_USER
226 > %token  MAX_CHANNELS
227   %token  MAX_GLOBAL
228   %token  MAX_IDENT
229   %token  MAX_IDLE
# Line 240 | Line 247 | reset_block_state(void)
247   %token  NETWORK_DESC
248   %token  NETWORK_NAME
249   %token  NICK
243 %token  NO_CREATE_ON_SPLIT
244 %token  NO_JOIN_ON_SPLIT
250   %token  NO_OPER_FLOOD
251   %token  NO_TILDE
252   %token  NUMBER
253   %token  NUMBER_PER_CIDR
254   %token  NUMBER_PER_IP
255   %token  OPER_ONLY_UMODES
251 %token  OPER_PASS_RESV
256   %token  OPER_UMODES
257   %token  OPERATOR
258   %token  OPERS_BYPASS_CALLERID
# Line 270 | Line 274 | reset_block_state(void)
274   %token  RESV
275   %token  RESV_EXEMPT
276   %token  RSA_PRIVATE_KEY_FILE
273 %token  RSA_PUBLIC_KEY_FILE
277   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
278   %token  SEND_PASSWORD
279   %token  SENDQ
# Line 283 | Line 286 | reset_block_state(void)
286   %token  SSL_CERTIFICATE_FILE
287   %token  SSL_CERTIFICATE_FINGERPRINT
288   %token  SSL_CONNECTION_REQUIRED
289 + %token  SSL_DH_ELLIPTIC_CURVE
290   %token  SSL_DH_PARAM_FILE
291 + %token  SSL_MESSAGE_DIGEST_ALGORITHM
292   %token  STATS_E_DISABLED
293   %token  STATS_I_OPER_ONLY
294   %token  STATS_K_OPER_ONLY
295 + %token  STATS_M_OPER_ONLY
296   %token  STATS_O_OPER_ONLY
297   %token  STATS_P_OPER_ONLY
298 + %token  STATS_U_OPER_ONLY
299   %token  T_ALL
300   %token  T_BOTS
301   %token  T_CALLERID
302   %token  T_CCONN
303 + %token  T_COMMAND
304   %token  T_CLUSTER
305   %token  T_DEAF
306   %token  T_DEBUG
# Line 307 | Line 315 | reset_block_state(void)
315   %token  T_IPV6
316   %token  T_LOCOPS
317   %token  T_LOG
310 %token  T_MAX_CLIENTS
318   %token  T_NCHANGE
319   %token  T_NONONREG
320 < %token  T_OPERWALL
320 > %token  T_OPME
321 > %token  T_PREPEND
322 > %token  T_PSEUDO
323   %token  T_RECVQ
324   %token  T_REJ
325   %token  T_RESTART
326   %token  T_SERVER
327   %token  T_SERVICE
319 %token  T_SERVICES_NAME
328   %token  T_SERVNOTICE
329   %token  T_SET
330   %token  T_SHARED
# Line 326 | Line 334 | reset_block_state(void)
334   %token  T_SPY
335   %token  T_SSL
336   %token  T_SSL_CIPHER_LIST
337 < %token  T_SSL_CLIENT_METHOD
330 < %token  T_SSL_SERVER_METHOD
331 < %token  T_SSLV3
332 < %token  T_TLSV1
337 > %token  T_TARGET
338   %token  T_UMODES
339   %token  T_UNAUTH
340   %token  T_UNDLINE
# Line 340 | Line 345 | reset_block_state(void)
345   %token  T_WALLOPS
346   %token  T_WEBIRC
347   %token  TBOOL
348 + %token  THROTTLE_COUNT
349   %token  THROTTLE_TIME
350   %token  TKLINE_EXPIRE_NOTICES
351   %token  TMASKED
346 %token  TRUE_NO_OPER_FLOOD
352   %token  TS_MAX_DELTA
353   %token  TS_WARN_DELTA
354   %token  TWODOTS
355   %token  TYPE
356   %token  UNKLINE
352 %token  USE_EGD
357   %token  USE_LOGGING
358   %token  USER
359   %token  VHOST
360   %token  VHOST6
361 < %token  WARN_NO_NLINE
361 > %token  WARN_NO_CONNECT_BLOCK
362 > %token  WHOIS
363   %token  XLINE
364 + %token  XLINE_EXEMPT
365  
366   %type  <string> QSTRING
367   %type  <number> NUMBER
# Line 365 | Line 371 | reset_block_state(void)
371   %type  <number> sizespec_
372  
373   %%
374 < conf:  
374 > conf:
375          | conf conf_item
376          ;
377  
378   conf_item:        admin_entry
379                  | logging_entry
380                  | oper_entry
381 <                | channel_entry
382 <                | class_entry
381 >                | channel_entry
382 >                | class_entry
383                  | listen_entry
384                  | auth_entry
385                  | serverinfo_entry
386 <                | serverhide_entry
386 >                | serverhide_entry
387                  | resv_entry
388                  | service_entry
389                  | shared_entry
390 <                | cluster_entry
390 >                | cluster_entry
391                  | connect_entry
392                  | kill_entry
393                  | deny_entry
394 <                | exempt_entry
395 <                | general_entry
394 >                | exempt_entry
395 >                | general_entry
396                  | gecos_entry
397                  | modules_entry
398                  | motd_entry
399 +                | pseudo_entry
400                  | error ';'
401                  | error '}'
402          ;
403  
404  
405   timespec_: { $$ = 0; } | timespec;
406 < timespec:       NUMBER timespec_
407 <                {
408 <                        $$ = $1 + $2;
409 <                }
410 <                | NUMBER SECONDS timespec_
411 <                {
412 <                        $$ = $1 + $3;
413 <                }
414 <                | NUMBER MINUTES timespec_
415 <                {
416 <                        $$ = $1 * 60 + $3;
417 <                }
418 <                | NUMBER HOURS timespec_
419 <                {
420 <                        $$ = $1 * 60 * 60 + $3;
421 <                }
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 <                ;
406 > timespec:  NUMBER timespec_         { $$ = $1 + $2; } |
407 >           NUMBER SECONDS timespec_ { $$ = $1 + $3; } |
408 >           NUMBER MINUTES timespec_ { $$ = $1 * 60 + $3; } |
409 >           NUMBER HOURS timespec_   { $$ = $1 * 60 * 60 + $3; } |
410 >           NUMBER DAYS timespec_    { $$ = $1 * 60 * 60 * 24 + $3; } |
411 >           NUMBER WEEKS timespec_   { $$ = $1 * 60 * 60 * 24 * 7 + $3; } |
412 >           NUMBER MONTHS timespec_  { $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; } |
413 >           NUMBER YEARS timespec_   { $$ = $1 * 60 * 60 * 24 * 365 + $3; }
414 >           ;
415 >
416 > sizespec_:  { $$ = 0; } | sizespec;
417 > sizespec:   NUMBER sizespec_ { $$ = $1 + $2; } |
418 >            NUMBER BYTES sizespec_ { $$ = $1 + $3; } |
419 >            NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } |
420 >            NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
421 >            ;
422  
423  
424   /***************************************************************************
425 < *  section modules
425 > * modules {} section
426   ***************************************************************************/
427 < modules_entry: MODULES
445 <  '{' modules_items '}' ';';
427 > modules_entry: MODULES '{' modules_items '}' ';';
428  
429   modules_items:  modules_items modules_item | modules_item;
430   modules_item:   modules_module | modules_path | error ';' ;
# Line 460 | Line 442 | modules_path: PATH '=' QSTRING ';'
442   };
443  
444  
445 + /***************************************************************************
446 + * serverinfo {}  section
447 + ***************************************************************************/
448   serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
449  
450   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
451 < serverinfo_item:        serverinfo_name | serverinfo_vhost |
452 <                        serverinfo_hub | serverinfo_description |
453 <                        serverinfo_network_name | serverinfo_network_desc |
454 <                        serverinfo_max_clients | serverinfo_max_nick_length |
455 <                        serverinfo_max_topic_length | serverinfo_ssl_dh_param_file |
456 <                        serverinfo_rsa_private_key_file | serverinfo_vhost6 |
457 <                        serverinfo_sid | serverinfo_ssl_certificate_file |
458 <                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
451 > serverinfo_item:        serverinfo_name |
452 >                        serverinfo_vhost |
453 >                        serverinfo_hub |
454 >                        serverinfo_description |
455 >                        serverinfo_network_name |
456 >                        serverinfo_network_desc |
457 >                        serverinfo_default_max_clients |
458 >                        serverinfo_max_nick_length |
459 >                        serverinfo_max_topic_length |
460 >                        serverinfo_ssl_dh_param_file |
461 >                        serverinfo_ssl_dh_elliptic_curve |
462 >                        serverinfo_rsa_private_key_file |
463 >                        serverinfo_vhost6 |
464 >                        serverinfo_sid |
465 >                        serverinfo_ssl_certificate_file |
466                          serverinfo_ssl_cipher_list |
467 <                        error ';' ;
468 <
467 >                        serverinfo_ssl_message_digest_algorithm |
468 >                        error ';' ;
469  
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 };
495
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 };
470  
471   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
472   {
473 < #ifdef HAVE_LIBCRYPTO
514 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
473 >  if (conf_parser_ctx.pass == 2)
474    {
475 <    if (!ServerInfo.rsa_private_key_file)
475 >    if (!ConfigServerInfo.rsa_private_key_file)
476      {
477        conf_error_report("No rsa_private_key_file specified, SSL disabled");
478        break;
479      }
480  
481 <    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
482 <                                     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 <    }
481 >    if (ConfigServerInfo.ssl_certificate_file)
482 >      xfree(ConfigServerInfo.ssl_certificate_file);
483  
484 <    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 <    }
484 >    ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string);
485    }
550 #endif
486   };
487  
488   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
489   {
555 #ifdef HAVE_LIBCRYPTO
556  BIO *file = NULL;
557
490    if (conf_parser_ctx.pass != 1)
491      break;
492  
493 <  if (ServerInfo.rsa_private_key)
494 <  {
495 <    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)
576 <  {
577 <    conf_error_report("File open failed, ignoring");
578 <    break;
579 <  }
580 <
581 <  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
582 <
583 <  BIO_set_close(file, BIO_CLOSE);
584 <  BIO_free(file);
585 <
586 <  if (ServerInfo.rsa_private_key == NULL)
587 <  {
588 <    conf_error_report("Couldn't extract key, ignoring");
589 <    break;
590 <  }
493 >  xfree(ConfigServerInfo.rsa_private_key_file);
494 >  ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
495 > };
496  
497 <  if (!RSA_check_key(ServerInfo.rsa_private_key))
497 > serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
498 > {
499 >  if (conf_parser_ctx.pass == 2)
500    {
501 <    RSA_free(ServerInfo.rsa_private_key);
502 <    ServerInfo.rsa_private_key = NULL;
596 <
597 <    conf_error_report("Invalid key, ignoring");
598 <    break;
501 >    xfree(ConfigServerInfo.ssl_dh_param_file);
502 >    ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string);
503    }
504 + };
505  
506 <  /* require 2048 bit (256 byte) key */
507 <  if (RSA_size(ServerInfo.rsa_private_key) != 256)
506 > serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
507 > {
508 >  if (conf_parser_ctx.pass == 2)
509    {
510 <    RSA_free(ServerInfo.rsa_private_key);
511 <    ServerInfo.rsa_private_key = NULL;
606 <
607 <    conf_error_report("Not a 2048 bit key, ignoring");
510 >    xfree(ConfigServerInfo.ssl_cipher_list);
511 >    ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string);
512    }
609 #endif
513   };
514  
515 < serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
515 > serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
516   {
517 < /* TBD - XXX: error reporting */
615 < #ifdef HAVE_LIBCRYPTO
616 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
517 >  if (conf_parser_ctx.pass == 2)
518    {
519 <    BIO *file = BIO_new_file(yylval.string, "r");
520 <
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 <    }
519 >    xfree(ConfigServerInfo.ssl_message_digest_algorithm);
520 >    ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string);
521    }
522 < #endif
638 < };
522 > }
523  
524 < serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
524 > serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
525   {
526 < #ifdef HAVE_LIBCRYPTO
527 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
528 <    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
529 < #endif
526 >  if (conf_parser_ctx.pass == 2)
527 >  {
528 >    xfree(ConfigServerInfo.ssl_dh_elliptic_curve);
529 >    ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string);
530 >  }
531   };
532  
533 < serverinfo_name: NAME '=' QSTRING ';'
533 > serverinfo_name: NAME '=' QSTRING ';'
534   {
535 <  /* this isn't rehashable */
536 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
535 >  /* This isn't rehashable */
536 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
537    {
538      if (valid_servname(yylval.string))
539 <      ServerInfo.name = xstrdup(yylval.string);
539 >      ConfigServerInfo.name = xstrdup(yylval.string);
540      else
541      {
542        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
543 <      exit(0);
543 >      exit(EXIT_FAILURE);
544      }
545    }
546   };
547  
548 < serverinfo_sid: IRCD_SID '=' QSTRING ';'
548 > serverinfo_sid: IRCD_SID '=' QSTRING ';'
549   {
550 <  /* this isn't rehashable */
551 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
550 >  /* This isn't rehashable */
551 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
552    {
553      if (valid_sid(yylval.string))
554 <      ServerInfo.sid = xstrdup(yylval.string);
554 >      ConfigServerInfo.sid = xstrdup(yylval.string);
555      else
556      {
557        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
558 <      exit(0);
558 >      exit(EXIT_FAILURE);
559      }
560    }
561   };
# Line 679 | Line 564 | serverinfo_description: DESCRIPTION '='
564   {
565    if (conf_parser_ctx.pass == 2)
566    {
567 <    MyFree(ServerInfo.description);
568 <    ServerInfo.description = xstrdup(yylval.string);
567 >    xfree(ConfigServerInfo.description);
568 >    ConfigServerInfo.description = xstrdup(yylval.string);
569 >    strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
570    }
571   };
572  
# Line 690 | Line 576 | serverinfo_network_name: NETWORK_NAME '=
576    {
577      char *p;
578  
579 <    if ((p = strchr(yylval.string, ' ')) != NULL)
580 <      p = '\0';
579 >    if ((p = strchr(yylval.string, ' ')))
580 >      *p = '\0';
581  
582 <    MyFree(ServerInfo.network_name);
583 <    ServerInfo.network_name = xstrdup(yylval.string);
582 >    xfree(ConfigServerInfo.network_name);
583 >    ConfigServerInfo.network_name = xstrdup(yylval.string);
584    }
585   };
586  
# Line 703 | Line 589 | serverinfo_network_desc: NETWORK_DESC '=
589    if (conf_parser_ctx.pass != 2)
590      break;
591  
592 <  MyFree(ServerInfo.network_desc);
593 <  ServerInfo.network_desc = xstrdup(yylval.string);
592 >  xfree(ConfigServerInfo.network_desc);
593 >  ConfigServerInfo.network_desc = xstrdup(yylval.string);
594   };
595  
596   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 723 | Line 609 | serverinfo_vhost: VHOST '=' QSTRING ';'
609        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
610      else
611      {
612 <      assert(res != NULL);
612 >      assert(res);
613  
614 <      memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
615 <      ServerInfo.ip.ss.ss_family = res->ai_family;
616 <      ServerInfo.ip.ss_len = res->ai_addrlen;
614 >      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
615 >      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
616 >      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
617        freeaddrinfo(res);
618  
619 <      ServerInfo.specific_ipv4_vhost = 1;
619 >      ConfigServerInfo.specific_ipv4_vhost = 1;
620      }
621    }
622   };
623  
624   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
625   {
740 #ifdef IPV6
626    if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
627    {
628      struct addrinfo hints, *res;
# Line 752 | Line 637 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
637        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
638      else
639      {
640 <      assert(res != NULL);
640 >      assert(res);
641  
642 <      memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
643 <      ServerInfo.ip6.ss.ss_family = res->ai_family;
644 <      ServerInfo.ip6.ss_len = res->ai_addrlen;
642 >      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
643 >      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
644 >      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
645        freeaddrinfo(res);
646  
647 <      ServerInfo.specific_ipv6_vhost = 1;
647 >      ConfigServerInfo.specific_ipv6_vhost = 1;
648      }
649    }
765 #endif
650   };
651  
652 < serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
652 > serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
653   {
654    if (conf_parser_ctx.pass != 2)
655      break;
656  
657    if ($3 < MAXCLIENTS_MIN)
658    {
659 <    char buf[IRCD_BUFSIZE];
659 >    char buf[IRCD_BUFSIZE] = "";
660  
661      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
662      conf_error_report(buf);
663 <    ServerInfo.max_clients = MAXCLIENTS_MIN;
663 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
664    }
665    else if ($3 > MAXCLIENTS_MAX)
666    {
667 <    char buf[IRCD_BUFSIZE];
667 >    char buf[IRCD_BUFSIZE] = "";
668  
669      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
670      conf_error_report(buf);
671 <    ServerInfo.max_clients = MAXCLIENTS_MAX;
671 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
672    }
673    else
674 <    ServerInfo.max_clients = $3;
674 >    ConfigServerInfo.default_max_clients = $3;
675   };
676  
677   serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
# Line 798 | Line 682 | serverinfo_max_nick_length: MAX_NICK_LEN
682    if ($3 < 9)
683    {
684      conf_error_report("max_nick_length too low, setting to 9");
685 <    ServerInfo.max_nick_length = 9;
685 >    ConfigServerInfo.max_nick_length = 9;
686    }
687    else if ($3 > NICKLEN)
688    {
689 <    char buf[IRCD_BUFSIZE];
689 >    char buf[IRCD_BUFSIZE] = "";
690  
691      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
692      conf_error_report(buf);
693 <    ServerInfo.max_nick_length = NICKLEN;
693 >    ConfigServerInfo.max_nick_length = NICKLEN;
694    }
695    else
696 <    ServerInfo.max_nick_length = $3;
696 >    ConfigServerInfo.max_nick_length = $3;
697   };
698  
699   serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
# Line 820 | Line 704 | serverinfo_max_topic_length: MAX_TOPIC_L
704    if ($3 < 80)
705    {
706      conf_error_report("max_topic_length too low, setting to 80");
707 <    ServerInfo.max_topic_length = 80;
707 >    ConfigServerInfo.max_topic_length = 80;
708    }
709    else if ($3 > TOPICLEN)
710    {
711 <    char buf[IRCD_BUFSIZE];
711 >    char buf[IRCD_BUFSIZE] = "";
712  
713      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
714      conf_error_report(buf);
715 <    ServerInfo.max_topic_length = TOPICLEN;
715 >    ConfigServerInfo.max_topic_length = TOPICLEN;
716    }
717    else
718 <    ServerInfo.max_topic_length = $3;
718 >    ConfigServerInfo.max_topic_length = $3;
719   };
720  
721 < serverinfo_hub: HUB '=' TBOOL ';'
721 > serverinfo_hub: HUB '=' TBOOL ';'
722   {
723    if (conf_parser_ctx.pass == 2)
724 <    ServerInfo.hub = yylval.number;
724 >    ConfigServerInfo.hub = yylval.number;
725   };
726  
727 +
728   /***************************************************************************
729 < * admin section
729 > * admin {} section
730   ***************************************************************************/
731   admin_entry: ADMIN  '{' admin_items '}' ';' ;
732  
733   admin_items: admin_items admin_item | admin_item;
734 < admin_item:  admin_name | admin_description |
735 <             admin_email | error ';' ;
734 > admin_item:  admin_name |
735 >             admin_description |
736 >             admin_email |
737 >             error ';' ;
738  
739 < admin_name: NAME '=' QSTRING ';'
739 > admin_name: NAME '=' QSTRING ';'
740   {
741    if (conf_parser_ctx.pass != 2)
742      break;
743  
744 <  MyFree(AdminInfo.name);
745 <  AdminInfo.name = xstrdup(yylval.string);
744 >  xfree(ConfigAdminInfo.name);
745 >  ConfigAdminInfo.name = xstrdup(yylval.string);
746   };
747  
748   admin_email: EMAIL '=' QSTRING ';'
# Line 863 | Line 750 | admin_email: EMAIL '=' QSTRING ';'
750    if (conf_parser_ctx.pass != 2)
751      break;
752  
753 <  MyFree(AdminInfo.email);
754 <  AdminInfo.email = xstrdup(yylval.string);
753 >  xfree(ConfigAdminInfo.email);
754 >  ConfigAdminInfo.email = xstrdup(yylval.string);
755   };
756  
757   admin_description: DESCRIPTION '=' QSTRING ';'
# Line 872 | Line 759 | admin_description: DESCRIPTION '=' QSTRI
759    if (conf_parser_ctx.pass != 2)
760      break;
761  
762 <  MyFree(AdminInfo.description);
763 <  AdminInfo.description = xstrdup(yylval.string);
762 >  xfree(ConfigAdminInfo.description);
763 >  ConfigAdminInfo.description = xstrdup(yylval.string);
764   };
765  
766 +
767   /***************************************************************************
768 < * motd section
768 > * motd {} section
769   ***************************************************************************/
770 < motd_entry: MOTD
770 > motd_entry: MOTD
771   {
772    if (conf_parser_ctx.pass == 2)
773      reset_block_state();
774   } '{' motd_items '}' ';'
775   {
776 <  dlink_node *ptr = NULL;
776 >  dlink_node *node = NULL;
777  
778    if (conf_parser_ctx.pass != 2)
779      break;
# Line 893 | Line 781 | motd_entry: MOTD
781    if (!block_state.file.buf[0])
782      break;
783  
784 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
785 <    motd_add(ptr->data, block_state.file.buf);
784 >  DLINK_FOREACH(node, block_state.mask.list.head)
785 >    motd_add(node->data, block_state.file.buf);
786   };
787  
788   motd_items: motd_items motd_item | motd_item;
789   motd_item:  motd_mask | motd_file | error ';' ;
790  
791 < motd_mask: MASK '=' QSTRING ';'
791 > motd_mask: MASK '=' QSTRING ';'
792   {
793    if (conf_parser_ctx.pass == 2)
794      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
# Line 912 | Line 800 | motd_file: T_FILE '=' QSTRING ';'
800      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
801   };
802  
803 +
804 + /***************************************************************************
805 + * pseudo {} section
806 + ***************************************************************************/
807 + pseudo_entry: T_PSEUDO
808 + {
809 +  if (conf_parser_ctx.pass == 2)
810 +    reset_block_state();
811 + } '{' pseudo_items '}' ';'
812 + {
813 +  if (conf_parser_ctx.pass != 2)
814 +    break;
815 +
816 +  if (!block_state.command.buf[0] ||
817 +      !block_state.name.buf[0] ||
818 +      !block_state.nick.buf[0] ||
819 +      !block_state.host.buf[0])
820 +    break;
821 +
822 +  pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf,
823 +                  block_state.prepend.buf, block_state.command.buf);
824 + };
825 +
826 + pseudo_items: pseudo_items pseudo_item | pseudo_item;
827 + pseudo_item:  pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ;
828 +
829 + pseudo_command: T_COMMAND '=' QSTRING ';'
830 + {
831 +  if (conf_parser_ctx.pass == 2)
832 +    strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf));
833 + };
834 +
835 + pseudo_name: NAME '=' QSTRING ';'
836 + {
837 +  if (conf_parser_ctx.pass == 2)
838 +    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
839 + };
840 +
841 + pseudo_prepend: T_PREPEND '=' QSTRING ';'
842 + {
843 +  if (conf_parser_ctx.pass == 2)
844 +    strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf));
845 + };
846 +
847 + pseudo_target: T_TARGET '=' QSTRING ';'
848 + {
849 +  if (conf_parser_ctx.pass == 2)
850 +  {
851 +    struct split_nuh_item nuh;
852 +
853 +    nuh.nuhmask  = yylval.string;
854 +    nuh.nickptr  = NULL;
855 +    nuh.userptr  = block_state.nick.buf;
856 +    nuh.hostptr  = block_state.host.buf;
857 +    nuh.nicksize = 0;
858 +    nuh.usersize = sizeof(block_state.nick.buf);
859 +    nuh.hostsize = sizeof(block_state.host.buf);
860 +
861 +    split_nuh(&nuh);
862 +  }
863 + };
864 +
865 +
866   /***************************************************************************
867 < *  section logging
867 > * log {} section
868   ***************************************************************************/
869   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
870   logging_items:          logging_items logging_item | logging_item ;
871  
872 < logging_item:           logging_use_logging | logging_file_entry |
873 <                        error ';' ;
872 > logging_item:           logging_use_logging | logging_file_entry |
873 >                        error ';' ;
874  
875   logging_use_logging: USE_LOGGING '=' TBOOL ';'
876   {
877    if (conf_parser_ctx.pass == 2)
878 <    ConfigLoggingEntry.use_logging = yylval.number;
878 >    ConfigLog.use_logging = yylval.number;
879   };
880  
881   logging_file_entry:
# Line 978 | Line 929 | logging_file_type_item:  USER
929   {
930    if (conf_parser_ctx.pass == 2)
931      block_state.type.value = LOG_TYPE_OPER;
932 < } | GLINE
932 > } | XLINE
933   {
934    if (conf_parser_ctx.pass == 2)
935 <    block_state.type.value = LOG_TYPE_GLINE;
935 >    block_state.type.value = LOG_TYPE_XLINE;
936 > } | RESV
937 > {
938 >  if (conf_parser_ctx.pass == 2)
939 >    block_state.type.value = LOG_TYPE_RESV;
940   } | T_DLINE
941   {
942    if (conf_parser_ctx.pass == 2)
# Line 1002 | Line 957 | logging_file_type_item:  USER
957  
958  
959   /***************************************************************************
960 < * section oper
960 > * operator {} section
961   ***************************************************************************/
962 < oper_entry: OPERATOR
962 > oper_entry: OPERATOR
963   {
964    if (conf_parser_ctx.pass != 2)
965      break;
# Line 1013 | Line 968 | oper_entry: OPERATOR
968    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
969   } '{' oper_items '}' ';'
970   {
971 <  dlink_node *ptr = NULL;
971 >  dlink_node *node = NULL;
972  
973    if (conf_parser_ctx.pass != 2)
974      break;
975  
976    if (!block_state.name.buf[0])
977      break;
978 < #ifdef HAVE_LIBCRYPTO
1024 <  if (!block_state.file.buf[0] &&
1025 <      !block_state.rpass.buf[0])
1026 <    break;
1027 < #else
978 >
979    if (!block_state.rpass.buf[0])
980      break;
1030 #endif
981  
982 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
982 >  DLINK_FOREACH(node, block_state.mask.list.head)
983    {
984      struct MaskItem *conf = NULL;
985      struct split_nuh_item nuh;
986  
987 <    nuh.nuhmask  = ptr->data;
987 >    nuh.nuhmask  = node->data;
988      nuh.nickptr  = NULL;
989      nuh.userptr  = block_state.user.buf;
990      nuh.hostptr  = block_state.host.buf;
# Line 1054 | Line 1004 | oper_entry: OPERATOR
1004      if (block_state.rpass.buf[0])
1005        conf->passwd = xstrdup(block_state.rpass.buf);
1006  
1007 +    if (block_state.whois.buf[0])
1008 +      conf->whois = xstrdup(block_state.whois.buf);
1009 +
1010      conf->flags = block_state.flags.value;
1011      conf->modes = block_state.modes.value;
1012      conf->port  = block_state.port.value;
1013      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1014  
1015      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 */
1016    }
1017   };
1018  
1019   oper_items:     oper_items oper_item | oper_item;
1020 < oper_item:      oper_name | oper_user | oper_password |
1021 <                oper_umodes | oper_class | oper_encrypted |
1022 <                oper_rsa_public_key_file | oper_ssl_certificate_fingerprint |
1023 <                oper_ssl_connection_required |
1024 <                oper_flags | error ';' ;
1020 > oper_item:      oper_name |
1021 >                oper_user |
1022 >                oper_password |
1023 >                oper_whois |
1024 >                oper_umodes |
1025 >                oper_class |
1026 >                oper_encrypted |
1027 >                oper_ssl_certificate_fingerprint |
1028 >                oper_ssl_connection_required |
1029 >                oper_flags |
1030 >                error ';' ;
1031  
1032   oper_name: NAME '=' QSTRING ';'
1033   {
# Line 1109 | Line 1047 | oper_password: PASSWORD '=' QSTRING ';'
1047      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1048   };
1049  
1050 + oper_whois: WHOIS '=' QSTRING ';'
1051 + {
1052 +  if (conf_parser_ctx.pass == 2)
1053 +    strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf));
1054 + };
1055 +
1056   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1057   {
1058    if (conf_parser_ctx.pass != 2)
# Line 1120 | Line 1064 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1064      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1065   };
1066  
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
1067   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1068   {
1069    if (conf_parser_ctx.pass == 2)
# Line 1180 | Line 1118 | oper_umodes_item:  T_BOTS
1118   {
1119    if (conf_parser_ctx.pass == 2)
1120      block_state.modes.value |= UMODE_HIDDEN;
1121 + } | HIDE_CHANS
1122 + {
1123 +  if (conf_parser_ctx.pass == 2)
1124 +    block_state.modes.value |= UMODE_HIDECHANS;
1125 + } | HIDE_IDLE
1126 + {
1127 +  if (conf_parser_ctx.pass == 2)
1128 +    block_state.modes.value |= UMODE_HIDEIDLE;
1129   } | T_SKILL
1130   {
1131    if (conf_parser_ctx.pass == 2)
# Line 1204 | Line 1150 | oper_umodes_item:  T_BOTS
1150   {
1151    if (conf_parser_ctx.pass == 2)
1152      block_state.modes.value |= UMODE_EXTERNAL;
1207 } | T_OPERWALL
1208 {
1209  if (conf_parser_ctx.pass == 2)
1210    block_state.modes.value |= UMODE_OPERWALL;
1153   } | T_SERVNOTICE
1154   {
1155    if (conf_parser_ctx.pass == 2)
# Line 1276 | Line 1218 | oper_flags_item: KILL ':' REMOTE
1218   } | KLINE
1219   {
1220    if (conf_parser_ctx.pass == 2)
1221 <    block_state.port.value |= OPER_FLAG_K;
1221 >    block_state.port.value |= OPER_FLAG_KLINE;
1222   } | UNKLINE
1223   {
1224    if (conf_parser_ctx.pass == 2)
# Line 1292 | Line 1234 | oper_flags_item: KILL ':' REMOTE
1234   } | XLINE
1235   {
1236    if (conf_parser_ctx.pass == 2)
1237 <    block_state.port.value |= OPER_FLAG_X;
1238 < } | GLINE
1237 >    block_state.port.value |= OPER_FLAG_XLINE;
1238 > } | T_UNXLINE
1239   {
1240    if (conf_parser_ctx.pass == 2)
1241 <    block_state.port.value |= OPER_FLAG_GLINE;
1241 >    block_state.port.value |= OPER_FLAG_UNXLINE;
1242   } | DIE
1243   {
1244    if (conf_parser_ctx.pass == 2)
# Line 1305 | Line 1247 | oper_flags_item: KILL ':' REMOTE
1247   {
1248    if (conf_parser_ctx.pass == 2)
1249      block_state.port.value |= OPER_FLAG_RESTART;
1250 + } | REHASH ':' REMOTE
1251 + {
1252 +  if (conf_parser_ctx.pass == 2)
1253 +    block_state.port.value |= OPER_FLAG_REHASH_REMOTE;
1254   } | REHASH
1255   {
1256    if (conf_parser_ctx.pass == 2)
# Line 1313 | Line 1259 | oper_flags_item: KILL ':' REMOTE
1259   {
1260    if (conf_parser_ctx.pass == 2)
1261      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;
1262   } | T_GLOBOPS
1263   {
1264    if (conf_parser_ctx.pass == 2)
# Line 1341 | Line 1283 | oper_flags_item: KILL ':' REMOTE
1283   {
1284    if (conf_parser_ctx.pass == 2)
1285      block_state.port.value |= OPER_FLAG_MODULE;
1286 + } | T_OPME
1287 + {
1288 +  if (conf_parser_ctx.pass == 2)
1289 +    block_state.port.value |= OPER_FLAG_OPME;
1290 + } | NICK ':' RESV
1291 + {
1292 +  if (conf_parser_ctx.pass == 2)
1293 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1294 + } | JOIN ':' RESV
1295 + {
1296 +  if (conf_parser_ctx.pass == 2)
1297 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1298 + } | RESV
1299 + {
1300 +  if (conf_parser_ctx.pass == 2)
1301 +    block_state.port.value |= OPER_FLAG_RESV;
1302 + } | T_UNRESV
1303 + {
1304 +  if (conf_parser_ctx.pass == 2)
1305 +    block_state.port.value |= OPER_FLAG_UNRESV;
1306 + } | CLOSE
1307 + {
1308 +  if (conf_parser_ctx.pass == 2)
1309 +    block_state.port.value |= OPER_FLAG_CLOSE;
1310   };
1311  
1312  
1313   /***************************************************************************
1314 < *  section class
1314 > * class {} section
1315   ***************************************************************************/
1316   class_entry: CLASS
1317   {
# Line 1373 | Line 1339 | class_entry: CLASS
1339      class = class_make();
1340  
1341    class->active = 1;
1342 <  MyFree(class->name);
1342 >  xfree(class->name);
1343    class->name = xstrdup(block_state.class.buf);
1344    class->ping_freq = block_state.ping_freq.value;
1345    class->max_perip = block_state.max_perip.value;
# Line 1384 | Line 1350 | class_entry: CLASS
1350    class->max_ident = block_state.max_ident.value;
1351    class->max_sendq = block_state.max_sendq.value;
1352    class->max_recvq = block_state.max_recvq.value;
1353 +  class->max_channels = block_state.max_channels.value;
1354  
1355    if (block_state.min_idle.value > block_state.max_idle.value)
1356    {
# Line 1396 | Line 1363 | class_entry: CLASS
1363    class->min_idle = block_state.min_idle.value;
1364    class->max_idle = block_state.max_idle.value;
1365  
1366 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1400 <    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);
1366 >  rebuild_cidr_list(class);
1367  
1368    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1369    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
# Line 1410 | Line 1372 | class_entry: CLASS
1372  
1373   class_items:    class_items class_item | class_item;
1374   class_item:     class_name |
1375 <                class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
1375 >                class_cidr_bitlen_ipv4 |
1376 >                class_cidr_bitlen_ipv6 |
1377                  class_ping_time |
1378 <                class_number_per_cidr |
1378 >                class_number_per_cidr |
1379                  class_number_per_ip |
1380                  class_connectfreq |
1381 +                class_max_channels |
1382                  class_max_number |
1383 <                class_max_global |
1384 <                class_max_local |
1385 <                class_max_ident |
1383 >                class_max_global |
1384 >                class_max_local |
1385 >                class_max_ident |
1386                  class_sendq | class_recvq |
1387                  class_min_idle |
1388                  class_max_idle |
1389                  class_flags |
1390 <                error ';' ;
1390 >                error ';' ;
1391  
1392 < class_name: NAME '=' QSTRING ';'
1392 > class_name: NAME '=' QSTRING ';'
1393   {
1394    if (conf_parser_ctx.pass == 1)
1395      strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf));
# Line 1449 | Line 1413 | class_connectfreq: CONNECTFREQ '=' times
1413      block_state.con_freq.value = $3;
1414   };
1415  
1416 + class_max_channels: MAX_CHANNELS '=' NUMBER ';'
1417 + {
1418 +  if (conf_parser_ctx.pass == 1)
1419 +    block_state.max_channels.value = $3;
1420 + };
1421 +
1422   class_max_number: MAX_NUMBER '=' NUMBER ';'
1423   {
1424    if (conf_parser_ctx.pass == 1)
# Line 1541 | Line 1511 | class_flags_item: RANDOM_IDLE
1511  
1512  
1513   /***************************************************************************
1514 < *  section listen
1514 > * listen {} section
1515   ***************************************************************************/
1516   listen_entry: LISTEN
1517   {
# Line 1580 | Line 1550 | port_item: NUMBER
1550   {
1551    if (conf_parser_ctx.pass == 2)
1552    {
1553 + #ifndef HAVE_TLS
1554      if (block_state.flags.value & LISTENER_SSL)
1555 < #ifdef HAVE_LIBCRYPTO
1556 <      if (!ServerInfo.server_ctx)
1555 >    {
1556 >      conf_error_report("TLS not available - port closed");
1557 >      break;
1558 >    }
1559   #endif
1560 <      {
1588 <        conf_error_report("SSL not available - port closed");
1589 <        break;
1590 <      }
1591 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1560 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1561    }
1562   } | NUMBER TWODOTS NUMBER
1563   {
1564    if (conf_parser_ctx.pass == 2)
1565    {
1566 <    int i;
1598 <
1566 > #ifndef HAVE_TLS
1567      if (block_state.flags.value & LISTENER_SSL)
1568 < #ifdef HAVE_LIBCRYPTO
1569 <      if (!ServerInfo.server_ctx)
1568 >    {
1569 >      conf_error_report("TLS not available - port closed");
1570 >      break;
1571 >    }
1572   #endif
1603      {
1604        conf_error_report("SSL not available - port closed");
1605        break;
1606      }
1573  
1574 <    for (i = $1; i <= $3; ++i)
1575 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1574 >    for (int i = $1; i <= $3; ++i)
1575 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1576    }
1577   };
1578  
# Line 1622 | Line 1588 | listen_host: HOST '=' QSTRING ';'
1588      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1589   };
1590  
1591 +
1592   /***************************************************************************
1593 < *  section auth
1593 > * auth {} section
1594   ***************************************************************************/
1595   auth_entry: IRCD_AUTH
1596   {
# Line 1631 | Line 1598 | auth_entry: IRCD_AUTH
1598      reset_block_state();
1599   } '{' auth_items '}' ';'
1600   {
1601 <  dlink_node *ptr = NULL;
1601 >  dlink_node *node = NULL;
1602  
1603    if (conf_parser_ctx.pass != 2)
1604      break;
1605  
1606 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1606 >  DLINK_FOREACH(node, block_state.mask.list.head)
1607    {
1608      struct MaskItem *conf = NULL;
1609      struct split_nuh_item nuh;
1610  
1611 <    nuh.nuhmask  = ptr->data;
1611 >    nuh.nuhmask  = node->data;
1612      nuh.nickptr  = NULL;
1613      nuh.userptr  = block_state.user.buf;
1614      nuh.hostptr  = block_state.host.buf;
# Line 1665 | Line 1632 | auth_entry: IRCD_AUTH
1632      conf_add_class_to_conf(conf, block_state.class.buf);
1633      add_conf_by_address(CONF_CLIENT, conf);
1634    }
1635 < };
1635 > };
1636  
1637   auth_items:     auth_items auth_item | auth_item;
1638 < auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1639 <                auth_spoof | auth_redir_serv | auth_redir_port |
1640 <                auth_encrypted | error ';' ;
1638 > auth_item:      auth_user |
1639 >                auth_passwd |
1640 >                auth_class |
1641 >                auth_flags |
1642 >                auth_spoof |
1643 >                auth_redir_serv |
1644 >                auth_redir_port |
1645 >                auth_encrypted |
1646 >                error ';' ;
1647  
1648   auth_user: USER '=' QSTRING ';'
1649   {
# Line 1720 | Line 1693 | auth_flags_item: SPOOF_NOTICE
1693   {
1694    if (conf_parser_ctx.pass == 2)
1695      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1696 + } | XLINE_EXEMPT
1697 + {
1698 +  if (conf_parser_ctx.pass == 2)
1699 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1700   } | NEED_IDENT
1701   {
1702    if (conf_parser_ctx.pass == 2)
# Line 1732 | Line 1709 | auth_flags_item: SPOOF_NOTICE
1709   {
1710    if (conf_parser_ctx.pass == 2)
1711      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;
1712   } | RESV_EXEMPT
1713   {
1714    if (conf_parser_ctx.pass == 2)
# Line 1750 | Line 1723 | auth_flags_item: SPOOF_NOTICE
1723      block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD;
1724   };
1725  
1726 < auth_spoof: SPOOF '=' QSTRING ';'
1726 > auth_spoof: SPOOF '=' QSTRING ';'
1727   {
1728    if (conf_parser_ctx.pass != 2)
1729      break;
1730  
1731 <  if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string))
1731 >  if (valid_hostname(yylval.string))
1732    {
1733      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1734      block_state.flags.value |= CONF_FLAGS_SPOOF_IP;
# Line 1784 | Line 1757 | auth_redir_port: REDIRPORT '=' NUMBER ';
1757  
1758  
1759   /***************************************************************************
1760 < *  section resv
1760 > * resv {} section
1761   ***************************************************************************/
1762   resv_entry: RESV
1763   {
# Line 1801 | Line 1774 | resv_entry: RESV
1774    create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1775   };
1776  
1777 < resv_items:     resv_items resv_item | resv_item;
1778 < resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1777 > resv_items:     resv_items resv_item | resv_item;
1778 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1779  
1780   resv_mask: MASK '=' QSTRING ';'
1781   {
# Line 1824 | Line 1797 | resv_exempt: EXEMPT '=' QSTRING ';'
1797  
1798  
1799   /***************************************************************************
1800 < *  section service
1800 > * service {} section
1801   ***************************************************************************/
1802   service_entry: T_SERVICE '{' service_items '}' ';';
1803  
# Line 1843 | Line 1816 | service_name: NAME '=' QSTRING ';'
1816    }
1817   };
1818  
1819 +
1820   /***************************************************************************
1821 < *  section shared, for sharing remote klines etc.
1821 > * shared {} section, for sharing remote klines etc.
1822   ***************************************************************************/
1823   shared_entry: T_SHARED
1824   {
# Line 1864 | Line 1838 | shared_entry: T_SHARED
1838    if (conf_parser_ctx.pass != 2)
1839      break;
1840  
1841 <  conf = conf_make(CONF_ULINE);
1841 >  conf = conf_make(CONF_SHARED);
1842    conf->flags = block_state.flags.value;
1843    conf->name = xstrdup(block_state.name.buf);
1844    conf->user = xstrdup(block_state.user.buf);
# Line 1948 | Line 1922 | shared_type_item: KLINE
1922      block_state.flags.value = SHARED_ALL;
1923   };
1924  
1925 +
1926   /***************************************************************************
1927 < *  section cluster
1927 > * cluster {} section
1928   ***************************************************************************/
1929   cluster_entry: T_CLUSTER
1930   {
# Line 1972 | Line 1947 | cluster_entry: T_CLUSTER
1947    conf->name = xstrdup(block_state.name.buf);
1948   };
1949  
1950 < cluster_items:  cluster_items cluster_item | cluster_item;
1951 < cluster_item:   cluster_name | cluster_type | error ';' ;
1950 > cluster_items:  cluster_items cluster_item | cluster_item;
1951 > cluster_item:   cluster_name | cluster_type | error ';' ;
1952  
1953   cluster_name: NAME '=' QSTRING ';'
1954   {
# Line 1987 | Line 1962 | cluster_type: TYPE
1962      block_state.flags.value = 0;
1963   } '=' cluster_types ';' ;
1964  
1965 < cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1965 > cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1966   cluster_type_item: KLINE
1967   {
1968    if (conf_parser_ctx.pass == 2)
# Line 2030 | Line 2005 | cluster_type_item: KLINE
2005      block_state.flags.value = SHARED_ALL;
2006   };
2007  
2008 +
2009   /***************************************************************************
2010 < *  section connect
2010 > * connect {}  section
2011   ***************************************************************************/
2012 < connect_entry: CONNECT  
2012 > connect_entry: CONNECT
2013   {
2014  
2015    if (conf_parser_ctx.pass != 2)
2016      break;
2017  
2018    reset_block_state();
2019 +  block_state.aftype.value = AF_INET;
2020    block_state.port.value = PORTNUM;
2021   } '{' connect_items '}' ';'
2022   {
# Line 2091 | Line 2068 | connect_entry: CONNECT
2068        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf);
2069      else
2070      {
2071 <      assert(res != NULL);
2071 >      assert(res);
2072  
2073        memcpy(&conf->bind, res->ai_addr, res->ai_addrlen);
2074        conf->bind.ss.ss_family = res->ai_family;
# Line 2105 | Line 2082 | connect_entry: CONNECT
2082   };
2083  
2084   connect_items:  connect_items connect_item | connect_item;
2085 < connect_item:   connect_name | connect_host | connect_vhost |
2086 <                connect_send_password | connect_accept_password |
2087 <                connect_ssl_certificate_fingerprint |
2088 <                connect_aftype | connect_port | connect_ssl_cipher_list |
2089 <                connect_flags | connect_hub_mask | connect_leaf_mask |
2090 <                connect_class | connect_encrypted |
2085 > connect_item:   connect_name |
2086 >                connect_host |
2087 >                connect_vhost |
2088 >                connect_send_password |
2089 >                connect_accept_password |
2090 >                connect_ssl_certificate_fingerprint |
2091 >                connect_aftype |
2092 >                connect_port |
2093 >                connect_ssl_cipher_list |
2094 >                connect_flags |
2095 >                connect_hub_mask |
2096 >                connect_leaf_mask |
2097 >                connect_class |
2098 >                connect_encrypted |
2099                  error ';' ;
2100  
2101   connect_name: NAME '=' QSTRING ';'
# Line 2119 | Line 2104 | connect_name: NAME '=' QSTRING ';'
2104      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2105   };
2106  
2107 < connect_host: HOST '=' QSTRING ';'
2107 > connect_host: HOST '=' QSTRING ';'
2108   {
2109    if (conf_parser_ctx.pass == 2)
2110      strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf));
2111   };
2112  
2113 < connect_vhost: VHOST '=' QSTRING ';'
2113 > connect_vhost: VHOST '=' QSTRING ';'
2114   {
2115    if (conf_parser_ctx.pass == 2)
2116      strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf));
2117   };
2118 <
2118 >
2119   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2120   {
2121    if (conf_parser_ctx.pass != 2)
# Line 2138 | Line 2123 | connect_send_password: SEND_PASSWORD '='
2123  
2124    if ($3[0] == ':')
2125      conf_error_report("Server passwords cannot begin with a colon");
2126 <  else if (strchr($3, ' ') != NULL)
2126 >  else if (strchr($3, ' '))
2127      conf_error_report("Server passwords cannot contain spaces");
2128    else
2129      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
# Line 2151 | Line 2136 | connect_accept_password: ACCEPT_PASSWORD
2136  
2137    if ($3[0] == ':')
2138      conf_error_report("Server passwords cannot begin with a colon");
2139 <  else if (strchr($3, ' ') != NULL)
2139 >  else if (strchr($3, ' '))
2140      conf_error_report("Server passwords cannot contain spaces");
2141    else
2142      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2175 | Line 2160 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2160      block_state.aftype.value = AF_INET;
2161   } | AFTYPE '=' T_IPV6 ';'
2162   {
2178 #ifdef IPV6
2163    if (conf_parser_ctx.pass == 2)
2164      block_state.aftype.value = AF_INET6;
2181 #endif
2165   };
2166  
2167   connect_flags: IRCD_FLAGS
# Line 2208 | Line 2191 | connect_encrypted: ENCRYPTED '=' TBOOL '
2191    }
2192   };
2193  
2194 < connect_hub_mask: HUB_MASK '=' QSTRING ';'
2194 > connect_hub_mask: HUB_MASK '=' QSTRING ';'
2195   {
2196    if (conf_parser_ctx.pass == 2)
2197      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list);
2198   };
2199  
2200 < connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2200 > connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2201   {
2202    if (conf_parser_ctx.pass == 2)
2203      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list);
# Line 2228 | Line 2211 | connect_class: CLASS '=' QSTRING ';'
2211  
2212   connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2213   {
2214 < #ifdef HAVE_LIBCRYPTO
2214 > #ifdef HAVE_TLS
2215    if (conf_parser_ctx.pass == 2)
2216      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2217   #else
2218    if (conf_parser_ctx.pass == 2)
2219 <    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2219 >    conf_error_report("Ignoring connect::ciphers -- no TLS support");
2220   #endif
2221   };
2222  
2223  
2224   /***************************************************************************
2225 < *  section kill
2225 > * kill {} section
2226   ***************************************************************************/
2227   kill_entry: KILL
2228   {
# Line 2265 | Line 2248 | kill_entry: KILL
2248    else
2249      conf->reason = xstrdup(CONF_NOREASON);
2250    add_conf_by_address(CONF_KLINE, conf);
2251 < };
2251 > };
2252  
2253   kill_items:     kill_items kill_item | kill_item;
2254   kill_item:      kill_user | kill_reason | error;
# Line 2290 | Line 2273 | kill_user: USER '=' QSTRING ';'
2273    }
2274   };
2275  
2276 < kill_reason: REASON '=' QSTRING ';'
2276 > kill_reason: REASON '=' QSTRING ';'
2277   {
2278    if (conf_parser_ctx.pass == 2)
2279      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2280   };
2281  
2282 +
2283   /***************************************************************************
2284 < *  section deny
2284 > * deny {} section
2285   ***************************************************************************/
2286 < deny_entry: DENY
2286 > deny_entry: DENY
2287   {
2288    if (conf_parser_ctx.pass == 2)
2289      reset_block_state();
# Line 2324 | Line 2308 | deny_entry: DENY
2308        conf->reason = xstrdup(CONF_NOREASON);
2309      add_conf_by_address(CONF_DLINE, conf);
2310    }
2311 < };
2311 > };
2312  
2313   deny_items:     deny_items deny_item | deny_item;
2314   deny_item:      deny_ip | deny_reason | error;
# Line 2335 | Line 2319 | deny_ip: IP '=' QSTRING ';'
2319      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
2320   };
2321  
2322 < deny_reason: REASON '=' QSTRING ';'
2322 > deny_reason: REASON '=' QSTRING ';'
2323   {
2324    if (conf_parser_ctx.pass == 2)
2325      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2326   };
2327  
2328 +
2329   /***************************************************************************
2330 < *  section exempt
2330 > * exempt {} section
2331   ***************************************************************************/
2332   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2333  
2334 < exempt_items:     exempt_items exempt_item | exempt_item;
2335 < exempt_item:      exempt_ip | error;
2334 > exempt_items: exempt_items exempt_item | exempt_item;
2335 > exempt_item:  exempt_ip | error;
2336  
2337   exempt_ip: IP '=' QSTRING ';'
2338   {
2339    if (conf_parser_ctx.pass == 2)
2340    {
2341 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2341 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2342      {
2343        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2344        conf->host = xstrdup(yylval.string);
# Line 2364 | Line 2349 | exempt_ip: IP '=' QSTRING ';'
2349   };
2350  
2351   /***************************************************************************
2352 < *  section gecos
2352 > * gecos {} section
2353   ***************************************************************************/
2354   gecos_entry: GECOS
2355   {
# Line 2392 | Line 2377 | gecos_entry: GECOS
2377   gecos_items: gecos_items gecos_item | gecos_item;
2378   gecos_item:  gecos_name | gecos_reason | error;
2379  
2380 < gecos_name: NAME '=' QSTRING ';'
2380 > gecos_name: NAME '=' QSTRING ';'
2381   {
2382    if (conf_parser_ctx.pass == 2)
2383      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2384   };
2385  
2386 < gecos_reason: REASON '=' QSTRING ';'
2386 > gecos_reason: REASON '=' QSTRING ';'
2387   {
2388    if (conf_parser_ctx.pass == 2)
2389      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2390   };
2391  
2392 +
2393   /***************************************************************************
2394 < *  section general
2394 > * general {} section
2395   ***************************************************************************/
2396 < general_entry: GENERAL
2411 <  '{' general_items '}' ';';
2396 > general_entry: GENERAL '{' general_items '}' ';';
2397  
2398   general_items:      general_items general_item | general_item;
2399 < general_item:       general_hide_spoof_ips | general_ignore_bogus_ts |
2400 <                    general_failed_oper_notice | general_anti_nick_flood |
2401 <                    general_max_nick_time | general_max_nick_changes |
2402 <                    general_max_accept | general_anti_spam_exit_message_time |
2403 <                    general_ts_warn_delta | general_ts_max_delta |
2399 > general_item:       general_away_count |
2400 >                    general_away_time |
2401 >                    general_ignore_bogus_ts |
2402 >                    general_failed_oper_notice |
2403 >                    general_anti_nick_flood |
2404 >                    general_max_nick_time |
2405 >                    general_max_nick_changes |
2406 >                    general_max_accept |
2407 >                    general_anti_spam_exit_message_time |
2408 >                    general_ts_warn_delta |
2409 >                    general_ts_max_delta |
2410                      general_kill_chase_time_limit |
2411                      general_invisible_on_connect |
2412 <                    general_warn_no_nline | general_dots_in_ident |
2413 <                    general_stats_o_oper_only | general_stats_k_oper_only |
2414 <                    general_pace_wait | general_stats_i_oper_only |
2415 <                    general_pace_wait_simple | general_stats_P_oper_only |
2416 <                    general_short_motd | general_no_oper_flood |
2417 <                    general_true_no_oper_flood | general_oper_pass_resv |
2418 <                    general_oper_only_umodes | general_max_targets |
2419 <                    general_use_egd | general_egdpool_path |
2420 <                    general_oper_umodes | general_caller_id_wait |
2421 <                    general_opers_bypass_callerid | general_default_floodcount |
2422 <                    general_min_nonwildcard | general_min_nonwildcard_simple |
2423 <                    general_throttle_time | general_havent_read_conf |
2412 >                    general_warn_no_connect_block |
2413 >                    general_dots_in_ident |
2414 >                    general_stats_i_oper_only |
2415 >                    general_stats_k_oper_only |
2416 >                    general_stats_m_oper_only |
2417 >                    general_stats_o_oper_only |
2418 >                    general_stats_P_oper_only |
2419 >                    general_stats_u_oper_only |
2420 >                    general_pace_wait |
2421 >                    general_pace_wait_simple |
2422 >                    general_short_motd |
2423 >                    general_no_oper_flood |
2424 >                    general_oper_only_umodes |
2425 >                    general_max_targets |
2426 >                    general_oper_umodes |
2427 >                    general_caller_id_wait |
2428 >                    general_opers_bypass_callerid |
2429 >                    general_default_floodcount |
2430 >                    general_min_nonwildcard |
2431 >                    general_min_nonwildcard_simple |
2432 >                    general_throttle_count |
2433 >                    general_throttle_time |
2434                      general_ping_cookie |
2435 <                    general_disable_auth |
2436 <                    general_tkline_expire_notices | general_gline_enable |
2437 <                    general_gline_duration | general_gline_request_duration |
2438 <                    general_gline_min_cidr |
2439 <                    general_gline_min_cidr6 |
2440 <                    general_stats_e_disabled |
2441 <                    general_max_watch | general_services_name |
2442 <                    error;
2435 >                    general_disable_auth |
2436 >                    general_tkline_expire_notices |
2437 >                    general_dline_min_cidr |
2438 >                    general_dline_min_cidr6 |
2439 >                    general_kline_min_cidr |
2440 >                    general_kline_min_cidr6 |
2441 >                    general_stats_e_disabled |
2442 >                    general_max_watch |
2443 >                    general_cycle_on_host_change |
2444 >                    error;
2445  
2446  
2447 < general_max_watch: MAX_WATCH '=' NUMBER ';'
2447 > general_away_count: AWAY_COUNT '=' NUMBER ';'
2448   {
2449 <  ConfigFileEntry.max_watch = $3;
2449 >  ConfigGeneral.away_count = $3;
2450   };
2451  
2452 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2452 > general_away_time: AWAY_TIME '=' timespec ';'
2453   {
2454 <  if (conf_parser_ctx.pass == 2)
2452 <    ConfigFileEntry.glines = yylval.number;
2454 >  ConfigGeneral.away_time = $3;
2455   };
2456  
2457 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2457 > general_max_watch: MAX_WATCH '=' NUMBER ';'
2458   {
2459 <  if (conf_parser_ctx.pass == 2)
2458 <    ConfigFileEntry.gline_time = $3;
2459 >  ConfigGeneral.max_watch = $3;
2460   };
2461  
2462 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2462 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2463   {
2464    if (conf_parser_ctx.pass == 2)
2465 <    ConfigFileEntry.gline_request_time = $3;
2465 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2466   };
2467  
2468 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2468 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2469   {
2470 <  ConfigFileEntry.gline_min_cidr = $3;
2470 >  ConfigGeneral.dline_min_cidr = $3;
2471   };
2472  
2473 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2473 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2474   {
2475 <  ConfigFileEntry.gline_min_cidr6 = $3;
2475 >  ConfigGeneral.dline_min_cidr6 = $3;
2476   };
2477  
2478 < general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2478 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2479   {
2480 <  ConfigFileEntry.tkline_expire_notices = yylval.number;
2480 >  ConfigGeneral.kline_min_cidr = $3;
2481   };
2482  
2483 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2483 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2484   {
2485 <  ConfigFileEntry.kill_chase_time_limit = $3;
2485 >  ConfigGeneral.kline_min_cidr6 = $3;
2486   };
2487  
2488 < general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';'
2488 > general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2489   {
2490 <  ConfigFileEntry.hide_spoof_ips = yylval.number;
2490 >  ConfigGeneral.tkline_expire_notices = yylval.number;
2491 > };
2492 >
2493 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2494 > {
2495 >  ConfigGeneral.kill_chase_time_limit = $3;
2496   };
2497  
2498   general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2499   {
2500 <  ConfigFileEntry.ignore_bogus_ts = yylval.number;
2500 >  ConfigGeneral.ignore_bogus_ts = yylval.number;
2501   };
2502  
2503   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2504   {
2505 <  ConfigFileEntry.failed_oper_notice = yylval.number;
2505 >  ConfigGeneral.failed_oper_notice = yylval.number;
2506   };
2507  
2508   general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';'
2509   {
2510 <  ConfigFileEntry.anti_nick_flood = yylval.number;
2510 >  ConfigGeneral.anti_nick_flood = yylval.number;
2511   };
2512  
2513   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2514   {
2515 <  ConfigFileEntry.max_nick_time = $3;
2515 >  ConfigGeneral.max_nick_time = $3;
2516   };
2517  
2518   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
2519   {
2520 <  ConfigFileEntry.max_nick_changes = $3;
2520 >  ConfigGeneral.max_nick_changes = $3;
2521   };
2522  
2523   general_max_accept: MAX_ACCEPT '=' NUMBER ';'
2524   {
2525 <  ConfigFileEntry.max_accept = $3;
2525 >  ConfigGeneral.max_accept = $3;
2526   };
2527  
2528   general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';'
2529   {
2530 <  ConfigFileEntry.anti_spam_exit_message_time = $3;
2530 >  ConfigGeneral.anti_spam_exit_message_time = $3;
2531   };
2532  
2533   general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';'
2534   {
2535 <  ConfigFileEntry.ts_warn_delta = $3;
2535 >  ConfigGeneral.ts_warn_delta = $3;
2536   };
2537  
2538   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2539   {
2540    if (conf_parser_ctx.pass == 2)
2541 <    ConfigFileEntry.ts_max_delta = $3;
2541 >    ConfigGeneral.ts_max_delta = $3;
2542   };
2543  
2544 < general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2544 > general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2545   {
2546 <  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 <  }
2546 >  ConfigGeneral.invisible_on_connect = yylval.number;
2547   };
2548  
2549 < general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2549 > general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';'
2550   {
2551 <  ConfigFileEntry.invisible_on_connect = yylval.number;
2551 >  ConfigGeneral.warn_no_connect_block = yylval.number;
2552   };
2553  
2554 < general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';'
2554 > general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2555   {
2556 <  ConfigFileEntry.warn_no_nline = yylval.number;
2556 >  ConfigGeneral.stats_e_disabled = yylval.number;
2557   };
2558  
2559 < general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2559 > general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';'
2560   {
2561 <  ConfigFileEntry.stats_e_disabled = yylval.number;
2561 >  ConfigGeneral.stats_m_oper_only = yylval.number;
2562   };
2563  
2564   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2565   {
2566 <  ConfigFileEntry.stats_o_oper_only = yylval.number;
2566 >  ConfigGeneral.stats_o_oper_only = yylval.number;
2567   };
2568  
2569   general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';'
2570   {
2571 <  ConfigFileEntry.stats_P_oper_only = yylval.number;
2571 >  ConfigGeneral.stats_P_oper_only = yylval.number;
2572 > };
2573 >
2574 > general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2575 > {
2576 >  ConfigGeneral.stats_u_oper_only = yylval.number;
2577   };
2578  
2579   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2580   {
2581 <  ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
2581 >  ConfigGeneral.stats_k_oper_only = 2 * yylval.number;
2582   } | STATS_K_OPER_ONLY '=' TMASKED ';'
2583   {
2584 <  ConfigFileEntry.stats_k_oper_only = 1;
2584 >  ConfigGeneral.stats_k_oper_only = 1;
2585   };
2586  
2587   general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';'
2588   {
2589 <  ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
2589 >  ConfigGeneral.stats_i_oper_only = 2 * yylval.number;
2590   } | STATS_I_OPER_ONLY '=' TMASKED ';'
2591   {
2592 <  ConfigFileEntry.stats_i_oper_only = 1;
2592 >  ConfigGeneral.stats_i_oper_only = 1;
2593   };
2594  
2595   general_pace_wait: PACE_WAIT '=' timespec ';'
2596   {
2597 <  ConfigFileEntry.pace_wait = $3;
2597 >  ConfigGeneral.pace_wait = $3;
2598   };
2599  
2600   general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';'
2601   {
2602 <  ConfigFileEntry.caller_id_wait = $3;
2602 >  ConfigGeneral.caller_id_wait = $3;
2603   };
2604  
2605   general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';'
2606   {
2607 <  ConfigFileEntry.opers_bypass_callerid = yylval.number;
2607 >  ConfigGeneral.opers_bypass_callerid = yylval.number;
2608   };
2609  
2610   general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';'
2611   {
2612 <  ConfigFileEntry.pace_wait_simple = $3;
2612 >  ConfigGeneral.pace_wait_simple = $3;
2613   };
2614  
2615   general_short_motd: SHORT_MOTD '=' TBOOL ';'
2616   {
2617 <  ConfigFileEntry.short_motd = yylval.number;
2613 < };
2614 <  
2615 < general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2616 < {
2617 <  ConfigFileEntry.no_oper_flood = yylval.number;
2617 >  ConfigGeneral.short_motd = yylval.number;
2618   };
2619  
2620 < 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 ';'
2620 > general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2621   {
2622 <  ConfigFileEntry.oper_pass_resv = yylval.number;
2622 >  ConfigGeneral.no_oper_flood = yylval.number;
2623   };
2624  
2625   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2626   {
2627 <  ConfigFileEntry.dots_in_ident = $3;
2627 >  ConfigGeneral.dots_in_ident = $3;
2628   };
2629  
2630   general_max_targets: MAX_TARGETS '=' NUMBER ';'
2631   {
2632 <  ConfigFileEntry.max_targets = $3;
2632 >  ConfigGeneral.max_targets = $3;
2633   };
2634  
2635 < general_use_egd: USE_EGD '=' TBOOL ';'
2641 < {
2642 <  ConfigFileEntry.use_egd = yylval.number;
2643 < };
2644 <
2645 < 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 ';'
2635 > general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2636   {
2637 <  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2657 <  {
2658 <    MyFree(ConfigFileEntry.service_name);
2659 <    ConfigFileEntry.service_name = xstrdup(yylval.string);
2660 <  }
2637 >  ConfigGeneral.ping_cookie = yylval.number;
2638   };
2639  
2640 < general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2640 > general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2641   {
2642 <  ConfigFileEntry.ping_cookie = yylval.number;
2642 >  ConfigGeneral.disable_auth = yylval.number;
2643   };
2644  
2645 < general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2645 > general_throttle_count: THROTTLE_COUNT '=' NUMBER ';'
2646   {
2647 <  ConfigFileEntry.disable_auth = yylval.number;
2647 >  ConfigGeneral.throttle_count = $3;
2648   };
2649  
2650   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2651   {
2652 <  ConfigFileEntry.throttle_time = yylval.number;
2652 >  ConfigGeneral.throttle_time = $3;
2653   };
2654  
2655   general_oper_umodes: OPER_UMODES
2656   {
2657 <  ConfigFileEntry.oper_umodes = 0;
2657 >  ConfigGeneral.oper_umodes = 0;
2658   } '='  umode_oitems ';' ;
2659  
2660   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2661   umode_oitem:     T_BOTS
2662   {
2663 <  ConfigFileEntry.oper_umodes |= UMODE_BOTS;
2663 >  ConfigGeneral.oper_umodes |= UMODE_BOTS;
2664   } | T_CCONN
2665   {
2666 <  ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2666 >  ConfigGeneral.oper_umodes |= UMODE_CCONN;
2667   } | T_DEAF
2668   {
2669 <  ConfigFileEntry.oper_umodes |= UMODE_DEAF;
2669 >  ConfigGeneral.oper_umodes |= UMODE_DEAF;
2670   } | T_DEBUG
2671   {
2672 <  ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
2672 >  ConfigGeneral.oper_umodes |= UMODE_DEBUG;
2673   } | T_FULL
2674   {
2675 <  ConfigFileEntry.oper_umodes |= UMODE_FULL;
2675 >  ConfigGeneral.oper_umodes |= UMODE_FULL;
2676   } | HIDDEN
2677   {
2678 <  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2678 >  ConfigGeneral.oper_umodes |= UMODE_HIDDEN;
2679 > } | HIDE_CHANS
2680 > {
2681 >  ConfigGeneral.oper_umodes |= UMODE_HIDECHANS;
2682 > } | HIDE_IDLE
2683 > {
2684 >  ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE;
2685   } | T_SKILL
2686   {
2687 <  ConfigFileEntry.oper_umodes |= UMODE_SKILL;
2687 >  ConfigGeneral.oper_umodes |= UMODE_SKILL;
2688   } | T_NCHANGE
2689   {
2690 <  ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
2690 >  ConfigGeneral.oper_umodes |= UMODE_NCHANGE;
2691   } | T_REJ
2692   {
2693 <  ConfigFileEntry.oper_umodes |= UMODE_REJ;
2693 >  ConfigGeneral.oper_umodes |= UMODE_REJ;
2694   } | T_UNAUTH
2695   {
2696 <  ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
2696 >  ConfigGeneral.oper_umodes |= UMODE_UNAUTH;
2697   } | T_SPY
2698   {
2699 <  ConfigFileEntry.oper_umodes |= UMODE_SPY;
2699 >  ConfigGeneral.oper_umodes |= UMODE_SPY;
2700   } | T_EXTERNAL
2701   {
2702 <  ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
2720 < } | T_OPERWALL
2721 < {
2722 <  ConfigFileEntry.oper_umodes |= UMODE_OPERWALL;
2702 >  ConfigGeneral.oper_umodes |= UMODE_EXTERNAL;
2703   } | T_SERVNOTICE
2704   {
2705 <  ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
2705 >  ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE;
2706   } | T_INVISIBLE
2707   {
2708 <  ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
2708 >  ConfigGeneral.oper_umodes |= UMODE_INVISIBLE;
2709   } | T_WALLOP
2710   {
2711 <  ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
2711 >  ConfigGeneral.oper_umodes |= UMODE_WALLOP;
2712   } | T_SOFTCALLERID
2713   {
2714 <  ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
2714 >  ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID;
2715   } | T_CALLERID
2716   {
2717 <  ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
2717 >  ConfigGeneral.oper_umodes |= UMODE_CALLERID;
2718   } | T_LOCOPS
2719   {
2720 <  ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2720 >  ConfigGeneral.oper_umodes |= UMODE_LOCOPS;
2721   } | T_NONONREG
2722   {
2723 <  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2723 >  ConfigGeneral.oper_umodes |= UMODE_REGONLY;
2724   } | T_FARCONNECT
2725   {
2726 <  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2726 >  ConfigGeneral.oper_umodes |= UMODE_FARCONNECT;
2727   };
2728  
2729 < general_oper_only_umodes: OPER_ONLY_UMODES
2729 > general_oper_only_umodes: OPER_ONLY_UMODES
2730   {
2731 <  ConfigFileEntry.oper_only_umodes = 0;
2731 >  ConfigGeneral.oper_only_umodes = 0;
2732   } '='  umode_items ';' ;
2733  
2734 < umode_items:    umode_items ',' umode_item | umode_item;
2735 < umode_item:     T_BOTS
2734 > umode_items:  umode_items ',' umode_item | umode_item;
2735 > umode_item:   T_BOTS
2736   {
2737 <  ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2737 >  ConfigGeneral.oper_only_umodes |= UMODE_BOTS;
2738   } | T_CCONN
2739   {
2740 <  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2740 >  ConfigGeneral.oper_only_umodes |= UMODE_CCONN;
2741   } | T_DEAF
2742   {
2743 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
2743 >  ConfigGeneral.oper_only_umodes |= UMODE_DEAF;
2744   } | T_DEBUG
2745   {
2746 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2746 >  ConfigGeneral.oper_only_umodes |= UMODE_DEBUG;
2747   } | T_FULL
2748 < {
2749 <  ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2748 > {
2749 >  ConfigGeneral.oper_only_umodes |= UMODE_FULL;
2750   } | T_SKILL
2751   {
2752 <  ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2752 >  ConfigGeneral.oper_only_umodes |= UMODE_SKILL;
2753   } | HIDDEN
2754   {
2755 <  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2755 >  ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN;
2756   } | T_NCHANGE
2757   {
2758 <  ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
2758 >  ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE;
2759   } | T_REJ
2760   {
2761 <  ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
2761 >  ConfigGeneral.oper_only_umodes |= UMODE_REJ;
2762   } | T_UNAUTH
2763   {
2764 <  ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
2764 >  ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH;
2765   } | T_SPY
2766   {
2767 <  ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
2767 >  ConfigGeneral.oper_only_umodes |= UMODE_SPY;
2768   } | T_EXTERNAL
2769   {
2770 <  ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
2791 < } | T_OPERWALL
2792 < {
2793 <  ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL;
2770 >  ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL;
2771   } | T_SERVNOTICE
2772   {
2773 <  ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
2773 >  ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE;
2774   } | T_INVISIBLE
2775   {
2776 <  ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
2776 >  ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE;
2777   } | T_WALLOP
2778   {
2779 <  ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
2779 >  ConfigGeneral.oper_only_umodes |= UMODE_WALLOP;
2780   } | T_SOFTCALLERID
2781   {
2782 <  ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
2782 >  ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID;
2783   } | T_CALLERID
2784   {
2785 <  ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
2785 >  ConfigGeneral.oper_only_umodes |= UMODE_CALLERID;
2786   } | T_LOCOPS
2787   {
2788 <  ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2788 >  ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS;
2789   } | T_NONONREG
2790   {
2791 <  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2791 >  ConfigGeneral.oper_only_umodes |= UMODE_REGONLY;
2792   } | T_FARCONNECT
2793   {
2794 <  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2794 >  ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT;
2795   };
2796  
2797   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
2798   {
2799 <  ConfigFileEntry.min_nonwildcard = $3;
2799 >  ConfigGeneral.min_nonwildcard = $3;
2800   };
2801  
2802   general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';'
2803   {
2804 <  ConfigFileEntry.min_nonwildcard_simple = $3;
2804 >  ConfigGeneral.min_nonwildcard_simple = $3;
2805   };
2806  
2807   general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';'
2808   {
2809 <  ConfigFileEntry.default_floodcount = $3;
2809 >  ConfigGeneral.default_floodcount = $3;
2810   };
2811  
2812  
2813   /***************************************************************************
2814 < *  section channel
2814 > * channel {} section
2815   ***************************************************************************/
2816 < channel_entry: CHANNEL
2840 <  '{' channel_items '}' ';';
2816 > channel_entry: CHANNEL '{' channel_items '}' ';';
2817  
2818   channel_items:      channel_items channel_item | channel_item;
2819   channel_item:       channel_max_bans |
2820 <                    channel_knock_delay | channel_knock_delay_channel |
2821 <                    channel_max_chans_per_user | channel_max_chans_per_oper |
2822 <                    channel_default_split_user_count |
2823 <                    channel_default_split_server_count |
2824 <                    channel_no_create_on_split |
2825 <                    channel_no_join_on_split |
2826 <                    channel_jflood_count | channel_jflood_time |
2827 <                    channel_disable_fake_channels | error;
2820 >                    channel_invite_client_count |
2821 >                    channel_invite_client_time |
2822 >                    channel_invite_delay_channel |
2823 >                    channel_knock_client_count |
2824 >                    channel_knock_client_time |
2825 >                    channel_knock_delay_channel |
2826 >                    channel_max_channels |
2827 >                    channel_default_join_flood_count |
2828 >                    channel_default_join_flood_time |
2829 >                    channel_disable_fake_channels |
2830 >                    error;
2831  
2832   channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
2833   {
2834    ConfigChannel.disable_fake_channels = yylval.number;
2835   };
2836  
2837 < channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2837 > channel_invite_client_count: INVITE_CLIENT_COUNT '=' NUMBER ';'
2838   {
2839 <  ConfigChannel.knock_delay = $3;
2839 >  ConfigChannel.invite_client_count = $3;
2840   };
2841  
2842 < channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2842 > channel_invite_client_time: INVITE_CLIENT_TIME '=' timespec ';'
2843   {
2844 <  ConfigChannel.knock_delay_channel = $3;
2844 >  ConfigChannel.invite_client_time = $3;
2845   };
2846  
2847 < channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';'
2847 > channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';'
2848   {
2849 <  ConfigChannel.max_chans_per_user = $3;
2849 >  ConfigChannel.invite_delay_channel = $3;
2850   };
2851  
2852 < channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';'
2852 > channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2853   {
2854 <  ConfigChannel.max_chans_per_oper = $3;
2854 >  ConfigChannel.knock_client_count = $3;
2855   };
2856  
2857 < channel_max_bans: MAX_BANS '=' NUMBER ';'
2857 > channel_knock_client_time: KNOCK_CLIENT_TIME '=' timespec ';'
2858   {
2859 <  ConfigChannel.max_bans = $3;
2859 >  ConfigChannel.knock_client_time = $3;
2860   };
2861  
2862 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
2862 > channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2863   {
2864 <  ConfigChannel.default_split_user_count = $3;
2864 >  ConfigChannel.knock_delay_channel = $3;
2865   };
2866  
2867 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
2867 > channel_max_channels: MAX_CHANNELS '=' NUMBER ';'
2868   {
2869 <  ConfigChannel.default_split_server_count = $3;
2869 >  ConfigChannel.max_channels = $3;
2870   };
2871  
2872 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2872 > channel_max_bans: MAX_BANS '=' NUMBER ';'
2873   {
2874 <  ConfigChannel.no_create_on_split = yylval.number;
2874 >  ConfigChannel.max_bans = $3;
2875   };
2876  
2877 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2877 > channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2878   {
2879 <  ConfigChannel.no_join_on_split = yylval.number;
2879 >  ConfigChannel.default_join_flood_count = yylval.number;
2880   };
2881  
2882 < channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2882 > channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';'
2883   {
2884 <  GlobalSetOptions.joinfloodcount = yylval.number;
2884 >  ConfigChannel.default_join_flood_time = $3;
2885   };
2886  
2908 channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
2909 {
2910  GlobalSetOptions.joinfloodtime = yylval.number;
2911 };
2887  
2888   /***************************************************************************
2889 < *  section serverhide
2889 > * serverhide {} section
2890   ***************************************************************************/
2891 < serverhide_entry: SERVERHIDE
2917 <  '{' serverhide_items '}' ';';
2891 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
2892  
2893   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2894 < serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
2894 > serverhide_item:    serverhide_flatten_links |
2895 >                    serverhide_flatten_links_delay |
2896 >                    serverhide_flatten_links_file |
2897 >                    serverhide_disable_remote_commands |
2898                      serverhide_hide_servers |
2899 <                    serverhide_hide_services |
2900 <                    serverhide_links_delay |
2901 <                    serverhide_hidden | serverhide_hidden_name |
2902 <                    serverhide_hide_server_ips |
2899 >                    serverhide_hide_services |
2900 >                    serverhide_hidden |
2901 >                    serverhide_hidden_name |
2902 >                    serverhide_hide_server_ips |
2903                      error;
2904  
2905   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
# Line 2931 | Line 2908 | serverhide_flatten_links: FLATTEN_LINKS
2908      ConfigServerHide.flatten_links = yylval.number;
2909   };
2910  
2911 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
2912 + {
2913 +  if (conf_parser_ctx.pass == 2)
2914 +  {
2915 +    if ($3 > 0)
2916 +    {
2917 +      event_write_links_file.when = $3;
2918 +      event_add(&event_write_links_file, NULL);
2919 +    }
2920 +    else
2921 +     event_delete(&event_write_links_file);
2922 +
2923 +    ConfigServerHide.flatten_links_delay = $3;
2924 +  }
2925 + };
2926 +
2927 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
2928 + {
2929 +  if (conf_parser_ctx.pass == 2)
2930 +  {
2931 +    xfree(ConfigServerHide.flatten_links_file);
2932 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
2933 +  }
2934 + };
2935 +
2936   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2937   {
2938    if (conf_parser_ctx.pass == 2)
# Line 2953 | Line 2955 | serverhide_hidden_name: HIDDEN_NAME '='
2955   {
2956    if (conf_parser_ctx.pass == 2)
2957    {
2958 <    MyFree(ConfigServerHide.hidden_name);
2958 >    xfree(ConfigServerHide.hidden_name);
2959      ConfigServerHide.hidden_name = xstrdup(yylval.string);
2960    }
2961   };
2962  
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
2963   serverhide_hidden: HIDDEN '=' TBOOL ';'
2964   {
2965    if (conf_parser_ctx.pass == 2)

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)