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 7624 by michael, Thu Jun 23 12:44:09 2016 UTC vs.
Revision 8864 by michael, Sat Feb 16 09:54:03 2019 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2000-2016 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 31 | Line 31
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"
# Line 92 | 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,
100    max_global,
101    max_local,
102      max_sendq,
103      max_recvq,
104      max_channels,
# Line 155 | Line 155 | reset_block_state(void)
155   %token  CALLER_ID_WAIT
156   %token  CAN_FLOOD
157   %token  CHANNEL
158 %token  CHECK_CACHE
158   %token  CIDR_BITLEN_IPV4
159   %token  CIDR_BITLEN_IPV6
160   %token  CLASS
# Line 164 | Line 163 | reset_block_state(void)
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
# Line 197 | Line 197 | reset_block_state(void)
197   %token  HOST
198   %token  HUB
199   %token  HUB_MASK
200 %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
# Line 217 | Line 217 | reset_block_state(void)
217   %token  KNOCK_CLIENT_TIME
218   %token  KNOCK_DELAY_CHANNEL
219   %token  LEAF_MASK
220 %token  LIBGEOIP_DATABASE_OPTIONS
221 %token  LIBGEOIP_IPV4_DATABASE_FILE
222 %token  LIBGEOIP_IPV6_DATABASE_FILE
220   %token  LISTEN
221   %token  MASK
222   %token  MAX_ACCEPT
223   %token  MAX_BANS
224 + %token  MAX_BANS_LARGE
225   %token  MAX_CHANNELS
228 %token  MAX_GLOBAL
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 235 | Line 232 | reset_block_state(void)
232   %token  MAX_TARGETS
233   %token  MAX_TOPIC_LENGTH
234   %token  MAX_WATCH
238 %token  MEMORY_CACHE
235   %token  MIN_IDLE
236   %token  MIN_NONWILDCARD
237   %token  MIN_NONWILDCARD_SIMPLE
242 %token  MMAP_CACHE
238   %token  MODULE
239   %token  MODULES
240   %token  MOTD
# Line 253 | Line 248 | reset_block_state(void)
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
254   %token  OPER_UMODES
255   %token  OPERATOR
# Line 291 | Line 287 | reset_block_state(void)
287   %token  SSL_DH_ELLIPTIC_CURVE
288   %token  SSL_DH_PARAM_FILE
289   %token  SSL_MESSAGE_DIGEST_ALGORITHM
294 %token  STANDARD
290   %token  STATS_E_DISABLED
291   %token  STATS_I_OPER_ONLY
292   %token  STATS_K_OPER_ONLY
# Line 300 | Line 295 | reset_block_state(void)
295   %token  STATS_P_OPER_ONLY
296   %token  STATS_U_OPER_ONLY
297   %token  T_ALL
298 + %token  T_BIND
299   %token  T_BOTS
300   %token  T_CALLERID
301   %token  T_CCONN
# Line 453 | Line 449 | serverinfo_entry: SERVERINFO '{' serveri
449  
450   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
451   serverinfo_item:        serverinfo_name |
456                        serverinfo_vhost |
452                          serverinfo_hub |
453                          serverinfo_description |
454                          serverinfo_network_name |
# Line 464 | Line 459 | serverinfo_item:        serverinfo_name
459                          serverinfo_ssl_dh_param_file |
460                          serverinfo_ssl_dh_elliptic_curve |
461                          serverinfo_rsa_private_key_file |
467                        serverinfo_vhost6 |
462                          serverinfo_sid |
463                          serverinfo_ssl_certificate_file |
464                          serverinfo_ssl_cipher_list |
465                          serverinfo_ssl_message_digest_algorithm |
472                        serverinfo_libgeoip_database_options |
473                        serverinfo_libgeoip_ipv4_database_file |
474                        serverinfo_libgeoip_ipv6_database_file |
466                          error ';' ;
467  
468  
# Line 529 | Line 520 | serverinfo_ssl_dh_elliptic_curve: SSL_DH
520    }
521   };
522  
532 serverinfo_libgeoip_database_options: LIBGEOIP_DATABASE_OPTIONS
533 {
534  if (conf_parser_ctx.pass == 1)
535    ConfigServerInfo.libgeoip_database_options = 0;
536 } '='  options_items ';';
537
538 options_items: options_items ',' options_item | options_item;
539 options_item: STANDARD
540 {
541 #ifdef HAVE_LIBGEOIP
542  if (conf_parser_ctx.pass == 1)
543    ConfigServerInfo.libgeoip_database_options |= GEOIP_STANDARD;
544 #endif
545 } | MEMORY_CACHE
546 {
547 #ifdef HAVE_LIBGEOIP
548  if (conf_parser_ctx.pass == 1)
549    ConfigServerInfo.libgeoip_database_options |= GEOIP_MEMORY_CACHE;
550 #endif
551 } | MMAP_CACHE
552 {
553 #ifdef HAVE_LIBGEOIP
554  if (conf_parser_ctx.pass == 1)
555    ConfigServerInfo.libgeoip_database_options |= GEOIP_MMAP_CACHE;
556 #endif
557 } | CHECK_CACHE
558 {
559 #ifdef HAVE_LIBGEOIP
560  if (conf_parser_ctx.pass == 1)
561    ConfigServerInfo.libgeoip_database_options |= GEOIP_CHECK_CACHE;
562 #endif
563 };
564
565 serverinfo_libgeoip_ipv4_database_file:  LIBGEOIP_IPV4_DATABASE_FILE '=' QSTRING ';'
566 {
567  if (conf_parser_ctx.pass == 2)
568  {
569    xfree(ConfigServerInfo.libgeoip_ipv4_database_file);
570    ConfigServerInfo.libgeoip_ipv4_database_file = xstrdup(yylval.string);
571
572 #ifdef HAVE_LIBGEOIP
573    if (GeoIPv4_ctx)
574      GeoIP_delete(GeoIPv4_ctx);
575    GeoIPv4_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
576 #endif
577  }
578 };
579
580 serverinfo_libgeoip_ipv6_database_file:  LIBGEOIP_IPV6_DATABASE_FILE '=' QSTRING ';'
581 {
582  if (conf_parser_ctx.pass == 2)
583  {
584    xfree(ConfigServerInfo.libgeoip_ipv6_database_file);
585    ConfigServerInfo.libgeoip_ipv6_database_file = xstrdup(yylval.string);
586
587 #ifdef HAVE_LIBGEOIP
588    if (GeoIPv6_ctx)
589      GeoIP_delete(GeoIPv6_ctx);
590    GeoIPv6_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
591 #endif
592  }
593 };
594
523   serverinfo_name: NAME '=' QSTRING ';'
524   {
525    /* This isn't rehashable */
526 <  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
526 >  if (conf_parser_ctx.pass == 2 && ConfigServerInfo.name == NULL)
527    {
528 <    if (valid_servname(yylval.string))
528 >    if (server_valid_name(yylval.string) == true)
529        ConfigServerInfo.name = xstrdup(yylval.string);
530      else
531      {
# Line 610 | Line 538 | serverinfo_name: NAME '=' QSTRING ';'
538   serverinfo_sid: IRCD_SID '=' QSTRING ';'
539   {
540    /* This isn't rehashable */
541 <  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
541 >  if (conf_parser_ctx.pass == 2 && ConfigServerInfo.sid == NULL)
542    {
543      if (valid_sid(yylval.string))
544        ConfigServerInfo.sid = xstrdup(yylval.string);
# Line 655 | Line 583 | serverinfo_network_desc: NETWORK_DESC '=
583    ConfigServerInfo.network_desc = xstrdup(yylval.string);
584   };
585  
658 serverinfo_vhost: VHOST '=' QSTRING ';'
659 {
660  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
661  {
662    struct addrinfo hints, *res;
663
664    memset(&hints, 0, sizeof(hints));
665
666    hints.ai_family   = AF_UNSPEC;
667    hints.ai_socktype = SOCK_STREAM;
668    hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
669
670    if (getaddrinfo(yylval.string, NULL, &hints, &res))
671      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
672    else
673    {
674      assert(res);
675
676      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
677      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
678      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
679      freeaddrinfo(res);
680
681      ConfigServerInfo.specific_ipv4_vhost = 1;
682    }
683  }
684 };
685
686 serverinfo_vhost6: VHOST6 '=' QSTRING ';'
687 {
688  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
689  {
690    struct addrinfo hints, *res;
691
692    memset(&hints, 0, sizeof(hints));
693
694    hints.ai_family   = AF_UNSPEC;
695    hints.ai_socktype = SOCK_STREAM;
696    hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
697
698    if (getaddrinfo(yylval.string, NULL, &hints, &res))
699      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
700    else
701    {
702      assert(res);
703
704      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
705      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
706      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
707      freeaddrinfo(res);
708
709      ConfigServerInfo.specific_ipv6_vhost = 1;
710    }
711  }
712 };
713
586   serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
587   {
588    if (conf_parser_ctx.pass != 2)
589      break;
590  
591 <  if ($3 < MAXCLIENTS_MIN)
591 >  if ($3 < 1)
592    {
593 <    char buf[IRCD_BUFSIZE] = "";
594 <
723 <    snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
724 <    conf_error_report(buf);
725 <    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
593 >    conf_error_report("default_max_clients too low, setting to 1");
594 >    ConfigServerInfo.default_max_clients = 1;
595    }
596    else if ($3 > MAXCLIENTS_MAX)
597    {
598      char buf[IRCD_BUFSIZE] = "";
599  
600 <    snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
600 >    snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MAXCLIENTS_MAX);
601      conf_error_report(buf);
602 +
603      ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
604    }
605    else
# Line 752 | Line 622 | serverinfo_max_nick_length: MAX_NICK_LEN
622  
623      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
624      conf_error_report(buf);
625 +
626      ConfigServerInfo.max_nick_length = NICKLEN;
627    }
628    else
# Line 774 | Line 645 | serverinfo_max_topic_length: MAX_TOPIC_L
645  
646      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
647      conf_error_report(buf);
648 +
649      ConfigServerInfo.max_topic_length = TOPICLEN;
650    }
651    else
# Line 790 | Line 662 | serverinfo_hub: HUB '=' TBOOL ';'
662   /***************************************************************************
663   * admin {} section
664   ***************************************************************************/
665 < admin_entry: ADMIN  '{' admin_items '}' ';' ;
665 > admin_entry: ADMIN '{' admin_items '}' ';' ;
666  
667   admin_items: admin_items admin_item | admin_item;
668   admin_item:  admin_name |
# Line 1043 | Line 915 | oper_entry: OPERATOR
915  
916    DLINK_FOREACH(node, block_state.mask.list.head)
917    {
1046    struct MaskItem *conf = NULL;
918      struct split_nuh_item nuh;
919      char *s = node->data;
920  
# Line 1054 | Line 925 | oper_entry: OPERATOR
925      nuh.nickptr  = NULL;
926      nuh.userptr  = block_state.user.buf;
927      nuh.hostptr  = block_state.host.buf;
928 +
929      nuh.nicksize = 0;
930      nuh.usersize = sizeof(block_state.user.buf);
931      nuh.hostsize = sizeof(block_state.host.buf);
932 +
933      split_nuh(&nuh);
934  
935 <    conf         = conf_make(CONF_OPER);
936 <    conf->name   = xstrdup(block_state.name.buf);
937 <    conf->user   = xstrdup(block_state.user.buf);
938 <    conf->host   = xstrdup(block_state.host.buf);
935 >    struct MaskItem *conf = conf_make(CONF_OPER);
936 >    conf->name = xstrdup(block_state.name.buf);
937 >    conf->user = xstrdup(block_state.user.buf);
938 >    conf->host = xstrdup(block_state.host.buf);
939  
940      if (block_state.cert.buf[0])
941        conf->certfp = xstrdup(block_state.cert.buf);
# Line 1393 | Line 1266 | class_entry: CLASS
1266    block_state.max_recvq.value = DEFAULT_RECVQ;
1267   } '{' class_items '}' ';'
1268   {
1396  struct ClassItem *class = NULL;
1397
1269    if (conf_parser_ctx.pass != 1)
1270      break;
1271  
1272    if (!block_state.class.buf[0])
1273      break;
1274  
1275 <  if (!(class = class_find(block_state.class.buf, 0)))
1275 >  struct ClassItem *class = class_find(block_state.class.buf, false);
1276 >  if (class == NULL)
1277      class = class_make();
1278  
1279 <  class->active = 1;
1279 >  class->active = true;
1280    xfree(class->name);
1281    class->name = xstrdup(block_state.class.buf);
1282    class->ping_freq = block_state.ping_freq.value;
1283 <  class->max_perip = block_state.max_perip.value;
1283 >  class->max_perip_local = block_state.max_perip_local.value;
1284 >  class->max_perip_global = block_state.max_perip_global.value;
1285    class->con_freq = block_state.con_freq.value;
1286    class->max_total = block_state.max_total.value;
1414  class->max_global = block_state.max_global.value;
1415  class->max_local = block_state.max_local.value;
1287    class->max_sendq = block_state.max_sendq.value;
1288    class->max_recvq = block_state.max_recvq.value;
1289    class->max_channels = block_state.max_channels.value;
# Line 1428 | Line 1299 | class_entry: CLASS
1299    class->min_idle = block_state.min_idle.value;
1300    class->max_idle = block_state.max_idle.value;
1301  
1302 <  rebuild_cidr_list(class);
1303 <
1302 >  bool diff = (class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value ||
1303 >               class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value);
1304    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1305    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
1306    class->number_per_cidr = block_state.number_per_cidr.value;
1307 +
1308 +  if (diff)
1309 +    class_ip_limit_rebuild(class);
1310   };
1311  
1312   class_items:    class_items class_item | class_item;
# Line 1441 | Line 1315 | class_item:     class_name |
1315                  class_cidr_bitlen_ipv6 |
1316                  class_ping_time |
1317                  class_number_per_cidr |
1318 <                class_number_per_ip |
1318 >                class_number_per_ip_local |
1319 >                class_number_per_ip_global |
1320                  class_connectfreq |
1321                  class_max_channels |
1322                  class_max_number |
1448                class_max_global |
1449                class_max_local |
1323                  class_sendq |
1324                  class_recvq |
1325                  class_min_idle |
# Line 1466 | Line 1339 | class_ping_time: PING_TIME '=' timespec
1339      block_state.ping_freq.value = $3;
1340   };
1341  
1342 < class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1342 > class_number_per_ip_local: NUMBER_PER_IP_LOCAL '=' NUMBER ';'
1343   {
1344    if (conf_parser_ctx.pass == 1)
1345 <    block_state.max_perip.value = $3;
1345 >    block_state.max_perip_local.value = $3;
1346 > };
1347 >
1348 > class_number_per_ip_global: NUMBER_PER_IP_GLOBAL '=' NUMBER ';'
1349 > {
1350 >  if (conf_parser_ctx.pass == 1)
1351 >    block_state.max_perip_global.value = $3;
1352   };
1353  
1354   class_connectfreq: CONNECTFREQ '=' timespec ';'
# Line 1490 | Line 1369 | class_max_number: MAX_NUMBER '=' NUMBER
1369      block_state.max_total.value = $3;
1370   };
1371  
1493 class_max_global: MAX_GLOBAL '=' NUMBER ';'
1494 {
1495  if (conf_parser_ctx.pass == 1)
1496    block_state.max_global.value = $3;
1497 };
1498
1499 class_max_local: MAX_LOCAL '=' NUMBER ';'
1500 {
1501  if (conf_parser_ctx.pass == 1)
1502    block_state.max_local.value = $3;
1503 };
1504
1372   class_sendq: SENDQ '=' sizespec ';'
1373   {
1374    if (conf_parser_ctx.pass == 1)
# Line 1664 | Line 1531 | auth_entry: IRCD_AUTH
1531  
1532    DLINK_FOREACH(node, block_state.mask.list.head)
1533    {
1667    struct MaskItem *conf = NULL;
1534      struct split_nuh_item nuh;
1535      char *s = node->data;
1536  
# Line 1675 | Line 1541 | auth_entry: IRCD_AUTH
1541      nuh.nickptr  = NULL;
1542      nuh.userptr  = block_state.user.buf;
1543      nuh.hostptr  = block_state.host.buf;
1544 +
1545      nuh.nicksize = 0;
1546      nuh.usersize = sizeof(block_state.user.buf);
1547      nuh.hostsize = sizeof(block_state.host.buf);
1548 +
1549      split_nuh(&nuh);
1550  
1551 <    conf        = conf_make(CONF_CLIENT);
1552 <    conf->user  = xstrdup(block_state.user.buf);
1553 <    conf->host  = xstrdup(block_state.host.buf);
1551 >    struct MaskItem *conf = conf_make(CONF_CLIENT);
1552 >    conf->user = xstrdup(block_state.user.buf);
1553 >    conf->host = xstrdup(block_state.host.buf);
1554  
1555      if (block_state.rpass.buf[0])
1556        conf->passwd = xstrdup(block_state.rpass.buf);
# Line 1741 | Line 1609 | auth_flags: IRCD_FLAGS
1609   {
1610    if (conf_parser_ctx.pass == 2)
1611      block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP);
1612 < } '='  auth_flags_items ';';
1612 > } '=' auth_flags_items ';';
1613  
1614   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1615   auth_flags_item: SPOOF_NOTICE
# Line 1872 | Line 1740 | service_name: NAME '=' QSTRING ';'
1740    if (conf_parser_ctx.pass != 2)
1741      break;
1742  
1743 <  if (valid_servname(yylval.string))
1743 >  if (server_valid_name(yylval.string) == true)
1744    {
1745      struct ServiceItem *service = service_make();
1746      service->name = xstrdup(yylval.string);
# Line 2079 | Line 1947 | connect_entry: CONNECT
1947    block_state.port.value = PORTNUM;
1948   } '{' connect_items '}' ';'
1949   {
2082  struct MaskItem *conf = NULL;
1950    struct addrinfo hints, *res;
1951  
1952    if (conf_parser_ctx.pass != 2)
# Line 2093 | Line 1960 | connect_entry: CONNECT
1960        !block_state.spass.buf[0])
1961      break;
1962  
1963 +  if (server_valid_name(block_state.name.buf) == false)
1964 +    break;
1965 +
1966    if (has_wildcards(block_state.name.buf) ||
1967        has_wildcards(block_state.host.buf))
1968      break;
1969  
1970 <  conf = conf_make(CONF_SERVER);
1970 >  struct MaskItem *conf = conf_make(CONF_SERVER);
1971    conf->port = block_state.port.value;
1972    conf->flags = block_state.flags.value;
1973    conf->aftype = block_state.aftype.value;
# Line 2124 | Line 1994 | connect_entry: CONNECT
1994      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
1995  
1996      if (getaddrinfo(block_state.bind.buf, NULL, &hints, &res))
1997 <      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf);
1997 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server bind(%s)", block_state.bind.buf);
1998      else
1999      {
2000        assert(res);
# Line 2143 | Line 2013 | connect_entry: CONNECT
2013   connect_items:  connect_items connect_item | connect_item;
2014   connect_item:   connect_name |
2015                  connect_host |
2016 <                connect_vhost |
2016 >                connect_bind |
2017                  connect_send_password |
2018                  connect_accept_password |
2019                  connect_ssl_certificate_fingerprint |
# Line 2169 | Line 2039 | connect_host: HOST '=' QSTRING ';'
2039      strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf));
2040   };
2041  
2042 < connect_vhost: VHOST '=' QSTRING ';'
2042 > connect_bind: T_BIND '=' QSTRING ';'
2043   {
2044    if (conf_parser_ctx.pass == 2)
2045      strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf));
# Line 2180 | Line 2050 | connect_send_password: SEND_PASSWORD '='
2050    if (conf_parser_ctx.pass != 2)
2051      break;
2052  
2053 <  if ($3[0] == ':')
2053 >  if (*yylval.string == ':')
2054      conf_error_report("Server passwords cannot begin with a colon");
2055 <  else if (strchr($3, ' '))
2055 >  else if (strchr(yylval.string, ' '))
2056      conf_error_report("Server passwords cannot contain spaces");
2057    else
2058      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
# Line 2193 | Line 2063 | connect_accept_password: ACCEPT_PASSWORD
2063    if (conf_parser_ctx.pass != 2)
2064      break;
2065  
2066 <  if ($3[0] == ':')
2066 >  if (*yylval.string == ':')
2067      conf_error_report("Server passwords cannot begin with a colon");
2068 <  else if (strchr($3, ' '))
2068 >  else if (strchr(yylval.string, ' '))
2069      conf_error_report("Server passwords cannot contain spaces");
2070    else
2071      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2226 | Line 2096 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2096   connect_flags: IRCD_FLAGS
2097   {
2098    block_state.flags.value &= CONF_FLAGS_ENCRYPTED;
2099 < } '='  connect_flags_items ';';
2099 > } '=' connect_flags_items ';';
2100  
2101   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2102   connect_flags_item: AUTOCONN
# Line 2289 | Line 2159 | kill_entry: KILL
2159      reset_block_state();
2160   } '{' kill_items '}' ';'
2161   {
2292  struct MaskItem *conf = NULL;
2293
2162    if (conf_parser_ctx.pass != 2)
2163      break;
2164  
# Line 2298 | Line 2166 | kill_entry: KILL
2166        !block_state.host.buf[0])
2167      break;
2168  
2169 <  conf = conf_make(CONF_KLINE);
2169 >  struct MaskItem *conf = conf_make(CONF_KLINE);
2170    conf->user = xstrdup(block_state.user.buf);
2171    conf->host = xstrdup(block_state.host.buf);
2172  
# Line 2348 | Line 2216 | deny_entry: DENY
2216      reset_block_state();
2217   } '{' deny_items '}' ';'
2218   {
2351  struct MaskItem *conf = NULL;
2352
2219    if (conf_parser_ctx.pass != 2)
2220      break;
2221  
# Line 2358 | Line 2224 | deny_entry: DENY
2224  
2225    if (parse_netmask(block_state.addr.buf, NULL, NULL) != HM_HOST)
2226    {
2227 <    conf = conf_make(CONF_DLINE);
2227 >    struct MaskItem *conf = conf_make(CONF_DLINE);
2228      conf->host = xstrdup(block_state.addr.buf);
2229  
2230      if (block_state.rpass.buf[0])
# Line 2455 | Line 2321 | general_entry: GENERAL '{' general_items
2321   general_items:      general_items general_item | general_item;
2322   general_item:       general_away_count |
2323                      general_away_time |
2458                    general_ignore_bogus_ts |
2324                      general_failed_oper_notice |
2325                      general_anti_nick_flood |
2326                      general_max_nick_time |
# Line 2485 | Line 2350 | general_item:       general_away_count |
2350                      general_caller_id_wait |
2351                      general_opers_bypass_callerid |
2352                      general_default_floodcount |
2353 +                    general_default_floodtime |
2354                      general_min_nonwildcard |
2355                      general_min_nonwildcard_simple |
2356                      general_throttle_count |
# Line 2524 | Line 2390 | general_whowas_history_length: WHOWAS_HI
2390  
2391   general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2392   {
2393 <  if (conf_parser_ctx.pass == 2)
2528 <    ConfigGeneral.cycle_on_host_change = yylval.number;
2393 >  ConfigGeneral.cycle_on_host_change = yylval.number;
2394   };
2395  
2396   general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
# Line 2558 | Line 2423 | general_kill_chase_time_limit: KILL_CHAS
2423    ConfigGeneral.kill_chase_time_limit = $3;
2424   };
2425  
2561 general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2562 {
2563  ConfigGeneral.ignore_bogus_ts = yylval.number;
2564 };
2565
2426   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2427   {
2428    ConfigGeneral.failed_oper_notice = yylval.number;
# Line 2600 | Line 2460 | general_ts_warn_delta: TS_WARN_DELTA '='
2460  
2461   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2462   {
2463 <  if (conf_parser_ctx.pass == 2)
2604 <    ConfigGeneral.ts_max_delta = $3;
2463 >  ConfigGeneral.ts_max_delta = $3;
2464   };
2465  
2466   general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
# Line 2718 | Line 2577 | general_throttle_time: THROTTLE_TIME '='
2577   general_oper_umodes: OPER_UMODES
2578   {
2579    ConfigGeneral.oper_umodes = 0;
2580 < } '='  umode_oitems ';' ;
2580 > } '=' umode_oitems ';' ;
2581  
2582   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2583   umode_oitem:     T_BOTS
# Line 2792 | Line 2651 | umode_oitem:     T_BOTS
2651   general_oper_only_umodes: OPER_ONLY_UMODES
2652   {
2653    ConfigGeneral.oper_only_umodes = 0;
2654 < } '='  umode_items ';' ;
2654 > } '=' umode_items ';' ;
2655  
2656   umode_items:  umode_items ',' umode_item | umode_item;
2657   umode_item:   T_BOTS
# Line 2872 | Line 2731 | general_default_floodcount: DEFAULT_FLOO
2731    ConfigGeneral.default_floodcount = $3;
2732   };
2733  
2734 + general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';'
2735 + {
2736 +  ConfigGeneral.default_floodtime = $3;
2737 + };
2738 +
2739  
2740   /***************************************************************************
2741   * channel {} section
# Line 2880 | Line 2744 | channel_entry: CHANNEL '{' channel_items
2744  
2745   channel_items:      channel_items channel_item | channel_item;
2746   channel_item:       channel_max_bans |
2747 +                    channel_max_bans_large |
2748                      channel_invite_client_count |
2749                      channel_invite_client_time |
2750                      channel_invite_delay_channel |
2751 +                    channel_invite_expire_time |
2752                      channel_knock_client_count |
2753                      channel_knock_client_time |
2754                      channel_knock_delay_channel |
2755                      channel_max_channels |
2756 +                    channel_max_invites |
2757                      channel_default_join_flood_count |
2758                      channel_default_join_flood_time |
2759                      channel_disable_fake_channels |
# Line 2912 | Line 2779 | channel_invite_delay_channel: INVITE_DEL
2779    ConfigChannel.invite_delay_channel = $3;
2780   };
2781  
2782 + channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';'
2783 + {
2784 +  ConfigChannel.invite_expire_time = $3;
2785 + };
2786 +
2787   channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2788   {
2789    ConfigChannel.knock_client_count = $3;
# Line 2932 | Line 2804 | channel_max_channels: MAX_CHANNELS '=' N
2804    ConfigChannel.max_channels = $3;
2805   };
2806  
2807 + channel_max_invites: MAX_INVITES '=' NUMBER ';'
2808 + {
2809 +  ConfigChannel.max_invites = $3;
2810 + };
2811 +
2812   channel_max_bans: MAX_BANS '=' NUMBER ';'
2813   {
2814    ConfigChannel.max_bans = $3;
2815   };
2816  
2817 + channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';'
2818 + {
2819 +  ConfigChannel.max_bans_large = $3;
2820 + };
2821 +
2822   channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2823   {
2824    ConfigChannel.default_join_flood_count = yylval.number;

Comparing ircd-hybrid/trunk/src/conf_parser.y (property svn:keywords):
Revision 7624 by michael, Thu Jun 23 12:44:09 2016 UTC vs.
Revision 8864 by michael, Sat Feb 16 09:54:03 2019 UTC

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

Diff Legend

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