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-7.2/src/ircd_parser.y (file contents), Revision 967 by michael, Sun Aug 2 18:05:28 2009 UTC vs.
ircd-hybrid-8/src/conf_parser.y (file contents), Revision 1416 by michael, Sat May 26 11:45:43 2012 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  ircd_parser.y: Parses the ircd configuration file.
3 > *  conf_parser.y: Parses the ircd configuration file.
4   *
5   *  Copyright (C) 2005 by the past and present ircd coders, and others.
6   *
# Line 28 | Line 28
28   #include <sys/types.h>
29   #include <string.h>
30  
31 + #include "config.h"
32   #include "stdinc.h"
33   #include "ircd.h"
33 #include "tools.h"
34   #include "list.h"
35 < #include "s_conf.h"
35 > #include "conf.h"
36   #include "event.h"
37 < #include "s_log.h"
37 > #include "log.h"
38   #include "client.h"     /* for UMODE_ALL only */
39 #include "pcre.h"
39   #include "irc_string.h"
41 #include "irc_getaddrinfo.h"
40   #include "sprintf_irc.h"
41   #include "memory.h"
42   #include "modules.h"
# Line 54 | Line 52
52   #include <openssl/rsa.h>
53   #include <openssl/bio.h>
54   #include <openssl/pem.h>
55 + #include <openssl/dh.h>
56   #endif
57  
58 + int yylex(void);
59 +
60   static char *class_name = NULL;
61   static struct ConfItem *yy_conf = NULL;
62   static struct AccessItem *yy_aconf = NULL;
# Line 64 | Line 65 | static struct ClassItem *yy_class = NULL
65   static char *yy_class_name = NULL;
66  
67   static dlink_list col_conf_list  = { NULL, NULL, 0 };
67 static dlink_list hub_conf_list  = { NULL, NULL, 0 };
68 static dlink_list leaf_conf_list = { NULL, NULL, 0 };
68   static unsigned int listener_flags = 0;
69   static unsigned int regex_ban = 0;
70   static char userbuf[IRCD_BUFSIZE];
71   static char hostbuf[IRCD_BUFSIZE];
72   static char reasonbuf[REASONLEN + 1];
73   static char gecos_name[REALLEN * 4];
74 <
75 < extern dlink_list gdeny_items; /* XXX */
76 <
74 > static char lfile[IRCD_BUFSIZE];
75 > static unsigned int ltype = 0;
76 > static unsigned int lsize = 0;
77   static char *resv_reason = NULL;
78   static char *listener_address = NULL;
80 static int not_atom = 0;
79  
80   struct CollectItem
81   {
# Line 107 | Line 105 | free_collect_item(struct CollectItem *it
105    MyFree(item);
106   }
107  
110 static void
111 unhook_hub_leaf_confs(void)
112 {
113  dlink_node *ptr;
114  dlink_node *next_ptr;
115  struct CollectItem *yy_hconf;
116  struct CollectItem *yy_lconf;
117
118  DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
119  {
120    yy_hconf = ptr->data;
121    dlinkDelete(&yy_hconf->node, &hub_conf_list);
122    free_collect_item(yy_hconf);
123  }
124
125  DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
126  {
127    yy_lconf = ptr->data;
128    dlinkDelete(&yy_lconf->node, &leaf_conf_list);
129    free_collect_item(yy_lconf);
130  }
131 }
132
108   %}
109  
110   %union {
# Line 147 | Line 122 | unhook_hub_leaf_confs(void)
122   %token  AUTOCONN
123   %token  T_BLOCK
124   %token  BURST_AWAY
150 %token  BURST_TOPICWHO
125   %token  BYTES KBYTES MBYTES GBYTES TBYTES
126   %token  CALLER_ID_WAIT
127   %token  CAN_FLOOD
154 %token  CAN_IDLE
128   %token  CHANNEL
129   %token  CIDR_BITLEN_IPV4
130   %token  CIDR_BITLEN_IPV6
158 %token  CIPHER_PREFERENCE
131   %token  CLASS
160 %token  COMPRESSED
161 %token  COMPRESSION_LEVEL
132   %token  CONNECT
133   %token  CONNECTFREQ
164 %token  CRYPTLINK
165 %token  DEFAULT_CIPHER_PREFERENCE
134   %token  DEFAULT_FLOODCOUNT
135   %token  DEFAULT_SPLIT_SERVER_COUNT
136   %token  DEFAULT_SPLIT_USER_COUNT
# Line 174 | Line 142 | unhook_hub_leaf_confs(void)
142   %token  DISABLE_HIDDEN
143   %token  DISABLE_LOCAL_CHANNELS
144   %token  DISABLE_REMOTE_COMMANDS
177 %token  DOT_IN_IP6_ADDR
145   %token  DOTS_IN_IDENT
146   %token  DURATION
147   %token  EGDPOOL_PATH
# Line 184 | Line 151 | unhook_hub_leaf_confs(void)
151   %token  EXCEED_LIMIT
152   %token  EXEMPT
153   %token  FAILED_OPER_NOTICE
187 %token  FAKENAME
154   %token  IRCD_FLAGS
155   %token  FLATTEN_LINKS
190 %token  FFAILED_OPERLOG
191 %token  FKILLLOG
192 %token  FKLINELOG
193 %token  FGLINELOG
194 %token  FIOERRLOG
195 %token  FOPERLOG
196 %token  FOPERSPYLOG
197 %token  FUSERLOG
156   %token  GECOS
157   %token  GENERAL
158   %token  GLINE
159   %token  GLINES
160   %token  GLINE_EXEMPT
203 %token  GLINE_LOG
161   %token  GLINE_TIME
162   %token  GLINE_MIN_CIDR
163   %token  GLINE_MIN_CIDR6
# Line 209 | Line 166 | unhook_hub_leaf_confs(void)
166   %token  NEED_IDENT
167   %token  HAVENT_READ_CONF
168   %token  HIDDEN
212 %token  HIDDEN_ADMIN
169   %token  HIDDEN_NAME
214 %token  HIDDEN_OPER
170   %token  HIDE_SERVER_IPS
171   %token  HIDE_SERVERS
172   %token  HIDE_SPOOF_IPS
173   %token  HOST
174   %token  HUB
175   %token  HUB_MASK
221 %token  IDLETIME
176   %token  IGNORE_BOGUS_TS
177   %token  INVISIBLE_ON_CONNECT
178   %token  IP
# Line 234 | Line 188 | unhook_hub_leaf_confs(void)
188   %token  LINKS_DELAY
189   %token  LISTEN
190   %token  T_LOG
237 %token  LOGGING
238 %token  LOG_LEVEL
191   %token  MAX_ACCEPT
192   %token  MAX_BANS
193   %token  MAX_CHANS_PER_USER
# Line 262 | Line 214 | unhook_hub_leaf_confs(void)
214   %token  NO_JOIN_ON_SPLIT
215   %token  NO_OPER_FLOOD
216   %token  NO_TILDE
265 %token  NOT
217   %token  NUMBER
218   %token  NUMBER_PER_IDENT
219   %token  NUMBER_PER_CIDR
# Line 270 | Line 221 | unhook_hub_leaf_confs(void)
221   %token  NUMBER_PER_IP_GLOBAL
222   %token  OPERATOR
223   %token  OPERS_BYPASS_CALLERID
273 %token  OPER_LOG
224   %token  OPER_ONLY_UMODES
225   %token  OPER_PASS_RESV
226   %token  OPER_SPY_T
# Line 300 | Line 250 | unhook_hub_leaf_confs(void)
250   %token  RSA_PRIVATE_KEY_FILE
251   %token  RSA_PUBLIC_KEY_FILE
252   %token  SSL_CERTIFICATE_FILE
253 < %token  T_SSL_CONNECTION_METHOD
253 > %token  SSL_DH_PARAM_FILE
254 > %token  T_SSL_CLIENT_METHOD
255 > %token  T_SSL_SERVER_METHOD
256   %token  T_SSLV3
257   %token  T_TLSV1
258   %token  RESV
# Line 310 | Line 262 | unhook_hub_leaf_confs(void)
262   %token  SEND_PASSWORD
263   %token  SERVERHIDE
264   %token  SERVERINFO
313 %token  SERVLINK_PATH
265   %token  IRCD_SID
266   %token  TKLINE_EXPIRE_NOTICES
267   %token  T_SHARED
# Line 337 | Line 288 | unhook_hub_leaf_confs(void)
288   %token  T_CALLERID
289   %token  T_CCONN
290   %token  T_CCONN_FULL
291 + %token  T_SSL_CIPHER_LIST
292   %token  T_CLIENT_FLOOD
293   %token  T_DEAF
294   %token  T_DEBUG
295 + %token  T_DLINE
296   %token  T_DRONE
297   %token  T_EXTERNAL
298   %token  T_FULL
# Line 347 | Line 300 | unhook_hub_leaf_confs(void)
300   %token  T_IPV4
301   %token  T_IPV6
302   %token  T_LOCOPS
350 %token  T_LOGPATH
351 %token  T_L_CRIT
352 %token  T_L_DEBUG
353 %token  T_L_ERROR
354 %token  T_L_INFO
355 %token  T_L_NOTICE
356 %token  T_L_TRACE
357 %token  T_L_WARN
303   %token  T_MAX_CLIENTS
304   %token  T_NCHANGE
305   %token  T_OPERWALL
# Line 366 | Line 311 | unhook_hub_leaf_confs(void)
311   %token  T_SSL
312   %token  T_UMODES
313   %token  T_UNAUTH
314 + %token  T_UNDLINE
315 + %token  T_UNLIMITED
316   %token  T_UNRESV
317   %token  T_UNXLINE
318 + %token  T_GLOBOPS
319   %token  T_WALLOP
320 + %token  T_RESTART
321 + %token  T_SERVICE
322 + %token  T_SERVICES_NAME
323   %token  THROTTLE_TIME
324   %token  TOPICBURST
325   %token  TRUE_NO_OPER_FLOOD
# Line 388 | Line 339 | unhook_hub_leaf_confs(void)
339   %token  XLINE
340   %token  WARN
341   %token  WARN_NO_NLINE
342 + %token  T_SIZE
343 + %token  T_FILE
344  
345   %type <string> QSTRING
346   %type <number> NUMBER
# Line 411 | Line 364 | conf_item:        admin_entry
364                  | serverinfo_entry
365                  | serverhide_entry
366                  | resv_entry
367 +                | service_entry
368                  | shared_entry
369                  | cluster_entry
370                  | connect_entry
# Line 472 | Line 426 | modules_item:   modules_module | modules
426  
427   modules_module: MODULE '=' QSTRING ';'
428   {
475 #ifndef STATIC_MODULES /* NOOP in the static case */
429    if (conf_parser_ctx.pass == 2)
430 <  {
478 <    char *m_bn;
479 <
480 <    m_bn = basename(yylval.string);
481 <
482 <    /* I suppose we should just ignore it if it is already loaded(since
483 <     * otherwise we would flood the opers on rehash) -A1kmm.
484 <     */
485 <    add_conf_module(yylval.string);
486 <  }
487 < #endif
430 >    add_conf_module(libio_basename(yylval.string));
431   };
432  
433   modules_path: PATH '=' QSTRING ';'
434   {
492 #ifndef STATIC_MODULES
435    if (conf_parser_ctx.pass == 2)
436      mod_add_path(yylval.string);
495 #endif
437   };
438  
439  
# Line 502 | Line 443 | serverinfo_items:       serverinfo_items
443   serverinfo_item:        serverinfo_name | serverinfo_vhost |
444                          serverinfo_hub | serverinfo_description |
445                          serverinfo_network_name | serverinfo_network_desc |
446 <                        serverinfo_max_clients |
446 >                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
447                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
448                          serverinfo_sid | serverinfo_ssl_certificate_file |
449 <                        serverinfo_ssl_connection_method |
449 >                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
450 >                        serverinfo_ssl_cipher_list |
451                          error ';' ;
452  
453  
454 < serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
454 > serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
455 > serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
456 >
457 > client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
458 > client_method_type_item: T_SSLV3
459   {
460 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
461 <    ServerInfo.tls_version = 0;
462 < } '=' method_types ';'
460 > #ifdef HAVE_LIBCRYPTO
461 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
462 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
463 > #endif
464 > } | T_TLSV1
465   {
466 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
467 <  {
468 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
469 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
522 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
523 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
524 <  }
466 > #ifdef HAVE_LIBCRYPTO
467 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
468 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
469 > #endif
470   };
471  
472 < method_types: method_types ',' method_type_item | method_type_item;
473 < method_type_item: T_SSLV3
472 > server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
473 > server_method_type_item: T_SSLV3
474   {
475 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
476 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
475 > #ifdef HAVE_LIBCRYPTO
476 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
477 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
478 > #endif
479   } | T_TLSV1
480   {
481 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
482 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
481 > #ifdef HAVE_LIBCRYPTO
482 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
483 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
484 > #endif
485   };
486  
487   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
# Line 547 | Line 496 | serverinfo_ssl_certificate_file: SSL_CER
496      }
497  
498      if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
499 +                                     SSL_FILETYPE_PEM) <= 0 ||
500 +        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
501                                       SSL_FILETYPE_PEM) <= 0)
502      {
503        yyerror(ERR_lib_error_string(ERR_get_error()));
# Line 554 | Line 505 | serverinfo_ssl_certificate_file: SSL_CER
505      }
506  
507      if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
508 +                                    SSL_FILETYPE_PEM) <= 0 ||
509 +        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
510                                      SSL_FILETYPE_PEM) <= 0)
511      {
512        yyerror(ERR_lib_error_string(ERR_get_error()));
513        break;
514      }
515  
516 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
516 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
517 >        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
518      {
519        yyerror(ERR_lib_error_string(ERR_get_error()));
520        break;
# Line 596 | Line 550 | serverinfo_rsa_private_key_file: RSA_PRI
550        break;
551      }
552  
553 <    ServerInfo.rsa_private_key = (RSA *)PEM_read_bio_RSAPrivateKey(file, NULL,
600 <      0, NULL);
553 >    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
554  
555      BIO_set_close(file, BIO_CLOSE);
556      BIO_free(file);
# Line 629 | Line 582 | serverinfo_rsa_private_key_file: RSA_PRI
582   #endif
583   };
584  
585 + serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
586 + {
587 + /* TBD - XXX: error reporting */
588 + #ifdef HAVE_LIBCRYPTO
589 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
590 +  {
591 +    BIO *file = BIO_new_file(yylval.string, "r");
592 +
593 +    if (file)
594 +    {
595 +      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
596 +
597 +      BIO_free(file);
598 +
599 +      if (dh)
600 +      {
601 +        if (DH_size(dh) < 128)
602 +          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
603 +        else
604 +          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
605 +
606 +        DH_free(dh);
607 +      }
608 +    }
609 +  }
610 + #endif
611 + };
612 +
613 + serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
614 + {
615 + #ifdef HAVE_LIBCRYPTO
616 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
617 +    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
618 + #endif
619 + };
620 +
621   serverinfo_name: NAME '=' QSTRING ';'
622   {
623    /* this isn't rehashable */
624 <  if (conf_parser_ctx.pass == 2)
624 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
625    {
626 <    if (ServerInfo.name == NULL)
626 >    if (valid_servname(yylval.string))
627 >      DupString(ServerInfo.name, yylval.string);
628 >    else
629      {
630 <      /* the ircd will exit() in main() if we dont set one */
631 <      if (strlen(yylval.string) <= HOSTLEN)
641 <        DupString(ServerInfo.name, yylval.string);
630 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
631 >      exit(0);
632      }
633    }
634   };
# Line 652 | Line 642 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
642        DupString(ServerInfo.sid, yylval.string);
643      else
644      {
645 <      ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting.");
645 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
646        exit(0);
647      }
648    }
# Line 702 | Line 692 | serverinfo_vhost: VHOST '=' QSTRING ';'
692      hints.ai_socktype = SOCK_STREAM;
693      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
694  
695 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
696 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
695 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
696 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
697      else
698      {
699        assert(res != NULL);
# Line 711 | Line 701 | serverinfo_vhost: VHOST '=' QSTRING ';'
701        memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
702        ServerInfo.ip.ss.ss_family = res->ai_family;
703        ServerInfo.ip.ss_len = res->ai_addrlen;
704 <      irc_freeaddrinfo(res);
704 >      freeaddrinfo(res);
705  
706        ServerInfo.specific_ipv4_vhost = 1;
707      }
# Line 731 | Line 721 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
721      hints.ai_socktype = SOCK_STREAM;
722      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
723  
724 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
725 <      ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string);
724 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
725 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
726      else
727      {
728        assert(res != NULL);
# Line 740 | Line 730 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
730        memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
731        ServerInfo.ip6.ss.ss_family = res->ai_family;
732        ServerInfo.ip6.ss_len = res->ai_addrlen;
733 <      irc_freeaddrinfo(res);
733 >      freeaddrinfo(res);
734  
735        ServerInfo.specific_ipv6_vhost = 1;
736      }
# Line 774 | Line 764 | serverinfo_max_clients: T_MAX_CLIENTS '=
764   serverinfo_hub: HUB '=' TBOOL ';'
765   {
766    if (conf_parser_ctx.pass == 2)
767 <  {
778 <    if (yylval.number)
779 <    {
780 <      ServerInfo.hub = 1;
781 <      delete_capability("HUB");
782 <      add_capability("HUB", CAP_HUB, 1);
783 <    }
784 <    else if (ServerInfo.hub)
785 <    {
786 <
787 <      ServerInfo.hub = 0;
788 <      delete_capability("HUB");
789 <    }
790 <  }
767 >    ServerInfo.hub = yylval.number;
768   };
769  
770   /***************************************************************************
# Line 829 | Line 806 | admin_description: DESCRIPTION '=' QSTRI
806   /***************************************************************************
807   *  section logging
808   ***************************************************************************/
809 < /* XXX */
810 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
809 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
810 > logging_items:          logging_items logging_item | logging_item ;
811  
812 < logging_items:          logging_items logging_item |
836 <                        logging_item ;
837 <
838 < logging_item:           logging_path | logging_oper_log |
839 <                        logging_log_level |
840 <                        logging_use_logging | logging_fuserlog |
841 <                        logging_foperlog | logging_fglinelog |
842 <                        logging_fklinelog | logging_killlog |
843 <                        logging_foperspylog | logging_ioerrlog |
844 <                        logging_ffailed_operlog |
812 > logging_item:           logging_use_logging | logging_file_entry |
813                          error ';' ;
814  
815 < logging_path:           T_LOGPATH '=' QSTRING ';'
848 <                        {
849 <                        };
850 <
851 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
852 <                        {
853 <                        };
854 <
855 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
815 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
816   {
817    if (conf_parser_ctx.pass == 2)
818 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
859 <            sizeof(ConfigLoggingEntry.userlog));
818 >    ConfigLoggingEntry.use_logging = yylval.number;
819   };
820  
821 < logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
821 > logging_file_entry:
822   {
823 <  if (conf_parser_ctx.pass == 2)
824 <    strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
825 <            sizeof(ConfigLoggingEntry.failed_operlog));
826 < };
868 <
869 < logging_foperlog: FOPERLOG '=' QSTRING ';'
823 >  lfile[0] = '\0';
824 >  ltype = 0;
825 >  lsize = 0;
826 > } T_FILE  '{' logging_file_items '}' ';'
827   {
828 <  if (conf_parser_ctx.pass == 2)
829 <    strlcpy(ConfigLoggingEntry.operlog, yylval.string,
873 <            sizeof(ConfigLoggingEntry.operlog));
828 >  if (conf_parser_ctx.pass == 2 && ltype > 0)
829 >    log_add_file(ltype, lsize, lfile);
830   };
831  
832 < logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
833 < {
878 <  if (conf_parser_ctx.pass == 2)
879 <    strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
880 <            sizeof(ConfigLoggingEntry.operspylog));
881 < };
832 > logging_file_items: logging_file_items logging_file_item |
833 >                    logging_file_item ;
834  
835 < logging_fglinelog: FGLINELOG '=' QSTRING ';'
836 < {
885 <  if (conf_parser_ctx.pass == 2)
886 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
887 <            sizeof(ConfigLoggingEntry.glinelog));
888 < };
835 > logging_file_item:  logging_file_name | logging_file_type |
836 >                    logging_file_size | error ';' ;
837  
838 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
838 > logging_file_name: NAME '=' QSTRING ';'
839   {
840 <  if (conf_parser_ctx.pass == 2)
841 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
894 <            sizeof(ConfigLoggingEntry.klinelog));
895 < };
840 >  strlcpy(lfile, yylval.string, sizeof(lfile));
841 > }
842  
843 < logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
843 > logging_file_size: T_SIZE '=' sizespec ';'
844   {
845 <  if (conf_parser_ctx.pass == 2)
846 <    strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
847 <            sizeof(ConfigLoggingEntry.ioerrlog));
845 >  lsize = $3;
846 > } | T_SIZE '=' T_UNLIMITED ';'
847 > {
848 >  lsize = 0;
849   };
850  
851 < logging_killlog: FKILLLOG '=' QSTRING ';'
851 > logging_file_type: TYPE
852   {
853    if (conf_parser_ctx.pass == 2)
854 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
855 <            sizeof(ConfigLoggingEntry.killlog));
909 < };
854 >    ltype = 0;
855 > } '='  logging_file_type_items ';' ;
856  
857 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
858 < {
913 <  if (conf_parser_ctx.pass == 2)
914 <    set_log_level(L_CRIT);
915 < } | LOG_LEVEL '=' T_L_ERROR ';'
857 > logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item;
858 > logging_file_type_item:  USER
859   {
860    if (conf_parser_ctx.pass == 2)
861 <    set_log_level(L_ERROR);
862 < } | LOG_LEVEL '=' T_L_WARN ';'
861 >    ltype = LOG_TYPE_USER;
862 > } | OPERATOR
863   {
864    if (conf_parser_ctx.pass == 2)
865 <    set_log_level(L_WARN);
866 < } | LOG_LEVEL '=' T_L_NOTICE ';'
865 >    ltype = LOG_TYPE_OPER;
866 > } | GLINE
867   {
868    if (conf_parser_ctx.pass == 2)
869 <    set_log_level(L_NOTICE);
870 < } | LOG_LEVEL '=' T_L_TRACE ';'
869 >    ltype = LOG_TYPE_GLINE;
870 > } | T_DLINE
871   {
872    if (conf_parser_ctx.pass == 2)
873 <    set_log_level(L_TRACE);
874 < } | LOG_LEVEL '=' T_L_INFO ';'
873 >    ltype = LOG_TYPE_DLINE;
874 > } | KLINE
875   {
876    if (conf_parser_ctx.pass == 2)
877 <    set_log_level(L_INFO);
878 < } | LOG_LEVEL '=' T_L_DEBUG ';'
877 >    ltype = LOG_TYPE_KLINE;
878 > } | KILL
879   {
880    if (conf_parser_ctx.pass == 2)
881 <    set_log_level(L_DEBUG);
882 < };
940 <
941 < logging_use_logging: USE_LOGGING '=' TBOOL ';'
881 >    ltype = LOG_TYPE_KILL;
882 > } | T_DEBUG
883   {
884    if (conf_parser_ctx.pass == 2)
885 <    ConfigLoggingEntry.use_logging = yylval.number;
885 >    ltype = LOG_TYPE_DEBUG;
886   };
887  
888 +
889   /***************************************************************************
890   * section oper
891   ***************************************************************************/
# Line 960 | Line 902 | oper_entry: OPERATOR
902      MyFree(class_name);
903      class_name = NULL;
904    }
905 < } oper_name_b '{' oper_items '}' ';'
905 > } '{' oper_items '}' ';'
906   {
907    if (conf_parser_ctx.pass == 2)
908    {
# Line 995 | Line 937 | oper_entry: OPERATOR
937          DupString(new_aconf->host, yy_tmp->host);
938        else
939          DupString(new_aconf->host, "*");
940 +
941 +      new_aconf->type = parse_netmask(new_aconf->host, &new_aconf->addr,
942 +                                     &new_aconf->bits);
943 +
944        conf_add_class_to_conf(new_conf, class_name);
945        if (yy_aconf->passwd != NULL)
946          DupString(new_aconf->passwd, yy_aconf->passwd);
# Line 1041 | Line 987 | oper_entry: OPERATOR
987    }
988   };
989  
1044 oper_name_b: | oper_name_t;
990   oper_items:     oper_items oper_item | oper_item;
991 < oper_item:      oper_name | oper_user | oper_password | oper_hidden_admin |
992 <                oper_hidden_oper | oper_umodes |
993 <                oper_class | oper_global_kill | oper_remote |
1049 <                oper_kline | oper_xline | oper_unkline |
1050 <                oper_gline | oper_nick_changes | oper_remoteban |
1051 <                oper_die | oper_rehash | oper_admin | oper_operwall |
1052 <                oper_encrypted | oper_rsa_public_key_file |
1053 <                oper_flags | error ';' ;
991 > oper_item:      oper_name | oper_user | oper_password |
992 >                oper_umodes | oper_class | oper_encrypted |
993 >                oper_rsa_public_key_file | oper_flags | error ';' ;
994  
995   oper_name: NAME '=' QSTRING ';'
996   {
997    if (conf_parser_ctx.pass == 2)
998    {
1059    if (strlen(yylval.string) > OPERNICKLEN)
1060      yylval.string[OPERNICKLEN] = '\0';
1061
1062    MyFree(yy_conf->name);
1063    DupString(yy_conf->name, yylval.string);
1064  }
1065 };
1066
1067 oper_name_t: QSTRING
1068 {
1069  if (conf_parser_ctx.pass == 2)
1070  {
1071    if (strlen(yylval.string) > OPERNICKLEN)
1072      yylval.string[OPERNICKLEN] = '\0';
1073
999      MyFree(yy_conf->name);
1000      DupString(yy_conf->name, yylval.string);
1001    }
# Line 1097 | Line 1022 | oper_user: USER '=' QSTRING ';'
1022      {
1023        DupString(yy_aconf->user, userbuf);
1024        DupString(yy_aconf->host, hostbuf);
1025 +
1026 +      yy_aconf->type = parse_netmask(yy_aconf->host, &yy_aconf->addr,
1027 +                                    &yy_aconf->bits);
1028      }
1029      else
1030      {
# Line 1215 | Line 1143 | oper_umodes_item:  T_BOTS
1143   {
1144    if (conf_parser_ctx.pass == 2)
1145      yy_aconf->modes |= UMODE_FULL;
1146 + } | HIDDEN
1147 + {
1148 +  if (conf_parser_ctx.pass == 2)
1149 +    yy_aconf->modes |= UMODE_HIDDEN;
1150   } | T_SKILL
1151   {
1152    if (conf_parser_ctx.pass == 2)
# Line 1269 | Line 1201 | oper_umodes_item:  T_BOTS
1201      yy_aconf->modes |= UMODE_LOCOPS;
1202   };
1203  
1272 oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1273 {
1274  if (conf_parser_ctx.pass == 2)
1275  {
1276    if (yylval.number)
1277      yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1278    else
1279      yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1280  }
1281 };
1282
1283 oper_remote: REMOTE '=' TBOOL ';'
1284 {
1285  if (conf_parser_ctx.pass == 2)
1286  {
1287    if (yylval.number)
1288      yy_aconf->port |= OPER_FLAG_REMOTE;
1289    else
1290      yy_aconf->port &= ~OPER_FLAG_REMOTE;
1291  }
1292 };
1293
1294 oper_remoteban: REMOTEBAN '=' TBOOL ';'
1295 {
1296  if (conf_parser_ctx.pass == 2)
1297  {
1298    if (yylval.number)
1299      yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1300    else
1301      yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1302  }
1303 };
1304
1305 oper_kline: KLINE '=' TBOOL ';'
1306 {
1307  if (conf_parser_ctx.pass == 2)
1308  {
1309    if (yylval.number)
1310      yy_aconf->port |= OPER_FLAG_K;
1311    else
1312      yy_aconf->port &= ~OPER_FLAG_K;
1313  }
1314 };
1315
1316 oper_xline: XLINE '=' TBOOL ';'
1317 {
1318  if (conf_parser_ctx.pass == 2)
1319  {
1320    if (yylval.number)
1321      yy_aconf->port |= OPER_FLAG_X;
1322    else
1323      yy_aconf->port &= ~OPER_FLAG_X;
1324  }
1325 };
1326
1327 oper_unkline: UNKLINE '=' TBOOL ';'
1328 {
1329  if (conf_parser_ctx.pass == 2)
1330  {
1331    if (yylval.number)
1332      yy_aconf->port |= OPER_FLAG_UNKLINE;
1333    else
1334      yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1335  }
1336 };
1337
1338 oper_gline: GLINE '=' TBOOL ';'
1339 {
1340  if (conf_parser_ctx.pass == 2)
1341  {
1342    if (yylval.number)
1343      yy_aconf->port |= OPER_FLAG_GLINE;
1344    else
1345      yy_aconf->port &= ~OPER_FLAG_GLINE;
1346  }
1347 };
1348
1349 oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1350 {
1351  if (conf_parser_ctx.pass == 2)
1352  {
1353    if (yylval.number)
1354      yy_aconf->port |= OPER_FLAG_N;
1355    else
1356      yy_aconf->port &= ~OPER_FLAG_N;
1357  }
1358 };
1359
1360 oper_die: DIE '=' TBOOL ';'
1361 {
1362  if (conf_parser_ctx.pass == 2)
1363  {
1364    if (yylval.number)
1365      yy_aconf->port |= OPER_FLAG_DIE;
1366    else
1367      yy_aconf->port &= ~OPER_FLAG_DIE;
1368  }
1369 };
1370
1371 oper_rehash: REHASH '=' TBOOL ';'
1372 {
1373  if (conf_parser_ctx.pass == 2)
1374  {
1375    if (yylval.number)
1376      yy_aconf->port |= OPER_FLAG_REHASH;
1377    else
1378      yy_aconf->port &= ~OPER_FLAG_REHASH;
1379  }
1380 };
1381
1382 oper_admin: ADMIN '=' TBOOL ';'
1383 {
1384  if (conf_parser_ctx.pass == 2)
1385  {
1386    if (yylval.number)
1387      yy_aconf->port |= OPER_FLAG_ADMIN;
1388    else
1389      yy_aconf->port &= ~OPER_FLAG_ADMIN;
1390  }
1391 };
1392
1393 oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1394 {
1395  if (conf_parser_ctx.pass == 2)
1396  {
1397    if (yylval.number)
1398      yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1399    else
1400      yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1401  }
1402 };
1403
1404 oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1405 {
1406  if (conf_parser_ctx.pass == 2)
1407  {
1408    if (yylval.number)
1409      yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1410    else
1411      yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1412  }
1413 };
1414
1415 oper_operwall: T_OPERWALL '=' TBOOL ';'
1416 {
1417  if (conf_parser_ctx.pass == 2)
1418  {
1419    if (yylval.number)
1420      yy_aconf->port |= OPER_FLAG_OPERWALL;
1421    else
1422      yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1423  }
1424 };
1425
1204   oper_flags: IRCD_FLAGS
1205   {
1206 +  if (conf_parser_ctx.pass == 2)
1207 +    yy_aconf->port = 0;
1208   } '='  oper_flags_items ';';
1209  
1210   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1211 < oper_flags_item: NOT { not_atom = 1; } oper_flags_item_atom
1432 <                | { not_atom = 0; } oper_flags_item_atom;
1433 <
1434 < oper_flags_item_atom: GLOBAL_KILL
1211 > oper_flags_item: GLOBAL_KILL
1212   {
1213    if (conf_parser_ctx.pass == 2)
1214 <  {
1438 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1439 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1440 <  }
1214 >    yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1215   } | REMOTE
1216   {
1217    if (conf_parser_ctx.pass == 2)
1218 <  {
1445 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1446 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1447 <  }
1218 >    yy_aconf->port |= OPER_FLAG_REMOTE;
1219   } | KLINE
1220   {
1221    if (conf_parser_ctx.pass == 2)
1222 <  {
1452 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1453 <    else yy_aconf->port |= OPER_FLAG_K;
1454 <  }
1222 >    yy_aconf->port |= OPER_FLAG_K;
1223   } | UNKLINE
1224   {
1225    if (conf_parser_ctx.pass == 2)
1226 <  {
1227 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1228 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1229 <  }
1226 >    yy_aconf->port |= OPER_FLAG_UNKLINE;
1227 > } | T_DLINE
1228 > {
1229 >  if (conf_parser_ctx.pass == 2)
1230 >    yy_aconf->port |= OPER_FLAG_DLINE;
1231 > } | T_UNDLINE
1232 > {
1233 >  if (conf_parser_ctx.pass == 2)
1234 >    yy_aconf->port |= OPER_FLAG_UNDLINE;
1235   } | XLINE
1236   {
1237    if (conf_parser_ctx.pass == 2)
1238 <  {
1466 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1467 <    else yy_aconf->port |= OPER_FLAG_X;
1468 <  }
1238 >    yy_aconf->port |= OPER_FLAG_X;
1239   } | GLINE
1240   {
1241    if (conf_parser_ctx.pass == 2)
1242 <  {
1473 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1474 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1475 <  }
1242 >    yy_aconf->port |= OPER_FLAG_GLINE;
1243   } | DIE
1244   {
1245    if (conf_parser_ctx.pass == 2)
1246 <  {
1247 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1481 <    else yy_aconf->port |= OPER_FLAG_DIE;
1482 <  }
1483 < } | REHASH
1246 >    yy_aconf->port |= OPER_FLAG_DIE;
1247 > } | T_RESTART
1248   {
1249    if (conf_parser_ctx.pass == 2)
1250 <  {
1251 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1488 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1489 <  }
1490 < } | ADMIN
1250 >    yy_aconf->port |= OPER_FLAG_RESTART;
1251 > } | REHASH
1252   {
1253    if (conf_parser_ctx.pass == 2)
1254 <  {
1255 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1495 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1496 <  }
1497 < } | HIDDEN_ADMIN
1254 >    yy_aconf->port |= OPER_FLAG_REHASH;
1255 > } | ADMIN
1256   {
1257    if (conf_parser_ctx.pass == 2)
1258 <  {
1501 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1502 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1503 <  }
1258 >    yy_aconf->port |= OPER_FLAG_ADMIN;
1259   } | NICK_CHANGES
1260   {
1261    if (conf_parser_ctx.pass == 2)
1262 <  {
1508 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1509 <    else yy_aconf->port |= OPER_FLAG_N;
1510 <  }
1262 >    yy_aconf->port |= OPER_FLAG_N;
1263   } | T_OPERWALL
1264   {
1265    if (conf_parser_ctx.pass == 2)
1266 <  {
1267 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1516 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1517 <  }
1518 < } | OPER_SPY_T
1266 >    yy_aconf->port |= OPER_FLAG_OPERWALL;
1267 > } | T_GLOBOPS
1268   {
1269    if (conf_parser_ctx.pass == 2)
1270 <  {
1271 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1523 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1524 <  }
1525 < } | HIDDEN_OPER
1270 >    yy_aconf->port |= OPER_FLAG_GLOBOPS;
1271 > } | OPER_SPY_T
1272   {
1273    if (conf_parser_ctx.pass == 2)
1274 <  {
1529 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1530 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1531 <  }
1274 >    yy_aconf->port |= OPER_FLAG_OPER_SPY;
1275   } | REMOTEBAN
1276   {
1277    if (conf_parser_ctx.pass == 2)
1278 <  {
1279 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1537 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1538 <  }
1539 < } | ENCRYPTED
1278 >    yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1279 > } | MODULE
1280   {
1281    if (conf_parser_ctx.pass == 2)
1282 <  {
1543 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1544 <    else SetConfEncrypted(yy_aconf);
1545 <  }
1282 >    yy_aconf->port |= OPER_FLAG_MODULE;
1283   };
1284  
1285  
# Line 1556 | Line 1293 | class_entry: CLASS
1293      yy_conf = make_conf_item(CLASS_TYPE);
1294      yy_class = map_to_conf(yy_conf);
1295    }
1296 < } class_name_b '{' class_items '}' ';'
1296 > } '{' class_items '}' ';'
1297   {
1298    if (conf_parser_ctx.pass == 1)
1299    {
# Line 1567 | Line 1304 | class_entry: CLASS
1304        delete_conf_item(yy_conf);
1305      else
1306      {
1307 <      cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1307 >      cconf = find_exact_name_conf(CLASS_TYPE, NULL, yy_class_name, NULL, NULL);
1308  
1309        if (cconf != NULL)                /* The class existed already */
1310        {
# Line 1599 | Line 1336 | class_entry: CLASS
1336    }
1337   };
1338  
1602 class_name_b: | class_name_t;
1603
1339   class_items:    class_items class_item | class_item;
1340   class_item:     class_name |
1341                  class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
# Line 1625 | Line 1360 | class_name: NAME '=' QSTRING ';'
1360    }
1361   };
1362  
1628 class_name_t: QSTRING
1629 {
1630  if (conf_parser_ctx.pass == 1)
1631  {
1632    MyFree(yy_class_name);
1633    DupString(yy_class_name, yylval.string);
1634  }
1635 };
1636
1363   class_ping_time: PING_TIME '=' timespec ';'
1364   {
1365    if (conf_parser_ctx.pass == 1)
1366 <    PingFreq(yy_class) = $3;
1366 >    yy_class->ping_freq = $3;
1367   };
1368  
1369   class_ping_warning: PING_WARNING '=' timespec ';'
1370   {
1371    if (conf_parser_ctx.pass == 1)
1372 <    PingWarning(yy_class) = $3;
1372 >    yy_class->ping_warning = $3;
1373   };
1374  
1375   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1376   {
1377    if (conf_parser_ctx.pass == 1)
1378 <    MaxPerIp(yy_class) = $3;
1378 >    yy_class->max_perip = $3;
1379   };
1380  
1381   class_connectfreq: CONNECTFREQ '=' timespec ';'
1382   {
1383    if (conf_parser_ctx.pass == 1)
1384 <    ConFreq(yy_class) = $3;
1384 >    yy_class->con_freq = $3;
1385   };
1386  
1387   class_max_number: MAX_NUMBER '=' NUMBER ';'
1388   {
1389    if (conf_parser_ctx.pass == 1)
1390 <    MaxTotal(yy_class) = $3;
1390 >    yy_class->max_total = $3;
1391   };
1392  
1393   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1394   {
1395    if (conf_parser_ctx.pass == 1)
1396 <    MaxGlobal(yy_class) = $3;
1396 >    yy_class->max_global = $3;
1397   };
1398  
1399   class_max_local: MAX_LOCAL '=' NUMBER ';'
1400   {
1401    if (conf_parser_ctx.pass == 1)
1402 <    MaxLocal(yy_class) = $3;
1402 >    yy_class->max_local = $3;
1403   };
1404  
1405   class_max_ident: MAX_IDENT '=' NUMBER ';'
1406   {
1407    if (conf_parser_ctx.pass == 1)
1408 <    MaxIdent(yy_class) = $3;
1408 >    yy_class->max_ident = $3;
1409   };
1410  
1411   class_sendq: SENDQ '=' sizespec ';'
1412   {
1413    if (conf_parser_ctx.pass == 1)
1414 <    MaxSendq(yy_class) = $3;
1414 >    yy_class->max_sendq = $3;
1415   };
1416  
1417   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1418   {
1419    if (conf_parser_ctx.pass == 1)
1420 <    CidrBitlenIPV4(yy_class) = $3;
1420 >    yy_class->cidr_bitlen_ipv4 = $3 > 32 ? 32 : $3;
1421   };
1422  
1423   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1424   {
1425    if (conf_parser_ctx.pass == 1)
1426 <    CidrBitlenIPV6(yy_class) = $3;
1426 >    yy_class->cidr_bitlen_ipv6 = $3 > 128 ? 128 : $3;
1427   };
1428  
1429   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1430   {
1431    if (conf_parser_ctx.pass == 1)
1432 <    NumberPerCidr(yy_class) = $3;
1432 >    yy_class->number_per_cidr = $3;
1433   };
1434  
1435   /***************************************************************************
# Line 1880 | Line 1606 | auth_entry: IRCD_AUTH
1606  
1607   auth_items:     auth_items auth_item | auth_item;
1608   auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1609 <                auth_kline_exempt | auth_need_ident |
1610 <                auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
1885 <                auth_spoof | auth_spoof_notice |
1886 <                auth_redir_serv | auth_redir_port | auth_can_flood |
1887 <                auth_need_password | auth_encrypted | error ';' ;
1609 >                auth_spoof | auth_redir_serv | auth_redir_port |
1610 >                auth_encrypted | error ';' ;
1611  
1612   auth_user: USER '=' QSTRING ';'
1613   {
# Line 1921 | Line 1644 | auth_user: USER '=' QSTRING ';'
1644    }
1645   };
1646  
1924 /* XXX - IP/IPV6 tags don't exist anymore - put IP/IPV6 into user. */
1925
1647   auth_passwd: PASSWORD '=' QSTRING ';'
1648   {
1649    if (conf_parser_ctx.pass == 2)
# Line 1936 | Line 1657 | auth_passwd: PASSWORD '=' QSTRING ';'
1657    }
1658   };
1659  
1939 auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1940 {
1941  if (conf_parser_ctx.pass == 2)
1942  {
1943    if (yylval.number)
1944      yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1945    else
1946      yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1947  }
1948 };
1949
1660   auth_class: CLASS '=' QSTRING ';'
1661   {
1662    if (conf_parser_ctx.pass == 2)
# Line 1972 | Line 1682 | auth_flags: IRCD_FLAGS
1682   } '='  auth_flags_items ';';
1683  
1684   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1685 < auth_flags_item: NOT { not_atom = 1; } auth_flags_item_atom
1976 <                | { not_atom = 0; } auth_flags_item_atom;
1977 <
1978 < auth_flags_item_atom: SPOOF_NOTICE
1685 > auth_flags_item: SPOOF_NOTICE
1686   {
1687    if (conf_parser_ctx.pass == 2)
1688 <  {
1982 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1983 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1984 <  }
1985 <
1688 >    yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1689   } | EXCEED_LIMIT
1690   {
1691    if (conf_parser_ctx.pass == 2)
1692 <  {
1990 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1991 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1992 <  }
1692 >    yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1693   } | KLINE_EXEMPT
1694   {
1695    if (conf_parser_ctx.pass == 2)
1696 <  {
1997 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1998 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1999 <  }
1696 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1697   } | NEED_IDENT
1698   {
1699    if (conf_parser_ctx.pass == 2)
1700 <  {
2004 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2005 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2006 <  }
1700 >    yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1701   } | CAN_FLOOD
1702   {
1703    if (conf_parser_ctx.pass == 2)
1704 <  {
2011 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2012 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2013 <  }
2014 < } | CAN_IDLE
2015 < {
2016 <  if (conf_parser_ctx.pass == 2)
2017 <  {
2018 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
2019 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
2020 <  }
1704 >    yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1705   } | NO_TILDE
1706   {
1707    if (conf_parser_ctx.pass == 2)
1708 <  {
2025 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2026 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2027 <  }
1708 >    yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1709   } | GLINE_EXEMPT
1710   {
1711    if (conf_parser_ctx.pass == 2)
1712 <  {
2032 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2033 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2034 <  }
1712 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1713   } | RESV_EXEMPT
1714   {
1715    if (conf_parser_ctx.pass == 2)
1716 <  {
2039 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
2040 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
2041 <  }
1716 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1717   } | NEED_PASSWORD
1718   {
1719    if (conf_parser_ctx.pass == 2)
1720 <  {
2046 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2047 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2048 <  }
2049 < };
2050 <
2051 < auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
2052 < {
2053 <  if (conf_parser_ctx.pass == 2)
2054 <  {
2055 <    if (yylval.number)
2056 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
2057 <    else
2058 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
2059 <  }
2060 < };
2061 <
2062 < auth_need_ident: NEED_IDENT '=' TBOOL ';'
2063 < {
2064 <  if (conf_parser_ctx.pass == 2)
2065 <  {
2066 <    if (yylval.number)
2067 <      yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2068 <    else
2069 <      yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2070 <  }
2071 < };
2072 <
2073 < auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2074 < {
2075 <  if (conf_parser_ctx.pass == 2)
2076 <  {
2077 <    if (yylval.number)
2078 <      yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
2079 <    else
2080 <      yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
2081 <  }
2082 < };
2083 <
2084 < auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2085 < {
2086 <  if (conf_parser_ctx.pass == 2)
2087 <  {
2088 <    if (yylval.number)
2089 <      yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2090 <    else
2091 <      yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2092 <  }
2093 < };
2094 <
2095 < auth_no_tilde: NO_TILDE '=' TBOOL ';'
2096 < {
2097 <  if (conf_parser_ctx.pass == 2)
2098 <  {
2099 <    if (yylval.number)
2100 <      yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2101 <    else
2102 <      yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2103 <  }
2104 < };
2105 <
2106 < auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2107 < {
2108 <  if (conf_parser_ctx.pass == 2)
2109 <  {
2110 <    if (yylval.number)
2111 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2112 <    else
2113 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2114 <  }
1720 >    yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1721   };
1722  
1723   /* XXX - need check for illegal hostnames here */
# Line 2128 | Line 1734 | auth_spoof: SPOOF '=' QSTRING ';'
1734      }
1735      else
1736      {
1737 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1737 >      ilog(LOG_TYPE_IRCD, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1738        yy_conf->name = NULL;
1739      }
1740    }
# Line 2153 | Line 1759 | auth_redir_port: REDIRPORT '=' NUMBER ';
1759    }
1760   };
1761  
2156 auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2157 {
2158  if (conf_parser_ctx.pass == 2)
2159  {
2160    if (yylval.number)
2161      yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2162    else
2163      yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2164  }
2165 };
2166
1762  
1763   /***************************************************************************
1764   *  section resv
# Line 2222 | Line 1817 | resv_nick: NICK '=' QSTRING ';'
1817   };
1818  
1819   /***************************************************************************
1820 + *  section service
1821 + ***************************************************************************/
1822 + service_entry: T_SERVICE '{' service_items '}' ';';
1823 +
1824 + service_items:     service_items service_item | service_item;
1825 + service_item:      service_name | error;
1826 +
1827 + service_name: NAME '=' QSTRING ';'
1828 + {
1829 +  if (conf_parser_ctx.pass == 2)
1830 +  {
1831 +    if (valid_servname(yylval.string))
1832 +    {
1833 +      yy_conf = make_conf_item(SERVICE_TYPE);
1834 +      DupString(yy_conf->name, yylval.string);
1835 +    }
1836 +  }
1837 + };
1838 +
1839 + /***************************************************************************
1840   *  section shared, for sharing remote klines etc.
1841   ***************************************************************************/
1842   shared_entry: T_SHARED
# Line 2285 | Line 1900 | shared_type_item: KLINE
1900   {
1901    if (conf_parser_ctx.pass == 2)
1902      yy_match_item->action |= SHARED_KLINE;
2288 } | TKLINE
2289 {
2290  if (conf_parser_ctx.pass == 2)
2291    yy_match_item->action |= SHARED_TKLINE;
1903   } | UNKLINE
1904   {
1905    if (conf_parser_ctx.pass == 2)
1906      yy_match_item->action |= SHARED_UNKLINE;
1907 < } | XLINE
1907 > } | T_DLINE
1908   {
1909    if (conf_parser_ctx.pass == 2)
1910 <    yy_match_item->action |= SHARED_XLINE;
1911 < } | TXLINE
1910 >    yy_match_item->action |= SHARED_DLINE;
1911 > } | T_UNDLINE
1912 > {
1913 >  if (conf_parser_ctx.pass == 2)
1914 >    yy_match_item->action |= SHARED_UNDLINE;
1915 > } | XLINE
1916   {
1917    if (conf_parser_ctx.pass == 2)
1918 <    yy_match_item->action |= SHARED_TXLINE;
1918 >    yy_match_item->action |= SHARED_XLINE;
1919   } | T_UNXLINE
1920   {
1921    if (conf_parser_ctx.pass == 2)
# Line 2309 | Line 1924 | shared_type_item: KLINE
1924   {
1925    if (conf_parser_ctx.pass == 2)
1926      yy_match_item->action |= SHARED_RESV;
2312 } | TRESV
2313 {
2314  if (conf_parser_ctx.pass == 2)
2315    yy_match_item->action |= SHARED_TRESV;
1927   } | T_UNRESV
1928   {
1929    if (conf_parser_ctx.pass == 2)
# Line 2367 | Line 1978 | cluster_type_item: KLINE
1978   {
1979    if (conf_parser_ctx.pass == 2)
1980      yy_conf->flags |= SHARED_KLINE;
2370 } | TKLINE
2371 {
2372  if (conf_parser_ctx.pass == 2)
2373    yy_conf->flags |= SHARED_TKLINE;
1981   } | UNKLINE
1982   {
1983    if (conf_parser_ctx.pass == 2)
1984      yy_conf->flags |= SHARED_UNKLINE;
1985 < } | XLINE
1985 > } | T_DLINE
1986   {
1987    if (conf_parser_ctx.pass == 2)
1988 <    yy_conf->flags |= SHARED_XLINE;
1989 < } | TXLINE
1988 >    yy_conf->flags |= SHARED_DLINE;
1989 > } | T_UNDLINE
1990 > {
1991 >  if (conf_parser_ctx.pass == 2)
1992 >    yy_conf->flags |= SHARED_UNDLINE;
1993 > } | XLINE
1994   {
1995    if (conf_parser_ctx.pass == 2)
1996 <    yy_conf->flags |= SHARED_TXLINE;
1996 >    yy_conf->flags |= SHARED_XLINE;
1997   } | T_UNXLINE
1998   {
1999    if (conf_parser_ctx.pass == 2)
# Line 2391 | Line 2002 | cluster_type_item: KLINE
2002   {
2003    if (conf_parser_ctx.pass == 2)
2004      yy_conf->flags |= SHARED_RESV;
2394 } | TRESV
2395 {
2396  if (conf_parser_ctx.pass == 2)
2397    yy_conf->flags |= SHARED_TRESV;
2005   } | T_UNRESV
2006   {
2007    if (conf_parser_ctx.pass == 2)
# Line 2417 | Line 2024 | connect_entry: CONNECT
2024    if (conf_parser_ctx.pass == 2)
2025    {
2026      yy_conf = make_conf_item(SERVER_TYPE);
2027 <    yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
2028 <    yy_aconf->passwd = NULL;
2027 >    yy_aconf = map_to_conf(yy_conf);
2028 >
2029      /* defaults */
2030      yy_aconf->port = PORTNUM;
2424
2425    if (ConfigFileEntry.burst_away)
2426      yy_aconf->flags = CONF_FLAGS_BURST_AWAY;
2031    }
2032    else
2033    {
2034      MyFree(class_name);
2035      class_name = NULL;
2036    }
2037 < } connect_name_b '{' connect_items '}' ';'
2037 > } '{' connect_items '}' ';'
2038   {
2039    if (conf_parser_ctx.pass == 2)
2040    {
2041 <    struct CollectItem *yy_hconf=NULL;
2042 <    struct CollectItem *yy_lconf=NULL;
2043 <    dlink_node *ptr;
2044 <    dlink_node *next_ptr;
2045 < #ifdef HAVE_LIBCRYPTO
2046 <    if (yy_aconf->host &&
2047 <        ((yy_aconf->passwd && yy_aconf->spasswd) ||
2048 <         (yy_aconf->rsa_public_key && IsConfCryptLink(yy_aconf))))
2445 < #else /* !HAVE_LIBCRYPTO */
2446 <      if (yy_aconf->host && !IsConfCryptLink(yy_aconf) &&
2447 <          yy_aconf->passwd && yy_aconf->spasswd)
2448 < #endif /* !HAVE_LIBCRYPTO */
2449 <        {
2450 <          if (conf_add_server(yy_conf, class_name) == -1)
2451 <          {
2452 <            delete_conf_item(yy_conf);
2453 <            yy_conf = NULL;
2454 <            yy_aconf = NULL;
2455 <          }
2456 <        }
2457 <        else
2458 <        {
2459 <          /* Even if yy_conf ->name is NULL
2460 <           * should still unhook any hub/leaf confs still pending
2461 <           */
2462 <          unhook_hub_leaf_confs();
2463 <
2464 <          if (yy_conf->name != NULL)
2465 <          {
2466 < #ifndef HAVE_LIBCRYPTO
2467 <            if (IsConfCryptLink(yy_aconf))
2468 <              yyerror("Ignoring connect block -- no OpenSSL support");
2469 < #else
2470 <            if (IsConfCryptLink(yy_aconf) && !yy_aconf->rsa_public_key)
2471 <              yyerror("Ignoring connect block -- missing key");
2472 < #endif
2473 <            if (yy_aconf->host == NULL)
2474 <              yyerror("Ignoring connect block -- missing host");
2475 <            else if (!IsConfCryptLink(yy_aconf) &&
2476 <                    (!yy_aconf->passwd || !yy_aconf->spasswd))
2477 <              yyerror("Ignoring connect block -- missing password");
2478 <          }
2479 <
2480 <
2481 <          /* XXX
2482 <           * This fixes a try_connections() core (caused by invalid class_ptr
2483 <           * pointers) reported by metalrock. That's an ugly fix, but there
2484 <           * is currently no better way. The entire config subsystem needs an
2485 <           * rewrite ASAP. make_conf_item() shouldn't really add things onto
2486 <           * a doubly linked list immediately without any sanity checks!  -Michael
2487 <           */
2488 <          delete_conf_item(yy_conf);
2489 <
2490 <          yy_aconf = NULL;
2491 <          yy_conf = NULL;
2492 <        }
2493 <
2494 <      /*
2495 <       * yy_conf is still pointing at the server that is having
2496 <       * a connect block built for it. This means, y_aconf->name
2497 <       * points to the actual irc name this server will be known as.
2498 <       * Now this new server has a set or even just one hub_mask (or leaf_mask)
2499 <       * given in the link list at yy_hconf. Fill in the HUB confs
2500 <       * from this link list now.
2501 <       */        
2502 <      DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
2041 >    if (yy_aconf->host && yy_aconf->passwd && yy_aconf->spasswd)
2042 >    {
2043 >      if (conf_add_server(yy_conf, class_name) == -1)
2044 >        delete_conf_item(yy_conf);
2045 >    }
2046 >    else
2047 >    {
2048 >      if (yy_conf->name != NULL)
2049        {
2050 <        struct ConfItem *new_hub_conf;
2051 <        struct MatchItem *match_item;
2052 <
2053 <        yy_hconf = ptr->data;
2508 <
2509 <        /* yy_conf == NULL is a fatal error for this connect block! */
2510 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2511 <        {
2512 <          new_hub_conf = make_conf_item(HUB_TYPE);
2513 <          match_item = (struct MatchItem *)map_to_conf(new_hub_conf);
2514 <          DupString(new_hub_conf->name, yy_conf->name);
2515 <          if (yy_hconf->user != NULL)
2516 <            DupString(match_item->user, yy_hconf->user);
2517 <          else
2518 <            DupString(match_item->user, "*");
2519 <          if (yy_hconf->host != NULL)
2520 <            DupString(match_item->host, yy_hconf->host);
2521 <          else
2522 <            DupString(match_item->host, "*");
2523 <        }
2524 <        dlinkDelete(&yy_hconf->node, &hub_conf_list);
2525 <        free_collect_item(yy_hconf);
2050 >        if (yy_aconf->host == NULL)
2051 >          yyerror("Ignoring connect block -- missing host");
2052 >        else if (!yy_aconf->passwd || !yy_aconf->spasswd)
2053 >          yyerror("Ignoring connect block -- missing password");
2054        }
2055  
2056 <      /* Ditto for the LEAF confs */
2057 <
2058 <      DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
2059 <      {
2060 <        struct ConfItem *new_leaf_conf;
2061 <        struct MatchItem *match_item;
2062 <
2063 <        yy_lconf = ptr->data;
2056 >      /* XXX
2057 >       * This fixes a try_connections() core (caused by invalid class_ptr
2058 >       * pointers) reported by metalrock. That's an ugly fix, but there
2059 >       * is currently no better way. The entire config subsystem needs an
2060 >       * rewrite ASAP. make_conf_item() shouldn't really add things onto
2061 >       * a doubly linked list immediately without any sanity checks!  -Michael
2062 >       */
2063 >      delete_conf_item(yy_conf);
2064 >    }
2065  
2066 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2067 <        {
2068 <          new_leaf_conf = make_conf_item(LEAF_TYPE);
2069 <          match_item = (struct MatchItem *)map_to_conf(new_leaf_conf);
2541 <          DupString(new_leaf_conf->name, yy_conf->name);
2542 <          if (yy_lconf->user != NULL)
2543 <            DupString(match_item->user, yy_lconf->user);
2544 <          else
2545 <            DupString(match_item->user, "*");
2546 <          if (yy_lconf->host != NULL)
2547 <            DupString(match_item->host, yy_lconf->host);
2548 <          else
2549 <            DupString(match_item->host, "*");
2550 <        }
2551 <        dlinkDelete(&yy_lconf->node, &leaf_conf_list);
2552 <        free_collect_item(yy_lconf);
2553 <      }
2554 <      MyFree(class_name);
2555 <      class_name = NULL;
2556 <      yy_conf = NULL;
2557 <      yy_aconf = NULL;
2066 >    MyFree(class_name);
2067 >    class_name = NULL;
2068 >    yy_conf = NULL;
2069 >    yy_aconf = NULL;
2070    }
2071   };
2072  
2561 connect_name_b: | connect_name_t;
2073   connect_items:  connect_items connect_item | connect_item;
2074   connect_item:   connect_name | connect_host | connect_vhost |
2075                  connect_send_password | connect_accept_password |
2076 <                connect_aftype | connect_port |
2077 <                connect_fakename | connect_flags | connect_hub_mask |
2078 <                connect_leaf_mask | connect_class | connect_auto |
2079 <                connect_encrypted | connect_compressed | connect_cryptlink |
2569 <                connect_rsa_public_key_file | connect_cipher_preference |
2570 <                connect_topicburst | error ';' ;
2076 >                connect_aftype | connect_port | connect_ssl_cipher_list |
2077 >                connect_flags | connect_hub_mask | connect_leaf_mask |
2078 >                connect_class | connect_encrypted |
2079 >                error ';' ;
2080  
2081   connect_name: NAME '=' QSTRING ';'
2082   {
2083    if (conf_parser_ctx.pass == 2)
2084    {
2576    if (yy_conf->name != NULL)
2577      yyerror("Multiple connect name entry");
2578
2579    MyFree(yy_conf->name);
2580    DupString(yy_conf->name, yylval.string);
2581  }
2582 };
2583
2584 connect_name_t: QSTRING
2585 {
2586  if (conf_parser_ctx.pass == 2)
2587  {
2588    if (yy_conf->name != NULL)
2589      yyerror("Multiple connect name entry");
2590
2085      MyFree(yy_conf->name);
2086      DupString(yy_conf->name, yylval.string);
2087    }
# Line 2614 | Line 2108 | connect_vhost: VHOST '=' QSTRING ';'
2108      hints.ai_socktype = SOCK_STREAM;
2109      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2110  
2111 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
2112 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2111 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
2112 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2113      else
2114      {
2115        assert(res != NULL);
2116  
2117 <      memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2118 <      yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2119 <      yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2120 <      irc_freeaddrinfo(res);
2117 >      memcpy(&yy_aconf->bind, res->ai_addr, res->ai_addrlen);
2118 >      yy_aconf->bind.ss.ss_family = res->ai_family;
2119 >      yy_aconf->bind.ss_len = res->ai_addrlen;
2120 >      freeaddrinfo(res);
2121      }
2122    }
2123   };
# Line 2682 | Line 2176 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2176   #endif
2177   };
2178  
2685 connect_fakename: FAKENAME '=' QSTRING ';'
2686 {
2687  if (conf_parser_ctx.pass == 2)
2688  {
2689    MyFree(yy_aconf->fakename);
2690    DupString(yy_aconf->fakename, yylval.string);
2691  }
2692 };
2693
2179   connect_flags: IRCD_FLAGS
2180   {
2181   } '='  connect_flags_items ';';
2182  
2183   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2184 < connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2700 <                        |  { not_atom = 0; } connect_flags_item_atom;
2701 <
2702 < connect_flags_item_atom: COMPRESSED
2184 > connect_flags_item: AUTOCONN
2185   {
2186    if (conf_parser_ctx.pass == 2)
2187 < #ifndef HAVE_LIBZ
2706 <    yyerror("Ignoring flags = compressed; -- no zlib support");
2707 < #else
2708 < {
2709 <   if (not_atom)ClearConfCompressed(yy_aconf);
2710 <   else SetConfCompressed(yy_aconf);
2711 < }
2712 < #endif
2713 < } | CRYPTLINK
2714 < {
2715 <  if (conf_parser_ctx.pass == 2)
2716 <  {
2717 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2718 <    else SetConfCryptLink(yy_aconf);
2719 <  }
2720 < } | AUTOCONN
2721 < {
2722 <  if (conf_parser_ctx.pass == 2)
2723 <  {
2724 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2725 <    else SetConfAllowAutoConn(yy_aconf);
2726 <  }
2187 >    SetConfAllowAutoConn(yy_aconf);
2188   } | BURST_AWAY
2189   {
2190    if (conf_parser_ctx.pass == 2)
2191 <  {
2731 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2732 <    else SetConfAwayBurst(yy_aconf);
2733 <  }
2191 >    SetConfAwayBurst(yy_aconf);
2192   } | TOPICBURST
2193   {
2194    if (conf_parser_ctx.pass == 2)
2195 <  {
2196 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2739 <    else SetConfTopicBurst(yy_aconf);
2740 <  }
2741 < }
2742 < ;
2743 <
2744 < connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2195 >    SetConfTopicBurst(yy_aconf);
2196 > } | T_SSL
2197   {
2746 #ifdef HAVE_LIBCRYPTO
2198    if (conf_parser_ctx.pass == 2)
2199 <  {
2749 <    BIO *file;
2750 <
2751 <    if (yy_aconf->rsa_public_key != NULL)
2752 <    {
2753 <      RSA_free(yy_aconf->rsa_public_key);
2754 <      yy_aconf->rsa_public_key = NULL;
2755 <    }
2756 <
2757 <    if (yy_aconf->rsa_public_key_file != NULL)
2758 <    {
2759 <      MyFree(yy_aconf->rsa_public_key_file);
2760 <      yy_aconf->rsa_public_key_file = NULL;
2761 <    }
2762 <
2763 <    DupString(yy_aconf->rsa_public_key_file, yylval.string);
2764 <
2765 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
2766 <    {
2767 <      yyerror("Ignoring rsa_public_key_file -- file doesn't exist");
2768 <      break;
2769 <    }
2770 <
2771 <    yy_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
2772 <
2773 <    if (yy_aconf->rsa_public_key == NULL)
2774 <    {
2775 <      yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
2776 <      break;
2777 <    }
2778 <      
2779 <    BIO_set_close(file, BIO_CLOSE);
2780 <    BIO_free(file);
2781 <  }
2782 < #endif /* HAVE_LIBCRYPTO */
2199 >    SetConfSSL(yy_aconf);
2200   };
2201  
2202   connect_encrypted: ENCRYPTED '=' TBOOL ';'
# Line 2793 | Line 2210 | connect_encrypted: ENCRYPTED '=' TBOOL '
2210    }
2211   };
2212  
2796 connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2797 {
2798  if (conf_parser_ctx.pass == 2)
2799  {
2800    if (yylval.number)
2801      yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
2802    else
2803      yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK;
2804  }
2805 };
2806
2807 connect_compressed: COMPRESSED '=' TBOOL ';'
2808 {
2809  if (conf_parser_ctx.pass == 2)
2810  {
2811    if (yylval.number)
2812 #ifndef HAVE_LIBZ
2813      yyerror("Ignoring compressed=yes; -- no zlib support");
2814 #else
2815      yy_aconf->flags |= CONF_FLAGS_COMPRESSED;
2816 #endif
2817    else
2818      yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED;
2819  }
2820 };
2821
2822 connect_auto: AUTOCONN '=' TBOOL ';'
2823 {
2824  if (conf_parser_ctx.pass == 2)
2825  {
2826    if (yylval.number)
2827      yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
2828    else
2829      yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
2830  }
2831 };
2832
2833 connect_topicburst: TOPICBURST '=' TBOOL ';'
2834 {
2835  if (conf_parser_ctx.pass == 2)
2836  {
2837    if (yylval.number)
2838      SetConfTopicBurst(yy_aconf);
2839    else
2840      ClearConfTopicBurst(yy_aconf);
2841  }
2842 };
2843
2213   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2214   {
2215    if (conf_parser_ctx.pass == 2)
2216    {
2217 <    struct CollectItem *yy_tmp;
2217 >    char *mask;
2218  
2219 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2220 <    DupString(yy_tmp->host, yylval.string);
2852 <    DupString(yy_tmp->user, "*");
2853 <    dlinkAdd(yy_tmp, &yy_tmp->node, &hub_conf_list);
2219 >    DupString(mask, yylval.string);
2220 >    dlinkAdd(mask, make_dlink_node(), &yy_aconf->hub_list);
2221    }
2222   };
2223  
# Line 2858 | Line 2225 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2225   {
2226    if (conf_parser_ctx.pass == 2)
2227    {
2228 <    struct CollectItem *yy_tmp;
2228 >    char *mask;
2229  
2230 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2231 <    DupString(yy_tmp->host, yylval.string);
2865 <    DupString(yy_tmp->user, "*");
2866 <    dlinkAdd(yy_tmp, &yy_tmp->node, &leaf_conf_list);
2230 >    DupString(mask, yylval.string);
2231 >    dlinkAdd(mask, make_dlink_node(), &yy_aconf->leaf_list);
2232    }
2233   };
2234  
# Line 2876 | Line 2241 | connect_class: CLASS '=' QSTRING ';'
2241    }
2242   };
2243  
2244 < connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2244 > connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2245   {
2246   #ifdef HAVE_LIBCRYPTO
2247    if (conf_parser_ctx.pass == 2)
2248    {
2249 <    struct EncCapability *ecap;
2250 <    const char *cipher_name;
2886 <    int found = 0;
2887 <
2888 <    yy_aconf->cipher_preference = NULL;
2889 <    cipher_name = yylval.string;
2890 <
2891 <    for (ecap = CipherTable; ecap->name; ecap++)
2892 <    {
2893 <      if ((irccmp(ecap->name, cipher_name) == 0) &&
2894 <          (ecap->cap & CAP_ENC_MASK))
2895 <      {
2896 <        yy_aconf->cipher_preference = ecap;
2897 <        found = 1;
2898 <        break;
2899 <      }
2900 <    }
2901 <
2902 <    if (!found)
2903 <      yyerror("Invalid cipher");
2249 >    MyFree(yy_aconf->cipher_list);
2250 >    DupString(yy_aconf->cipher_list, yylval.string);
2251    }
2252   #else
2253    if (conf_parser_ctx.pass == 2)
2254 <    yyerror("Ignoring cipher_preference -- no OpenSSL support");
2254 >    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2255   #endif
2256   };
2257  
2258 +
2259   /***************************************************************************
2260   *  section kill
2261   ***************************************************************************/
# Line 2926 | Line 2274 | kill_entry: KILL
2274      {
2275        if (regex_ban)
2276        {
2277 <        pcre *exp_user = NULL;
2278 <        pcre *exp_host = NULL;
2277 > #ifdef HAVE_LIBPCRE
2278 >        void *exp_user = NULL;
2279 >        void *exp_host = NULL;
2280          const char *errptr = NULL;
2281  
2282          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2283              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2284          {
2285 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s",
2285 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2286                 errptr);
2287            break;
2288          }
2289  
2290 <        yy_conf = make_conf_item(RKLINE_TYPE);
2942 <        yy_aconf = map_to_conf(yy_conf);
2943 <
2290 >        yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE));
2291          yy_aconf->regexuser = exp_user;
2292          yy_aconf->regexhost = exp_host;
2293  
# Line 2951 | Line 2298 | kill_entry: KILL
2298            DupString(yy_aconf->reason, reasonbuf);
2299          else
2300            DupString(yy_aconf->reason, "No reason");
2301 + #else
2302 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2303 +        break;
2304 + #endif
2305        }
2306        else
2307        {
2308 <        yy_conf = make_conf_item(KLINE_TYPE);
2309 <        yy_aconf = map_to_conf(yy_conf);
2308 >        find_and_delete_temporary(userbuf, hostbuf, CONF_KLINE);
2309 >
2310 >        yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2311  
2312          DupString(yy_aconf->user, userbuf);
2313          DupString(yy_aconf->host, hostbuf);
# Line 2964 | Line 2316 | kill_entry: KILL
2316            DupString(yy_aconf->reason, reasonbuf);
2317          else
2318            DupString(yy_aconf->reason, "No reason");
2319 <        add_conf_by_address(CONF_KILL, yy_aconf);
2319 >        add_conf_by_address(CONF_KLINE, yy_aconf);
2320        }
2321      }
2970    else
2971      delete_conf_item(yy_conf);
2322  
2973    yy_conf = NULL;
2323      yy_aconf = NULL;
2324    }
2325   };
# Line 3020 | Line 2369 | kill_reason: REASON '=' QSTRING ';'
2369   deny_entry: DENY
2370   {
2371    if (conf_parser_ctx.pass == 2)
2372 <  {
3024 <    yy_conf = make_conf_item(DLINE_TYPE);
3025 <    yy_aconf = map_to_conf(yy_conf);
3026 <    /* default reason */
3027 <    DupString(yy_aconf->reason, "No reason");
3028 <  }
2372 >    hostbuf[0] = reasonbuf[0] = '\0';
2373   } '{' deny_items '}' ';'
2374   {
2375    if (conf_parser_ctx.pass == 2)
2376    {
2377 <    if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
2377 >    if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
2378 >    {
2379 >      find_and_delete_temporary(NULL, hostbuf, CONF_DLINE);
2380 >
2381 >      yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
2382 >      DupString(yy_aconf->host, hostbuf);
2383 >
2384 >      if (reasonbuf[0])
2385 >        DupString(yy_aconf->reason, reasonbuf);
2386 >      else
2387 >        DupString(yy_aconf->reason, "No reason");
2388        add_conf_by_address(CONF_DLINE, yy_aconf);
2389 <    else
2390 <      delete_conf_item(yy_conf);
3037 <    yy_conf = NULL;
3038 <    yy_aconf = NULL;
2389 >      yy_aconf = NULL;
2390 >    }
2391    }
2392   };
2393  
# Line 3045 | Line 2397 | deny_item:      deny_ip | deny_reason |
2397   deny_ip: IP '=' QSTRING ';'
2398   {
2399    if (conf_parser_ctx.pass == 2)
2400 <  {
3049 <    MyFree(yy_aconf->host);
3050 <    DupString(yy_aconf->host, yylval.string);
3051 <  }
2400 >    strlcpy(hostbuf, yylval.string, sizeof(hostbuf));
2401   };
2402  
2403   deny_reason: REASON '=' QSTRING ';'
2404   {
2405    if (conf_parser_ctx.pass == 2)
2406 <  {
3058 <    MyFree(yy_aconf->reason);
3059 <    DupString(yy_aconf->reason, yylval.string);
3060 <  }
2406 >    strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2407   };
2408  
2409   /***************************************************************************
# Line 3074 | Line 2420 | exempt_ip: IP '=' QSTRING ';'
2420    {
2421      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2422      {
2423 <      yy_conf = make_conf_item(EXEMPTDLINE_TYPE);
3078 <      yy_aconf = map_to_conf(yy_conf);
2423 >      yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE));
2424        DupString(yy_aconf->host, yylval.string);
2425  
2426        add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf);
3082
3083      yy_conf = NULL;
2427        yy_aconf = NULL;
2428      }
2429    }
# Line 3104 | Line 2447 | gecos_entry: GECOS
2447      {
2448        if (regex_ban)
2449        {
2450 <        pcre *exp_p = NULL;
2450 > #ifdef HAVE_LIBPCRE
2451 >        void *exp_p = NULL;
2452          const char *errptr = NULL;
2453  
2454          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2455          {
2456 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s",
2456 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2457                 errptr);
2458            break;
2459          }
2460  
2461          yy_conf = make_conf_item(RXLINE_TYPE);
2462          yy_conf->regexpname = exp_p;
2463 + #else
2464 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2465 +        break;
2466 + #endif
2467        }
2468        else
2469          yy_conf = make_conf_item(XLINE_TYPE);
# Line 3177 | Line 2525 | general_item:       general_hide_spoof_i
2525                      general_pace_wait_simple | general_stats_P_oper_only |
2526                      general_short_motd | general_no_oper_flood |
2527                      general_true_no_oper_flood | general_oper_pass_resv |
2528 <                    general_idletime | general_message_locale |
2528 >                    general_message_locale |
2529                      general_oper_only_umodes | general_max_targets |
2530                      general_use_egd | general_egdpool_path |
2531                      general_oper_umodes | general_caller_id_wait |
2532                      general_opers_bypass_callerid | general_default_floodcount |
2533                      general_min_nonwildcard | general_min_nonwildcard_simple |
2534 <                    general_servlink_path | general_disable_remote_commands |
2535 <                    general_default_cipher_preference |
3188 <                    general_compression_level | general_client_flood |
2534 >                    general_disable_remote_commands |
2535 >                    general_client_flood |
2536                      general_throttle_time | general_havent_read_conf |
2537 <                    general_dot_in_ip6_addr | general_ping_cookie |
2538 <                    general_disable_auth | general_burst_away |
2537 >                    general_ping_cookie |
2538 >                    general_disable_auth |
2539                      general_tkline_expire_notices | general_gline_min_cidr |
2540                      general_gline_min_cidr6 | general_use_whois_actually |
2541                      general_reject_hold_time | general_stats_e_disabled |
2542 <                    general_max_watch |
2542 >                    general_max_watch | general_services_name |
2543                      error;
2544  
2545  
# Line 3211 | Line 2558 | general_gline_min_cidr6: GLINE_MIN_CIDR6
2558    ConfigFileEntry.gline_min_cidr6 = $3;
2559   };
2560  
3214 general_burst_away: BURST_AWAY '=' TBOOL ';'
3215 {
3216  ConfigFileEntry.burst_away = yylval.number;
3217 };
3218
2561   general_use_whois_actually: USE_WHOIS_ACTUALLY '=' TBOOL ';'
2562   {
2563    ConfigFileEntry.use_whois_actually = yylval.number;
# Line 3231 | Line 2573 | general_tkline_expire_notices: TKLINE_EX
2573    ConfigFileEntry.tkline_expire_notices = yylval.number;
2574   };
2575  
2576 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' NUMBER ';'
2576 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2577   {
2578    ConfigFileEntry.kill_chase_time_limit = $3;
2579   };
# Line 3296 | Line 2638 | general_havent_read_conf: HAVENT_READ_CO
2638   {
2639    if (($3 > 0) && conf_parser_ctx.pass == 1)
2640    {
2641 <    ilog(L_CRIT, "You haven't read your config file properly.");
2642 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2643 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2641 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2642 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2643 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2644      exit(0);
2645    }
2646   };
# Line 3409 | Line 2751 | general_message_locale: MESSAGE_LOCALE '
2751    }
2752   };
2753  
3412 general_idletime: IDLETIME '=' timespec ';'
3413 {
3414  ConfigFileEntry.idletime = $3;
3415 };
3416
2754   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2755   {
2756    ConfigFileEntry.dots_in_ident = $3;
# Line 3424 | Line 2761 | general_max_targets: MAX_TARGETS '=' NUM
2761    ConfigFileEntry.max_targets = $3;
2762   };
2763  
3427 general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3428 {
3429  if (conf_parser_ctx.pass == 2)
3430  {
3431    MyFree(ConfigFileEntry.servlink_path);
3432    DupString(ConfigFileEntry.servlink_path, yylval.string);
3433  }
3434 };
3435
3436 general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3437 {
3438 #ifdef HAVE_LIBCRYPTO
3439  if (conf_parser_ctx.pass == 2)
3440  {
3441    struct EncCapability *ecap;
3442    const char *cipher_name;
3443    int found = 0;
3444
3445    ConfigFileEntry.default_cipher_preference = NULL;
3446    cipher_name = yylval.string;
3447
3448    for (ecap = CipherTable; ecap->name; ecap++)
3449    {
3450      if ((irccmp(ecap->name, cipher_name) == 0) &&
3451          (ecap->cap & CAP_ENC_MASK))
3452      {
3453        ConfigFileEntry.default_cipher_preference = ecap;
3454        found = 1;
3455        break;
3456      }
3457    }
3458
3459    if (!found)
3460      yyerror("Invalid cipher");
3461  }
3462 #else
3463  if (conf_parser_ctx.pass == 2)
3464    yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3465 #endif
3466 };
3467
3468 general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3469 {
3470  if (conf_parser_ctx.pass == 2)
3471  {
3472    ConfigFileEntry.compression_level = $3;
3473 #ifndef HAVE_LIBZ
3474    yyerror("Ignoring compression_level -- no zlib support");
3475 #else
3476    if ((ConfigFileEntry.compression_level < 1) ||
3477        (ConfigFileEntry.compression_level > 9))
3478    {
3479      yyerror("Ignoring invalid compression_level, using default");
3480      ConfigFileEntry.compression_level = 0;
3481    }
3482 #endif
3483  }
3484 };
3485
2764   general_use_egd: USE_EGD '=' TBOOL ';'
2765   {
2766    ConfigFileEntry.use_egd = yylval.number;
# Line 3497 | Line 2775 | general_egdpool_path: EGDPOOL_PATH '=' Q
2775    }
2776   };
2777  
2778 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2779 + {
2780 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2781 +  {
2782 +    MyFree(ConfigFileEntry.service_name);
2783 +    DupString(ConfigFileEntry.service_name, yylval.string);
2784 +  }
2785 + };
2786 +
2787   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2788   {
2789    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3536 | Line 2823 | umode_oitem:     T_BOTS
2823   } | T_FULL
2824   {
2825    ConfigFileEntry.oper_umodes |= UMODE_FULL;
2826 + } | HIDDEN
2827 + {
2828 +  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2829   } | T_SKILL
2830   {
2831    ConfigFileEntry.oper_umodes |= UMODE_SKILL;
# Line 3604 | Line 2894 | umode_item:    T_BOTS
2894   } | T_SKILL
2895   {
2896    ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2897 + } | HIDDEN
2898 + {
2899 +  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2900   } | T_NCHANGE
2901   {
2902    ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
# Line 3662 | Line 2955 | general_client_flood: T_CLIENT_FLOOD '='
2955    ConfigFileEntry.client_flood = $3;
2956   };
2957  
3665 general_dot_in_ip6_addr: DOT_IN_IP6_ADDR '=' TBOOL ';'
3666 {
3667  ConfigFileEntry.dot_in_ip6_addr = yylval.number;
3668 };
2958  
2959   /***************************************************************************
2960   *  section glines
# Line 3715 | Line 3004 | gline_duration: DURATION '=' timespec ';
3004      ConfigFileEntry.gline_time = $3;
3005   };
3006  
3007 < gline_logging: LOGGING
3007 > gline_logging: T_LOG
3008   {
3009    if (conf_parser_ctx.pass == 2)
3010      ConfigFileEntry.gline_logging = 0;
# Line 3849 | Line 3138 | channel_item:       channel_disable_loca
3138                      channel_quiet_on_ban | channel_default_split_user_count |
3139                      channel_default_split_server_count |
3140                      channel_no_create_on_split | channel_restrict_channels |
3141 <                    channel_no_join_on_split | channel_burst_topicwho |
3141 >                    channel_no_join_on_split |
3142                      channel_jflood_count | channel_jflood_time |
3143                      channel_disable_fake_channels | error;
3144  
# Line 3928 | Line 3217 | channel_no_join_on_split: NO_JOIN_ON_SPL
3217    ConfigChannel.no_join_on_split = yylval.number;
3218   };
3219  
3931 channel_burst_topicwho: BURST_TOPICWHO '=' TBOOL ';'
3932 {
3933  ConfigChannel.burst_topicwho = yylval.number;
3934 };
3935
3220   channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
3221   {
3222    GlobalSetOptions.joinfloodcount = yylval.number;

Diff Legend

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