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 1024 by michael, Sun Nov 1 23:14:25 2009 UTC vs.
ircd-hybrid-8/src/conf_parser.y (file contents), Revision 1352 by michael, Fri Apr 13 09:57:08 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 32 | Line 32
32   #include "stdinc.h"
33   #include "ircd.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 "irc_string.h"
40 #include "irc_getaddrinfo.h"
40   #include "sprintf_irc.h"
41   #include "memory.h"
42   #include "modules.h"
# Line 53 | 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 71 | Line 73 | static char userbuf[IRCD_BUFSIZE];
73   static char hostbuf[IRCD_BUFSIZE];
74   static char reasonbuf[REASONLEN + 1];
75   static char gecos_name[REALLEN * 4];
76 <
76 > static char lfile[IRCD_BUFSIZE];
77 > static unsigned int ltype = 0;
78 > static unsigned int lsize = 0;
79   static char *resv_reason = NULL;
80   static char *listener_address = NULL;
77 static int not_atom = 0;
81  
82   struct CollectItem
83   {
# Line 148 | Line 151 | unhook_hub_leaf_confs(void)
151   %token  BYTES KBYTES MBYTES GBYTES TBYTES
152   %token  CALLER_ID_WAIT
153   %token  CAN_FLOOD
151 %token  CAN_IDLE
154   %token  CHANNEL
155   %token  CIDR_BITLEN_IPV4
156   %token  CIDR_BITLEN_IPV6
155 %token  CIPHER_PREFERENCE
157   %token  CLASS
157 %token  COMPRESSED
158 %token  COMPRESSION_LEVEL
158   %token  CONNECT
159   %token  CONNECTFREQ
161 %token  CRYPTLINK
162 %token  DEFAULT_CIPHER_PREFERENCE
160   %token  DEFAULT_FLOODCOUNT
161   %token  DEFAULT_SPLIT_SERVER_COUNT
162   %token  DEFAULT_SPLIT_USER_COUNT
# Line 171 | Line 168 | unhook_hub_leaf_confs(void)
168   %token  DISABLE_HIDDEN
169   %token  DISABLE_LOCAL_CHANNELS
170   %token  DISABLE_REMOTE_COMMANDS
174 %token  DOT_IN_IP6_ADDR
171   %token  DOTS_IN_IDENT
172   %token  DURATION
173   %token  EGDPOOL_PATH
# Line 181 | Line 177 | unhook_hub_leaf_confs(void)
177   %token  EXCEED_LIMIT
178   %token  EXEMPT
179   %token  FAILED_OPER_NOTICE
184 %token  FAKENAME
180   %token  IRCD_FLAGS
181   %token  FLATTEN_LINKS
187 %token  FFAILED_OPERLOG
188 %token  FKILLLOG
189 %token  FKLINELOG
190 %token  FGLINELOG
191 %token  FIOERRLOG
192 %token  FOPERLOG
193 %token  FOPERSPYLOG
194 %token  FUSERLOG
182   %token  GECOS
183   %token  GENERAL
184   %token  GLINE
185   %token  GLINES
186   %token  GLINE_EXEMPT
200 %token  GLINE_LOG
187   %token  GLINE_TIME
188   %token  GLINE_MIN_CIDR
189   %token  GLINE_MIN_CIDR6
# Line 206 | Line 192 | unhook_hub_leaf_confs(void)
192   %token  NEED_IDENT
193   %token  HAVENT_READ_CONF
194   %token  HIDDEN
209 %token  HIDDEN_ADMIN
195   %token  HIDDEN_NAME
211 %token  HIDDEN_OPER
196   %token  HIDE_SERVER_IPS
197   %token  HIDE_SERVERS
198   %token  HIDE_SPOOF_IPS
199   %token  HOST
200   %token  HUB
201   %token  HUB_MASK
218 %token  IDLETIME
202   %token  IGNORE_BOGUS_TS
203   %token  INVISIBLE_ON_CONNECT
204   %token  IP
# Line 231 | Line 214 | unhook_hub_leaf_confs(void)
214   %token  LINKS_DELAY
215   %token  LISTEN
216   %token  T_LOG
234 %token  LOGGING
235 %token  LOG_LEVEL
217   %token  MAX_ACCEPT
218   %token  MAX_BANS
219   %token  MAX_CHANS_PER_USER
# Line 259 | Line 240 | unhook_hub_leaf_confs(void)
240   %token  NO_JOIN_ON_SPLIT
241   %token  NO_OPER_FLOOD
242   %token  NO_TILDE
262 %token  NOT
243   %token  NUMBER
244   %token  NUMBER_PER_IDENT
245   %token  NUMBER_PER_CIDR
# Line 267 | Line 247 | unhook_hub_leaf_confs(void)
247   %token  NUMBER_PER_IP_GLOBAL
248   %token  OPERATOR
249   %token  OPERS_BYPASS_CALLERID
270 %token  OPER_LOG
250   %token  OPER_ONLY_UMODES
251   %token  OPER_PASS_RESV
252   %token  OPER_SPY_T
# Line 297 | Line 276 | unhook_hub_leaf_confs(void)
276   %token  RSA_PRIVATE_KEY_FILE
277   %token  RSA_PUBLIC_KEY_FILE
278   %token  SSL_CERTIFICATE_FILE
279 < %token  T_SSL_CONNECTION_METHOD
279 > %token  SSL_DH_PARAM_FILE
280 > %token  T_SSL_CLIENT_METHOD
281 > %token  T_SSL_SERVER_METHOD
282   %token  T_SSLV3
283   %token  T_TLSV1
284   %token  RESV
# Line 307 | Line 288 | unhook_hub_leaf_confs(void)
288   %token  SEND_PASSWORD
289   %token  SERVERHIDE
290   %token  SERVERINFO
310 %token  SERVLINK_PATH
291   %token  IRCD_SID
292   %token  TKLINE_EXPIRE_NOTICES
293   %token  T_SHARED
# Line 334 | Line 314 | unhook_hub_leaf_confs(void)
314   %token  T_CALLERID
315   %token  T_CCONN
316   %token  T_CCONN_FULL
317 + %token  T_SSL_CIPHER_LIST
318   %token  T_CLIENT_FLOOD
319   %token  T_DEAF
320   %token  T_DEBUG
321 + %token  T_DLINE
322   %token  T_DRONE
323   %token  T_EXTERNAL
324   %token  T_FULL
# Line 344 | Line 326 | unhook_hub_leaf_confs(void)
326   %token  T_IPV4
327   %token  T_IPV6
328   %token  T_LOCOPS
347 %token  T_LOGPATH
348 %token  T_L_CRIT
349 %token  T_L_DEBUG
350 %token  T_L_ERROR
351 %token  T_L_INFO
352 %token  T_L_NOTICE
353 %token  T_L_TRACE
354 %token  T_L_WARN
329   %token  T_MAX_CLIENTS
330   %token  T_NCHANGE
331   %token  T_OPERWALL
# Line 363 | Line 337 | unhook_hub_leaf_confs(void)
337   %token  T_SSL
338   %token  T_UMODES
339   %token  T_UNAUTH
340 + %token  T_UNDLINE
341 + %token  T_UNLIMITED
342   %token  T_UNRESV
343   %token  T_UNXLINE
344 + %token  T_GLOBOPS
345   %token  T_WALLOP
346 + %token  T_RESTART
347 + %token  T_SERVICE
348 + %token  T_SERVICES_NAME
349   %token  THROTTLE_TIME
350   %token  TOPICBURST
351   %token  TRUE_NO_OPER_FLOOD
# Line 385 | Line 365 | unhook_hub_leaf_confs(void)
365   %token  XLINE
366   %token  WARN
367   %token  WARN_NO_NLINE
368 + %token  T_SIZE
369 + %token  T_FILE
370  
371   %type <string> QSTRING
372   %type <number> NUMBER
# Line 408 | Line 390 | conf_item:        admin_entry
390                  | serverinfo_entry
391                  | serverhide_entry
392                  | resv_entry
393 +                | service_entry
394                  | shared_entry
395                  | cluster_entry
396                  | connect_entry
# Line 469 | Line 452 | modules_item:   modules_module | modules
452  
453   modules_module: MODULE '=' QSTRING ';'
454   {
472 #ifndef STATIC_MODULES /* NOOP in the static case */
455    if (conf_parser_ctx.pass == 2)
456      add_conf_module(libio_basename(yylval.string));
475 #endif
457   };
458  
459   modules_path: PATH '=' QSTRING ';'
460   {
480 #ifndef STATIC_MODULES
461    if (conf_parser_ctx.pass == 2)
462      mod_add_path(yylval.string);
483 #endif
463   };
464  
465  
# Line 490 | Line 469 | serverinfo_items:       serverinfo_items
469   serverinfo_item:        serverinfo_name | serverinfo_vhost |
470                          serverinfo_hub | serverinfo_description |
471                          serverinfo_network_name | serverinfo_network_desc |
472 <                        serverinfo_max_clients |
472 >                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
473                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
474                          serverinfo_sid | serverinfo_ssl_certificate_file |
475 <                        serverinfo_ssl_connection_method |
475 >                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
476 >                        serverinfo_ssl_cipher_list |
477                          error ';' ;
478  
479  
480 < serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
480 > serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
481 > serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
482 >
483 > client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
484 > client_method_type_item: T_SSLV3
485   {
486   #ifdef HAVE_LIBCRYPTO
487 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
488 <    ServerInfo.tls_version = 0;
487 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
488 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
489   #endif
490 < } '=' method_types ';'
490 > } | T_TLSV1
491   {
492   #ifdef HAVE_LIBCRYPTO
493 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
494 <  {
511 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
512 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
513 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
514 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
515 <  }
493 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
494 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
495   #endif
496   };
497  
498 < method_types: method_types ',' method_type_item | method_type_item;
499 < method_type_item: T_SSLV3
498 > server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
499 > server_method_type_item: T_SSLV3
500   {
501   #ifdef HAVE_LIBCRYPTO
502 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
503 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
502 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
503 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
504   #endif
505   } | T_TLSV1
506   {
507   #ifdef HAVE_LIBCRYPTO
508 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
509 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
508 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
509 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
510   #endif
511   };
512  
# Line 543 | Line 522 | serverinfo_ssl_certificate_file: SSL_CER
522      }
523  
524      if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
525 +                                     SSL_FILETYPE_PEM) <= 0 ||
526 +        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
527                                       SSL_FILETYPE_PEM) <= 0)
528      {
529        yyerror(ERR_lib_error_string(ERR_get_error()));
# Line 550 | Line 531 | serverinfo_ssl_certificate_file: SSL_CER
531      }
532  
533      if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
534 +                                    SSL_FILETYPE_PEM) <= 0 ||
535 +        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
536                                      SSL_FILETYPE_PEM) <= 0)
537      {
538        yyerror(ERR_lib_error_string(ERR_get_error()));
539        break;
540      }
541  
542 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
542 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
543 >        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
544      {
545        yyerror(ERR_lib_error_string(ERR_get_error()));
546        break;
# Line 592 | Line 576 | serverinfo_rsa_private_key_file: RSA_PRI
576        break;
577      }
578  
579 <    ServerInfo.rsa_private_key = (RSA *)PEM_read_bio_RSAPrivateKey(file, NULL,
596 <      0, NULL);
579 >    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
580  
581      BIO_set_close(file, BIO_CLOSE);
582      BIO_free(file);
# Line 625 | Line 608 | serverinfo_rsa_private_key_file: RSA_PRI
608   #endif
609   };
610  
611 + serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
612 + {
613 + /* TBD - XXX: error reporting */
614 + #ifdef HAVE_LIBCRYPTO
615 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
616 +  {
617 +    BIO *file = BIO_new_file(yylval.string, "r");
618 +
619 +    if (file)
620 +    {
621 +      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
622 +
623 +      BIO_free(file);
624 +
625 +      if (dh)
626 +      {
627 +        if (DH_size(dh) < 128)
628 +          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
629 +        else
630 +          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
631 +
632 +        DH_free(dh);
633 +      }
634 +    }
635 +  }
636 + #endif
637 + };
638 +
639 + serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
640 + {
641 + #ifdef HAVE_LIBCRYPTO
642 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
643 +    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
644 + #endif
645 + };
646 +
647   serverinfo_name: NAME '=' QSTRING ';'
648   {
649    /* this isn't rehashable */
650 <  if (conf_parser_ctx.pass == 2)
650 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
651    {
652 <    if (ServerInfo.name == NULL)
652 >    if (valid_servname(yylval.string))
653 >      DupString(ServerInfo.name, yylval.string);
654 >    else
655      {
656 <      /* the ircd will exit() in main() if we dont set one */
657 <      if (strlen(yylval.string) <= HOSTLEN)
637 <        DupString(ServerInfo.name, yylval.string);
656 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
657 >      exit(0);
658      }
659    }
660   };
# Line 648 | Line 668 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
668        DupString(ServerInfo.sid, yylval.string);
669      else
670      {
671 <      ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting.");
671 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
672        exit(0);
673      }
674    }
# Line 698 | Line 718 | serverinfo_vhost: VHOST '=' QSTRING ';'
718      hints.ai_socktype = SOCK_STREAM;
719      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
720  
721 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
722 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
721 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
722 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
723      else
724      {
725        assert(res != NULL);
# Line 707 | Line 727 | serverinfo_vhost: VHOST '=' QSTRING ';'
727        memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
728        ServerInfo.ip.ss.ss_family = res->ai_family;
729        ServerInfo.ip.ss_len = res->ai_addrlen;
730 <      irc_freeaddrinfo(res);
730 >      freeaddrinfo(res);
731  
732        ServerInfo.specific_ipv4_vhost = 1;
733      }
# Line 727 | Line 747 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
747      hints.ai_socktype = SOCK_STREAM;
748      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
749  
750 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
751 <      ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string);
750 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
751 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
752      else
753      {
754        assert(res != NULL);
# Line 736 | Line 756 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
756        memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
757        ServerInfo.ip6.ss.ss_family = res->ai_family;
758        ServerInfo.ip6.ss_len = res->ai_addrlen;
759 <      irc_freeaddrinfo(res);
759 >      freeaddrinfo(res);
760  
761        ServerInfo.specific_ipv6_vhost = 1;
762      }
# Line 770 | Line 790 | serverinfo_max_clients: T_MAX_CLIENTS '=
790   serverinfo_hub: HUB '=' TBOOL ';'
791   {
792    if (conf_parser_ctx.pass == 2)
793 <  {
774 <    if (yylval.number)
775 <    {
776 <      ServerInfo.hub = 1;
777 <      delete_capability("HUB");
778 <      add_capability("HUB", CAP_HUB, 1);
779 <    }
780 <    else if (ServerInfo.hub)
781 <    {
782 <
783 <      ServerInfo.hub = 0;
784 <      delete_capability("HUB");
785 <    }
786 <  }
793 >    ServerInfo.hub = yylval.number;
794   };
795  
796   /***************************************************************************
# Line 825 | Line 832 | admin_description: DESCRIPTION '=' QSTRI
832   /***************************************************************************
833   *  section logging
834   ***************************************************************************/
835 < /* XXX */
836 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
830 <
831 < logging_items:          logging_items logging_item |
832 <                        logging_item ;
835 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
836 > logging_items:          logging_items logging_item | logging_item ;
837  
838 < logging_item:           logging_path | logging_oper_log |
835 <                        logging_log_level |
836 <                        logging_use_logging | logging_fuserlog |
837 <                        logging_foperlog | logging_fglinelog |
838 <                        logging_fklinelog | logging_killlog |
839 <                        logging_foperspylog | logging_ioerrlog |
840 <                        logging_ffailed_operlog |
838 > logging_item:           logging_use_logging | logging_file_entry |
839                          error ';' ;
840  
841 < logging_path:           T_LOGPATH '=' QSTRING ';'
844 <                        {
845 <                        };
846 <
847 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
848 <                        {
849 <                        };
850 <
851 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
841 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
842   {
843    if (conf_parser_ctx.pass == 2)
844 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
855 <            sizeof(ConfigLoggingEntry.userlog));
844 >    ConfigLoggingEntry.use_logging = yylval.number;
845   };
846  
847 < logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
847 > logging_file_entry:
848   {
849 <  if (conf_parser_ctx.pass == 2)
850 <    strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
851 <            sizeof(ConfigLoggingEntry.failed_operlog));
852 < };
864 <
865 < logging_foperlog: FOPERLOG '=' QSTRING ';'
849 >  lfile[0] = '\0';
850 >  ltype = 0;
851 >  lsize = 0;
852 > } T_FILE  '{' logging_file_items '}' ';'
853   {
854 <  if (conf_parser_ctx.pass == 2)
855 <    strlcpy(ConfigLoggingEntry.operlog, yylval.string,
869 <            sizeof(ConfigLoggingEntry.operlog));
854 >  if (conf_parser_ctx.pass == 2 && ltype > 0)
855 >    log_add_file(ltype, lsize, lfile);
856   };
857  
858 < logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
859 < {
874 <  if (conf_parser_ctx.pass == 2)
875 <    strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
876 <            sizeof(ConfigLoggingEntry.operspylog));
877 < };
858 > logging_file_items: logging_file_items logging_file_item |
859 >                    logging_file_item ;
860  
861 < logging_fglinelog: FGLINELOG '=' QSTRING ';'
862 < {
881 <  if (conf_parser_ctx.pass == 2)
882 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
883 <            sizeof(ConfigLoggingEntry.glinelog));
884 < };
861 > logging_file_item:  logging_file_name | logging_file_type |
862 >                    logging_file_size | error ';' ;
863  
864 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
864 > logging_file_name: NAME '=' QSTRING ';'
865   {
866 <  if (conf_parser_ctx.pass == 2)
867 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
890 <            sizeof(ConfigLoggingEntry.klinelog));
891 < };
866 >  strlcpy(lfile, yylval.string, sizeof(lfile));
867 > }
868  
869 < logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
869 > logging_file_size: T_SIZE '=' sizespec ';'
870   {
871 <  if (conf_parser_ctx.pass == 2)
872 <    strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
873 <            sizeof(ConfigLoggingEntry.ioerrlog));
871 >  lsize = $3;
872 > } | T_SIZE '=' T_UNLIMITED ';'
873 > {
874 >  lsize = 0;
875   };
876  
877 < logging_killlog: FKILLLOG '=' QSTRING ';'
877 > logging_file_type: TYPE
878   {
879    if (conf_parser_ctx.pass == 2)
880 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
881 <            sizeof(ConfigLoggingEntry.killlog));
905 < };
880 >    ltype = 0;
881 > } '='  logging_file_type_items ';' ;
882  
883 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
884 < {
909 <  if (conf_parser_ctx.pass == 2)
910 <    set_log_level(L_CRIT);
911 < } | LOG_LEVEL '=' T_L_ERROR ';'
883 > logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item;
884 > logging_file_type_item:  USER
885   {
886    if (conf_parser_ctx.pass == 2)
887 <    set_log_level(L_ERROR);
888 < } | LOG_LEVEL '=' T_L_WARN ';'
887 >    ltype = LOG_TYPE_USER;
888 > } | OPERATOR
889   {
890    if (conf_parser_ctx.pass == 2)
891 <    set_log_level(L_WARN);
892 < } | LOG_LEVEL '=' T_L_NOTICE ';'
891 >    ltype = LOG_TYPE_OPER;
892 > } | GLINE
893   {
894    if (conf_parser_ctx.pass == 2)
895 <    set_log_level(L_NOTICE);
896 < } | LOG_LEVEL '=' T_L_TRACE ';'
895 >    ltype = LOG_TYPE_GLINE;
896 > } | T_DLINE
897   {
898    if (conf_parser_ctx.pass == 2)
899 <    set_log_level(L_TRACE);
900 < } | LOG_LEVEL '=' T_L_INFO ';'
899 >    ltype = LOG_TYPE_DLINE;
900 > } | KLINE
901   {
902    if (conf_parser_ctx.pass == 2)
903 <    set_log_level(L_INFO);
904 < } | LOG_LEVEL '=' T_L_DEBUG ';'
903 >    ltype = LOG_TYPE_KLINE;
904 > } | KILL
905   {
906    if (conf_parser_ctx.pass == 2)
907 <    set_log_level(L_DEBUG);
908 < };
936 <
937 < logging_use_logging: USE_LOGGING '=' TBOOL ';'
907 >    ltype = LOG_TYPE_KILL;
908 > } | T_DEBUG
909   {
910    if (conf_parser_ctx.pass == 2)
911 <    ConfigLoggingEntry.use_logging = yylval.number;
911 >    ltype = LOG_TYPE_DEBUG;
912   };
913  
914 +
915   /***************************************************************************
916   * section oper
917   ***************************************************************************/
# Line 956 | Line 928 | oper_entry: OPERATOR
928      MyFree(class_name);
929      class_name = NULL;
930    }
931 < } oper_name_b '{' oper_items '}' ';'
931 > } '{' oper_items '}' ';'
932   {
933    if (conf_parser_ctx.pass == 2)
934    {
# Line 991 | Line 963 | oper_entry: OPERATOR
963          DupString(new_aconf->host, yy_tmp->host);
964        else
965          DupString(new_aconf->host, "*");
966 +
967 +      new_aconf->type = parse_netmask(new_aconf->host, &new_aconf->ipnum,
968 +                                     &new_aconf->bits);
969 +
970        conf_add_class_to_conf(new_conf, class_name);
971        if (yy_aconf->passwd != NULL)
972          DupString(new_aconf->passwd, yy_aconf->passwd);
# Line 1037 | Line 1013 | oper_entry: OPERATOR
1013    }
1014   };
1015  
1040 oper_name_b: | oper_name_t;
1016   oper_items:     oper_items oper_item | oper_item;
1017 < oper_item:      oper_name | oper_user | oper_password | oper_hidden_admin |
1018 <                oper_hidden_oper | oper_umodes |
1019 <                oper_class | oper_global_kill | oper_remote |
1045 <                oper_kline | oper_xline | oper_unkline |
1046 <                oper_gline | oper_nick_changes | oper_remoteban |
1047 <                oper_die | oper_rehash | oper_admin | oper_operwall |
1048 <                oper_encrypted | oper_rsa_public_key_file |
1049 <                oper_flags | error ';' ;
1017 > oper_item:      oper_name | oper_user | oper_password |
1018 >                oper_umodes | oper_class | oper_encrypted |
1019 >                oper_rsa_public_key_file | oper_flags | error ';' ;
1020  
1021   oper_name: NAME '=' QSTRING ';'
1022   {
# Line 1060 | Line 1030 | oper_name: NAME '=' QSTRING ';'
1030    }
1031   };
1032  
1063 oper_name_t: QSTRING
1064 {
1065  if (conf_parser_ctx.pass == 2)
1066  {
1067    if (strlen(yylval.string) > OPERNICKLEN)
1068      yylval.string[OPERNICKLEN] = '\0';
1069
1070    MyFree(yy_conf->name);
1071    DupString(yy_conf->name, yylval.string);
1072  }
1073 };
1074
1033   oper_user: USER '=' QSTRING ';'
1034   {
1035    if (conf_parser_ctx.pass == 2)
# Line 1093 | Line 1051 | oper_user: USER '=' QSTRING ';'
1051      {
1052        DupString(yy_aconf->user, userbuf);
1053        DupString(yy_aconf->host, hostbuf);
1054 +
1055 +      yy_aconf->type = parse_netmask(yy_aconf->host, &yy_aconf->ipnum,
1056 +                                    &yy_aconf->bits);
1057      }
1058      else
1059      {
# Line 1211 | Line 1172 | oper_umodes_item:  T_BOTS
1172   {
1173    if (conf_parser_ctx.pass == 2)
1174      yy_aconf->modes |= UMODE_FULL;
1175 + } | HIDDEN
1176 + {
1177 +  if (conf_parser_ctx.pass == 2)
1178 +    yy_aconf->modes |= UMODE_HIDDEN;
1179   } | T_SKILL
1180   {
1181    if (conf_parser_ctx.pass == 2)
# Line 1265 | Line 1230 | oper_umodes_item:  T_BOTS
1230      yy_aconf->modes |= UMODE_LOCOPS;
1231   };
1232  
1268 oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1269 {
1270  if (conf_parser_ctx.pass == 2)
1271  {
1272    if (yylval.number)
1273      yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1274    else
1275      yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1276  }
1277 };
1278
1279 oper_remote: REMOTE '=' TBOOL ';'
1280 {
1281  if (conf_parser_ctx.pass == 2)
1282  {
1283    if (yylval.number)
1284      yy_aconf->port |= OPER_FLAG_REMOTE;
1285    else
1286      yy_aconf->port &= ~OPER_FLAG_REMOTE;
1287  }
1288 };
1289
1290 oper_remoteban: REMOTEBAN '=' TBOOL ';'
1291 {
1292  if (conf_parser_ctx.pass == 2)
1293  {
1294    if (yylval.number)
1295      yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1296    else
1297      yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1298  }
1299 };
1300
1301 oper_kline: KLINE '=' TBOOL ';'
1302 {
1303  if (conf_parser_ctx.pass == 2)
1304  {
1305    if (yylval.number)
1306      yy_aconf->port |= OPER_FLAG_K;
1307    else
1308      yy_aconf->port &= ~OPER_FLAG_K;
1309  }
1310 };
1311
1312 oper_xline: XLINE '=' TBOOL ';'
1313 {
1314  if (conf_parser_ctx.pass == 2)
1315  {
1316    if (yylval.number)
1317      yy_aconf->port |= OPER_FLAG_X;
1318    else
1319      yy_aconf->port &= ~OPER_FLAG_X;
1320  }
1321 };
1322
1323 oper_unkline: UNKLINE '=' TBOOL ';'
1324 {
1325  if (conf_parser_ctx.pass == 2)
1326  {
1327    if (yylval.number)
1328      yy_aconf->port |= OPER_FLAG_UNKLINE;
1329    else
1330      yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1331  }
1332 };
1333
1334 oper_gline: GLINE '=' TBOOL ';'
1335 {
1336  if (conf_parser_ctx.pass == 2)
1337  {
1338    if (yylval.number)
1339      yy_aconf->port |= OPER_FLAG_GLINE;
1340    else
1341      yy_aconf->port &= ~OPER_FLAG_GLINE;
1342  }
1343 };
1344
1345 oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1346 {
1347  if (conf_parser_ctx.pass == 2)
1348  {
1349    if (yylval.number)
1350      yy_aconf->port |= OPER_FLAG_N;
1351    else
1352      yy_aconf->port &= ~OPER_FLAG_N;
1353  }
1354 };
1355
1356 oper_die: DIE '=' TBOOL ';'
1357 {
1358  if (conf_parser_ctx.pass == 2)
1359  {
1360    if (yylval.number)
1361      yy_aconf->port |= OPER_FLAG_DIE;
1362    else
1363      yy_aconf->port &= ~OPER_FLAG_DIE;
1364  }
1365 };
1366
1367 oper_rehash: REHASH '=' TBOOL ';'
1368 {
1369  if (conf_parser_ctx.pass == 2)
1370  {
1371    if (yylval.number)
1372      yy_aconf->port |= OPER_FLAG_REHASH;
1373    else
1374      yy_aconf->port &= ~OPER_FLAG_REHASH;
1375  }
1376 };
1377
1378 oper_admin: ADMIN '=' TBOOL ';'
1379 {
1380  if (conf_parser_ctx.pass == 2)
1381  {
1382    if (yylval.number)
1383      yy_aconf->port |= OPER_FLAG_ADMIN;
1384    else
1385      yy_aconf->port &= ~OPER_FLAG_ADMIN;
1386  }
1387 };
1388
1389 oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1390 {
1391  if (conf_parser_ctx.pass == 2)
1392  {
1393    if (yylval.number)
1394      yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1395    else
1396      yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1397  }
1398 };
1399
1400 oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1401 {
1402  if (conf_parser_ctx.pass == 2)
1403  {
1404    if (yylval.number)
1405      yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1406    else
1407      yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1408  }
1409 };
1410
1411 oper_operwall: T_OPERWALL '=' TBOOL ';'
1412 {
1413  if (conf_parser_ctx.pass == 2)
1414  {
1415    if (yylval.number)
1416      yy_aconf->port |= OPER_FLAG_OPERWALL;
1417    else
1418      yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1419  }
1420 };
1421
1233   oper_flags: IRCD_FLAGS
1234   {
1235 +  if (conf_parser_ctx.pass == 2)
1236 +    yy_aconf->port = 0;
1237   } '='  oper_flags_items ';';
1238  
1239   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1240 < oper_flags_item: NOT { not_atom = 1; } oper_flags_item_atom
1428 <                | { not_atom = 0; } oper_flags_item_atom;
1429 <
1430 < oper_flags_item_atom: GLOBAL_KILL
1240 > oper_flags_item: GLOBAL_KILL
1241   {
1242    if (conf_parser_ctx.pass == 2)
1243 <  {
1434 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1435 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1436 <  }
1243 >    yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1244   } | REMOTE
1245   {
1246    if (conf_parser_ctx.pass == 2)
1247 <  {
1441 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1442 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1443 <  }
1247 >    yy_aconf->port |= OPER_FLAG_REMOTE;
1248   } | KLINE
1249   {
1250    if (conf_parser_ctx.pass == 2)
1251 <  {
1448 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1449 <    else yy_aconf->port |= OPER_FLAG_K;
1450 <  }
1251 >    yy_aconf->port |= OPER_FLAG_K;
1252   } | UNKLINE
1253   {
1254    if (conf_parser_ctx.pass == 2)
1255 <  {
1256 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1257 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1258 <  }
1255 >    yy_aconf->port |= OPER_FLAG_UNKLINE;
1256 > } | T_DLINE
1257 > {
1258 >  if (conf_parser_ctx.pass == 2)
1259 >    yy_aconf->port |= OPER_FLAG_DLINE;
1260 > } | T_UNDLINE
1261 > {
1262 >  if (conf_parser_ctx.pass == 2)
1263 >    yy_aconf->port |= OPER_FLAG_UNDLINE;
1264   } | XLINE
1265   {
1266    if (conf_parser_ctx.pass == 2)
1267 <  {
1462 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1463 <    else yy_aconf->port |= OPER_FLAG_X;
1464 <  }
1267 >    yy_aconf->port |= OPER_FLAG_X;
1268   } | GLINE
1269   {
1270    if (conf_parser_ctx.pass == 2)
1271 <  {
1469 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1470 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1471 <  }
1271 >    yy_aconf->port |= OPER_FLAG_GLINE;
1272   } | DIE
1273   {
1274    if (conf_parser_ctx.pass == 2)
1275 <  {
1276 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1477 <    else yy_aconf->port |= OPER_FLAG_DIE;
1478 <  }
1479 < } | REHASH
1275 >    yy_aconf->port |= OPER_FLAG_DIE;
1276 > } | T_RESTART
1277   {
1278    if (conf_parser_ctx.pass == 2)
1279 <  {
1280 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1484 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1485 <  }
1486 < } | ADMIN
1279 >    yy_aconf->port |= OPER_FLAG_RESTART;
1280 > } | REHASH
1281   {
1282    if (conf_parser_ctx.pass == 2)
1283 <  {
1284 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1491 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1492 <  }
1493 < } | HIDDEN_ADMIN
1283 >    yy_aconf->port |= OPER_FLAG_REHASH;
1284 > } | ADMIN
1285   {
1286    if (conf_parser_ctx.pass == 2)
1287 <  {
1497 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1498 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1499 <  }
1287 >    yy_aconf->port |= OPER_FLAG_ADMIN;
1288   } | NICK_CHANGES
1289   {
1290    if (conf_parser_ctx.pass == 2)
1291 <  {
1504 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1505 <    else yy_aconf->port |= OPER_FLAG_N;
1506 <  }
1291 >    yy_aconf->port |= OPER_FLAG_N;
1292   } | T_OPERWALL
1293   {
1294    if (conf_parser_ctx.pass == 2)
1295 <  {
1296 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1512 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1513 <  }
1514 < } | OPER_SPY_T
1295 >    yy_aconf->port |= OPER_FLAG_OPERWALL;
1296 > } | T_GLOBOPS
1297   {
1298    if (conf_parser_ctx.pass == 2)
1299 <  {
1300 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1519 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1520 <  }
1521 < } | HIDDEN_OPER
1299 >    yy_aconf->port |= OPER_FLAG_GLOBOPS;
1300 > } | OPER_SPY_T
1301   {
1302    if (conf_parser_ctx.pass == 2)
1303 <  {
1525 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1526 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1527 <  }
1303 >    yy_aconf->port |= OPER_FLAG_OPER_SPY;
1304   } | REMOTEBAN
1305   {
1306    if (conf_parser_ctx.pass == 2)
1307 <  {
1308 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1533 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1534 <  }
1535 < } | ENCRYPTED
1307 >    yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1308 > } | MODULE
1309   {
1310    if (conf_parser_ctx.pass == 2)
1311 <  {
1539 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1540 <    else SetConfEncrypted(yy_aconf);
1541 <  }
1311 >    yy_aconf->port |= OPER_FLAG_MODULE;
1312   };
1313  
1314  
# Line 1552 | Line 1322 | class_entry: CLASS
1322      yy_conf = make_conf_item(CLASS_TYPE);
1323      yy_class = map_to_conf(yy_conf);
1324    }
1325 < } class_name_b '{' class_items '}' ';'
1325 > } '{' class_items '}' ';'
1326   {
1327    if (conf_parser_ctx.pass == 1)
1328    {
# Line 1563 | Line 1333 | class_entry: CLASS
1333        delete_conf_item(yy_conf);
1334      else
1335      {
1336 <      cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1336 >      cconf = find_exact_name_conf(CLASS_TYPE, NULL, yy_class_name, NULL, NULL);
1337  
1338        if (cconf != NULL)                /* The class existed already */
1339        {
# Line 1595 | Line 1365 | class_entry: CLASS
1365    }
1366   };
1367  
1598 class_name_b: | class_name_t;
1599
1368   class_items:    class_items class_item | class_item;
1369   class_item:     class_name |
1370                  class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
# Line 1621 | Line 1389 | class_name: NAME '=' QSTRING ';'
1389    }
1390   };
1391  
1624 class_name_t: QSTRING
1625 {
1626  if (conf_parser_ctx.pass == 1)
1627  {
1628    MyFree(yy_class_name);
1629    DupString(yy_class_name, yylval.string);
1630  }
1631 };
1632
1392   class_ping_time: PING_TIME '=' timespec ';'
1393   {
1394    if (conf_parser_ctx.pass == 1)
# Line 1876 | Line 1635 | auth_entry: IRCD_AUTH
1635  
1636   auth_items:     auth_items auth_item | auth_item;
1637   auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1638 <                auth_kline_exempt | auth_need_ident |
1639 <                auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
1881 <                auth_spoof | auth_spoof_notice |
1882 <                auth_redir_serv | auth_redir_port | auth_can_flood |
1883 <                auth_need_password | auth_encrypted | error ';' ;
1638 >                auth_spoof | auth_redir_serv | auth_redir_port |
1639 >                auth_encrypted | error ';' ;
1640  
1641   auth_user: USER '=' QSTRING ';'
1642   {
# Line 1932 | Line 1688 | auth_passwd: PASSWORD '=' QSTRING ';'
1688    }
1689   };
1690  
1935 auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1936 {
1937  if (conf_parser_ctx.pass == 2)
1938  {
1939    if (yylval.number)
1940      yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1941    else
1942      yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1943  }
1944 };
1945
1691   auth_class: CLASS '=' QSTRING ';'
1692   {
1693    if (conf_parser_ctx.pass == 2)
# Line 1968 | Line 1713 | auth_flags: IRCD_FLAGS
1713   } '='  auth_flags_items ';';
1714  
1715   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1716 < auth_flags_item: NOT { not_atom = 1; } auth_flags_item_atom
1972 <                | { not_atom = 0; } auth_flags_item_atom;
1973 <
1974 < auth_flags_item_atom: SPOOF_NOTICE
1716 > auth_flags_item: SPOOF_NOTICE
1717   {
1718    if (conf_parser_ctx.pass == 2)
1719 <  {
1978 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1979 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1980 <  }
1981 <
1719 >    yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1720   } | EXCEED_LIMIT
1721   {
1722    if (conf_parser_ctx.pass == 2)
1723 <  {
1986 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1987 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1988 <  }
1723 >    yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1724   } | KLINE_EXEMPT
1725   {
1726    if (conf_parser_ctx.pass == 2)
1727 <  {
1993 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1994 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1995 <  }
1727 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1728   } | NEED_IDENT
1729   {
1730    if (conf_parser_ctx.pass == 2)
1731 <  {
2000 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2001 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2002 <  }
1731 >    yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1732   } | CAN_FLOOD
1733   {
1734    if (conf_parser_ctx.pass == 2)
1735 <  {
2007 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2008 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2009 <  }
2010 < } | CAN_IDLE
2011 < {
2012 <  if (conf_parser_ctx.pass == 2)
2013 <  {
2014 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
2015 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
2016 <  }
1735 >    yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1736   } | NO_TILDE
1737   {
1738    if (conf_parser_ctx.pass == 2)
1739 <  {
2021 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2022 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2023 <  }
1739 >    yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1740   } | GLINE_EXEMPT
1741   {
1742    if (conf_parser_ctx.pass == 2)
1743 <  {
2028 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2029 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2030 <  }
1743 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1744   } | RESV_EXEMPT
1745   {
1746    if (conf_parser_ctx.pass == 2)
1747 <  {
2035 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
2036 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
2037 <  }
1747 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1748   } | NEED_PASSWORD
1749   {
1750    if (conf_parser_ctx.pass == 2)
1751 <  {
2042 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2043 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2044 <  }
2045 < };
2046 <
2047 < auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
2048 < {
2049 <  if (conf_parser_ctx.pass == 2)
2050 <  {
2051 <    if (yylval.number)
2052 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
2053 <    else
2054 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
2055 <  }
2056 < };
2057 <
2058 < auth_need_ident: NEED_IDENT '=' TBOOL ';'
2059 < {
2060 <  if (conf_parser_ctx.pass == 2)
2061 <  {
2062 <    if (yylval.number)
2063 <      yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2064 <    else
2065 <      yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2066 <  }
2067 < };
2068 <
2069 < auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2070 < {
2071 <  if (conf_parser_ctx.pass == 2)
2072 <  {
2073 <    if (yylval.number)
2074 <      yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
2075 <    else
2076 <      yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
2077 <  }
2078 < };
2079 <
2080 < auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2081 < {
2082 <  if (conf_parser_ctx.pass == 2)
2083 <  {
2084 <    if (yylval.number)
2085 <      yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2086 <    else
2087 <      yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2088 <  }
2089 < };
2090 <
2091 < auth_no_tilde: NO_TILDE '=' TBOOL ';'
2092 < {
2093 <  if (conf_parser_ctx.pass == 2)
2094 <  {
2095 <    if (yylval.number)
2096 <      yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2097 <    else
2098 <      yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2099 <  }
2100 < };
2101 <
2102 < auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2103 < {
2104 <  if (conf_parser_ctx.pass == 2)
2105 <  {
2106 <    if (yylval.number)
2107 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2108 <    else
2109 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2110 <  }
1751 >    yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1752   };
1753  
1754   /* XXX - need check for illegal hostnames here */
# Line 2124 | Line 1765 | auth_spoof: SPOOF '=' QSTRING ';'
1765      }
1766      else
1767      {
1768 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1768 >      ilog(LOG_TYPE_IRCD, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1769        yy_conf->name = NULL;
1770      }
1771    }
# Line 2149 | Line 1790 | auth_redir_port: REDIRPORT '=' NUMBER ';
1790    }
1791   };
1792  
2152 auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2153 {
2154  if (conf_parser_ctx.pass == 2)
2155  {
2156    if (yylval.number)
2157      yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2158    else
2159      yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2160  }
2161 };
2162
1793  
1794   /***************************************************************************
1795   *  section resv
# Line 2218 | Line 1848 | resv_nick: NICK '=' QSTRING ';'
1848   };
1849  
1850   /***************************************************************************
1851 + *  section service
1852 + ***************************************************************************/
1853 + service_entry: T_SERVICE '{' service_items '}' ';';
1854 +
1855 + service_items:     service_items service_item | service_item;
1856 + service_item:      service_name | error;
1857 +
1858 + service_name: NAME '=' QSTRING ';'
1859 + {
1860 +  if (conf_parser_ctx.pass == 2)
1861 +  {
1862 +    if (valid_servname(yylval.string))
1863 +    {
1864 +      yy_conf = make_conf_item(SERVICE_TYPE);
1865 +      DupString(yy_conf->name, yylval.string);
1866 +    }
1867 +  }
1868 + };
1869 +
1870 + /***************************************************************************
1871   *  section shared, for sharing remote klines etc.
1872   ***************************************************************************/
1873   shared_entry: T_SHARED
# Line 2281 | Line 1931 | shared_type_item: KLINE
1931   {
1932    if (conf_parser_ctx.pass == 2)
1933      yy_match_item->action |= SHARED_KLINE;
2284 } | TKLINE
2285 {
2286  if (conf_parser_ctx.pass == 2)
2287    yy_match_item->action |= SHARED_TKLINE;
1934   } | UNKLINE
1935   {
1936    if (conf_parser_ctx.pass == 2)
1937      yy_match_item->action |= SHARED_UNKLINE;
1938 < } | XLINE
1938 > } | T_DLINE
1939   {
1940    if (conf_parser_ctx.pass == 2)
1941 <    yy_match_item->action |= SHARED_XLINE;
1942 < } | TXLINE
1941 >    yy_match_item->action |= SHARED_DLINE;
1942 > } | T_UNDLINE
1943   {
1944    if (conf_parser_ctx.pass == 2)
1945 <    yy_match_item->action |= SHARED_TXLINE;
1945 >    yy_match_item->action |= SHARED_UNDLINE;
1946 > } | XLINE
1947 > {
1948 >  if (conf_parser_ctx.pass == 2)
1949 >    yy_match_item->action |= SHARED_XLINE;
1950   } | T_UNXLINE
1951   {
1952    if (conf_parser_ctx.pass == 2)
# Line 2305 | Line 1955 | shared_type_item: KLINE
1955   {
1956    if (conf_parser_ctx.pass == 2)
1957      yy_match_item->action |= SHARED_RESV;
2308 } | TRESV
2309 {
2310  if (conf_parser_ctx.pass == 2)
2311    yy_match_item->action |= SHARED_TRESV;
1958   } | T_UNRESV
1959   {
1960    if (conf_parser_ctx.pass == 2)
# Line 2363 | Line 2009 | cluster_type_item: KLINE
2009   {
2010    if (conf_parser_ctx.pass == 2)
2011      yy_conf->flags |= SHARED_KLINE;
2366 } | TKLINE
2367 {
2368  if (conf_parser_ctx.pass == 2)
2369    yy_conf->flags |= SHARED_TKLINE;
2012   } | UNKLINE
2013   {
2014    if (conf_parser_ctx.pass == 2)
2015      yy_conf->flags |= SHARED_UNKLINE;
2016 < } | XLINE
2016 > } | T_DLINE
2017   {
2018    if (conf_parser_ctx.pass == 2)
2019 <    yy_conf->flags |= SHARED_XLINE;
2020 < } | TXLINE
2019 >    yy_conf->flags |= SHARED_DLINE;
2020 > } | T_UNDLINE
2021 > {
2022 >  if (conf_parser_ctx.pass == 2)
2023 >    yy_conf->flags |= SHARED_UNDLINE;
2024 > } | XLINE
2025   {
2026    if (conf_parser_ctx.pass == 2)
2027 <    yy_conf->flags |= SHARED_TXLINE;
2027 >    yy_conf->flags |= SHARED_XLINE;
2028   } | T_UNXLINE
2029   {
2030    if (conf_parser_ctx.pass == 2)
# Line 2387 | Line 2033 | cluster_type_item: KLINE
2033   {
2034    if (conf_parser_ctx.pass == 2)
2035      yy_conf->flags |= SHARED_RESV;
2390 } | TRESV
2391 {
2392  if (conf_parser_ctx.pass == 2)
2393    yy_conf->flags |= SHARED_TRESV;
2036   } | T_UNRESV
2037   {
2038    if (conf_parser_ctx.pass == 2)
# Line 2413 | Line 2055 | connect_entry: CONNECT
2055    if (conf_parser_ctx.pass == 2)
2056    {
2057      yy_conf = make_conf_item(SERVER_TYPE);
2058 <    yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
2059 <    yy_aconf->passwd = NULL;
2058 >    yy_aconf = map_to_conf(yy_conf);
2059 >
2060      /* defaults */
2061      yy_aconf->port = PORTNUM;
2420
2421    if (ConfigFileEntry.burst_away)
2422      yy_aconf->flags = CONF_FLAGS_BURST_AWAY;
2062    }
2063    else
2064    {
2065      MyFree(class_name);
2066      class_name = NULL;
2067    }
2068 < } connect_name_b '{' connect_items '}' ';'
2068 > } '{' connect_items '}' ';'
2069   {
2070    if (conf_parser_ctx.pass == 2)
2071    {
2072      struct CollectItem *yy_hconf=NULL;
2073      struct CollectItem *yy_lconf=NULL;
2074 <    dlink_node *ptr;
2075 <    dlink_node *next_ptr;
2437 < #ifdef HAVE_LIBCRYPTO
2074 >    dlink_node *ptr = NULL, *next_ptr = NULL;
2075 >
2076      if (yy_aconf->host &&
2077 <        ((yy_aconf->passwd && yy_aconf->spasswd) ||
2078 <         (yy_aconf->rsa_public_key && IsConfCryptLink(yy_aconf))))
2079 < #else /* !HAVE_LIBCRYPTO */
2080 <      if (yy_aconf->host && !IsConfCryptLink(yy_aconf) &&
2081 <          yy_aconf->passwd && yy_aconf->spasswd)
2082 < #endif /* !HAVE_LIBCRYPTO */
2083 <        {
2084 <          if (conf_add_server(yy_conf, class_name) == -1)
2085 <          {
2086 <            delete_conf_item(yy_conf);
2087 <            yy_conf = NULL;
2088 <            yy_aconf = NULL;
2089 <          }
2090 <        }
2091 <        else
2454 <        {
2455 <          /* Even if yy_conf ->name is NULL
2456 <           * should still unhook any hub/leaf confs still pending
2457 <           */
2458 <          unhook_hub_leaf_confs();
2459 <
2460 <          if (yy_conf->name != NULL)
2461 <          {
2462 < #ifndef HAVE_LIBCRYPTO
2463 <            if (IsConfCryptLink(yy_aconf))
2464 <              yyerror("Ignoring connect block -- no OpenSSL support");
2465 < #else
2466 <            if (IsConfCryptLink(yy_aconf) && !yy_aconf->rsa_public_key)
2467 <              yyerror("Ignoring connect block -- missing key");
2468 < #endif
2469 <            if (yy_aconf->host == NULL)
2470 <              yyerror("Ignoring connect block -- missing host");
2471 <            else if (!IsConfCryptLink(yy_aconf) &&
2472 <                    (!yy_aconf->passwd || !yy_aconf->spasswd))
2473 <              yyerror("Ignoring connect block -- missing password");
2474 <          }
2475 <
2476 <
2477 <          /* XXX
2478 <           * This fixes a try_connections() core (caused by invalid class_ptr
2479 <           * pointers) reported by metalrock. That's an ugly fix, but there
2480 <           * is currently no better way. The entire config subsystem needs an
2481 <           * rewrite ASAP. make_conf_item() shouldn't really add things onto
2482 <           * a doubly linked list immediately without any sanity checks!  -Michael
2483 <           */
2484 <          delete_conf_item(yy_conf);
2077 >        yy_aconf->passwd && yy_aconf->spasswd)
2078 >    {
2079 >      if (conf_add_server(yy_conf, class_name) == -1)
2080 >      {
2081 >        delete_conf_item(yy_conf);
2082 >        yy_conf = NULL;
2083 >        yy_aconf = NULL;
2084 >      }
2085 >    }
2086 >    else
2087 >    {
2088 >      /* Even if yy_conf ->name is NULL
2089 >       * should still unhook any hub/leaf confs still pending
2090 >       */
2091 >      unhook_hub_leaf_confs();
2092  
2093 <          yy_aconf = NULL;
2094 <          yy_conf = NULL;
2095 <        }
2093 >      if (yy_conf->name != NULL)
2094 >      {
2095 >        if (yy_aconf->host == NULL)
2096 >          yyerror("Ignoring connect block -- missing host");
2097 >        else if (!yy_aconf->passwd || !yy_aconf->spasswd)
2098 >          yyerror("Ignoring connect block -- missing password");
2099 >      }
2100 >
2101 >
2102 >      /* XXX
2103 >       * This fixes a try_connections() core (caused by invalid class_ptr
2104 >       * pointers) reported by metalrock. That's an ugly fix, but there
2105 >       * is currently no better way. The entire config subsystem needs an
2106 >       * rewrite ASAP. make_conf_item() shouldn't really add things onto
2107 >       * a doubly linked list immediately without any sanity checks!  -Michael
2108 >       */
2109 >      delete_conf_item(yy_conf);
2110 >
2111 >      yy_aconf = NULL;
2112 >      yy_conf = NULL;
2113 >    }
2114  
2115        /*
2116         * yy_conf is still pointing at the server that is having
# Line 2554 | Line 2179 | connect_entry: CONNECT
2179    }
2180   };
2181  
2557 connect_name_b: | connect_name_t;
2182   connect_items:  connect_items connect_item | connect_item;
2183   connect_item:   connect_name | connect_host | connect_vhost |
2184                  connect_send_password | connect_accept_password |
2185 <                connect_aftype | connect_port |
2186 <                connect_fakename | connect_flags | connect_hub_mask |
2187 <                connect_leaf_mask | connect_class | connect_auto |
2188 <                connect_encrypted | connect_compressed | connect_cryptlink |
2565 <                connect_rsa_public_key_file | connect_cipher_preference |
2566 <                connect_topicburst | error ';' ;
2185 >                connect_aftype | connect_port | connect_ssl_cipher_list |
2186 >                connect_flags | connect_hub_mask | connect_leaf_mask |
2187 >                connect_class | connect_encrypted |
2188 >                error ';' ;
2189  
2190   connect_name: NAME '=' QSTRING ';'
2191   {
# Line 2577 | Line 2199 | connect_name: NAME '=' QSTRING ';'
2199    }
2200   };
2201  
2580 connect_name_t: QSTRING
2581 {
2582  if (conf_parser_ctx.pass == 2)
2583  {
2584    if (yy_conf->name != NULL)
2585      yyerror("Multiple connect name entry");
2586
2587    MyFree(yy_conf->name);
2588    DupString(yy_conf->name, yylval.string);
2589  }
2590 };
2591
2202   connect_host: HOST '=' QSTRING ';'
2203   {
2204    if (conf_parser_ctx.pass == 2)
# Line 2610 | Line 2220 | connect_vhost: VHOST '=' QSTRING ';'
2220      hints.ai_socktype = SOCK_STREAM;
2221      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2222  
2223 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
2224 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2223 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
2224 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2225      else
2226      {
2227        assert(res != NULL);
# Line 2619 | Line 2229 | connect_vhost: VHOST '=' QSTRING ';'
2229        memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2230        yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2231        yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2232 <      irc_freeaddrinfo(res);
2232 >      freeaddrinfo(res);
2233      }
2234    }
2235   };
# Line 2678 | Line 2288 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2288   #endif
2289   };
2290  
2681 connect_fakename: FAKENAME '=' QSTRING ';'
2682 {
2683  if (conf_parser_ctx.pass == 2)
2684  {
2685    MyFree(yy_aconf->fakename);
2686    DupString(yy_aconf->fakename, yylval.string);
2687  }
2688 };
2689
2291   connect_flags: IRCD_FLAGS
2292   {
2293   } '='  connect_flags_items ';';
2294  
2295   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2296 < connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2696 <                        |  { not_atom = 0; } connect_flags_item_atom;
2697 <
2698 < connect_flags_item_atom: COMPRESSED
2699 < {
2700 <  if (conf_parser_ctx.pass == 2)
2701 < #ifndef HAVE_LIBZ
2702 <    yyerror("Ignoring flags = compressed; -- no zlib support");
2703 < #else
2704 < {
2705 <   if (not_atom)ClearConfCompressed(yy_aconf);
2706 <   else SetConfCompressed(yy_aconf);
2707 < }
2708 < #endif
2709 < } | CRYPTLINK
2296 > connect_flags_item: AUTOCONN
2297   {
2298    if (conf_parser_ctx.pass == 2)
2299 <  {
2713 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2714 <    else SetConfCryptLink(yy_aconf);
2715 <  }
2716 < } | AUTOCONN
2717 < {
2718 <  if (conf_parser_ctx.pass == 2)
2719 <  {
2720 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2721 <    else SetConfAllowAutoConn(yy_aconf);
2722 <  }
2299 >    SetConfAllowAutoConn(yy_aconf);
2300   } | BURST_AWAY
2301   {
2302    if (conf_parser_ctx.pass == 2)
2303 <  {
2727 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2728 <    else SetConfAwayBurst(yy_aconf);
2729 <  }
2303 >    SetConfAwayBurst(yy_aconf);
2304   } | TOPICBURST
2305   {
2306    if (conf_parser_ctx.pass == 2)
2307 <  {
2308 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2735 <    else SetConfTopicBurst(yy_aconf);
2736 <  }
2737 < }
2738 < ;
2739 <
2740 < connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2307 >    SetConfTopicBurst(yy_aconf);
2308 > } | T_SSL
2309   {
2742 #ifdef HAVE_LIBCRYPTO
2310    if (conf_parser_ctx.pass == 2)
2311 <  {
2745 <    BIO *file;
2746 <
2747 <    if (yy_aconf->rsa_public_key != NULL)
2748 <    {
2749 <      RSA_free(yy_aconf->rsa_public_key);
2750 <      yy_aconf->rsa_public_key = NULL;
2751 <    }
2752 <
2753 <    if (yy_aconf->rsa_public_key_file != NULL)
2754 <    {
2755 <      MyFree(yy_aconf->rsa_public_key_file);
2756 <      yy_aconf->rsa_public_key_file = NULL;
2757 <    }
2758 <
2759 <    DupString(yy_aconf->rsa_public_key_file, yylval.string);
2760 <
2761 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
2762 <    {
2763 <      yyerror("Ignoring rsa_public_key_file -- file doesn't exist");
2764 <      break;
2765 <    }
2766 <
2767 <    yy_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
2768 <
2769 <    if (yy_aconf->rsa_public_key == NULL)
2770 <    {
2771 <      yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
2772 <      break;
2773 <    }
2774 <      
2775 <    BIO_set_close(file, BIO_CLOSE);
2776 <    BIO_free(file);
2777 <  }
2778 < #endif /* HAVE_LIBCRYPTO */
2311 >    SetConfSSL(yy_aconf);
2312   };
2313  
2314   connect_encrypted: ENCRYPTED '=' TBOOL ';'
# Line 2789 | Line 2322 | connect_encrypted: ENCRYPTED '=' TBOOL '
2322    }
2323   };
2324  
2792 connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2793 {
2794  if (conf_parser_ctx.pass == 2)
2795  {
2796    if (yylval.number)
2797      yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
2798    else
2799      yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK;
2800  }
2801 };
2802
2803 connect_compressed: COMPRESSED '=' TBOOL ';'
2804 {
2805  if (conf_parser_ctx.pass == 2)
2806  {
2807    if (yylval.number)
2808 #ifndef HAVE_LIBZ
2809      yyerror("Ignoring compressed=yes; -- no zlib support");
2810 #else
2811      yy_aconf->flags |= CONF_FLAGS_COMPRESSED;
2812 #endif
2813    else
2814      yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED;
2815  }
2816 };
2817
2818 connect_auto: AUTOCONN '=' TBOOL ';'
2819 {
2820  if (conf_parser_ctx.pass == 2)
2821  {
2822    if (yylval.number)
2823      yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
2824    else
2825      yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
2826  }
2827 };
2828
2829 connect_topicburst: TOPICBURST '=' TBOOL ';'
2830 {
2831  if (conf_parser_ctx.pass == 2)
2832  {
2833    if (yylval.number)
2834      SetConfTopicBurst(yy_aconf);
2835    else
2836      ClearConfTopicBurst(yy_aconf);
2837  }
2838 };
2839
2325   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2326   {
2327    if (conf_parser_ctx.pass == 2)
# Line 2872 | Line 2357 | connect_class: CLASS '=' QSTRING ';'
2357    }
2358   };
2359  
2360 < connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2360 > connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2361   {
2362   #ifdef HAVE_LIBCRYPTO
2363    if (conf_parser_ctx.pass == 2)
2364    {
2365 <    struct EncCapability *ecap;
2366 <    const char *cipher_name;
2882 <    int found = 0;
2883 <
2884 <    yy_aconf->cipher_preference = NULL;
2885 <    cipher_name = yylval.string;
2886 <
2887 <    for (ecap = CipherTable; ecap->name; ecap++)
2888 <    {
2889 <      if ((irccmp(ecap->name, cipher_name) == 0) &&
2890 <          (ecap->cap & CAP_ENC_MASK))
2891 <      {
2892 <        yy_aconf->cipher_preference = ecap;
2893 <        found = 1;
2894 <        break;
2895 <      }
2896 <    }
2897 <
2898 <    if (!found)
2899 <      yyerror("Invalid cipher");
2365 >    MyFree(yy_aconf->cipher_list);
2366 >    DupString(yy_aconf->cipher_list, yylval.string);
2367    }
2368   #else
2369    if (conf_parser_ctx.pass == 2)
2370 <    yyerror("Ignoring cipher_preference -- no OpenSSL support");
2370 >    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2371   #endif
2372   };
2373  
2374 +
2375   /***************************************************************************
2376   *  section kill
2377   ***************************************************************************/
# Line 2930 | Line 2398 | kill_entry: KILL
2398          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2399              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2400          {
2401 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s",
2401 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2402                 errptr);
2403            break;
2404          }
# Line 2947 | Line 2415 | kill_entry: KILL
2415          else
2416            DupString(yy_aconf->reason, "No reason");
2417   #else
2418 <        ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support");
2418 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2419          break;
2420   #endif
2421        }
# Line 3097 | Line 2565 | gecos_entry: GECOS
2565  
2566          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2567          {
2568 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s",
2568 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2569                 errptr);
2570            break;
2571          }
# Line 3105 | Line 2573 | gecos_entry: GECOS
2573          yy_conf = make_conf_item(RXLINE_TYPE);
2574          yy_conf->regexpname = exp_p;
2575   #else
2576 <        ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support");
2576 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2577          break;
2578   #endif
2579        }
# Line 3169 | Line 2637 | general_item:       general_hide_spoof_i
2637                      general_pace_wait_simple | general_stats_P_oper_only |
2638                      general_short_motd | general_no_oper_flood |
2639                      general_true_no_oper_flood | general_oper_pass_resv |
2640 <                    general_idletime | general_message_locale |
2640 >                    general_message_locale |
2641                      general_oper_only_umodes | general_max_targets |
2642                      general_use_egd | general_egdpool_path |
2643                      general_oper_umodes | general_caller_id_wait |
2644                      general_opers_bypass_callerid | general_default_floodcount |
2645                      general_min_nonwildcard | general_min_nonwildcard_simple |
2646 <                    general_servlink_path | general_disable_remote_commands |
2647 <                    general_default_cipher_preference |
3180 <                    general_compression_level | general_client_flood |
2646 >                    general_disable_remote_commands |
2647 >                    general_client_flood |
2648                      general_throttle_time | general_havent_read_conf |
2649 <                    general_dot_in_ip6_addr | general_ping_cookie |
2650 <                    general_disable_auth | general_burst_away |
2649 >                    general_ping_cookie |
2650 >                    general_disable_auth |
2651                      general_tkline_expire_notices | general_gline_min_cidr |
2652                      general_gline_min_cidr6 | general_use_whois_actually |
2653                      general_reject_hold_time | general_stats_e_disabled |
2654 <                    general_max_watch |
2654 >                    general_max_watch | general_services_name |
2655                      error;
2656  
2657  
# Line 3203 | Line 2670 | general_gline_min_cidr6: GLINE_MIN_CIDR6
2670    ConfigFileEntry.gline_min_cidr6 = $3;
2671   };
2672  
3206 general_burst_away: BURST_AWAY '=' TBOOL ';'
3207 {
3208  ConfigFileEntry.burst_away = yylval.number;
3209 };
3210
2673   general_use_whois_actually: USE_WHOIS_ACTUALLY '=' TBOOL ';'
2674   {
2675    ConfigFileEntry.use_whois_actually = yylval.number;
# Line 3223 | Line 2685 | general_tkline_expire_notices: TKLINE_EX
2685    ConfigFileEntry.tkline_expire_notices = yylval.number;
2686   };
2687  
2688 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' NUMBER ';'
2688 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2689   {
2690    ConfigFileEntry.kill_chase_time_limit = $3;
2691   };
# Line 3288 | Line 2750 | general_havent_read_conf: HAVENT_READ_CO
2750   {
2751    if (($3 > 0) && conf_parser_ctx.pass == 1)
2752    {
2753 <    ilog(L_CRIT, "You haven't read your config file properly.");
2754 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2755 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2753 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2754 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2755 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2756      exit(0);
2757    }
2758   };
# Line 3401 | Line 2863 | general_message_locale: MESSAGE_LOCALE '
2863    }
2864   };
2865  
3404 general_idletime: IDLETIME '=' timespec ';'
3405 {
3406  ConfigFileEntry.idletime = $3;
3407 };
3408
2866   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2867   {
2868    ConfigFileEntry.dots_in_ident = $3;
# Line 3416 | Line 2873 | general_max_targets: MAX_TARGETS '=' NUM
2873    ConfigFileEntry.max_targets = $3;
2874   };
2875  
3419 general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3420 {
3421  if (conf_parser_ctx.pass == 2)
3422  {
3423    MyFree(ConfigFileEntry.servlink_path);
3424    DupString(ConfigFileEntry.servlink_path, yylval.string);
3425  }
3426 };
3427
3428 general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3429 {
3430 #ifdef HAVE_LIBCRYPTO
3431  if (conf_parser_ctx.pass == 2)
3432  {
3433    struct EncCapability *ecap;
3434    const char *cipher_name;
3435    int found = 0;
3436
3437    ConfigFileEntry.default_cipher_preference = NULL;
3438    cipher_name = yylval.string;
3439
3440    for (ecap = CipherTable; ecap->name; ecap++)
3441    {
3442      if ((irccmp(ecap->name, cipher_name) == 0) &&
3443          (ecap->cap & CAP_ENC_MASK))
3444      {
3445        ConfigFileEntry.default_cipher_preference = ecap;
3446        found = 1;
3447        break;
3448      }
3449    }
3450
3451    if (!found)
3452      yyerror("Invalid cipher");
3453  }
3454 #else
3455  if (conf_parser_ctx.pass == 2)
3456    yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3457 #endif
3458 };
3459
3460 general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3461 {
3462  if (conf_parser_ctx.pass == 2)
3463  {
3464    ConfigFileEntry.compression_level = $3;
3465 #ifndef HAVE_LIBZ
3466    yyerror("Ignoring compression_level -- no zlib support");
3467 #else
3468    if ((ConfigFileEntry.compression_level < 1) ||
3469        (ConfigFileEntry.compression_level > 9))
3470    {
3471      yyerror("Ignoring invalid compression_level, using default");
3472      ConfigFileEntry.compression_level = 0;
3473    }
3474 #endif
3475  }
3476 };
3477
2876   general_use_egd: USE_EGD '=' TBOOL ';'
2877   {
2878    ConfigFileEntry.use_egd = yylval.number;
# Line 3489 | Line 2887 | general_egdpool_path: EGDPOOL_PATH '=' Q
2887    }
2888   };
2889  
2890 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2891 + {
2892 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2893 +  {
2894 +    MyFree(ConfigFileEntry.service_name);
2895 +    DupString(ConfigFileEntry.service_name, yylval.string);
2896 +  }
2897 + };
2898 +
2899   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2900   {
2901    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3528 | Line 2935 | umode_oitem:     T_BOTS
2935   } | T_FULL
2936   {
2937    ConfigFileEntry.oper_umodes |= UMODE_FULL;
2938 + } | HIDDEN
2939 + {
2940 +  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2941   } | T_SKILL
2942   {
2943    ConfigFileEntry.oper_umodes |= UMODE_SKILL;
# Line 3596 | Line 3006 | umode_item:    T_BOTS
3006   } | T_SKILL
3007   {
3008    ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
3009 + } | HIDDEN
3010 + {
3011 +  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
3012   } | T_NCHANGE
3013   {
3014    ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
# Line 3654 | Line 3067 | general_client_flood: T_CLIENT_FLOOD '='
3067    ConfigFileEntry.client_flood = $3;
3068   };
3069  
3657 general_dot_in_ip6_addr: DOT_IN_IP6_ADDR '=' TBOOL ';'
3658 {
3659  ConfigFileEntry.dot_in_ip6_addr = yylval.number;
3660 };
3070  
3071   /***************************************************************************
3072   *  section glines
# Line 3707 | Line 3116 | gline_duration: DURATION '=' timespec ';
3116      ConfigFileEntry.gline_time = $3;
3117   };
3118  
3119 < gline_logging: LOGGING
3119 > gline_logging: T_LOG
3120   {
3121    if (conf_parser_ctx.pass == 2)
3122      ConfigFileEntry.gline_logging = 0;

Diff Legend

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