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 5602 by michael, Mon Feb 23 21:04:46 2015 UTC vs.
Revision 8792 by michael, Thu Jan 17 18:35:32 2019 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2000-2015 ircd-hybrid development team
4 > *  Copyright (c) 2000-2019 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 27 | Line 27
27  
28   %{
29  
30 #define YY_NO_UNPUT
31 #include <sys/types.h>
32 #include <string.h>
33
30   #include "config.h"
31   #include "stdinc.h"
32   #include "ircd.h"
33   #include "list.h"
34 + #include "parse.h"
35   #include "conf.h"
36   #include "conf_class.h"
37 + #include "conf_cluster.h"
38 + #include "conf_gecos.h"
39   #include "conf_pseudo.h"
40 + #include "conf_resv.h"
41 + #include "conf_service.h"
42 + #include "conf_shared.h"
43   #include "event.h"
44 + #include "id.h"
45   #include "log.h"
43 #include "client.h"     /* for UMODE_ALL only */
46   #include "irc_string.h"
47   #include "memory.h"
48   #include "modules.h"
49   #include "server.h"
50   #include "hostmask.h"
49 #include "send.h"
51   #include "listener.h"
51 #include "resv.h"
52 #include "numeric.h"
52   #include "user.h"
53   #include "motd.h"
54  
56 #ifdef HAVE_LIBCRYPTO
57 #include <openssl/rsa.h>
58 #include <openssl/bio.h>
59 #include <openssl/pem.h>
60 #include <openssl/dh.h>
61 #endif
62
63 #include "rsa.h"
64
55   int yylex(void);
56  
57   static struct
# Line 103 | Line 93 | static struct
93      port,
94      aftype,
95      ping_freq,
96 <    max_perip,
96 >    max_perip_local,
97 >    max_perip_global,
98      con_freq,
99      min_idle,
100      max_idle,
101      max_total,
111    max_global,
112    max_local,
113    max_ident,
102      max_sendq,
103      max_recvq,
104      max_channels,
# Line 126 | Line 114 | reset_block_state(void)
114  
115    DLINK_FOREACH_SAFE(node, node_next, block_state.mask.list.head)
116    {
117 <    MyFree(node->data);
117 >    xfree(node->data);
118      dlinkDelete(node, &block_state.mask.list);
119      free_dlink_node(node);
120    }
121  
122    DLINK_FOREACH_SAFE(node, node_next, block_state.leaf.list.head)
123    {
124 <    MyFree(node->data);
124 >    xfree(node->data);
125      dlinkDelete(node, &block_state.leaf.list);
126      free_dlink_node(node);
127    }
128  
129    DLINK_FOREACH_SAFE(node, node_next, block_state.hub.list.head)
130    {
131 <    MyFree(node->data);
131 >    xfree(node->data);
132      dlinkDelete(node, &block_state.hub.list);
133      free_dlink_node(node);
134    }
# Line 170 | Line 158 | reset_block_state(void)
158   %token  CIDR_BITLEN_IPV4
159   %token  CIDR_BITLEN_IPV6
160   %token  CLASS
161 + %token  CLOSE
162   %token  CONNECT
163   %token  CONNECTFREQ
164   %token  CYCLE_ON_HOST_CHANGE
165   %token  DEFAULT_FLOODCOUNT
166 + %token  DEFAULT_FLOODTIME
167   %token  DEFAULT_JOIN_FLOOD_COUNT
168   %token  DEFAULT_JOIN_FLOOD_TIME
169   %token  DEFAULT_MAX_CLIENTS
180 %token  DEFAULT_SPLIT_SERVER_COUNT
181 %token  DEFAULT_SPLIT_USER_COUNT
170   %token  DENY
171   %token  DESCRIPTION
172   %token  DIE
173   %token  DISABLE_AUTH
174   %token  DISABLE_FAKE_CHANNELS
175   %token  DISABLE_REMOTE_COMMANDS
176 + %token  DLINE_MIN_CIDR
177 + %token  DLINE_MIN_CIDR6
178   %token  DOTS_IN_IDENT
179   %token  EMAIL
180   %token  ENCRYPTED
# Line 192 | Line 182 | reset_block_state(void)
182   %token  EXEMPT
183   %token  FAILED_OPER_NOTICE
184   %token  FLATTEN_LINKS
185 + %token  FLATTEN_LINKS_DELAY
186 + %token  FLATTEN_LINKS_FILE
187   %token  GECOS
188   %token  GENERAL
197 %token  GLINE
198 %token  GLINE_DURATION
199 %token  GLINE_ENABLE
200 %token  GLINE_EXEMPT
201 %token  GLINE_MIN_CIDR
202 %token  GLINE_MIN_CIDR6
203 %token  GLINE_REQUEST_DURATION
204 %token  GLOBAL_KILL
205 %token  HAVENT_READ_CONF
189   %token  HIDDEN
190   %token  HIDDEN_NAME
191   %token  HIDE_CHANS
# Line 211 | Line 194 | reset_block_state(void)
194   %token  HIDE_SERVER_IPS
195   %token  HIDE_SERVERS
196   %token  HIDE_SERVICES
214 %token  HIDE_SPOOF_IPS
197   %token  HOST
198   %token  HUB
199   %token  HUB_MASK
218 %token  IGNORE_BOGUS_TS
200   %token  INVISIBLE_ON_CONNECT
201   %token  INVITE_CLIENT_COUNT
202   %token  INVITE_CLIENT_TIME
203 + %token  INVITE_DELAY_CHANNEL
204 + %token  INVITE_EXPIRE_TIME
205   %token  IP
206   %token  IRCD_AUTH
207   %token  IRCD_FLAGS
208   %token  IRCD_SID
209 + %token  JOIN
210   %token  KILL
211   %token  KILL_CHASE_TIME_LIMIT
212   %token  KLINE
213   %token  KLINE_EXEMPT
214 + %token  KLINE_MIN_CIDR
215 + %token  KLINE_MIN_CIDR6
216   %token  KNOCK_CLIENT_COUNT
217   %token  KNOCK_CLIENT_TIME
218   %token  KNOCK_DELAY_CHANNEL
219   %token  LEAF_MASK
234 %token  LINKS_DELAY
220   %token  LISTEN
221   %token  MASK
222   %token  MAX_ACCEPT
223   %token  MAX_BANS
224 + %token  MAX_BANS_LARGE
225   %token  MAX_CHANNELS
240 %token  MAX_GLOBAL
241 %token  MAX_IDENT
226   %token  MAX_IDLE
227 < %token  MAX_LOCAL
227 > %token  MAX_INVITES
228   %token  MAX_NICK_CHANGES
229   %token  MAX_NICK_LENGTH
230   %token  MAX_NICK_TIME
# Line 260 | Line 244 | reset_block_state(void)
244   %token  NETWORK_DESC
245   %token  NETWORK_NAME
246   %token  NICK
263 %token  NO_CREATE_ON_SPLIT
264 %token  NO_JOIN_ON_SPLIT
247   %token  NO_OPER_FLOOD
248   %token  NO_TILDE
249   %token  NUMBER
250   %token  NUMBER_PER_CIDR
251 < %token  NUMBER_PER_IP
251 > %token  NUMBER_PER_IP_GLOBAL
252 > %token  NUMBER_PER_IP_LOCAL
253   %token  OPER_ONLY_UMODES
271 %token  OPER_PASS_RESV
254   %token  OPER_UMODES
255   %token  OPERATOR
256   %token  OPERS_BYPASS_CALLERID
# Line 290 | Line 272 | reset_block_state(void)
272   %token  RESV
273   %token  RESV_EXEMPT
274   %token  RSA_PRIVATE_KEY_FILE
293 %token  RSA_PUBLIC_KEY_FILE
275   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
276   %token  SEND_PASSWORD
277   %token  SENDQ
# Line 377 | Line 358 | reset_block_state(void)
358   %token  VHOST6
359   %token  WARN_NO_CONNECT_BLOCK
360   %token  WHOIS
361 + %token  WHOWAS_HISTORY_LENGTH
362   %token  XLINE
363 + %token  XLINE_EXEMPT
364  
365   %type  <string> QSTRING
366   %type  <number> NUMBER
# Line 438 | Line 421 | sizespec:   NUMBER sizespec_ { $$ = $1 +
421  
422  
423   /***************************************************************************
424 < *  section modules
424 > * modules {} section
425   ***************************************************************************/
426 < modules_entry: MODULES
444 <  '{' modules_items '}' ';';
426 > modules_entry: MODULES '{' modules_items '}' ';';
427  
428   modules_items:  modules_items modules_item | modules_item;
429   modules_item:   modules_module | modules_path | error ';' ;
# Line 459 | Line 441 | modules_path: PATH '=' QSTRING ';'
441   };
442  
443  
444 + /***************************************************************************
445 + * serverinfo {}  section
446 + ***************************************************************************/
447   serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
448  
449   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
# Line 484 | Line 469 | serverinfo_item:        serverinfo_name
469  
470   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
471   {
487 #ifdef HAVE_LIBCRYPTO
472    if (conf_parser_ctx.pass == 2)
473    {
474 <    if (!ConfigServerInfo.rsa_private_key_file)
475 <    {
492 <      conf_error_report("No rsa_private_key_file specified, SSL disabled");
493 <      break;
494 <    }
495 <
496 <    if (SSL_CTX_use_certificate_chain_file(ConfigServerInfo.server_ctx, yylval.string) <= 0 ||
497 <        SSL_CTX_use_certificate_chain_file(ConfigServerInfo.client_ctx, yylval.string) <= 0)
498 <    {
499 <      report_crypto_errors();
500 <      conf_error_report("Could not open/read certificate file");
501 <      break;
502 <    }
503 <
504 <    if (SSL_CTX_use_PrivateKey_file(ConfigServerInfo.server_ctx, ConfigServerInfo.rsa_private_key_file,
505 <                                    SSL_FILETYPE_PEM) <= 0 ||
506 <        SSL_CTX_use_PrivateKey_file(ConfigServerInfo.client_ctx, ConfigServerInfo.rsa_private_key_file,
507 <                                    SSL_FILETYPE_PEM) <= 0)
508 <    {
509 <      report_crypto_errors();
510 <      conf_error_report("Could not read RSA private key");
511 <      break;
512 <    }
513 <
514 <    if (!SSL_CTX_check_private_key(ConfigServerInfo.server_ctx) ||
515 <        !SSL_CTX_check_private_key(ConfigServerInfo.client_ctx))
516 <    {
517 <      report_crypto_errors();
518 <      conf_error_report("Could not read RSA private key");
519 <      break;
520 <    }
474 >    xfree(ConfigServerInfo.ssl_certificate_file);
475 >    ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string);
476    }
522 #endif
477   };
478  
479   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
480   {
481 < #ifdef HAVE_LIBCRYPTO
528 <  BIO *file = NULL;
529 <
530 <  if (conf_parser_ctx.pass != 1)
531 <    break;
532 <
533 <  if (ConfigServerInfo.rsa_private_key)
534 <  {
535 <    RSA_free(ConfigServerInfo.rsa_private_key);
536 <    ConfigServerInfo.rsa_private_key = NULL;
537 <  }
538 <
539 <  if (ConfigServerInfo.rsa_private_key_file)
540 <  {
541 <    MyFree(ConfigServerInfo.rsa_private_key_file);
542 <    ConfigServerInfo.rsa_private_key_file = NULL;
543 <  }
544 <
545 <  ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
546 <
547 <  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
548 <  {
549 <    conf_error_report("File open failed, ignoring");
550 <    break;
551 <  }
552 <
553 <  ConfigServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
554 <
555 <  BIO_set_close(file, BIO_CLOSE);
556 <  BIO_free(file);
557 <
558 <  if (ConfigServerInfo.rsa_private_key == NULL)
559 <  {
560 <    conf_error_report("Couldn't extract key, ignoring");
561 <    break;
562 <  }
563 <
564 <  if (!RSA_check_key(ConfigServerInfo.rsa_private_key))
565 <  {
566 <    RSA_free(ConfigServerInfo.rsa_private_key);
567 <    ConfigServerInfo.rsa_private_key = NULL;
568 <
569 <    conf_error_report("Invalid key, ignoring");
570 <    break;
571 <  }
572 <
573 <  if (RSA_size(ConfigServerInfo.rsa_private_key) < 128)
481 >  if (conf_parser_ctx.pass == 2)
482    {
483 <    RSA_free(ConfigServerInfo.rsa_private_key);
484 <    ConfigServerInfo.rsa_private_key = NULL;
577 <
578 <    conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 1024 bit key size");
483 >    xfree(ConfigServerInfo.rsa_private_key_file);
484 >    ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
485    }
580 #endif
486   };
487  
488   serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
489   {
585 #ifdef HAVE_LIBCRYPTO
490    if (conf_parser_ctx.pass == 2)
491    {
492 <    BIO *file = BIO_new_file(yylval.string, "r");
493 <
590 <    if (file)
591 <    {
592 <      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
593 <
594 <      BIO_free(file);
595 <
596 <      if (dh)
597 <      {
598 <        if (DH_size(dh) < 128)
599 <          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
600 <        else
601 <          SSL_CTX_set_tmp_dh(ConfigServerInfo.server_ctx, dh);
602 <
603 <        DH_free(dh);
604 <      }
605 <    }
606 <    else
607 <      conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- could not open/read Diffie-Hellman parameter file");
492 >    xfree(ConfigServerInfo.ssl_dh_param_file);
493 >    ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string);
494    }
609 #endif
495   };
496  
497   serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
498   {
614 #ifdef HAVE_LIBCRYPTO
499    if (conf_parser_ctx.pass == 2)
500 <    SSL_CTX_set_cipher_list(ConfigServerInfo.server_ctx, yylval.string);
501 < #endif
500 >  {
501 >    xfree(ConfigServerInfo.ssl_cipher_list);
502 >    ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string);
503 >  }
504   };
505  
506   serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
507   {
622 #ifdef HAVE_LIBCRYPTO
508    if (conf_parser_ctx.pass == 2)
509    {
510 <    if ((ConfigServerInfo.message_digest_algorithm = EVP_get_digestbyname(yylval.string)) == NULL)
511 <    {
627 <      ConfigServerInfo.message_digest_algorithm = EVP_sha256();
628 <      conf_error_report("Ignoring serverinfo::ssl_message_digest_algorithm -- unknown message digest algorithm");
629 <    }
510 >    xfree(ConfigServerInfo.ssl_message_digest_algorithm);
511 >    ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string);
512    }
631 #endif
513   }
514  
515   serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
516   {
636 #ifdef HAVE_LIBCRYPTO
637 #if OPENSSL_VERSION_NUMBER >= 0x009080FFL && !defined(OPENSSL_NO_ECDH)
638  int nid = 0;
639  EC_KEY *key = NULL;
640
517    if (conf_parser_ctx.pass == 2)
518    {
519 <    if ((nid = OBJ_sn2nid(yylval.string)) == 0)
520 <    {
521 <        conf_error_report("Ignoring serverinfo::serverinfo_ssl_dh_elliptic_curve -- unknown curve name");
646 <        break;
647 <    }
648 <
649 <    if ((key = EC_KEY_new_by_curve_name(nid)) == NULL)
650 <    {
651 <      conf_error_report("Ignoring serverinfo::serverinfo_ssl_dh_elliptic_curve -- could not create curve");
652 <      break;
653 <    }
654 <
655 <    SSL_CTX_set_tmp_ecdh(ConfigServerInfo.server_ctx, key);
656 <    EC_KEY_free(key);
657 < }
658 < #endif
659 < #endif
519 >    xfree(ConfigServerInfo.ssl_dh_elliptic_curve);
520 >    ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string);
521 >  }
522   };
523  
524   serverinfo_name: NAME '=' QSTRING ';'
525   {
526 <  /* this isn't rehashable */
526 >  /* This isn't rehashable */
527    if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
528    {
529 <    if (valid_servname(yylval.string))
529 >    if (server_valid_name(yylval.string) == true)
530        ConfigServerInfo.name = xstrdup(yylval.string);
531      else
532      {
533        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
534 <      exit(0);
534 >      exit(EXIT_FAILURE);
535      }
536    }
537   };
538  
539   serverinfo_sid: IRCD_SID '=' QSTRING ';'
540   {
541 <  /* this isn't rehashable */
541 >  /* This isn't rehashable */
542    if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
543    {
544      if (valid_sid(yylval.string))
# Line 684 | Line 546 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
546      else
547      {
548        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
549 <      exit(0);
549 >      exit(EXIT_FAILURE);
550      }
551    }
552   };
# Line 693 | Line 555 | serverinfo_description: DESCRIPTION '='
555   {
556    if (conf_parser_ctx.pass == 2)
557    {
558 <    MyFree(ConfigServerInfo.description);
558 >    xfree(ConfigServerInfo.description);
559      ConfigServerInfo.description = xstrdup(yylval.string);
560      strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
561    }
# Line 708 | Line 570 | serverinfo_network_name: NETWORK_NAME '=
570      if ((p = strchr(yylval.string, ' ')))
571        *p = '\0';
572  
573 <    MyFree(ConfigServerInfo.network_name);
573 >    xfree(ConfigServerInfo.network_name);
574      ConfigServerInfo.network_name = xstrdup(yylval.string);
575    }
576   };
# Line 718 | Line 580 | serverinfo_network_desc: NETWORK_DESC '=
580    if (conf_parser_ctx.pass != 2)
581      break;
582  
583 <  MyFree(ConfigServerInfo.network_desc);
583 >  xfree(ConfigServerInfo.network_desc);
584    ConfigServerInfo.network_desc = xstrdup(yylval.string);
585   };
586  
# Line 783 | Line 645 | serverinfo_default_max_clients: DEFAULT_
645    if (conf_parser_ctx.pass != 2)
646      break;
647  
648 <  if ($3 < MAXCLIENTS_MIN)
648 >  if ($3 < 1)
649    {
650 <    char buf[IRCD_BUFSIZE] = "";
651 <
790 <    snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
791 <    conf_error_report(buf);
792 <    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
650 >    conf_error_report("default_max_clients too low, setting to 1");
651 >    ConfigServerInfo.default_max_clients = 1;
652    }
653    else if ($3 > MAXCLIENTS_MAX)
654    {
655      char buf[IRCD_BUFSIZE] = "";
656  
657 <    snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
657 >    snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MAXCLIENTS_MAX);
658      conf_error_report(buf);
659      ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
660    }
# Line 853 | Line 712 | serverinfo_hub: HUB '=' TBOOL ';'
712      ConfigServerInfo.hub = yylval.number;
713   };
714  
715 +
716   /***************************************************************************
717 < * admin section
717 > * admin {} section
718   ***************************************************************************/
719   admin_entry: ADMIN  '{' admin_items '}' ';' ;
720  
# Line 869 | Line 729 | admin_name: NAME '=' QSTRING ';'
729    if (conf_parser_ctx.pass != 2)
730      break;
731  
732 <  MyFree(ConfigAdminInfo.name);
732 >  xfree(ConfigAdminInfo.name);
733    ConfigAdminInfo.name = xstrdup(yylval.string);
734   };
735  
# Line 878 | Line 738 | admin_email: EMAIL '=' QSTRING ';'
738    if (conf_parser_ctx.pass != 2)
739      break;
740  
741 <  MyFree(ConfigAdminInfo.email);
741 >  xfree(ConfigAdminInfo.email);
742    ConfigAdminInfo.email = xstrdup(yylval.string);
743   };
744  
# Line 887 | Line 747 | admin_description: DESCRIPTION '=' QSTRI
747    if (conf_parser_ctx.pass != 2)
748      break;
749  
750 <  MyFree(ConfigAdminInfo.description);
750 >  xfree(ConfigAdminInfo.description);
751    ConfigAdminInfo.description = xstrdup(yylval.string);
752   };
753  
754 +
755   /***************************************************************************
756 < * motd section
756 > * motd {} section
757   ***************************************************************************/
758   motd_entry: MOTD
759   {
# Line 927 | Line 788 | motd_file: T_FILE '=' QSTRING ';'
788      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
789   };
790  
791 +
792   /***************************************************************************
793 < * pseudo section
793 > * pseudo {} section
794   ***************************************************************************/
795   pseudo_entry: T_PSEUDO
796   {
# Line 988 | Line 850 | pseudo_target: T_TARGET '=' QSTRING ';'
850    }
851   };
852  
853 +
854   /***************************************************************************
855 < *  section logging
855 > * log {} section
856   ***************************************************************************/
857   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
858   logging_items:          logging_items logging_item | logging_item ;
# Line 1054 | Line 917 | logging_file_type_item:  USER
917   {
918    if (conf_parser_ctx.pass == 2)
919      block_state.type.value = LOG_TYPE_OPER;
1057 } | GLINE
1058 {
1059  if (conf_parser_ctx.pass == 2)
1060    block_state.type.value = LOG_TYPE_GLINE;
920   } | XLINE
921   {
922    if (conf_parser_ctx.pass == 2)
# Line 1086 | Line 945 | logging_file_type_item:  USER
945  
946  
947   /***************************************************************************
948 < * section oper
948 > * operator {} section
949   ***************************************************************************/
950   oper_entry: OPERATOR
951   {
# Line 1104 | Line 963 | oper_entry: OPERATOR
963  
964    if (!block_state.name.buf[0])
965      break;
966 < #ifdef HAVE_LIBCRYPTO
1108 <  if (!block_state.file.buf[0] &&
1109 <      !block_state.rpass.buf[0])
1110 <    break;
1111 < #else
966 >
967    if (!block_state.rpass.buf[0])
968      break;
1114 #endif
969  
970    DLINK_FOREACH(node, block_state.mask.list.head)
971    {
972      struct MaskItem *conf = NULL;
973      struct split_nuh_item nuh;
974 +    char *s = node->data;
975  
976 <    nuh.nuhmask  = node->data;
976 >    if (EmptyString(s))
977 >      continue;
978 >
979 >    nuh.nuhmask  = s;
980      nuh.nickptr  = NULL;
981      nuh.userptr  = block_state.user.buf;
982      nuh.hostptr  = block_state.host.buf;
# Line 1147 | Line 1005 | oper_entry: OPERATOR
1005      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1006  
1007      conf_add_class_to_conf(conf, block_state.class.buf);
1150
1151 #ifdef HAVE_LIBCRYPTO
1152    if (block_state.file.buf[0])
1153    {
1154      BIO *file = NULL;
1155      RSA *pkey = NULL;
1156
1157      if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1158      {
1159        ilog(LOG_TYPE_IRCD, "Ignoring rsa_public_key_file -- file doesn't exist");
1160        break;
1161      }
1162
1163      if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1164        ilog(LOG_TYPE_IRCD, "Ignoring rsa_public_key_file -- key invalid; check key syntax");
1165      else
1166      {
1167        if (RSA_size(pkey) > 128)
1168          ilog(LOG_TYPE_IRCD, "Ignoring rsa_public_key_file -- key size must be 1024 or below");
1169        else
1170          conf->rsa_public_key = pkey;
1171      }
1172
1173      BIO_set_close(file, BIO_CLOSE);
1174      BIO_free(file);
1175    }
1176 #endif /* HAVE_LIBCRYPTO */
1008    }
1009   };
1010  
# Line 1185 | Line 1016 | oper_item:      oper_name |
1016                  oper_umodes |
1017                  oper_class |
1018                  oper_encrypted |
1188                oper_rsa_public_key_file |
1019                  oper_ssl_certificate_fingerprint |
1020                  oper_ssl_connection_required |
1021                  oper_flags |
# Line 1226 | Line 1056 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1056      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1057   };
1058  
1229 oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1230 {
1231  if (conf_parser_ctx.pass == 2)
1232    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
1233 };
1234
1059   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1060   {
1061    if (conf_parser_ctx.pass == 2)
# Line 1407 | Line 1231 | oper_flags_item: KILL ':' REMOTE
1231   {
1232    if (conf_parser_ctx.pass == 2)
1233      block_state.port.value |= OPER_FLAG_UNXLINE;
1410 } | GLINE
1411 {
1412  if (conf_parser_ctx.pass == 2)
1413    block_state.port.value |= OPER_FLAG_GLINE;
1234   } | DIE
1235   {
1236    if (conf_parser_ctx.pass == 2)
# Line 1419 | Line 1239 | oper_flags_item: KILL ':' REMOTE
1239   {
1240    if (conf_parser_ctx.pass == 2)
1241      block_state.port.value |= OPER_FLAG_RESTART;
1242 + } | REHASH ':' REMOTE
1243 + {
1244 +  if (conf_parser_ctx.pass == 2)
1245 +    block_state.port.value |= OPER_FLAG_REHASH_REMOTE;
1246   } | REHASH
1247   {
1248    if (conf_parser_ctx.pass == 2)
# Line 1455 | Line 1279 | oper_flags_item: KILL ':' REMOTE
1279   {
1280    if (conf_parser_ctx.pass == 2)
1281      block_state.port.value |= OPER_FLAG_OPME;
1282 + } | NICK ':' RESV
1283 + {
1284 +  if (conf_parser_ctx.pass == 2)
1285 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1286 + } | JOIN ':' RESV
1287 + {
1288 +  if (conf_parser_ctx.pass == 2)
1289 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1290 + } | RESV
1291 + {
1292 +  if (conf_parser_ctx.pass == 2)
1293 +    block_state.port.value |= OPER_FLAG_RESV;
1294 + } | T_UNRESV
1295 + {
1296 +  if (conf_parser_ctx.pass == 2)
1297 +    block_state.port.value |= OPER_FLAG_UNRESV;
1298 + } | CLOSE
1299 + {
1300 +  if (conf_parser_ctx.pass == 2)
1301 +    block_state.port.value |= OPER_FLAG_CLOSE;
1302   };
1303  
1304  
1305   /***************************************************************************
1306 < *  section class
1306 > * class {} section
1307   ***************************************************************************/
1308   class_entry: CLASS
1309   {
# Line 1483 | Line 1327 | class_entry: CLASS
1327    if (!block_state.class.buf[0])
1328      break;
1329  
1330 <  if (!(class = class_find(block_state.class.buf, 0)))
1330 >  if (!(class = class_find(block_state.class.buf, false)))
1331      class = class_make();
1332  
1333    class->active = 1;
1334 <  MyFree(class->name);
1334 >  xfree(class->name);
1335    class->name = xstrdup(block_state.class.buf);
1336    class->ping_freq = block_state.ping_freq.value;
1337 <  class->max_perip = block_state.max_perip.value;
1337 >  class->max_perip_local = block_state.max_perip_local.value;
1338 >  class->max_perip_global = block_state.max_perip_global.value;
1339    class->con_freq = block_state.con_freq.value;
1340    class->max_total = block_state.max_total.value;
1496  class->max_global = block_state.max_global.value;
1497  class->max_local = block_state.max_local.value;
1498  class->max_ident = block_state.max_ident.value;
1341    class->max_sendq = block_state.max_sendq.value;
1342    class->max_recvq = block_state.max_recvq.value;
1343    class->max_channels = block_state.max_channels.value;
# Line 1511 | Line 1353 | class_entry: CLASS
1353    class->min_idle = block_state.min_idle.value;
1354    class->max_idle = block_state.max_idle.value;
1355  
1356 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1357 <    if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1516 <        (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
1517 <      if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) ||
1518 <          (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value))
1519 <        rebuild_cidr_list(class);
1520 <
1356 >  int diff = (class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value ||
1357 >              class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value);
1358    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1359    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
1360    class->number_per_cidr = block_state.number_per_cidr.value;
1361 +
1362 +  if (diff)
1363 +    class_ip_limit_rebuild(class);
1364   };
1365  
1366   class_items:    class_items class_item | class_item;
# Line 1529 | Line 1369 | class_item:     class_name |
1369                  class_cidr_bitlen_ipv6 |
1370                  class_ping_time |
1371                  class_number_per_cidr |
1372 <                class_number_per_ip |
1372 >                class_number_per_ip_local |
1373 >                class_number_per_ip_global |
1374                  class_connectfreq |
1375                  class_max_channels |
1376                  class_max_number |
1377 <                class_max_global |
1378 <                class_max_local |
1538 <                class_max_ident |
1539 <                class_sendq | class_recvq |
1377 >                class_sendq |
1378 >                class_recvq |
1379                  class_min_idle |
1380                  class_max_idle |
1381                  class_flags |
# Line 1554 | Line 1393 | class_ping_time: PING_TIME '=' timespec
1393      block_state.ping_freq.value = $3;
1394   };
1395  
1396 < class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1396 > class_number_per_ip_local: NUMBER_PER_IP_LOCAL '=' NUMBER ';'
1397   {
1398    if (conf_parser_ctx.pass == 1)
1399 <    block_state.max_perip.value = $3;
1399 >    block_state.max_perip_local.value = $3;
1400 > };
1401 >
1402 > class_number_per_ip_global: NUMBER_PER_IP_GLOBAL '=' NUMBER ';'
1403 > {
1404 >  if (conf_parser_ctx.pass == 1)
1405 >    block_state.max_perip_global.value = $3;
1406   };
1407  
1408   class_connectfreq: CONNECTFREQ '=' timespec ';'
# Line 1578 | Line 1423 | class_max_number: MAX_NUMBER '=' NUMBER
1423      block_state.max_total.value = $3;
1424   };
1425  
1581 class_max_global: MAX_GLOBAL '=' NUMBER ';'
1582 {
1583  if (conf_parser_ctx.pass == 1)
1584    block_state.max_global.value = $3;
1585 };
1586
1587 class_max_local: MAX_LOCAL '=' NUMBER ';'
1588 {
1589  if (conf_parser_ctx.pass == 1)
1590    block_state.max_local.value = $3;
1591 };
1592
1593 class_max_ident: MAX_IDENT '=' NUMBER ';'
1594 {
1595  if (conf_parser_ctx.pass == 1)
1596    block_state.max_ident.value = $3;
1597 };
1598
1426   class_sendq: SENDQ '=' sizespec ';'
1427   {
1428    if (conf_parser_ctx.pass == 1)
# Line 1664 | Line 1491 | class_flags_item: RANDOM_IDLE
1491  
1492  
1493   /***************************************************************************
1494 < *  section listen
1494 > * listen {} section
1495   ***************************************************************************/
1496   listen_entry: LISTEN
1497   {
# Line 1703 | Line 1530 | port_item: NUMBER
1530   {
1531    if (conf_parser_ctx.pass == 2)
1532    {
1533 < #ifndef HAVE_LIBCRYPTO
1533 > #ifndef HAVE_TLS
1534      if (block_state.flags.value & LISTENER_SSL)
1535      {
1536 <      conf_error_report("SSL not available - port closed");
1536 >      conf_error_report("TLS not available - port closed");
1537        break;
1538      }
1539   #endif
1540 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1540 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1541    }
1542   } | NUMBER TWODOTS NUMBER
1543   {
1544    if (conf_parser_ctx.pass == 2)
1545    {
1546 < #ifndef HAVE_LIBCRYPTO
1546 > #ifndef HAVE_TLS
1547      if (block_state.flags.value & LISTENER_SSL)
1548      {
1549 <      conf_error_report("SSL not available - port closed");
1549 >      conf_error_report("TLS not available - port closed");
1550        break;
1551      }
1552   #endif
1553  
1554      for (int i = $1; i <= $3; ++i)
1555 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1555 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1556    }
1557   };
1558  
# Line 1741 | Line 1568 | listen_host: HOST '=' QSTRING ';'
1568      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1569   };
1570  
1571 +
1572   /***************************************************************************
1573 < *  section auth
1573 > * auth {} section
1574   ***************************************************************************/
1575   auth_entry: IRCD_AUTH
1576   {
# Line 1759 | Line 1587 | auth_entry: IRCD_AUTH
1587    {
1588      struct MaskItem *conf = NULL;
1589      struct split_nuh_item nuh;
1590 +    char *s = node->data;
1591  
1592 <    nuh.nuhmask  = node->data;
1592 >    if (EmptyString(s))
1593 >      continue;
1594 >
1595 >    nuh.nuhmask  = s;
1596      nuh.nickptr  = NULL;
1597      nuh.userptr  = block_state.user.buf;
1598      nuh.hostptr  = block_state.host.buf;
# Line 1845 | Line 1677 | auth_flags_item: SPOOF_NOTICE
1677   {
1678    if (conf_parser_ctx.pass == 2)
1679      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1680 + } | XLINE_EXEMPT
1681 + {
1682 +  if (conf_parser_ctx.pass == 2)
1683 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1684   } | NEED_IDENT
1685   {
1686    if (conf_parser_ctx.pass == 2)
# Line 1857 | Line 1693 | auth_flags_item: SPOOF_NOTICE
1693   {
1694    if (conf_parser_ctx.pass == 2)
1695      block_state.flags.value |= CONF_FLAGS_NO_TILDE;
1860 } | GLINE_EXEMPT
1861 {
1862  if (conf_parser_ctx.pass == 2)
1863    block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE;
1696   } | RESV_EXEMPT
1697   {
1698    if (conf_parser_ctx.pass == 2)
# Line 1909 | Line 1741 | auth_redir_port: REDIRPORT '=' NUMBER ';
1741  
1742  
1743   /***************************************************************************
1744 < *  section resv
1744 > * resv {} section
1745   ***************************************************************************/
1746   resv_entry: RESV
1747   {
# Line 1923 | Line 1755 | resv_entry: RESV
1755    if (conf_parser_ctx.pass != 2)
1756      break;
1757  
1758 <  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1758 >  resv_make(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1759   };
1760  
1761   resv_items:     resv_items resv_item | resv_item;
# Line 1949 | Line 1781 | resv_exempt: EXEMPT '=' QSTRING ';'
1781  
1782  
1783   /***************************************************************************
1784 < *  section service
1784 > * service {} section
1785   ***************************************************************************/
1786   service_entry: T_SERVICE '{' service_items '}' ';';
1787  
# Line 1961 | Line 1793 | service_name: NAME '=' QSTRING ';'
1793    if (conf_parser_ctx.pass != 2)
1794      break;
1795  
1796 <  if (valid_servname(yylval.string))
1796 >  if (server_valid_name(yylval.string) == true)
1797    {
1798 <    struct MaskItem *conf = conf_make(CONF_SERVICE);
1799 <    conf->name = xstrdup(yylval.string);
1798 >    struct ServiceItem *service = service_make();
1799 >    service->name = xstrdup(yylval.string);
1800    }
1801   };
1802  
1803 +
1804   /***************************************************************************
1805 < *  section shared, for sharing remote klines etc.
1805 > * shared {} section, for sharing remote klines etc.
1806   ***************************************************************************/
1807   shared_entry: T_SHARED
1808   {
# Line 1984 | Line 1817 | shared_entry: T_SHARED
1817    block_state.flags.value = SHARED_ALL;
1818   } '{' shared_items '}' ';'
1819   {
1987  struct MaskItem *conf = NULL;
1988
1820    if (conf_parser_ctx.pass != 2)
1821      break;
1822  
1823 <  conf = conf_make(CONF_ULINE);
1824 <  conf->flags = block_state.flags.value;
1825 <  conf->name = xstrdup(block_state.name.buf);
1826 <  conf->user = xstrdup(block_state.user.buf);
1827 <  conf->host = xstrdup(block_state.host.buf);
1823 >  struct SharedItem *shared = shared_make();
1824 >  shared->type = block_state.flags.value;
1825 >  shared->server = xstrdup(block_state.name.buf);
1826 >  shared->user = xstrdup(block_state.user.buf);
1827 >  shared->host = xstrdup(block_state.host.buf);
1828   };
1829  
1830   shared_items: shared_items shared_item | shared_item;
# Line 2073 | Line 1904 | shared_type_item: KLINE
1904      block_state.flags.value = SHARED_ALL;
1905   };
1906  
1907 +
1908   /***************************************************************************
1909 < *  section cluster
1909 > * cluster {} section
1910   ***************************************************************************/
1911   cluster_entry: T_CLUSTER
1912   {
# Line 2084 | Line 1916 | cluster_entry: T_CLUSTER
1916    reset_block_state();
1917  
1918    strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf));
1919 <  block_state.flags.value = SHARED_ALL;
1919 >  block_state.flags.value = CLUSTER_ALL;
1920   } '{' cluster_items '}' ';'
1921   {
2090  struct MaskItem *conf = NULL;
2091
1922    if (conf_parser_ctx.pass != 2)
1923      break;
1924  
1925 <  conf = conf_make(CONF_CLUSTER);
1926 <  conf->flags = block_state.flags.value;
1927 <  conf->name = xstrdup(block_state.name.buf);
1925 >  struct ClusterItem *cluster = cluster_make();
1926 >  cluster->type = block_state.flags.value;
1927 >  cluster->server = xstrdup(block_state.name.buf);
1928   };
1929  
1930   cluster_items:  cluster_items cluster_item | cluster_item;
# Line 2116 | Line 1946 | cluster_types:  cluster_types ',' cluste
1946   cluster_type_item: KLINE
1947   {
1948    if (conf_parser_ctx.pass == 2)
1949 <    block_state.flags.value |= SHARED_KLINE;
1949 >    block_state.flags.value |= CLUSTER_KLINE;
1950   } | UNKLINE
1951   {
1952    if (conf_parser_ctx.pass == 2)
1953 <    block_state.flags.value |= SHARED_UNKLINE;
1953 >    block_state.flags.value |= CLUSTER_UNKLINE;
1954   } | T_DLINE
1955   {
1956    if (conf_parser_ctx.pass == 2)
1957 <    block_state.flags.value |= SHARED_DLINE;
1957 >    block_state.flags.value |= CLUSTER_DLINE;
1958   } | T_UNDLINE
1959   {
1960    if (conf_parser_ctx.pass == 2)
1961 <    block_state.flags.value |= SHARED_UNDLINE;
1961 >    block_state.flags.value |= CLUSTER_UNDLINE;
1962   } | XLINE
1963   {
1964    if (conf_parser_ctx.pass == 2)
1965 <    block_state.flags.value |= SHARED_XLINE;
1965 >    block_state.flags.value |= CLUSTER_XLINE;
1966   } | T_UNXLINE
1967   {
1968    if (conf_parser_ctx.pass == 2)
1969 <    block_state.flags.value |= SHARED_UNXLINE;
1969 >    block_state.flags.value |= CLUSTER_UNXLINE;
1970   } | RESV
1971   {
1972    if (conf_parser_ctx.pass == 2)
1973 <    block_state.flags.value |= SHARED_RESV;
1973 >    block_state.flags.value |= CLUSTER_RESV;
1974   } | T_UNRESV
1975   {
1976    if (conf_parser_ctx.pass == 2)
1977 <    block_state.flags.value |= SHARED_UNRESV;
1977 >    block_state.flags.value |= CLUSTER_UNRESV;
1978   } | T_LOCOPS
1979   {
1980    if (conf_parser_ctx.pass == 2)
1981 <    block_state.flags.value |= SHARED_LOCOPS;
1981 >    block_state.flags.value |= CLUSTER_LOCOPS;
1982   } | T_ALL
1983   {
1984    if (conf_parser_ctx.pass == 2)
1985 <    block_state.flags.value = SHARED_ALL;
1985 >    block_state.flags.value = CLUSTER_ALL;
1986   };
1987  
1988 +
1989   /***************************************************************************
1990 < *  section connect
1990 > * connect {}  section
1991   ***************************************************************************/
1992   connect_entry: CONNECT
1993   {
# Line 2360 | Line 2191 | connect_class: CLASS '=' QSTRING ';'
2191  
2192   connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2193   {
2194 < #ifdef HAVE_LIBCRYPTO
2194 > #ifdef HAVE_TLS
2195    if (conf_parser_ctx.pass == 2)
2196      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2197   #else
2198    if (conf_parser_ctx.pass == 2)
2199 <    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2199 >    conf_error_report("Ignoring connect::ciphers -- no TLS support");
2200   #endif
2201   };
2202  
2203  
2204   /***************************************************************************
2205 < *  section kill
2205 > * kill {} section
2206   ***************************************************************************/
2207   kill_entry: KILL
2208   {
# Line 2428 | Line 2259 | kill_reason: REASON '=' QSTRING ';'
2259      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2260   };
2261  
2262 +
2263   /***************************************************************************
2264 < *  section deny
2264 > * deny {} section
2265   ***************************************************************************/
2266   deny_entry: DENY
2267   {
# Line 2473 | Line 2305 | deny_reason: REASON '=' QSTRING ';'
2305      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2306   };
2307  
2308 +
2309   /***************************************************************************
2310 < *  section exempt
2310 > * exempt {} section
2311   ***************************************************************************/
2312   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2313  
2314 < exempt_items:     exempt_items exempt_item | exempt_item;
2315 < exempt_item:      exempt_ip | error;
2314 > exempt_items: exempt_items exempt_item | exempt_item;
2315 > exempt_item:  exempt_ip | error;
2316  
2317   exempt_ip: IP '=' QSTRING ';'
2318   {
2319    if (conf_parser_ctx.pass == 2)
2320    {
2321 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2321 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2322      {
2323        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2324        conf->host = xstrdup(yylval.string);
# Line 2496 | Line 2329 | exempt_ip: IP '=' QSTRING ';'
2329   };
2330  
2331   /***************************************************************************
2332 < *  section gecos
2332 > * gecos {} section
2333   ***************************************************************************/
2334   gecos_entry: GECOS
2335   {
# Line 2504 | Line 2337 | gecos_entry: GECOS
2337      reset_block_state();
2338   } '{' gecos_items '}' ';'
2339   {
2507  struct MaskItem *conf = NULL;
2508
2340    if (conf_parser_ctx.pass != 2)
2341      break;
2342  
2343    if (!block_state.name.buf[0])
2344      break;
2345  
2346 <  conf = conf_make(CONF_XLINE);
2347 <  conf->name = xstrdup(block_state.name.buf);
2346 >  struct GecosItem *gecos = gecos_make();
2347 >  gecos->mask = xstrdup(block_state.name.buf);
2348  
2349    if (block_state.rpass.buf[0])
2350 <    conf->reason = xstrdup(block_state.rpass.buf);
2350 >    gecos->reason = xstrdup(block_state.rpass.buf);
2351    else
2352 <    conf->reason = xstrdup(CONF_NOREASON);
2352 >    gecos->reason = xstrdup(CONF_NOREASON);
2353   };
2354  
2355   gecos_items: gecos_items gecos_item | gecos_item;
# Line 2536 | Line 2367 | gecos_reason: REASON '=' QSTRING ';'
2367      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2368   };
2369  
2370 +
2371   /***************************************************************************
2372 < *  section general
2372 > * general {} section
2373   ***************************************************************************/
2374 < general_entry: GENERAL
2543 <  '{' general_items '}' ';';
2374 > general_entry: GENERAL '{' general_items '}' ';';
2375  
2376   general_items:      general_items general_item | general_item;
2377   general_item:       general_away_count |
2378                      general_away_time |
2548                    general_ignore_bogus_ts |
2379                      general_failed_oper_notice |
2380                      general_anti_nick_flood |
2381                      general_max_nick_time |
2382                      general_max_nick_changes |
2383                      general_max_accept |
2384 +                    general_whowas_history_length |
2385                      general_anti_spam_exit_message_time |
2386                      general_ts_warn_delta |
2387                      general_ts_max_delta |
# Line 2568 | Line 2399 | general_item:       general_away_count |
2399                      general_pace_wait_simple |
2400                      general_short_motd |
2401                      general_no_oper_flood |
2571                    general_oper_pass_resv |
2402                      general_oper_only_umodes |
2403                      general_max_targets |
2404                      general_oper_umodes |
2405                      general_caller_id_wait |
2406                      general_opers_bypass_callerid |
2407                      general_default_floodcount |
2408 +                    general_default_floodtime |
2409                      general_min_nonwildcard |
2410                      general_min_nonwildcard_simple |
2411                      general_throttle_count |
2412                      general_throttle_time |
2582                    general_havent_read_conf |
2413                      general_ping_cookie |
2414                      general_disable_auth |
2415                      general_tkline_expire_notices |
2416 <                    general_gline_enable |
2417 <                    general_gline_duration |
2418 <                    general_gline_request_duration |
2419 <                    general_gline_min_cidr |
2590 <                    general_gline_min_cidr6 |
2416 >                    general_dline_min_cidr |
2417 >                    general_dline_min_cidr6 |
2418 >                    general_kline_min_cidr |
2419 >                    general_kline_min_cidr6 |
2420                      general_stats_e_disabled |
2421                      general_max_watch |
2422                      general_cycle_on_host_change |
# Line 2609 | Line 2438 | general_max_watch: MAX_WATCH '=' NUMBER
2438    ConfigGeneral.max_watch = $3;
2439   };
2440  
2441 < general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2441 > general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2442   {
2443 <  if (conf_parser_ctx.pass == 2)
2615 <    ConfigGeneral.cycle_on_host_change = yylval.number;
2443 >  ConfigGeneral.whowas_history_length = $3;
2444   };
2445  
2446 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2446 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2447   {
2448    if (conf_parser_ctx.pass == 2)
2449 <    ConfigGeneral.glines = yylval.number;
2449 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2450   };
2451  
2452 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2452 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2453   {
2454 <  if (conf_parser_ctx.pass == 2)
2627 <    ConfigGeneral.gline_time = $3;
2454 >  ConfigGeneral.dline_min_cidr = $3;
2455   };
2456  
2457 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2457 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2458   {
2459 <  if (conf_parser_ctx.pass == 2)
2633 <    ConfigGeneral.gline_request_time = $3;
2459 >  ConfigGeneral.dline_min_cidr6 = $3;
2460   };
2461  
2462 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2462 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2463   {
2464 <  ConfigGeneral.gline_min_cidr = $3;
2464 >  ConfigGeneral.kline_min_cidr = $3;
2465   };
2466  
2467 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2467 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2468   {
2469 <  ConfigGeneral.gline_min_cidr6 = $3;
2469 >  ConfigGeneral.kline_min_cidr6 = $3;
2470   };
2471  
2472   general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
# Line 2653 | Line 2479 | general_kill_chase_time_limit: KILL_CHAS
2479    ConfigGeneral.kill_chase_time_limit = $3;
2480   };
2481  
2656 general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2657 {
2658  ConfigGeneral.ignore_bogus_ts = yylval.number;
2659 };
2660
2482   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2483   {
2484    ConfigGeneral.failed_oper_notice = yylval.number;
# Line 2699 | Line 2520 | general_ts_max_delta: TS_MAX_DELTA '=' t
2520      ConfigGeneral.ts_max_delta = $3;
2521   };
2522  
2702 general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2703 {
2704  if (($3 > 0) && conf_parser_ctx.pass == 1)
2705  {
2706    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2707    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2708    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2709    exit(0);
2710  }
2711 };
2712
2523   general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2524   {
2525    ConfigGeneral.invisible_on_connect = yylval.number;
# Line 2791 | Line 2601 | general_no_oper_flood: NO_OPER_FLOOD '='
2601    ConfigGeneral.no_oper_flood = yylval.number;
2602   };
2603  
2794 general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';'
2795 {
2796  ConfigGeneral.oper_pass_resv = yylval.number;
2797 };
2798
2604   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2605   {
2606    ConfigGeneral.dots_in_ident = $3;
# Line 2983 | Line 2788 | general_default_floodcount: DEFAULT_FLOO
2788    ConfigGeneral.default_floodcount = $3;
2789   };
2790  
2791 + general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';'
2792 + {
2793 +  ConfigGeneral.default_floodtime = $3;
2794 + };
2795 +
2796  
2797   /***************************************************************************
2798 < *  section channel
2798 > * channel {} section
2799   ***************************************************************************/
2800 < channel_entry: CHANNEL
2991 <  '{' channel_items '}' ';';
2800 > channel_entry: CHANNEL '{' channel_items '}' ';';
2801  
2802   channel_items:      channel_items channel_item | channel_item;
2803   channel_item:       channel_max_bans |
2804 +                    channel_max_bans_large |
2805                      channel_invite_client_count |
2806                      channel_invite_client_time |
2807 +                    channel_invite_delay_channel |
2808 +                    channel_invite_expire_time |
2809                      channel_knock_client_count |
2810                      channel_knock_client_time |
2811                      channel_knock_delay_channel |
2812                      channel_max_channels |
2813 <                    channel_default_split_user_count |
3002 <                    channel_default_split_server_count |
3003 <                    channel_no_create_on_split |
3004 <                    channel_no_join_on_split |
2813 >                    channel_max_invites |
2814                      channel_default_join_flood_count |
2815                      channel_default_join_flood_time |
2816                      channel_disable_fake_channels |
# Line 3022 | Line 2831 | channel_invite_client_time: INVITE_CLIEN
2831    ConfigChannel.invite_client_time = $3;
2832   };
2833  
2834 + channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';'
2835 + {
2836 +  ConfigChannel.invite_delay_channel = $3;
2837 + };
2838 +
2839 + channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';'
2840 + {
2841 +  ConfigChannel.invite_expire_time = $3;
2842 + };
2843 +
2844   channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2845   {
2846    ConfigChannel.knock_client_count = $3;
# Line 3042 | Line 2861 | channel_max_channels: MAX_CHANNELS '=' N
2861    ConfigChannel.max_channels = $3;
2862   };
2863  
2864 < channel_max_bans: MAX_BANS '=' NUMBER ';'
2864 > channel_max_invites: MAX_INVITES '=' NUMBER ';'
2865   {
2866 <  ConfigChannel.max_bans = $3;
2866 >  ConfigChannel.max_invites = $3;
2867   };
2868  
2869 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
3051 < {
3052 <  ConfigChannel.default_split_user_count = $3;
3053 < };
3054 <
3055 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
3056 < {
3057 <  ConfigChannel.default_split_server_count = $3;
3058 < };
3059 <
3060 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2869 > channel_max_bans: MAX_BANS '=' NUMBER ';'
2870   {
2871 <  ConfigChannel.no_create_on_split = yylval.number;
2871 >  ConfigChannel.max_bans = $3;
2872   };
2873  
2874 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2874 > channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';'
2875   {
2876 <  ConfigChannel.no_join_on_split = yylval.number;
2876 >  ConfigChannel.max_bans_large = $3;
2877   };
2878  
2879   channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
# Line 3077 | Line 2886 | channel_default_join_flood_time: DEFAULT
2886    ConfigChannel.default_join_flood_time = $3;
2887   };
2888  
2889 +
2890   /***************************************************************************
2891 < *  section serverhide
2891 > * serverhide {} section
2892   ***************************************************************************/
2893 < serverhide_entry: SERVERHIDE
3084 <  '{' serverhide_items '}' ';';
2893 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
2894  
2895   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2896   serverhide_item:    serverhide_flatten_links |
2897 +                    serverhide_flatten_links_delay |
2898 +                    serverhide_flatten_links_file |
2899                      serverhide_disable_remote_commands |
2900                      serverhide_hide_servers |
2901                      serverhide_hide_services |
3091                    serverhide_links_delay |
2902                      serverhide_hidden |
2903                      serverhide_hidden_name |
2904                      serverhide_hide_server_ips |
# Line 3100 | Line 2910 | serverhide_flatten_links: FLATTEN_LINKS
2910      ConfigServerHide.flatten_links = yylval.number;
2911   };
2912  
2913 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
2914 + {
2915 +  if (conf_parser_ctx.pass == 2)
2916 +  {
2917 +    if ($3 > 0)
2918 +    {
2919 +      event_write_links_file.when = $3;
2920 +      event_add(&event_write_links_file, NULL);
2921 +    }
2922 +    else
2923 +     event_delete(&event_write_links_file);
2924 +
2925 +    ConfigServerHide.flatten_links_delay = $3;
2926 +  }
2927 + };
2928 +
2929 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
2930 + {
2931 +  if (conf_parser_ctx.pass == 2)
2932 +  {
2933 +    xfree(ConfigServerHide.flatten_links_file);
2934 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
2935 +  }
2936 + };
2937 +
2938   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2939   {
2940    if (conf_parser_ctx.pass == 2)
# Line 3122 | Line 2957 | serverhide_hidden_name: HIDDEN_NAME '='
2957   {
2958    if (conf_parser_ctx.pass == 2)
2959    {
2960 <    MyFree(ConfigServerHide.hidden_name);
2960 >    xfree(ConfigServerHide.hidden_name);
2961      ConfigServerHide.hidden_name = xstrdup(yylval.string);
2962    }
2963   };
2964  
3130 serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3131 {
3132  if (conf_parser_ctx.pass == 2)
3133  {
3134    if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3135    {
3136      event_write_links_file.when = $3;
3137      event_addish(&event_write_links_file, NULL);
3138      ConfigServerHide.links_disabled = 0;
3139    }
3140
3141    ConfigServerHide.links_delay = $3;
3142  }
3143 };
3144
2965   serverhide_hidden: HIDDEN '=' TBOOL ';'
2966   {
2967    if (conf_parser_ctx.pass == 2)

Comparing ircd-hybrid/trunk/src/conf_parser.y (property svn:keywords):
Revision 5602 by michael, Mon Feb 23 21:04:46 2015 UTC vs.
Revision 8792 by michael, Thu Jan 17 18:35:32 2019 UTC

# Line 1 | Line 1
1 < Id Revision
1 > Id

Diff Legend

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