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-8/src/ircd_parser.y (file contents), Revision 1156 by michael, Tue Aug 9 20:29:20 2011 UTC vs.
ircd-hybrid-8/src/conf_parser.y (file contents), Revision 1389 by michael, Tue May 1 13:08:29 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 "sprintf_irc.h"
# Line 52 | 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 62 | 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 };
65 static dlink_list hub_conf_list  = { NULL, NULL, 0 };
66 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 <
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;
76 static int not_atom = 0;
79  
80   struct CollectItem
81   {
# Line 103 | Line 105 | free_collect_item(struct CollectItem *it
105    MyFree(item);
106   }
107  
106 static void
107 unhook_hub_leaf_confs(void)
108 {
109  dlink_node *ptr;
110  dlink_node *next_ptr;
111  struct CollectItem *yy_hconf;
112  struct CollectItem *yy_lconf;
113
114  DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
115  {
116    yy_hconf = ptr->data;
117    dlinkDelete(&yy_hconf->node, &hub_conf_list);
118    free_collect_item(yy_hconf);
119  }
120
121  DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
122  {
123    yy_lconf = ptr->data;
124    dlinkDelete(&yy_lconf->node, &leaf_conf_list);
125    free_collect_item(yy_lconf);
126  }
127 }
128
108   %}
109  
110   %union {
# Line 147 | Line 126 | unhook_hub_leaf_confs(void)
126   %token  BYTES KBYTES MBYTES GBYTES TBYTES
127   %token  CALLER_ID_WAIT
128   %token  CAN_FLOOD
150 %token  CAN_IDLE
129   %token  CHANNEL
130   %token  CIDR_BITLEN_IPV4
131   %token  CIDR_BITLEN_IPV6
154 %token  CIPHER_PREFERENCE
132   %token  CLASS
156 %token  COMPRESSED
157 %token  COMPRESSION_LEVEL
133   %token  CONNECT
134   %token  CONNECTFREQ
160 %token  CRYPTLINK
161 %token  DEFAULT_CIPHER_PREFERENCE
135   %token  DEFAULT_FLOODCOUNT
136   %token  DEFAULT_SPLIT_SERVER_COUNT
137   %token  DEFAULT_SPLIT_USER_COUNT
# Line 181 | Line 154 | unhook_hub_leaf_confs(void)
154   %token  FAILED_OPER_NOTICE
155   %token  IRCD_FLAGS
156   %token  FLATTEN_LINKS
184 %token  FFAILED_OPERLOG
185 %token  FKILLLOG
186 %token  FKLINELOG
187 %token  FGLINELOG
188 %token  FIOERRLOG
189 %token  FOPERLOG
190 %token  FOPERSPYLOG
191 %token  FUSERLOG
157   %token  GECOS
158   %token  GENERAL
159   %token  GLINE
160   %token  GLINES
161   %token  GLINE_EXEMPT
197 %token  GLINE_LOG
162   %token  GLINE_TIME
163   %token  GLINE_MIN_CIDR
164   %token  GLINE_MIN_CIDR6
# Line 203 | Line 167 | unhook_hub_leaf_confs(void)
167   %token  NEED_IDENT
168   %token  HAVENT_READ_CONF
169   %token  HIDDEN
206 %token  HIDDEN_ADMIN
170   %token  HIDDEN_NAME
208 %token  HIDDEN_OPER
171   %token  HIDE_SERVER_IPS
172   %token  HIDE_SERVERS
173   %token  HIDE_SPOOF_IPS
174   %token  HOST
175   %token  HUB
176   %token  HUB_MASK
215 %token  IDLETIME
177   %token  IGNORE_BOGUS_TS
178   %token  INVISIBLE_ON_CONNECT
179   %token  IP
# Line 228 | Line 189 | unhook_hub_leaf_confs(void)
189   %token  LINKS_DELAY
190   %token  LISTEN
191   %token  T_LOG
231 %token  LOGGING
232 %token  LOG_LEVEL
192   %token  MAX_ACCEPT
193   %token  MAX_BANS
194   %token  MAX_CHANS_PER_USER
# Line 256 | Line 215 | unhook_hub_leaf_confs(void)
215   %token  NO_JOIN_ON_SPLIT
216   %token  NO_OPER_FLOOD
217   %token  NO_TILDE
259 %token  NOT
218   %token  NUMBER
219   %token  NUMBER_PER_IDENT
220   %token  NUMBER_PER_CIDR
# Line 264 | Line 222 | unhook_hub_leaf_confs(void)
222   %token  NUMBER_PER_IP_GLOBAL
223   %token  OPERATOR
224   %token  OPERS_BYPASS_CALLERID
267 %token  OPER_LOG
225   %token  OPER_ONLY_UMODES
226   %token  OPER_PASS_RESV
227   %token  OPER_SPY_T
# Line 294 | Line 251 | unhook_hub_leaf_confs(void)
251   %token  RSA_PRIVATE_KEY_FILE
252   %token  RSA_PUBLIC_KEY_FILE
253   %token  SSL_CERTIFICATE_FILE
254 < %token  T_SSL_CONNECTION_METHOD
254 > %token  SSL_DH_PARAM_FILE
255 > %token  T_SSL_CLIENT_METHOD
256 > %token  T_SSL_SERVER_METHOD
257   %token  T_SSLV3
258   %token  T_TLSV1
259   %token  RESV
# Line 304 | Line 263 | unhook_hub_leaf_confs(void)
263   %token  SEND_PASSWORD
264   %token  SERVERHIDE
265   %token  SERVERINFO
307 %token  SERVLINK_PATH
266   %token  IRCD_SID
267   %token  TKLINE_EXPIRE_NOTICES
268   %token  T_SHARED
# Line 331 | Line 289 | unhook_hub_leaf_confs(void)
289   %token  T_CALLERID
290   %token  T_CCONN
291   %token  T_CCONN_FULL
292 + %token  T_SSL_CIPHER_LIST
293   %token  T_CLIENT_FLOOD
294   %token  T_DEAF
295   %token  T_DEBUG
296 + %token  T_DLINE
297   %token  T_DRONE
298   %token  T_EXTERNAL
299   %token  T_FULL
# Line 341 | Line 301 | unhook_hub_leaf_confs(void)
301   %token  T_IPV4
302   %token  T_IPV6
303   %token  T_LOCOPS
344 %token  T_LOGPATH
345 %token  T_L_CRIT
346 %token  T_L_DEBUG
347 %token  T_L_ERROR
348 %token  T_L_INFO
349 %token  T_L_NOTICE
350 %token  T_L_TRACE
351 %token  T_L_WARN
304   %token  T_MAX_CLIENTS
305   %token  T_NCHANGE
306   %token  T_OPERWALL
# Line 360 | Line 312 | unhook_hub_leaf_confs(void)
312   %token  T_SSL
313   %token  T_UMODES
314   %token  T_UNAUTH
315 + %token  T_UNDLINE
316 + %token  T_UNLIMITED
317   %token  T_UNRESV
318   %token  T_UNXLINE
319 + %token  T_GLOBOPS
320   %token  T_WALLOP
321 + %token  T_RESTART
322 + %token  T_SERVICE
323 + %token  T_SERVICES_NAME
324   %token  THROTTLE_TIME
325   %token  TOPICBURST
326   %token  TRUE_NO_OPER_FLOOD
# Line 382 | Line 340 | unhook_hub_leaf_confs(void)
340   %token  XLINE
341   %token  WARN
342   %token  WARN_NO_NLINE
343 + %token  T_SIZE
344 + %token  T_FILE
345  
346   %type <string> QSTRING
347   %type <number> NUMBER
# Line 405 | Line 365 | conf_item:        admin_entry
365                  | serverinfo_entry
366                  | serverhide_entry
367                  | resv_entry
368 +                | service_entry
369                  | shared_entry
370                  | cluster_entry
371                  | connect_entry
# Line 483 | Line 444 | serverinfo_items:       serverinfo_items
444   serverinfo_item:        serverinfo_name | serverinfo_vhost |
445                          serverinfo_hub | serverinfo_description |
446                          serverinfo_network_name | serverinfo_network_desc |
447 <                        serverinfo_max_clients |
447 >                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
448                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
449                          serverinfo_sid | serverinfo_ssl_certificate_file |
450 <                        serverinfo_ssl_connection_method |
450 >                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
451 >                        serverinfo_ssl_cipher_list |
452                          error ';' ;
453  
454  
455 < serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
455 > serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
456 > serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
457 >
458 > client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
459 > client_method_type_item: T_SSLV3
460   {
461   #ifdef HAVE_LIBCRYPTO
462 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
463 <    ServerInfo.tls_version = 0;
462 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
463 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
464   #endif
465 < } '=' method_types ';'
465 > } | T_TLSV1
466   {
467   #ifdef HAVE_LIBCRYPTO
468 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
469 <  {
504 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
505 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
506 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
507 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
508 <  }
468 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
469 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
470   #endif
471   };
472  
473 < method_types: method_types ',' method_type_item | method_type_item;
474 < method_type_item: T_SSLV3
473 > server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
474 > server_method_type_item: T_SSLV3
475   {
476   #ifdef HAVE_LIBCRYPTO
477 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
478 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
477 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
478 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
479   #endif
480   } | T_TLSV1
481   {
482   #ifdef HAVE_LIBCRYPTO
483 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
484 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
483 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
484 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
485   #endif
486   };
487  
# Line 536 | Line 497 | serverinfo_ssl_certificate_file: SSL_CER
497      }
498  
499      if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
500 +                                     SSL_FILETYPE_PEM) <= 0 ||
501 +        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
502                                       SSL_FILETYPE_PEM) <= 0)
503      {
504        yyerror(ERR_lib_error_string(ERR_get_error()));
# Line 543 | Line 506 | serverinfo_ssl_certificate_file: SSL_CER
506      }
507  
508      if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
509 +                                    SSL_FILETYPE_PEM) <= 0 ||
510 +        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
511                                      SSL_FILETYPE_PEM) <= 0)
512      {
513        yyerror(ERR_lib_error_string(ERR_get_error()));
514        break;
515      }
516  
517 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
517 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
518 >        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
519      {
520        yyerror(ERR_lib_error_string(ERR_get_error()));
521        break;
# Line 585 | Line 551 | serverinfo_rsa_private_key_file: RSA_PRI
551        break;
552      }
553  
554 <    ServerInfo.rsa_private_key = (RSA *)PEM_read_bio_RSAPrivateKey(file, NULL,
589 <      0, NULL);
554 >    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
555  
556      BIO_set_close(file, BIO_CLOSE);
557      BIO_free(file);
# Line 618 | Line 583 | serverinfo_rsa_private_key_file: RSA_PRI
583   #endif
584   };
585  
586 + serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
587 + {
588 + /* TBD - XXX: error reporting */
589 + #ifdef HAVE_LIBCRYPTO
590 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
591 +  {
592 +    BIO *file = BIO_new_file(yylval.string, "r");
593 +
594 +    if (file)
595 +    {
596 +      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
597 +
598 +      BIO_free(file);
599 +
600 +      if (dh)
601 +      {
602 +        if (DH_size(dh) < 128)
603 +          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
604 +        else
605 +          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
606 +
607 +        DH_free(dh);
608 +      }
609 +    }
610 +  }
611 + #endif
612 + };
613 +
614 + serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
615 + {
616 + #ifdef HAVE_LIBCRYPTO
617 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
618 +    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
619 + #endif
620 + };
621 +
622   serverinfo_name: NAME '=' QSTRING ';'
623   {
624    /* this isn't rehashable */
# Line 627 | Line 628 | serverinfo_name: NAME '=' QSTRING ';'
628        DupString(ServerInfo.name, yylval.string);
629      else
630      {
631 <      ilog(L_ERROR, "Ignoring serverinfo::name -- invalid name. Aborting.");
631 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
632        exit(0);
633      }
634    }
# Line 642 | Line 643 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
643        DupString(ServerInfo.sid, yylval.string);
644      else
645      {
646 <      ilog(L_ERROR, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
646 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
647        exit(0);
648      }
649    }
# Line 693 | Line 694 | serverinfo_vhost: VHOST '=' QSTRING ';'
694      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
695  
696      if (getaddrinfo(yylval.string, NULL, &hints, &res))
697 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
697 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
698      else
699      {
700        assert(res != NULL);
# Line 722 | Line 723 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
723      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
724  
725      if (getaddrinfo(yylval.string, NULL, &hints, &res))
726 <      ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string);
726 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
727      else
728      {
729        assert(res != NULL);
# Line 806 | Line 807 | admin_description: DESCRIPTION '=' QSTRI
807   /***************************************************************************
808   *  section logging
809   ***************************************************************************/
810 < /* XXX */
811 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
811 <
812 < logging_items:          logging_items logging_item |
813 <                        logging_item ;
810 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
811 > logging_items:          logging_items logging_item | logging_item ;
812  
813 < logging_item:           logging_path | logging_oper_log |
816 <                        logging_log_level |
817 <                        logging_use_logging | logging_fuserlog |
818 <                        logging_foperlog | logging_fglinelog |
819 <                        logging_fklinelog | logging_killlog |
820 <                        logging_foperspylog | logging_ioerrlog |
821 <                        logging_ffailed_operlog |
813 > logging_item:           logging_use_logging | logging_file_entry |
814                          error ';' ;
815  
816 < logging_path:           T_LOGPATH '=' QSTRING ';'
825 <                        {
826 <                        };
827 <
828 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
829 <                        {
830 <                        };
831 <
832 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
816 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
817   {
818    if (conf_parser_ctx.pass == 2)
819 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
836 <            sizeof(ConfigLoggingEntry.userlog));
819 >    ConfigLoggingEntry.use_logging = yylval.number;
820   };
821  
822 < logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
822 > logging_file_entry:
823   {
824 <  if (conf_parser_ctx.pass == 2)
825 <    strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
826 <            sizeof(ConfigLoggingEntry.failed_operlog));
827 < };
845 <
846 < logging_foperlog: FOPERLOG '=' QSTRING ';'
824 >  lfile[0] = '\0';
825 >  ltype = 0;
826 >  lsize = 0;
827 > } T_FILE  '{' logging_file_items '}' ';'
828   {
829 <  if (conf_parser_ctx.pass == 2)
830 <    strlcpy(ConfigLoggingEntry.operlog, yylval.string,
850 <            sizeof(ConfigLoggingEntry.operlog));
829 >  if (conf_parser_ctx.pass == 2 && ltype > 0)
830 >    log_add_file(ltype, lsize, lfile);
831   };
832  
833 < logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
834 < {
855 <  if (conf_parser_ctx.pass == 2)
856 <    strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
857 <            sizeof(ConfigLoggingEntry.operspylog));
858 < };
833 > logging_file_items: logging_file_items logging_file_item |
834 >                    logging_file_item ;
835  
836 < logging_fglinelog: FGLINELOG '=' QSTRING ';'
837 < {
862 <  if (conf_parser_ctx.pass == 2)
863 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
864 <            sizeof(ConfigLoggingEntry.glinelog));
865 < };
836 > logging_file_item:  logging_file_name | logging_file_type |
837 >                    logging_file_size | error ';' ;
838  
839 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
839 > logging_file_name: NAME '=' QSTRING ';'
840   {
841 <  if (conf_parser_ctx.pass == 2)
842 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
871 <            sizeof(ConfigLoggingEntry.klinelog));
872 < };
841 >  strlcpy(lfile, yylval.string, sizeof(lfile));
842 > }
843  
844 < logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
844 > logging_file_size: T_SIZE '=' sizespec ';'
845   {
846 <  if (conf_parser_ctx.pass == 2)
847 <    strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
848 <            sizeof(ConfigLoggingEntry.ioerrlog));
846 >  lsize = $3;
847 > } | T_SIZE '=' T_UNLIMITED ';'
848 > {
849 >  lsize = 0;
850   };
851  
852 < logging_killlog: FKILLLOG '=' QSTRING ';'
852 > logging_file_type: TYPE
853   {
854    if (conf_parser_ctx.pass == 2)
855 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
856 <            sizeof(ConfigLoggingEntry.killlog));
886 < };
855 >    ltype = 0;
856 > } '='  logging_file_type_items ';' ;
857  
858 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
859 < {
890 <  if (conf_parser_ctx.pass == 2)
891 <    set_log_level(L_CRIT);
892 < } | LOG_LEVEL '=' T_L_ERROR ';'
858 > logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item;
859 > logging_file_type_item:  USER
860   {
861    if (conf_parser_ctx.pass == 2)
862 <    set_log_level(L_ERROR);
863 < } | LOG_LEVEL '=' T_L_WARN ';'
862 >    ltype = LOG_TYPE_USER;
863 > } | OPERATOR
864   {
865    if (conf_parser_ctx.pass == 2)
866 <    set_log_level(L_WARN);
867 < } | LOG_LEVEL '=' T_L_NOTICE ';'
866 >    ltype = LOG_TYPE_OPER;
867 > } | GLINE
868   {
869    if (conf_parser_ctx.pass == 2)
870 <    set_log_level(L_NOTICE);
871 < } | LOG_LEVEL '=' T_L_TRACE ';'
870 >    ltype = LOG_TYPE_GLINE;
871 > } | T_DLINE
872   {
873    if (conf_parser_ctx.pass == 2)
874 <    set_log_level(L_TRACE);
875 < } | LOG_LEVEL '=' T_L_INFO ';'
874 >    ltype = LOG_TYPE_DLINE;
875 > } | KLINE
876   {
877    if (conf_parser_ctx.pass == 2)
878 <    set_log_level(L_INFO);
879 < } | LOG_LEVEL '=' T_L_DEBUG ';'
878 >    ltype = LOG_TYPE_KLINE;
879 > } | KILL
880   {
881    if (conf_parser_ctx.pass == 2)
882 <    set_log_level(L_DEBUG);
883 < };
917 <
918 < logging_use_logging: USE_LOGGING '=' TBOOL ';'
882 >    ltype = LOG_TYPE_KILL;
883 > } | T_DEBUG
884   {
885    if (conf_parser_ctx.pass == 2)
886 <    ConfigLoggingEntry.use_logging = yylval.number;
886 >    ltype = LOG_TYPE_DEBUG;
887   };
888  
889 +
890   /***************************************************************************
891   * section oper
892   ***************************************************************************/
# Line 937 | Line 903 | oper_entry: OPERATOR
903      MyFree(class_name);
904      class_name = NULL;
905    }
906 < } oper_name_b '{' oper_items '}' ';'
906 > } '{' oper_items '}' ';'
907   {
908    if (conf_parser_ctx.pass == 2)
909    {
# Line 972 | Line 938 | oper_entry: OPERATOR
938          DupString(new_aconf->host, yy_tmp->host);
939        else
940          DupString(new_aconf->host, "*");
941 +
942 +      new_aconf->type = parse_netmask(new_aconf->host, &new_aconf->addr,
943 +                                     &new_aconf->bits);
944 +
945        conf_add_class_to_conf(new_conf, class_name);
946        if (yy_aconf->passwd != NULL)
947          DupString(new_aconf->passwd, yy_aconf->passwd);
# Line 1018 | Line 988 | oper_entry: OPERATOR
988    }
989   };
990  
1021 oper_name_b: | oper_name_t;
991   oper_items:     oper_items oper_item | oper_item;
992   oper_item:      oper_name | oper_user | oper_password |
993                  oper_umodes | oper_class | oper_encrypted |
# Line 1028 | Line 997 | oper_name: NAME '=' QSTRING ';'
997   {
998    if (conf_parser_ctx.pass == 2)
999    {
1031    if (strlen(yylval.string) > OPERNICKLEN)
1032      yylval.string[OPERNICKLEN] = '\0';
1033
1034    MyFree(yy_conf->name);
1035    DupString(yy_conf->name, yylval.string);
1036  }
1037 };
1038
1039 oper_name_t: QSTRING
1040 {
1041  if (conf_parser_ctx.pass == 2)
1042  {
1043    if (strlen(yylval.string) > OPERNICKLEN)
1044      yylval.string[OPERNICKLEN] = '\0';
1045
1000      MyFree(yy_conf->name);
1001      DupString(yy_conf->name, yylval.string);
1002    }
# Line 1069 | Line 1023 | oper_user: USER '=' QSTRING ';'
1023      {
1024        DupString(yy_aconf->user, userbuf);
1025        DupString(yy_aconf->host, hostbuf);
1026 +
1027 +      yy_aconf->type = parse_netmask(yy_aconf->host, &yy_aconf->addr,
1028 +                                    &yy_aconf->bits);
1029      }
1030      else
1031      {
# Line 1187 | Line 1144 | oper_umodes_item:  T_BOTS
1144   {
1145    if (conf_parser_ctx.pass == 2)
1146      yy_aconf->modes |= UMODE_FULL;
1147 + } | HIDDEN
1148 + {
1149 +  if (conf_parser_ctx.pass == 2)
1150 +    yy_aconf->modes |= UMODE_HIDDEN;
1151   } | T_SKILL
1152   {
1153    if (conf_parser_ctx.pass == 2)
# Line 1243 | Line 1204 | oper_umodes_item:  T_BOTS
1204  
1205   oper_flags: IRCD_FLAGS
1206   {
1207 +  if (conf_parser_ctx.pass == 2)
1208 +    yy_aconf->port = 0;
1209   } '='  oper_flags_items ';';
1210  
1211   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1212 < oper_flags_item: NOT { not_atom = 1; } oper_flags_item_atom
1250 <                | { not_atom = 0; } oper_flags_item_atom;
1251 <
1252 < oper_flags_item_atom: GLOBAL_KILL
1212 > oper_flags_item: GLOBAL_KILL
1213   {
1214    if (conf_parser_ctx.pass == 2)
1215 <  {
1256 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1257 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1258 <  }
1215 >    yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1216   } | REMOTE
1217   {
1218    if (conf_parser_ctx.pass == 2)
1219 <  {
1263 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1264 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1265 <  }
1219 >    yy_aconf->port |= OPER_FLAG_REMOTE;
1220   } | KLINE
1221   {
1222    if (conf_parser_ctx.pass == 2)
1223 <  {
1270 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1271 <    else yy_aconf->port |= OPER_FLAG_K;
1272 <  }
1223 >    yy_aconf->port |= OPER_FLAG_K;
1224   } | UNKLINE
1225   {
1226    if (conf_parser_ctx.pass == 2)
1227 <  {
1228 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1229 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1230 <  }
1227 >    yy_aconf->port |= OPER_FLAG_UNKLINE;
1228 > } | T_DLINE
1229 > {
1230 >  if (conf_parser_ctx.pass == 2)
1231 >    yy_aconf->port |= OPER_FLAG_DLINE;
1232 > } | T_UNDLINE
1233 > {
1234 >  if (conf_parser_ctx.pass == 2)
1235 >    yy_aconf->port |= OPER_FLAG_UNDLINE;
1236   } | XLINE
1237   {
1238    if (conf_parser_ctx.pass == 2)
1239 <  {
1284 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1285 <    else yy_aconf->port |= OPER_FLAG_X;
1286 <  }
1239 >    yy_aconf->port |= OPER_FLAG_X;
1240   } | GLINE
1241   {
1242    if (conf_parser_ctx.pass == 2)
1243 <  {
1291 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1292 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1293 <  }
1243 >    yy_aconf->port |= OPER_FLAG_GLINE;
1244   } | DIE
1245   {
1246    if (conf_parser_ctx.pass == 2)
1247 <  {
1248 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1299 <    else yy_aconf->port |= OPER_FLAG_DIE;
1300 <  }
1301 < } | REHASH
1247 >    yy_aconf->port |= OPER_FLAG_DIE;
1248 > } | T_RESTART
1249   {
1250    if (conf_parser_ctx.pass == 2)
1251 <  {
1252 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1306 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1307 <  }
1308 < } | ADMIN
1251 >    yy_aconf->port |= OPER_FLAG_RESTART;
1252 > } | REHASH
1253   {
1254    if (conf_parser_ctx.pass == 2)
1255 <  {
1256 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1313 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1314 <  }
1315 < } | HIDDEN_ADMIN
1255 >    yy_aconf->port |= OPER_FLAG_REHASH;
1256 > } | ADMIN
1257   {
1258    if (conf_parser_ctx.pass == 2)
1259 <  {
1319 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1320 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1321 <  }
1259 >    yy_aconf->port |= OPER_FLAG_ADMIN;
1260   } | NICK_CHANGES
1261   {
1262    if (conf_parser_ctx.pass == 2)
1263 <  {
1326 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1327 <    else yy_aconf->port |= OPER_FLAG_N;
1328 <  }
1263 >    yy_aconf->port |= OPER_FLAG_N;
1264   } | T_OPERWALL
1265   {
1266    if (conf_parser_ctx.pass == 2)
1267 <  {
1268 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1334 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1335 <  }
1336 < } | OPER_SPY_T
1267 >    yy_aconf->port |= OPER_FLAG_OPERWALL;
1268 > } | T_GLOBOPS
1269   {
1270    if (conf_parser_ctx.pass == 2)
1271 <  {
1272 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1341 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1342 <  }
1343 < } | HIDDEN_OPER
1271 >    yy_aconf->port |= OPER_FLAG_GLOBOPS;
1272 > } | OPER_SPY_T
1273   {
1274    if (conf_parser_ctx.pass == 2)
1275 <  {
1347 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1348 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1349 <  }
1275 >    yy_aconf->port |= OPER_FLAG_OPER_SPY;
1276   } | REMOTEBAN
1277   {
1278    if (conf_parser_ctx.pass == 2)
1279 <  {
1280 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1355 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1356 <  }
1357 < } | ENCRYPTED
1279 >    yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1280 > } | MODULE
1281   {
1282    if (conf_parser_ctx.pass == 2)
1283 <  {
1361 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1362 <    else SetConfEncrypted(yy_aconf);
1363 <  }
1283 >    yy_aconf->port |= OPER_FLAG_MODULE;
1284   };
1285  
1286  
# Line 1374 | Line 1294 | class_entry: CLASS
1294      yy_conf = make_conf_item(CLASS_TYPE);
1295      yy_class = map_to_conf(yy_conf);
1296    }
1297 < } class_name_b '{' class_items '}' ';'
1297 > } '{' class_items '}' ';'
1298   {
1299    if (conf_parser_ctx.pass == 1)
1300    {
# Line 1385 | Line 1305 | class_entry: CLASS
1305        delete_conf_item(yy_conf);
1306      else
1307      {
1308 <      cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1308 >      cconf = find_exact_name_conf(CLASS_TYPE, NULL, yy_class_name, NULL, NULL);
1309  
1310        if (cconf != NULL)                /* The class existed already */
1311        {
# Line 1417 | Line 1337 | class_entry: CLASS
1337    }
1338   };
1339  
1420 class_name_b: | class_name_t;
1421
1340   class_items:    class_items class_item | class_item;
1341   class_item:     class_name |
1342                  class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
# Line 1443 | Line 1361 | class_name: NAME '=' QSTRING ';'
1361    }
1362   };
1363  
1446 class_name_t: QSTRING
1447 {
1448  if (conf_parser_ctx.pass == 1)
1449  {
1450    MyFree(yy_class_name);
1451    DupString(yy_class_name, yylval.string);
1452  }
1453 };
1454
1364   class_ping_time: PING_TIME '=' timespec ';'
1365   {
1366    if (conf_parser_ctx.pass == 1)
1367 <    PingFreq(yy_class) = $3;
1367 >    yy_class->ping_freq = $3;
1368   };
1369  
1370   class_ping_warning: PING_WARNING '=' timespec ';'
1371   {
1372    if (conf_parser_ctx.pass == 1)
1373 <    PingWarning(yy_class) = $3;
1373 >    yy_class->ping_warning = $3;
1374   };
1375  
1376   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1377   {
1378    if (conf_parser_ctx.pass == 1)
1379 <    MaxPerIp(yy_class) = $3;
1379 >    yy_class->max_perip = $3;
1380   };
1381  
1382   class_connectfreq: CONNECTFREQ '=' timespec ';'
1383   {
1384    if (conf_parser_ctx.pass == 1)
1385 <    ConFreq(yy_class) = $3;
1385 >    yy_class->con_freq = $3;
1386   };
1387  
1388   class_max_number: MAX_NUMBER '=' NUMBER ';'
1389   {
1390    if (conf_parser_ctx.pass == 1)
1391 <    MaxTotal(yy_class) = $3;
1391 >    yy_class->max_total = $3;
1392   };
1393  
1394   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1395   {
1396    if (conf_parser_ctx.pass == 1)
1397 <    MaxGlobal(yy_class) = $3;
1397 >    yy_class->max_global = $3;
1398   };
1399  
1400   class_max_local: MAX_LOCAL '=' NUMBER ';'
1401   {
1402    if (conf_parser_ctx.pass == 1)
1403 <    MaxLocal(yy_class) = $3;
1403 >    yy_class->max_local = $3;
1404   };
1405  
1406   class_max_ident: MAX_IDENT '=' NUMBER ';'
1407   {
1408    if (conf_parser_ctx.pass == 1)
1409 <    MaxIdent(yy_class) = $3;
1409 >    yy_class->max_ident = $3;
1410   };
1411  
1412   class_sendq: SENDQ '=' sizespec ';'
1413   {
1414    if (conf_parser_ctx.pass == 1)
1415 <    MaxSendq(yy_class) = $3;
1415 >    yy_class->max_sendq = $3;
1416   };
1417  
1418   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1419   {
1420    if (conf_parser_ctx.pass == 1)
1421 <    CidrBitlenIPV4(yy_class) = $3;
1421 >    yy_class->cidr_bitlen_ipv4 = $3;
1422   };
1423  
1424   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1425   {
1426    if (conf_parser_ctx.pass == 1)
1427 <    CidrBitlenIPV6(yy_class) = $3;
1427 >    yy_class->cidr_bitlen_ipv6 = $3;
1428   };
1429  
1430   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1431   {
1432    if (conf_parser_ctx.pass == 1)
1433 <    NumberPerCidr(yy_class) = $3;
1433 >    yy_class->number_per_cidr = $3;
1434   };
1435  
1436   /***************************************************************************
# Line 1776 | Line 1685 | auth_flags: IRCD_FLAGS
1685   } '='  auth_flags_items ';';
1686  
1687   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1688 < auth_flags_item: NOT { not_atom = 1; } auth_flags_item_atom
1780 <                | { not_atom = 0; } auth_flags_item_atom;
1781 <
1782 < auth_flags_item_atom: SPOOF_NOTICE
1688 > auth_flags_item: SPOOF_NOTICE
1689   {
1690    if (conf_parser_ctx.pass == 2)
1691 <  {
1786 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1787 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1788 <  }
1691 >    yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1692   } | EXCEED_LIMIT
1693   {
1694    if (conf_parser_ctx.pass == 2)
1695 <  {
1793 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1794 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1795 <  }
1695 >    yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1696   } | KLINE_EXEMPT
1697   {
1698    if (conf_parser_ctx.pass == 2)
1699 <  {
1800 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1801 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1802 <  }
1699 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1700   } | NEED_IDENT
1701   {
1702    if (conf_parser_ctx.pass == 2)
1703 <  {
1807 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
1808 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1809 <  }
1703 >    yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1704   } | CAN_FLOOD
1705   {
1706    if (conf_parser_ctx.pass == 2)
1707 <  {
1814 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
1815 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1816 <  }
1817 < } | CAN_IDLE
1818 < {
1819 <  if (conf_parser_ctx.pass == 2)
1820 <  {
1821 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
1822 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
1823 <  }
1707 >    yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1708   } | NO_TILDE
1709   {
1710    if (conf_parser_ctx.pass == 2)
1711 <  {
1828 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
1829 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1830 <  }
1711 >    yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1712   } | GLINE_EXEMPT
1713   {
1714    if (conf_parser_ctx.pass == 2)
1715 <  {
1835 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
1836 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1837 <  }
1715 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1716   } | RESV_EXEMPT
1717   {
1718    if (conf_parser_ctx.pass == 2)
1719 <  {
1842 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
1843 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1844 <  }
1719 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1720   } | NEED_PASSWORD
1721   {
1722    if (conf_parser_ctx.pass == 2)
1723 <  {
1849 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
1850 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1851 <  }
1723 >    yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1724   };
1725  
1726   /* XXX - need check for illegal hostnames here */
# Line 1865 | Line 1737 | auth_spoof: SPOOF '=' QSTRING ';'
1737      }
1738      else
1739      {
1740 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1740 >      ilog(LOG_TYPE_IRCD, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1741        yy_conf->name = NULL;
1742      }
1743    }
# Line 1948 | Line 1820 | resv_nick: NICK '=' QSTRING ';'
1820   };
1821  
1822   /***************************************************************************
1823 + *  section service
1824 + ***************************************************************************/
1825 + service_entry: T_SERVICE '{' service_items '}' ';';
1826 +
1827 + service_items:     service_items service_item | service_item;
1828 + service_item:      service_name | error;
1829 +
1830 + service_name: NAME '=' QSTRING ';'
1831 + {
1832 +  if (conf_parser_ctx.pass == 2)
1833 +  {
1834 +    if (valid_servname(yylval.string))
1835 +    {
1836 +      yy_conf = make_conf_item(SERVICE_TYPE);
1837 +      DupString(yy_conf->name, yylval.string);
1838 +    }
1839 +  }
1840 + };
1841 +
1842 + /***************************************************************************
1843   *  section shared, for sharing remote klines etc.
1844   ***************************************************************************/
1845   shared_entry: T_SHARED
# Line 2011 | Line 1903 | shared_type_item: KLINE
1903   {
1904    if (conf_parser_ctx.pass == 2)
1905      yy_match_item->action |= SHARED_KLINE;
2014 } | TKLINE
2015 {
2016  if (conf_parser_ctx.pass == 2)
2017    yy_match_item->action |= SHARED_TKLINE;
1906   } | UNKLINE
1907   {
1908    if (conf_parser_ctx.pass == 2)
1909      yy_match_item->action |= SHARED_UNKLINE;
1910 < } | XLINE
1910 > } | T_DLINE
1911   {
1912    if (conf_parser_ctx.pass == 2)
1913 <    yy_match_item->action |= SHARED_XLINE;
1914 < } | TXLINE
1913 >    yy_match_item->action |= SHARED_DLINE;
1914 > } | T_UNDLINE
1915 > {
1916 >  if (conf_parser_ctx.pass == 2)
1917 >    yy_match_item->action |= SHARED_UNDLINE;
1918 > } | XLINE
1919   {
1920    if (conf_parser_ctx.pass == 2)
1921 <    yy_match_item->action |= SHARED_TXLINE;
1921 >    yy_match_item->action |= SHARED_XLINE;
1922   } | T_UNXLINE
1923   {
1924    if (conf_parser_ctx.pass == 2)
# Line 2035 | Line 1927 | shared_type_item: KLINE
1927   {
1928    if (conf_parser_ctx.pass == 2)
1929      yy_match_item->action |= SHARED_RESV;
2038 } | TRESV
2039 {
2040  if (conf_parser_ctx.pass == 2)
2041    yy_match_item->action |= SHARED_TRESV;
1930   } | T_UNRESV
1931   {
1932    if (conf_parser_ctx.pass == 2)
# Line 2093 | Line 1981 | cluster_type_item: KLINE
1981   {
1982    if (conf_parser_ctx.pass == 2)
1983      yy_conf->flags |= SHARED_KLINE;
2096 } | TKLINE
2097 {
2098  if (conf_parser_ctx.pass == 2)
2099    yy_conf->flags |= SHARED_TKLINE;
1984   } | UNKLINE
1985   {
1986    if (conf_parser_ctx.pass == 2)
1987      yy_conf->flags |= SHARED_UNKLINE;
1988 < } | XLINE
1988 > } | T_DLINE
1989   {
1990    if (conf_parser_ctx.pass == 2)
1991 <    yy_conf->flags |= SHARED_XLINE;
1992 < } | TXLINE
1991 >    yy_conf->flags |= SHARED_DLINE;
1992 > } | T_UNDLINE
1993 > {
1994 >  if (conf_parser_ctx.pass == 2)
1995 >    yy_conf->flags |= SHARED_UNDLINE;
1996 > } | XLINE
1997   {
1998    if (conf_parser_ctx.pass == 2)
1999 <    yy_conf->flags |= SHARED_TXLINE;
1999 >    yy_conf->flags |= SHARED_XLINE;
2000   } | T_UNXLINE
2001   {
2002    if (conf_parser_ctx.pass == 2)
# Line 2117 | Line 2005 | cluster_type_item: KLINE
2005   {
2006    if (conf_parser_ctx.pass == 2)
2007      yy_conf->flags |= SHARED_RESV;
2120 } | TRESV
2121 {
2122  if (conf_parser_ctx.pass == 2)
2123    yy_conf->flags |= SHARED_TRESV;
2008   } | T_UNRESV
2009   {
2010    if (conf_parser_ctx.pass == 2)
# Line 2143 | Line 2027 | connect_entry: CONNECT
2027    if (conf_parser_ctx.pass == 2)
2028    {
2029      yy_conf = make_conf_item(SERVER_TYPE);
2030 <    yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
2031 <    yy_aconf->passwd = NULL;
2030 >    yy_aconf = map_to_conf(yy_conf);
2031 >
2032      /* defaults */
2033      yy_aconf->port = PORTNUM;
2150
2151    if (ConfigFileEntry.burst_away)
2152      yy_aconf->flags = CONF_FLAGS_BURST_AWAY;
2034    }
2035    else
2036    {
2037      MyFree(class_name);
2038      class_name = NULL;
2039    }
2040 < } connect_name_b '{' connect_items '}' ';'
2040 > } '{' connect_items '}' ';'
2041   {
2042    if (conf_parser_ctx.pass == 2)
2043    {
2044 <    struct CollectItem *yy_hconf=NULL;
2045 <    struct CollectItem *yy_lconf=NULL;
2046 <    dlink_node *ptr;
2047 <    dlink_node *next_ptr;
2048 < #ifdef HAVE_LIBCRYPTO
2049 <    if (yy_aconf->host &&
2050 <        ((yy_aconf->passwd && yy_aconf->spasswd) ||
2051 <         (yy_aconf->rsa_public_key && IsConfCryptLink(yy_aconf))))
2171 < #else /* !HAVE_LIBCRYPTO */
2172 <      if (yy_aconf->host && !IsConfCryptLink(yy_aconf) &&
2173 <          yy_aconf->passwd && yy_aconf->spasswd)
2174 < #endif /* !HAVE_LIBCRYPTO */
2175 <        {
2176 <          if (conf_add_server(yy_conf, class_name) == -1)
2177 <          {
2178 <            delete_conf_item(yy_conf);
2179 <            yy_conf = NULL;
2180 <            yy_aconf = NULL;
2181 <          }
2182 <        }
2183 <        else
2184 <        {
2185 <          /* Even if yy_conf ->name is NULL
2186 <           * should still unhook any hub/leaf confs still pending
2187 <           */
2188 <          unhook_hub_leaf_confs();
2189 <
2190 <          if (yy_conf->name != NULL)
2191 <          {
2192 < #ifndef HAVE_LIBCRYPTO
2193 <            if (IsConfCryptLink(yy_aconf))
2194 <              yyerror("Ignoring connect block -- no OpenSSL support");
2195 < #else
2196 <            if (IsConfCryptLink(yy_aconf) && !yy_aconf->rsa_public_key)
2197 <              yyerror("Ignoring connect block -- missing key");
2198 < #endif
2199 <            if (yy_aconf->host == NULL)
2200 <              yyerror("Ignoring connect block -- missing host");
2201 <            else if (!IsConfCryptLink(yy_aconf) &&
2202 <                    (!yy_aconf->passwd || !yy_aconf->spasswd))
2203 <              yyerror("Ignoring connect block -- missing password");
2204 <          }
2205 <
2206 <
2207 <          /* XXX
2208 <           * This fixes a try_connections() core (caused by invalid class_ptr
2209 <           * pointers) reported by metalrock. That's an ugly fix, but there
2210 <           * is currently no better way. The entire config subsystem needs an
2211 <           * rewrite ASAP. make_conf_item() shouldn't really add things onto
2212 <           * a doubly linked list immediately without any sanity checks!  -Michael
2213 <           */
2214 <          delete_conf_item(yy_conf);
2215 <
2216 <          yy_aconf = NULL;
2217 <          yy_conf = NULL;
2218 <        }
2219 <
2220 <      /*
2221 <       * yy_conf is still pointing at the server that is having
2222 <       * a connect block built for it. This means, y_aconf->name
2223 <       * points to the actual irc name this server will be known as.
2224 <       * Now this new server has a set or even just one hub_mask (or leaf_mask)
2225 <       * given in the link list at yy_hconf. Fill in the HUB confs
2226 <       * from this link list now.
2227 <       */        
2228 <      DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
2044 >    if (yy_aconf->host && yy_aconf->passwd && yy_aconf->spasswd)
2045 >    {
2046 >      if (conf_add_server(yy_conf, class_name) == -1)
2047 >        delete_conf_item(yy_conf);
2048 >    }
2049 >    else
2050 >    {
2051 >      if (yy_conf->name != NULL)
2052        {
2053 <        struct ConfItem *new_hub_conf;
2054 <        struct MatchItem *match_item;
2055 <
2056 <        yy_hconf = ptr->data;
2234 <
2235 <        /* yy_conf == NULL is a fatal error for this connect block! */
2236 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2237 <        {
2238 <          new_hub_conf = make_conf_item(HUB_TYPE);
2239 <          match_item = (struct MatchItem *)map_to_conf(new_hub_conf);
2240 <          DupString(new_hub_conf->name, yy_conf->name);
2241 <          if (yy_hconf->user != NULL)
2242 <            DupString(match_item->user, yy_hconf->user);
2243 <          else
2244 <            DupString(match_item->user, "*");
2245 <          if (yy_hconf->host != NULL)
2246 <            DupString(match_item->host, yy_hconf->host);
2247 <          else
2248 <            DupString(match_item->host, "*");
2249 <        }
2250 <        dlinkDelete(&yy_hconf->node, &hub_conf_list);
2251 <        free_collect_item(yy_hconf);
2053 >        if (yy_aconf->host == NULL)
2054 >          yyerror("Ignoring connect block -- missing host");
2055 >        else if (!yy_aconf->passwd || !yy_aconf->spasswd)
2056 >          yyerror("Ignoring connect block -- missing password");
2057        }
2058  
2059 <      /* Ditto for the LEAF confs */
2060 <
2061 <      DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
2062 <      {
2063 <        struct ConfItem *new_leaf_conf;
2064 <        struct MatchItem *match_item;
2065 <
2066 <        yy_lconf = ptr->data;
2059 >      /* XXX
2060 >       * This fixes a try_connections() core (caused by invalid class_ptr
2061 >       * pointers) reported by metalrock. That's an ugly fix, but there
2062 >       * is currently no better way. The entire config subsystem needs an
2063 >       * rewrite ASAP. make_conf_item() shouldn't really add things onto
2064 >       * a doubly linked list immediately without any sanity checks!  -Michael
2065 >       */
2066 >      delete_conf_item(yy_conf);
2067 >    }
2068  
2069 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2070 <        {
2071 <          new_leaf_conf = make_conf_item(LEAF_TYPE);
2072 <          match_item = (struct MatchItem *)map_to_conf(new_leaf_conf);
2267 <          DupString(new_leaf_conf->name, yy_conf->name);
2268 <          if (yy_lconf->user != NULL)
2269 <            DupString(match_item->user, yy_lconf->user);
2270 <          else
2271 <            DupString(match_item->user, "*");
2272 <          if (yy_lconf->host != NULL)
2273 <            DupString(match_item->host, yy_lconf->host);
2274 <          else
2275 <            DupString(match_item->host, "*");
2276 <        }
2277 <        dlinkDelete(&yy_lconf->node, &leaf_conf_list);
2278 <        free_collect_item(yy_lconf);
2279 <      }
2280 <      MyFree(class_name);
2281 <      class_name = NULL;
2282 <      yy_conf = NULL;
2283 <      yy_aconf = NULL;
2069 >    MyFree(class_name);
2070 >    class_name = NULL;
2071 >    yy_conf = NULL;
2072 >    yy_aconf = NULL;
2073    }
2074   };
2075  
2287 connect_name_b: | connect_name_t;
2076   connect_items:  connect_items connect_item | connect_item;
2077   connect_item:   connect_name | connect_host | connect_vhost |
2078                  connect_send_password | connect_accept_password |
2079 <                connect_aftype | connect_port |
2079 >                connect_aftype | connect_port | connect_ssl_cipher_list |
2080                  connect_flags | connect_hub_mask | connect_leaf_mask |
2081 <                connect_class | connect_encrypted |
2294 <                connect_rsa_public_key_file | connect_cipher_preference |
2081 >                connect_class | connect_encrypted |
2082                  error ';' ;
2083  
2084   connect_name: NAME '=' QSTRING ';'
2085   {
2086    if (conf_parser_ctx.pass == 2)
2087    {
2301    if (yy_conf->name != NULL)
2302      yyerror("Multiple connect name entry");
2303
2304    MyFree(yy_conf->name);
2305    DupString(yy_conf->name, yylval.string);
2306  }
2307 };
2308
2309 connect_name_t: QSTRING
2310 {
2311  if (conf_parser_ctx.pass == 2)
2312  {
2313    if (yy_conf->name != NULL)
2314      yyerror("Multiple connect name entry");
2315
2088      MyFree(yy_conf->name);
2089      DupString(yy_conf->name, yylval.string);
2090    }
# Line 2340 | Line 2112 | connect_vhost: VHOST '=' QSTRING ';'
2112      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2113  
2114      if (getaddrinfo(yylval.string, NULL, &hints, &res))
2115 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2115 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2116      else
2117      {
2118        assert(res != NULL);
2119  
2120 <      memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2121 <      yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2122 <      yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2120 >      memcpy(&yy_aconf->bind, res->ai_addr, res->ai_addrlen);
2121 >      yy_aconf->bind.ss.ss_family = res->ai_family;
2122 >      yy_aconf->bind.ss_len = res->ai_addrlen;
2123        freeaddrinfo(res);
2124      }
2125    }
# Line 2412 | Line 2184 | connect_flags: IRCD_FLAGS
2184   } '='  connect_flags_items ';';
2185  
2186   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2187 < connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2416 <                        |  { not_atom = 0; } connect_flags_item_atom;
2417 <
2418 < connect_flags_item_atom: COMPRESSED
2187 > connect_flags_item: AUTOCONN
2188   {
2189    if (conf_parser_ctx.pass == 2)
2190 < #ifndef HAVE_LIBZ
2422 <    yyerror("Ignoring flags = compressed; -- no zlib support");
2423 < #else
2424 < {
2425 <   if (not_atom)ClearConfCompressed(yy_aconf);
2426 <   else SetConfCompressed(yy_aconf);
2427 < }
2428 < #endif
2429 < } | CRYPTLINK
2430 < {
2431 <  if (conf_parser_ctx.pass == 2)
2432 <  {
2433 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2434 <    else SetConfCryptLink(yy_aconf);
2435 <  }
2436 < } | AUTOCONN
2437 < {
2438 <  if (conf_parser_ctx.pass == 2)
2439 <  {
2440 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2441 <    else SetConfAllowAutoConn(yy_aconf);
2442 <  }
2190 >    SetConfAllowAutoConn(yy_aconf);
2191   } | BURST_AWAY
2192   {
2193    if (conf_parser_ctx.pass == 2)
2194 <  {
2447 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2448 <    else SetConfAwayBurst(yy_aconf);
2449 <  }
2194 >    SetConfAwayBurst(yy_aconf);
2195   } | TOPICBURST
2196   {
2197    if (conf_parser_ctx.pass == 2)
2198 <  {
2199 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2455 <    else SetConfTopicBurst(yy_aconf);
2456 <  }
2457 < }
2458 < ;
2459 <
2460 < connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2198 >    SetConfTopicBurst(yy_aconf);
2199 > } | T_SSL
2200   {
2462 #ifdef HAVE_LIBCRYPTO
2201    if (conf_parser_ctx.pass == 2)
2202 <  {
2465 <    BIO *file;
2466 <
2467 <    if (yy_aconf->rsa_public_key != NULL)
2468 <    {
2469 <      RSA_free(yy_aconf->rsa_public_key);
2470 <      yy_aconf->rsa_public_key = NULL;
2471 <    }
2472 <
2473 <    if (yy_aconf->rsa_public_key_file != NULL)
2474 <    {
2475 <      MyFree(yy_aconf->rsa_public_key_file);
2476 <      yy_aconf->rsa_public_key_file = NULL;
2477 <    }
2478 <
2479 <    DupString(yy_aconf->rsa_public_key_file, yylval.string);
2480 <
2481 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
2482 <    {
2483 <      yyerror("Ignoring rsa_public_key_file -- file doesn't exist");
2484 <      break;
2485 <    }
2486 <
2487 <    yy_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
2488 <
2489 <    if (yy_aconf->rsa_public_key == NULL)
2490 <    {
2491 <      yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
2492 <      break;
2493 <    }
2494 <      
2495 <    BIO_set_close(file, BIO_CLOSE);
2496 <    BIO_free(file);
2497 <  }
2498 < #endif /* HAVE_LIBCRYPTO */
2202 >    SetConfSSL(yy_aconf);
2203   };
2204  
2205   connect_encrypted: ENCRYPTED '=' TBOOL ';'
# Line 2513 | Line 2217 | connect_hub_mask: HUB_MASK '=' QSTRING '
2217   {
2218    if (conf_parser_ctx.pass == 2)
2219    {
2220 <    struct CollectItem *yy_tmp;
2220 >    char *mask;
2221  
2222 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2223 <    DupString(yy_tmp->host, yylval.string);
2520 <    DupString(yy_tmp->user, "*");
2521 <    dlinkAdd(yy_tmp, &yy_tmp->node, &hub_conf_list);
2222 >    DupString(mask, yylval.string);
2223 >    dlinkAdd(mask, make_dlink_node(), &yy_aconf->hub_list);
2224    }
2225   };
2226  
# Line 2526 | Line 2228 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2228   {
2229    if (conf_parser_ctx.pass == 2)
2230    {
2231 <    struct CollectItem *yy_tmp;
2231 >    char *mask;
2232  
2233 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2234 <    DupString(yy_tmp->host, yylval.string);
2533 <    DupString(yy_tmp->user, "*");
2534 <    dlinkAdd(yy_tmp, &yy_tmp->node, &leaf_conf_list);
2233 >    DupString(mask, yylval.string);
2234 >    dlinkAdd(mask, make_dlink_node(), &yy_aconf->leaf_list);
2235    }
2236   };
2237  
# Line 2544 | Line 2244 | connect_class: CLASS '=' QSTRING ';'
2244    }
2245   };
2246  
2247 < connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2247 > connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2248   {
2249   #ifdef HAVE_LIBCRYPTO
2250    if (conf_parser_ctx.pass == 2)
2251    {
2252 <    struct EncCapability *ecap;
2253 <    const char *cipher_name;
2554 <    int found = 0;
2555 <
2556 <    yy_aconf->cipher_preference = NULL;
2557 <    cipher_name = yylval.string;
2558 <
2559 <    for (ecap = CipherTable; ecap->name; ecap++)
2560 <    {
2561 <      if ((irccmp(ecap->name, cipher_name) == 0) &&
2562 <          (ecap->cap & CAP_ENC_MASK))
2563 <      {
2564 <        yy_aconf->cipher_preference = ecap;
2565 <        found = 1;
2566 <        break;
2567 <      }
2568 <    }
2569 <
2570 <    if (!found)
2571 <      yyerror("Invalid cipher");
2252 >    MyFree(yy_aconf->cipher_list);
2253 >    DupString(yy_aconf->cipher_list, yylval.string);
2254    }
2255   #else
2256    if (conf_parser_ctx.pass == 2)
2257 <    yyerror("Ignoring cipher_preference -- no OpenSSL support");
2257 >    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2258   #endif
2259   };
2260  
2261 +
2262   /***************************************************************************
2263   *  section kill
2264   ***************************************************************************/
# Line 2602 | Line 2285 | kill_entry: KILL
2285          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2286              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2287          {
2288 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s",
2288 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2289                 errptr);
2290            break;
2291          }
# Line 2619 | Line 2302 | kill_entry: KILL
2302          else
2303            DupString(yy_aconf->reason, "No reason");
2304   #else
2305 <        ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support");
2305 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2306          break;
2307   #endif
2308        }
2309        else
2310        {
2311 +        find_and_delete_temporary(userbuf, hostbuf, CONF_KLINE);
2312 +
2313          yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2314  
2315          DupString(yy_aconf->user, userbuf);
# Line 2634 | Line 2319 | kill_entry: KILL
2319            DupString(yy_aconf->reason, reasonbuf);
2320          else
2321            DupString(yy_aconf->reason, "No reason");
2322 <        add_conf_by_address(CONF_KILL, yy_aconf);
2322 >        add_conf_by_address(CONF_KLINE, yy_aconf);
2323        }
2324      }
2325  
# Line 2694 | Line 2379 | deny_entry: DENY
2379    {
2380      if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
2381      {
2382 +      find_and_delete_temporary(NULL, hostbuf, CONF_DLINE);
2383 +
2384        yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
2385        DupString(yy_aconf->host, hostbuf);
2386  
# Line 2769 | Line 2456 | gecos_entry: GECOS
2456  
2457          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2458          {
2459 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s",
2459 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2460                 errptr);
2461            break;
2462          }
# Line 2777 | Line 2464 | gecos_entry: GECOS
2464          yy_conf = make_conf_item(RXLINE_TYPE);
2465          yy_conf->regexpname = exp_p;
2466   #else
2467 <        ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support");
2467 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2468          break;
2469   #endif
2470        }
# Line 2841 | Line 2528 | general_item:       general_hide_spoof_i
2528                      general_pace_wait_simple | general_stats_P_oper_only |
2529                      general_short_motd | general_no_oper_flood |
2530                      general_true_no_oper_flood | general_oper_pass_resv |
2531 <                    general_idletime | general_message_locale |
2531 >                    general_message_locale |
2532                      general_oper_only_umodes | general_max_targets |
2533                      general_use_egd | general_egdpool_path |
2534                      general_oper_umodes | general_caller_id_wait |
2535                      general_opers_bypass_callerid | general_default_floodcount |
2536                      general_min_nonwildcard | general_min_nonwildcard_simple |
2537 <                    general_servlink_path | general_disable_remote_commands |
2538 <                    general_default_cipher_preference |
2852 <                    general_compression_level | general_client_flood |
2537 >                    general_disable_remote_commands |
2538 >                    general_client_flood |
2539                      general_throttle_time | general_havent_read_conf |
2540                      general_ping_cookie |
2541 <                    general_disable_auth | general_burst_away |
2541 >                    general_disable_auth |
2542                      general_tkline_expire_notices | general_gline_min_cidr |
2543                      general_gline_min_cidr6 | general_use_whois_actually |
2544                      general_reject_hold_time | general_stats_e_disabled |
2545 <                    general_max_watch |
2545 >                    general_max_watch | general_services_name |
2546                      error;
2547  
2548  
# Line 2875 | Line 2561 | general_gline_min_cidr6: GLINE_MIN_CIDR6
2561    ConfigFileEntry.gline_min_cidr6 = $3;
2562   };
2563  
2878 general_burst_away: BURST_AWAY '=' TBOOL ';'
2879 {
2880  ConfigFileEntry.burst_away = yylval.number;
2881 };
2882
2564   general_use_whois_actually: USE_WHOIS_ACTUALLY '=' TBOOL ';'
2565   {
2566    ConfigFileEntry.use_whois_actually = yylval.number;
# Line 2960 | Line 2641 | general_havent_read_conf: HAVENT_READ_CO
2641   {
2642    if (($3 > 0) && conf_parser_ctx.pass == 1)
2643    {
2644 <    ilog(L_CRIT, "You haven't read your config file properly.");
2645 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2646 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2644 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2645 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2646 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2647      exit(0);
2648    }
2649   };
# Line 3073 | Line 2754 | general_message_locale: MESSAGE_LOCALE '
2754    }
2755   };
2756  
3076 general_idletime: IDLETIME '=' timespec ';'
3077 {
3078  ConfigFileEntry.idletime = $3;
3079 };
3080
2757   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2758   {
2759    ConfigFileEntry.dots_in_ident = $3;
# Line 3088 | Line 2764 | general_max_targets: MAX_TARGETS '=' NUM
2764    ConfigFileEntry.max_targets = $3;
2765   };
2766  
3091 general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3092 {
3093  if (conf_parser_ctx.pass == 2)
3094  {
3095    MyFree(ConfigFileEntry.servlink_path);
3096    DupString(ConfigFileEntry.servlink_path, yylval.string);
3097  }
3098 };
3099
3100 general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3101 {
3102 #ifdef HAVE_LIBCRYPTO
3103  if (conf_parser_ctx.pass == 2)
3104  {
3105    struct EncCapability *ecap;
3106    const char *cipher_name;
3107    int found = 0;
3108
3109    ConfigFileEntry.default_cipher_preference = NULL;
3110    cipher_name = yylval.string;
3111
3112    for (ecap = CipherTable; ecap->name; ecap++)
3113    {
3114      if ((irccmp(ecap->name, cipher_name) == 0) &&
3115          (ecap->cap & CAP_ENC_MASK))
3116      {
3117        ConfigFileEntry.default_cipher_preference = ecap;
3118        found = 1;
3119        break;
3120      }
3121    }
3122
3123    if (!found)
3124      yyerror("Invalid cipher");
3125  }
3126 #else
3127  if (conf_parser_ctx.pass == 2)
3128    yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3129 #endif
3130 };
3131
3132 general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3133 {
3134  if (conf_parser_ctx.pass == 2)
3135  {
3136    ConfigFileEntry.compression_level = $3;
3137 #ifndef HAVE_LIBZ
3138    yyerror("Ignoring compression_level -- no zlib support");
3139 #else
3140    if ((ConfigFileEntry.compression_level < 1) ||
3141        (ConfigFileEntry.compression_level > 9))
3142    {
3143      yyerror("Ignoring invalid compression_level, using default");
3144      ConfigFileEntry.compression_level = 0;
3145    }
3146 #endif
3147  }
3148 };
3149
2767   general_use_egd: USE_EGD '=' TBOOL ';'
2768   {
2769    ConfigFileEntry.use_egd = yylval.number;
# Line 3161 | Line 2778 | general_egdpool_path: EGDPOOL_PATH '=' Q
2778    }
2779   };
2780  
2781 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2782 + {
2783 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2784 +  {
2785 +    MyFree(ConfigFileEntry.service_name);
2786 +    DupString(ConfigFileEntry.service_name, yylval.string);
2787 +  }
2788 + };
2789 +
2790   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2791   {
2792    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3200 | Line 2826 | umode_oitem:     T_BOTS
2826   } | T_FULL
2827   {
2828    ConfigFileEntry.oper_umodes |= UMODE_FULL;
2829 + } | HIDDEN
2830 + {
2831 +  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2832   } | T_SKILL
2833   {
2834    ConfigFileEntry.oper_umodes |= UMODE_SKILL;
# Line 3268 | Line 2897 | umode_item:    T_BOTS
2897   } | T_SKILL
2898   {
2899    ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2900 + } | HIDDEN
2901 + {
2902 +  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2903   } | T_NCHANGE
2904   {
2905    ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
# Line 3375 | Line 3007 | gline_duration: DURATION '=' timespec ';
3007      ConfigFileEntry.gline_time = $3;
3008   };
3009  
3010 < gline_logging: LOGGING
3010 > gline_logging: T_LOG
3011   {
3012    if (conf_parser_ctx.pass == 2)
3013      ConfigFileEntry.gline_logging = 0;

Diff Legend

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