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 102 by michael, Mon Oct 10 12:17:19 2005 UTC vs.
ircd-hybrid-8/src/ircd_parser.y (file contents), Revision 1285 by michael, Sun Feb 5 15:12:59 2012 UTC

# Line 26 | Line 26
26  
27   #define YY_NO_UNPUT
28   #include <sys/types.h>
29 + #include <string.h>
30  
31 + #include "config.h"
32   #include "stdinc.h"
31 #include "dalloca.h"
33   #include "ircd.h"
33 #include "tools.h"
34   #include "list.h"
35   #include "s_conf.h"
36   #include "event.h"
37   #include "s_log.h"
38   #include "client.h"     /* for UMODE_ALL only */
39 #include "pcre.h"
39   #include "irc_string.h"
41 #include "irc_getaddrinfo.h"
40   #include "sprintf_irc.h"
41   #include "memory.h"
42   #include "modules.h"
43 < #include "s_serv.h" /* for CAP_LL / IsCapable */
43 > #include "s_serv.h"
44   #include "hostmask.h"
45   #include "send.h"
46   #include "listener.h"
# Line 72 | Line 70 | static char userbuf[IRCD_BUFSIZE];
70   static char hostbuf[IRCD_BUFSIZE];
71   static char reasonbuf[REASONLEN + 1];
72   static char gecos_name[REALLEN * 4];
73 <
74 < extern dlink_list gdeny_items; /* XXX */
75 <
73 > static char lfile[IRCD_BUFSIZE];
74 > static unsigned int ltype = 0;
75 > static unsigned int lsize = 0;
76   static char *resv_reason = NULL;
77   static char *listener_address = NULL;
80 static int not_atom = 0;
78  
79 < struct CollectItem {
79 > struct CollectItem
80 > {
81    dlink_node node;
82    char *name;
83    char *user;
# Line 150 | Line 148 | unhook_hub_leaf_confs(void)
148   %token  BYTES KBYTES MBYTES GBYTES TBYTES
149   %token  CALLER_ID_WAIT
150   %token  CAN_FLOOD
153 %token  CAN_IDLE
151   %token  CHANNEL
152   %token  CIDR_BITLEN_IPV4
153   %token  CIDR_BITLEN_IPV6
# Line 169 | Line 166 | unhook_hub_leaf_confs(void)
166   %token  DESCRIPTION
167   %token  DIE
168   %token  DISABLE_AUTH
169 + %token  DISABLE_FAKE_CHANNELS
170   %token  DISABLE_HIDDEN
171   %token  DISABLE_LOCAL_CHANNELS
172   %token  DISABLE_REMOTE_COMMANDS
175 %token  DOT_IN_IP6_ADDR
173   %token  DOTS_IN_IDENT
174   %token  DURATION
175   %token  EGDPOOL_PATH
# Line 182 | Line 179 | unhook_hub_leaf_confs(void)
179   %token  EXCEED_LIMIT
180   %token  EXEMPT
181   %token  FAILED_OPER_NOTICE
185 %token  FAKENAME
182   %token  IRCD_FLAGS
183   %token  FLATTEN_LINKS
188 %token  FFAILED_OPERLOG
189 %token  FKILLLOG
190 %token  FKLINELOG
191 %token  FGLINELOG
192 %token  FIOERRLOG
193 %token  FOPERLOG
194 %token  FOPERSPYLOG
195 %token  FUSERLOG
184   %token  GECOS
185   %token  GENERAL
186   %token  GLINE
187   %token  GLINES
188   %token  GLINE_EXEMPT
201 %token  GLINE_LOG
189   %token  GLINE_TIME
190   %token  GLINE_MIN_CIDR
191   %token  GLINE_MIN_CIDR6
# Line 216 | Line 203 | unhook_hub_leaf_confs(void)
203   %token  HOST
204   %token  HUB
205   %token  HUB_MASK
219 %token  IDLETIME
206   %token  IGNORE_BOGUS_TS
207   %token  INVISIBLE_ON_CONNECT
208   %token  IP
# Line 228 | Line 214 | unhook_hub_leaf_confs(void)
214   %token  KLINE_WITH_REASON
215   %token  KNOCK_DELAY
216   %token  KNOCK_DELAY_CHANNEL
231 %token  LAZYLINK
217   %token  LEAF_MASK
218   %token  LINKS_DELAY
219   %token  LISTEN
220   %token  T_LOG
236 %token  LOGGING
237 %token  LOG_LEVEL
221   %token  MAX_ACCEPT
222   %token  MAX_BANS
223   %token  MAX_CHANS_PER_USER
# Line 245 | Line 228 | unhook_hub_leaf_confs(void)
228   %token  MAX_NICK_TIME
229   %token  MAX_NUMBER
230   %token  MAX_TARGETS
231 + %token  MAX_WATCH
232   %token  MESSAGE_LOCALE
233   %token  MIN_NONWILDCARD
234   %token  MIN_NONWILDCARD_SIMPLE
# Line 260 | Line 244 | unhook_hub_leaf_confs(void)
244   %token  NO_JOIN_ON_SPLIT
245   %token  NO_OPER_FLOOD
246   %token  NO_TILDE
263 %token  NOT
247   %token  NUMBER
248   %token  NUMBER_PER_IDENT
249   %token  NUMBER_PER_CIDR
# Line 268 | Line 251 | unhook_hub_leaf_confs(void)
251   %token  NUMBER_PER_IP_GLOBAL
252   %token  OPERATOR
253   %token  OPERS_BYPASS_CALLERID
271 %token  OPER_LOG
254   %token  OPER_ONLY_UMODES
255   %token  OPER_PASS_RESV
256   %token  OPER_SPY_T
257   %token  OPER_UMODES
276 %token  INVITE_OPS_ONLY
258   %token  JOIN_FLOOD_COUNT
259   %token  JOIN_FLOOD_TIME
260   %token  PACE_WAIT
# Line 299 | Line 280 | unhook_hub_leaf_confs(void)
280   %token  RSA_PRIVATE_KEY_FILE
281   %token  RSA_PUBLIC_KEY_FILE
282   %token  SSL_CERTIFICATE_FILE
283 + %token  T_SSL_CONNECTION_METHOD
284 + %token  T_SSLV3
285 + %token  T_TLSV1
286   %token  RESV
287   %token  RESV_EXEMPT
288   %token  SECONDS MINUTES HOURS DAYS WEEKS
# Line 316 | Line 300 | unhook_hub_leaf_confs(void)
300   %token  SILENT
301   %token  SPOOF
302   %token  SPOOF_NOTICE
303 + %token  STATS_E_DISABLED
304   %token  STATS_I_OPER_ONLY
305   %token  STATS_K_OPER_ONLY
306   %token  STATS_O_OPER_ONLY
# Line 331 | Line 316 | unhook_hub_leaf_confs(void)
316   %token  T_SOFTCALLERID
317   %token  T_CALLERID
318   %token  T_CCONN
319 + %token  T_CCONN_FULL
320   %token  T_CLIENT_FLOOD
321   %token  T_DEAF
322   %token  T_DEBUG
323 + %token  T_DLINE
324   %token  T_DRONE
325   %token  T_EXTERNAL
326   %token  T_FULL
# Line 341 | Line 328 | unhook_hub_leaf_confs(void)
328   %token  T_IPV4
329   %token  T_IPV6
330   %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
331   %token  T_MAX_CLIENTS
332   %token  T_NCHANGE
333   %token  T_OPERWALL
334   %token  T_REJ
335 + %token  T_SERVER
336   %token  T_SERVNOTICE
337   %token  T_SKILL
338   %token  T_SPY
339   %token  T_SSL
340   %token  T_UMODES
341   %token  T_UNAUTH
342 + %token  T_UNLIMITED
343   %token  T_UNRESV
344   %token  T_UNXLINE
345 + %token  T_GLOBOPS
346   %token  T_WALLOP
347 + %token  T_RESTART
348 + %token  T_SERVICE
349 + %token  T_SERVICES_NAME
350 + %token  T_TIMESTAMP
351   %token  THROTTLE_TIME
352   %token  TOPICBURST
353   %token  TRUE_NO_OPER_FLOOD
# Line 381 | Line 367 | unhook_hub_leaf_confs(void)
367   %token  XLINE
368   %token  WARN
369   %token  WARN_NO_NLINE
370 + %token  T_SIZE
371 + %token  T_FILE
372  
373   %type <string> QSTRING
374   %type <number> NUMBER
# Line 404 | Line 392 | conf_item:        admin_entry
392                  | serverinfo_entry
393                  | serverhide_entry
394                  | resv_entry
395 +                | service_entry
396                  | shared_entry
397                  | cluster_entry
398                  | connect_entry
# Line 465 | Line 454 | modules_item:   modules_module | modules
454  
455   modules_module: MODULE '=' QSTRING ';'
456   {
457 < #ifndef STATIC_MODULES /* NOOP in the static case */
458 <  if (ypass == 2)
470 <  {
471 <    char *m_bn;
472 <
473 <    m_bn = basename(yylval.string);
474 <
475 <    /* I suppose we should just ignore it if it is already loaded(since
476 <     * otherwise we would flood the opers on rehash) -A1kmm.
477 <     */
478 <    add_conf_module(yylval.string);
479 <  }
480 < #endif
457 >  if (conf_parser_ctx.pass == 2)
458 >    add_conf_module(libio_basename(yylval.string));
459   };
460  
461   modules_path: PATH '=' QSTRING ';'
462   {
463 < #ifndef STATIC_MODULES
486 <  if (ypass == 2)
463 >  if (conf_parser_ctx.pass == 2)
464      mod_add_path(yylval.string);
488 #endif
465   };
466  
491 /***************************************************************************
492 *  section serverinfo
493 ***************************************************************************/
494 serverinfo_entry: SERVERINFO
495  '{' serverinfo_items '}' ';';
467  
468 < serverinfo_items:       serverinfo_items serverinfo_item |
469 <                        serverinfo_item ;
468 > serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
469 >
470 > serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
471   serverinfo_item:        serverinfo_name | serverinfo_vhost |
472                          serverinfo_hub | serverinfo_description |
473                          serverinfo_network_name | serverinfo_network_desc |
474                          serverinfo_max_clients |
475                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
476                          serverinfo_sid | serverinfo_ssl_certificate_file |
477 +                        serverinfo_ssl_connection_method |
478                          error ';' ;
479  
480 +
481 + serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
482 + {
483 + #ifdef HAVE_LIBCRYPTO
484 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
485 +    ServerInfo.tls_version = 0;
486 + #endif
487 + } '=' method_types ';'
488 + {
489 + #ifdef HAVE_LIBCRYPTO
490 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
491 +  {
492 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
493 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
494 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
495 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
496 +  }
497 + #endif
498 + };
499 +
500 + method_types: method_types ',' method_type_item | method_type_item;
501 + method_type_item: T_SSLV3
502 + {
503 + #ifdef HAVE_LIBCRYPTO
504 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
505 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
506 + #endif
507 + } | T_TLSV1
508 + {
509 + #ifdef HAVE_LIBCRYPTO
510 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
511 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
512 + #endif
513 + };
514 +
515   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
516   {
517   #ifdef HAVE_LIBCRYPTO
518 <  if (ypass == 2 && ServerInfo.ctx)
518 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
519    {
520      if (!ServerInfo.rsa_private_key_file)
521      {
# Line 515 | Line 523 | serverinfo_ssl_certificate_file: SSL_CER
523        break;
524      }
525  
526 <    if (SSL_CTX_use_certificate_file(ServerInfo.ctx,
527 <      yylval.string, SSL_FILETYPE_PEM) <= 0)
526 >    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
527 >                                     SSL_FILETYPE_PEM) <= 0)
528      {
529        yyerror(ERR_lib_error_string(ERR_get_error()));
530        break;
531      }
532  
533 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx,
534 <      ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0)
533 >    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
534 >                                    SSL_FILETYPE_PEM) <= 0)
535      {
536        yyerror(ERR_lib_error_string(ERR_get_error()));
537        break;
538      }
539  
540 <    if (!SSL_CTX_check_private_key(ServerInfo.ctx))
540 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
541      {
542 <      yyerror("RSA private key does not match the SSL certificate public key!");
542 >      yyerror(ERR_lib_error_string(ERR_get_error()));
543        break;
544      }
545    }
# Line 541 | Line 549 | serverinfo_ssl_certificate_file: SSL_CER
549   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
550   {
551   #ifdef HAVE_LIBCRYPTO
552 <  if (ypass == 1)
552 >  if (conf_parser_ctx.pass == 1)
553    {
554      BIO *file;
555  
# Line 601 | Line 609 | serverinfo_rsa_private_key_file: RSA_PRI
609   serverinfo_name: NAME '=' QSTRING ';'
610   {
611    /* this isn't rehashable */
612 <  if (ypass == 2)
612 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
613    {
614 <    if (ServerInfo.name == NULL)
614 >    if (valid_servname(yylval.string))
615 >      DupString(ServerInfo.name, yylval.string);
616 >    else
617      {
618 <      /* the ircd will exit() in main() if we dont set one */
619 <      if (strlen(yylval.string) <= HOSTLEN)
610 <        DupString(ServerInfo.name, yylval.string);
618 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
619 >      exit(0);
620      }
621    }
622   };
# Line 615 | Line 624 | serverinfo_name: NAME '=' QSTRING ';'
624   serverinfo_sid: IRCD_SID '=' QSTRING ';'
625   {
626    /* this isn't rehashable */
627 <  if (ypass == 2 && !ServerInfo.sid)
627 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
628    {
629 <    if ((strlen(yylval.string) == IRC_MAXSID) && IsDigit(yylval.string[0])
621 <        && IsAlNum(yylval.string[1]) && IsAlNum(yylval.string[2]))
622 <    {
629 >    if (valid_sid(yylval.string))
630        DupString(ServerInfo.sid, yylval.string);
624    }
631      else
632      {
633 <      ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting.");
633 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
634        exit(0);
635      }
636    }
# Line 632 | Line 638 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
638  
639   serverinfo_description: DESCRIPTION '=' QSTRING ';'
640   {
641 <  if (ypass == 2)
641 >  if (conf_parser_ctx.pass == 2)
642    {
643      MyFree(ServerInfo.description);
644      DupString(ServerInfo.description,yylval.string);
# Line 641 | Line 647 | serverinfo_description: DESCRIPTION '='
647  
648   serverinfo_network_name: NETWORK_NAME '=' QSTRING ';'
649   {
650 <  if (ypass == 2)
650 >  if (conf_parser_ctx.pass == 2)
651    {
652      char *p;
653  
# Line 655 | Line 661 | serverinfo_network_name: NETWORK_NAME '=
661  
662   serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
663   {
664 <  if (ypass == 2)
664 >  if (conf_parser_ctx.pass == 2)
665    {
666      MyFree(ServerInfo.network_desc);
667      DupString(ServerInfo.network_desc, yylval.string);
# Line 664 | Line 670 | serverinfo_network_desc: NETWORK_DESC '=
670  
671   serverinfo_vhost: VHOST '=' QSTRING ';'
672   {
673 <  if (ypass == 2 && *yylval.string != '*')
673 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
674    {
675      struct addrinfo hints, *res;
676  
# Line 674 | Line 680 | serverinfo_vhost: VHOST '=' QSTRING ';'
680      hints.ai_socktype = SOCK_STREAM;
681      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
682  
683 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
684 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
683 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
684 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
685      else
686      {
687        assert(res != NULL);
# Line 683 | Line 689 | serverinfo_vhost: VHOST '=' QSTRING ';'
689        memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
690        ServerInfo.ip.ss.ss_family = res->ai_family;
691        ServerInfo.ip.ss_len = res->ai_addrlen;
692 <      irc_freeaddrinfo(res);
692 >      freeaddrinfo(res);
693  
694        ServerInfo.specific_ipv4_vhost = 1;
695      }
# Line 693 | Line 699 | serverinfo_vhost: VHOST '=' QSTRING ';'
699   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
700   {
701   #ifdef IPV6
702 <  if (ypass == 2 && *yylval.string != '*')
702 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
703    {
704      struct addrinfo hints, *res;
705  
# Line 703 | Line 709 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
709      hints.ai_socktype = SOCK_STREAM;
710      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
711  
712 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
713 <      ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string);
712 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
713 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
714      else
715      {
716        assert(res != NULL);
# Line 712 | Line 718 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
718        memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
719        ServerInfo.ip6.ss.ss_family = res->ai_family;
720        ServerInfo.ip6.ss_len = res->ai_addrlen;
721 <      irc_freeaddrinfo(res);
721 >      freeaddrinfo(res);
722  
723        ServerInfo.specific_ipv6_vhost = 1;
724      }
# Line 722 | Line 728 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
728  
729   serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
730   {
731 <  if (ypass == 2)
731 >  if (conf_parser_ctx.pass == 2)
732    {
733      recalc_fdlimit(NULL);
734  
# Line 745 | Line 751 | serverinfo_max_clients: T_MAX_CLIENTS '=
751  
752   serverinfo_hub: HUB '=' TBOOL ';'
753   {
754 <  if (ypass == 2)
755 <  {
750 <    if (yylval.number)
751 <    {
752 <      /* Don't become a hub if we have a lazylink active. */
753 <      if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
754 <      {
755 <        sendto_realops_flags(UMODE_ALL, L_ALL,
756 <                             "Ignoring config file line hub=yes; "
757 <                             "due to active LazyLink (%s)", uplink->name);
758 <      }
759 <      else
760 <      {
761 <        ServerInfo.hub = 1;
762 <        uplink = NULL;
763 <        delete_capability("HUB");
764 <        add_capability("HUB", CAP_HUB, 1);
765 <      }
766 <    }
767 <    else if (ServerInfo.hub)
768 <    {
769 <      dlink_node *ptr = NULL;
770 <
771 <      ServerInfo.hub = 0;
772 <      delete_capability("HUB");
773 <
774 <      /* Don't become a leaf if we have a lazylink active. */
775 <      DLINK_FOREACH(ptr, serv_list.head)
776 <      {
777 <        const struct Client *acptr = ptr->data;
778 <        if (MyConnect(acptr) && IsCapable(acptr, CAP_LL))
779 <        {
780 <          sendto_realops_flags(UMODE_ALL, L_ALL,
781 <                               "Ignoring config file line hub=no; "
782 <                               "due to active LazyLink (%s)",
783 <                               acptr->name);
784 <          add_capability("HUB", CAP_HUB, 1);
785 <          ServerInfo.hub = 1;
786 <          break;
787 <        }
788 <      }
789 <    }
790 <  }
754 >  if (conf_parser_ctx.pass == 2)
755 >    ServerInfo.hub = yylval.number;
756   };
757  
758   /***************************************************************************
# Line 801 | Line 766 | admin_item:  admin_name | admin_descript
766  
767   admin_name: NAME '=' QSTRING ';'
768   {
769 <  if (ypass == 2)
769 >  if (conf_parser_ctx.pass == 2)
770    {
771      MyFree(AdminInfo.name);
772      DupString(AdminInfo.name, yylval.string);
# Line 810 | Line 775 | admin_name: NAME '=' QSTRING ';'
775  
776   admin_email: EMAIL '=' QSTRING ';'
777   {
778 <  if (ypass == 2)
778 >  if (conf_parser_ctx.pass == 2)
779    {
780      MyFree(AdminInfo.email);
781      DupString(AdminInfo.email, yylval.string);
# Line 819 | Line 784 | admin_email: EMAIL '=' QSTRING ';'
784  
785   admin_description: DESCRIPTION '=' QSTRING ';'
786   {
787 <  if (ypass == 2)
787 >  if (conf_parser_ctx.pass == 2)
788    {
789      MyFree(AdminInfo.description);
790      DupString(AdminInfo.description, yylval.string);
# Line 829 | Line 794 | admin_description: DESCRIPTION '=' QSTRI
794   /***************************************************************************
795   *  section logging
796   ***************************************************************************/
797 < /* XXX */
798 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
834 <
835 < logging_items:          logging_items logging_item |
836 <                        logging_item ;
797 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
798 > logging_items:          logging_items logging_item | logging_item ;
799  
800 < logging_item:           logging_path | logging_oper_log |
839 <                        logging_log_level |
840 <                        logging_use_logging | logging_fuserlog |
841 <                        logging_foperlog | logging_fglinelog |
842 <                        logging_fklinelog | logging_killlog |
843 <                        logging_foperspylog | logging_ioerrlog |
844 <                        logging_ffailed_operlog |
800 > logging_item:           logging_use_logging | logging_timestamp | logging_file_entry |
801                          error ';' ;
802  
803 < logging_path:           T_LOGPATH '=' QSTRING ';'
848 <                        {
849 <                        };
850 <
851 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
852 <                        {
853 <                        };
854 <
855 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
803 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
804   {
805 <  if (ypass == 2)
806 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
859 <            sizeof(ConfigLoggingEntry.userlog));
805 >  if (conf_parser_ctx.pass == 2)
806 >    ConfigLoggingEntry.use_logging = yylval.number;
807   };
808  
809 < logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
809 > logging_timestamp: T_TIMESTAMP '=' TBOOL ';'
810   {
811 <  if (ypass == 2)
812 <    strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
866 <            sizeof(ConfigLoggingEntry.failed_operlog));
811 >  if (conf_parser_ctx.pass == 2)
812 >    ConfigLoggingEntry.timestamp = yylval.number;
813   };
814  
815 < logging_foperlog: FOPERLOG '=' QSTRING ';'
815 > logging_file_entry:
816   {
817 <  if (ypass == 2)
818 <    strlcpy(ConfigLoggingEntry.operlog, yylval.string,
819 <            sizeof(ConfigLoggingEntry.operlog));
820 < };
875 <
876 < logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
817 >  lfile[0] = '\0';
818 >  ltype = 0;
819 >  lsize = 0;
820 > } T_FILE  '{' logging_file_items '}' ';'
821   {
822 <  if (ypass == 2)
823 <    strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
880 <            sizeof(ConfigLoggingEntry.operspylog));
822 >  if (conf_parser_ctx.pass == 2 && ltype > 0)
823 >    log_add_file(ltype, lsize, lfile);
824   };
825  
826 < logging_fglinelog: FGLINELOG '=' QSTRING ';'
827 < {
885 <  if (ypass == 2)
886 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
887 <            sizeof(ConfigLoggingEntry.glinelog));
888 < };
826 > logging_file_items: logging_file_items logging_file_item |
827 >                    logging_file_item ;
828  
829 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
830 < {
892 <  if (ypass == 2)
893 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
894 <            sizeof(ConfigLoggingEntry.klinelog));
895 < };
829 > logging_file_item:  logging_file_name | logging_file_type |
830 >                    logging_file_size | error ';' ;
831  
832 < logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
832 > logging_file_name: NAME '=' QSTRING ';'
833   {
834 <  if (ypass == 2)
835 <    strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
901 <            sizeof(ConfigLoggingEntry.ioerrlog));
902 < };
834 >  strlcpy(lfile, yylval.string, sizeof(lfile));
835 > }
836  
837 < logging_killlog: FKILLLOG '=' QSTRING ';'
837 > logging_file_size: T_SIZE '=' sizespec ';'
838 > {
839 >  lsize = $3;
840 > } | T_SIZE '=' T_UNLIMITED ';'
841   {
842 <  if (ypass == 2)
907 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
908 <            sizeof(ConfigLoggingEntry.killlog));
842 >  lsize = 0;
843   };
844  
845 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
912 < {
913 <  if (ypass == 2)
914 <    set_log_level(L_CRIT);
915 < } | LOG_LEVEL '=' T_L_ERROR ';'
916 < {
917 <  if (ypass == 2)
918 <    set_log_level(L_ERROR);
919 < } | LOG_LEVEL '=' T_L_WARN ';'
920 < {
921 <  if (ypass == 2)
922 <    set_log_level(L_WARN);
923 < } | LOG_LEVEL '=' T_L_NOTICE ';'
924 < {
925 <  if (ypass == 2)
926 <    set_log_level(L_NOTICE);
927 < } | LOG_LEVEL '=' T_L_TRACE ';'
928 < {
929 <  if (ypass == 2)
930 <    set_log_level(L_TRACE);
931 < } | LOG_LEVEL '=' T_L_INFO ';'
932 < {
933 <  if (ypass == 2)
934 <    set_log_level(L_INFO);
935 < } | LOG_LEVEL '=' T_L_DEBUG ';'
845 > logging_file_type: TYPE
846   {
847 <  if (ypass == 2)
848 <    set_log_level(L_DEBUG);
849 < };
847 >  if (conf_parser_ctx.pass == 2)
848 >    ltype = 0;
849 > } '='  logging_file_type_items ';' ;
850  
851 < logging_use_logging: USE_LOGGING '=' TBOOL ';'
851 > logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item;
852 > logging_file_type_item:  USER
853   {
854 <  if (ypass == 2)
855 <    ConfigLoggingEntry.use_logging = yylval.number;
854 >  if (conf_parser_ctx.pass == 2)
855 >    ltype = LOG_TYPE_USER;
856 > } | OPERATOR
857 > {
858 >  if (conf_parser_ctx.pass == 2)
859 >    ltype = LOG_TYPE_OPER;
860 > } | GLINE
861 > {
862 >  if (conf_parser_ctx.pass == 2)
863 >    ltype = LOG_TYPE_GLINE;
864 > } | T_DLINE
865 > {
866 >  if (conf_parser_ctx.pass == 2)
867 >    ltype = LOG_TYPE_DLINE;
868 > } | KLINE
869 > {
870 >  if (conf_parser_ctx.pass == 2)
871 >    ltype = LOG_TYPE_KLINE;
872 > } | KILL
873 > {
874 >  if (conf_parser_ctx.pass == 2)
875 >    ltype = LOG_TYPE_KILL;
876 > } | T_DEBUG
877 > {
878 >  if (conf_parser_ctx.pass == 2)
879 >    ltype = LOG_TYPE_DEBUG;
880   };
881  
882 +
883   /***************************************************************************
884   * section oper
885   ***************************************************************************/
886   oper_entry: OPERATOR
887   {
888 <  if (ypass == 2)
888 >  if (conf_parser_ctx.pass == 2)
889    {
890      yy_conf = make_conf_item(OPER_TYPE);
891      yy_aconf = map_to_conf(yy_conf);
# Line 960 | Line 896 | oper_entry: OPERATOR
896      MyFree(class_name);
897      class_name = NULL;
898    }
899 < } oper_name_b '{' oper_items '}' ';'
899 > } '{' oper_items '}' ';'
900   {
901 <  if (ypass == 2)
901 >  if (conf_parser_ctx.pass == 2)
902    {
903      struct CollectItem *yy_tmp;
904      dlink_node *ptr;
# Line 995 | Line 931 | oper_entry: OPERATOR
931          DupString(new_aconf->host, yy_tmp->host);
932        else
933          DupString(new_aconf->host, "*");
934 +
935 +      new_aconf->type = parse_netmask(new_aconf->host, &new_aconf->ipnum,
936 +                                     &new_aconf->bits);
937 +
938        conf_add_class_to_conf(new_conf, class_name);
939        if (yy_aconf->passwd != NULL)
940          DupString(new_aconf->passwd, yy_aconf->passwd);
# Line 1041 | Line 981 | oper_entry: OPERATOR
981    }
982   };
983  
1044 oper_name_b: | oper_name_t;
984   oper_items:     oper_items oper_item | oper_item;
985 < oper_item:      oper_name | oper_user | oper_password | oper_hidden_admin |
986 <                oper_hidden_oper | oper_umodes |
987 <                oper_class | oper_global_kill | oper_remote |
1049 <                oper_kline | oper_xline | oper_unkline |
1050 <                oper_gline | oper_nick_changes | oper_remoteban |
1051 <                oper_die | oper_rehash | oper_admin | oper_operwall |
1052 <                oper_encrypted | oper_rsa_public_key_file |
1053 <                oper_flags | error ';' ;
985 > oper_item:      oper_name | oper_user | oper_password |
986 >                oper_umodes | oper_class | oper_encrypted |
987 >                oper_rsa_public_key_file | oper_flags | error ';' ;
988  
989   oper_name: NAME '=' QSTRING ';'
990   {
991 <  if (ypass == 2)
991 >  if (conf_parser_ctx.pass == 2)
992    {
993      if (strlen(yylval.string) > OPERNICKLEN)
994        yylval.string[OPERNICKLEN] = '\0';
# Line 1064 | Line 998 | oper_name: NAME '=' QSTRING ';'
998    }
999   };
1000  
1001 < oper_name_t: QSTRING
1001 > oper_user: USER '=' QSTRING ';'
1002   {
1003 <  if (ypass == 2)
1003 >  if (conf_parser_ctx.pass == 2)
1004    {
1005 <    if (strlen(yylval.string) > OPERNICKLEN)
1072 <      yylval.string[OPERNICKLEN] = '\0';
1005 >    struct split_nuh_item nuh;
1006  
1007 <    MyFree(yy_conf->name);
1008 <    DupString(yy_conf->name, yylval.string);
1009 <  }
1010 < };
1007 >    nuh.nuhmask  = yylval.string;
1008 >    nuh.nickptr  = NULL;
1009 >    nuh.userptr  = userbuf;
1010 >    nuh.hostptr  = hostbuf;
1011  
1012 < oper_user: USER '=' QSTRING ';'
1013 < {
1014 <  if (ypass == 2)
1015 <  {
1016 <    struct CollectItem *yy_tmp;
1012 >    nuh.nicksize = 0;
1013 >    nuh.usersize = sizeof(userbuf);
1014 >    nuh.hostsize = sizeof(hostbuf);
1015 >
1016 >    split_nuh(&nuh);
1017  
1018      if (yy_aconf->user == NULL)
1019      {
1020 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1020 >      DupString(yy_aconf->user, userbuf);
1021 >      DupString(yy_aconf->host, hostbuf);
1022 >
1023 >      yy_aconf->type = parse_netmask(yy_aconf->host, &yy_aconf->ipnum,
1024 >                                    &yy_aconf->bits);
1025      }
1026      else
1027      {
1028 <      yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
1029 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1028 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
1029 >
1030 >      DupString(yy_tmp->user, userbuf);
1031 >      DupString(yy_tmp->host, hostbuf);
1032 >
1033        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1034      }
1035    }
# Line 1097 | Line 1037 | oper_user: USER '=' QSTRING ';'
1037  
1038   oper_password: PASSWORD '=' QSTRING ';'
1039   {
1040 <  if (ypass == 2)
1040 >  if (conf_parser_ctx.pass == 2)
1041    {
1042      if (yy_aconf->passwd != NULL)
1043        memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
# Line 1109 | Line 1049 | oper_password: PASSWORD '=' QSTRING ';'
1049  
1050   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1051   {
1052 <  if (ypass == 2)
1052 >  if (conf_parser_ctx.pass == 2)
1053    {
1054      if (yylval.number)
1055        SetConfEncrypted(yy_aconf);
# Line 1121 | Line 1061 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1061   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1062   {
1063   #ifdef HAVE_LIBCRYPTO
1064 <  if (ypass == 2)
1064 >  if (conf_parser_ctx.pass == 2)
1065    {
1066      BIO *file;
1067  
# Line 1162 | Line 1102 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1102  
1103   oper_class: CLASS '=' QSTRING ';'
1104   {
1105 <  if (ypass == 2)
1105 >  if (conf_parser_ctx.pass == 2)
1106    {
1107      MyFree(class_name);
1108      DupString(class_name, yylval.string);
# Line 1171 | Line 1111 | oper_class: CLASS '=' QSTRING ';'
1111  
1112   oper_umodes: T_UMODES
1113   {
1114 <  yy_aconf->modes = 0;
1114 >  if (conf_parser_ctx.pass == 2)
1115 >    yy_aconf->modes = 0;
1116   } '='  oper_umodes_items ';' ;
1117  
1118   oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
1119   oper_umodes_item:  T_BOTS
1120   {
1121 <  yy_aconf->modes |= UMODE_BOTS;
1121 >  if (conf_parser_ctx.pass == 2)
1122 >    yy_aconf->modes |= UMODE_BOTS;
1123   } | T_CCONN
1124   {
1125 <  yy_aconf->modes |= UMODE_CCONN;
1125 >  if (conf_parser_ctx.pass == 2)
1126 >    yy_aconf->modes |= UMODE_CCONN;
1127 > } | T_CCONN_FULL
1128 > {
1129 >  if (conf_parser_ctx.pass == 2)
1130 >    yy_aconf->modes |= UMODE_CCONN_FULL;
1131   } | T_DEAF
1132   {
1133 <  yy_aconf->modes |= UMODE_DEAF;
1133 >  if (conf_parser_ctx.pass == 2)
1134 >    yy_aconf->modes |= UMODE_DEAF;
1135   } | T_DEBUG
1136   {
1137 <  yy_aconf->modes |= UMODE_DEBUG;
1137 >  if (conf_parser_ctx.pass == 2)
1138 >    yy_aconf->modes |= UMODE_DEBUG;
1139   } | T_FULL
1140   {
1141 <  yy_aconf->modes |= UMODE_FULL;
1141 >  if (conf_parser_ctx.pass == 2)
1142 >    yy_aconf->modes |= UMODE_FULL;
1143   } | T_SKILL
1144   {
1145 <  yy_aconf->modes |= UMODE_SKILL;
1145 >  if (conf_parser_ctx.pass == 2)
1146 >    yy_aconf->modes |= UMODE_SKILL;
1147   } | T_NCHANGE
1148   {
1149 <  yy_aconf->modes |= UMODE_NCHANGE;
1149 >  if (conf_parser_ctx.pass == 2)
1150 >    yy_aconf->modes |= UMODE_NCHANGE;
1151   } | T_REJ
1152   {
1153 <  yy_aconf->modes |= UMODE_REJ;
1153 >  if (conf_parser_ctx.pass == 2)
1154 >    yy_aconf->modes |= UMODE_REJ;
1155   } | T_UNAUTH
1156   {
1157 <  yy_aconf->modes |= UMODE_UNAUTH;
1157 >  if (conf_parser_ctx.pass == 2)
1158 >    yy_aconf->modes |= UMODE_UNAUTH;
1159   } | T_SPY
1160   {
1161 <  yy_aconf->modes |= UMODE_SPY;
1161 >  if (conf_parser_ctx.pass == 2)
1162 >    yy_aconf->modes |= UMODE_SPY;
1163   } | T_EXTERNAL
1164   {
1165 <  yy_aconf->modes |= UMODE_EXTERNAL;
1165 >  if (conf_parser_ctx.pass == 2)
1166 >    yy_aconf->modes |= UMODE_EXTERNAL;
1167   } | T_OPERWALL
1168   {
1169 <  yy_aconf->modes |= UMODE_OPERWALL;
1169 >  if (conf_parser_ctx.pass == 2)
1170 >    yy_aconf->modes |= UMODE_OPERWALL;
1171   } | T_SERVNOTICE
1172   {
1173 <  yy_aconf->modes |= UMODE_SERVNOTICE;
1173 >  if (conf_parser_ctx.pass == 2)
1174 >    yy_aconf->modes |= UMODE_SERVNOTICE;
1175   } | T_INVISIBLE
1176   {
1177 <  yy_aconf->modes |= UMODE_INVISIBLE;
1177 >  if (conf_parser_ctx.pass == 2)
1178 >    yy_aconf->modes |= UMODE_INVISIBLE;
1179   } | T_WALLOP
1180   {
1181 <  yy_aconf->modes |= UMODE_WALLOP;
1181 >  if (conf_parser_ctx.pass == 2)
1182 >    yy_aconf->modes |= UMODE_WALLOP;
1183   } | T_SOFTCALLERID
1184   {
1185 <  yy_aconf->modes |= UMODE_SOFTCALLERID;
1185 >  if (conf_parser_ctx.pass == 2)
1186 >    yy_aconf->modes |= UMODE_SOFTCALLERID;
1187   } | T_CALLERID
1188   {
1189 <  yy_aconf->modes |= UMODE_CALLERID;
1189 >  if (conf_parser_ctx.pass == 2)
1190 >    yy_aconf->modes |= UMODE_CALLERID;
1191   } | T_LOCOPS
1192   {
1193 <  yy_aconf->modes |= UMODE_LOCOPS;
1194 < };
1233 <
1234 < oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1235 < {
1236 <  if (ypass == 2)
1237 <  {
1238 <    if (yylval.number)
1239 <      yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1240 <    else
1241 <      yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1242 <  }
1243 < };
1244 <
1245 < oper_remote: REMOTE '=' TBOOL ';'
1246 < {
1247 <  if (ypass == 2)
1248 <  {
1249 <    if (yylval.number)
1250 <      yy_aconf->port |= OPER_FLAG_REMOTE;
1251 <    else
1252 <      yy_aconf->port &= ~OPER_FLAG_REMOTE;
1253 <  }
1254 < };
1255 <
1256 < oper_remoteban: REMOTEBAN '=' TBOOL ';'
1257 < {
1258 <  if (ypass == 2)
1259 <  {
1260 <    if (yylval.number)
1261 <      yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1262 <    else
1263 <      yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1264 <  }
1265 < };
1266 <
1267 < oper_kline: KLINE '=' TBOOL ';'
1268 < {
1269 <  if (ypass == 2)
1270 <  {
1271 <    if (yylval.number)
1272 <      yy_aconf->port |= OPER_FLAG_K;
1273 <    else
1274 <      yy_aconf->port &= ~OPER_FLAG_K;
1275 <  }
1276 < };
1277 <
1278 < oper_xline: XLINE '=' TBOOL ';'
1279 < {
1280 <  if (ypass == 2)
1281 <  {
1282 <    if (yylval.number)
1283 <      yy_aconf->port |= OPER_FLAG_X;
1284 <    else
1285 <      yy_aconf->port &= ~OPER_FLAG_X;
1286 <  }
1287 < };
1288 <
1289 < oper_unkline: UNKLINE '=' TBOOL ';'
1290 < {
1291 <  if (ypass == 2)
1292 <  {
1293 <    if (yylval.number)
1294 <      yy_aconf->port |= OPER_FLAG_UNKLINE;
1295 <    else
1296 <      yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1297 <  }
1298 < };
1299 <
1300 < oper_gline: GLINE '=' TBOOL ';'
1301 < {
1302 <  if (ypass == 2)
1303 <  {
1304 <    if (yylval.number)
1305 <      yy_aconf->port |= OPER_FLAG_GLINE;
1306 <    else
1307 <      yy_aconf->port &= ~OPER_FLAG_GLINE;
1308 <  }
1309 < };
1310 <
1311 < oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1312 < {
1313 <  if (ypass == 2)
1314 <  {
1315 <    if (yylval.number)
1316 <      yy_aconf->port |= OPER_FLAG_N;
1317 <    else
1318 <      yy_aconf->port &= ~OPER_FLAG_N;
1319 <  }
1320 < };
1321 <
1322 < oper_die: DIE '=' TBOOL ';'
1323 < {
1324 <  if (ypass == 2)
1325 <  {
1326 <    if (yylval.number)
1327 <      yy_aconf->port |= OPER_FLAG_DIE;
1328 <    else
1329 <      yy_aconf->port &= ~OPER_FLAG_DIE;
1330 <  }
1331 < };
1332 <
1333 < oper_rehash: REHASH '=' TBOOL ';'
1334 < {
1335 <  if (ypass == 2)
1336 <  {
1337 <    if (yylval.number)
1338 <      yy_aconf->port |= OPER_FLAG_REHASH;
1339 <    else
1340 <      yy_aconf->port &= ~OPER_FLAG_REHASH;
1341 <  }
1342 < };
1343 <
1344 < oper_admin: ADMIN '=' TBOOL ';'
1345 < {
1346 <  if (ypass == 2)
1347 <  {
1348 <    if (yylval.number)
1349 <      yy_aconf->port |= OPER_FLAG_ADMIN;
1350 <    else
1351 <      yy_aconf->port &= ~OPER_FLAG_ADMIN;
1352 <  }
1353 < };
1354 <
1355 < oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1356 < {
1357 <  if (ypass == 2)
1358 <  {
1359 <    if (yylval.number)
1360 <      yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1361 <    else
1362 <      yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1363 <  }
1364 < };
1365 <
1366 < oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1367 < {
1368 <  if (ypass == 2)
1369 <  {
1370 <    if (yylval.number)
1371 <      yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1372 <    else
1373 <      yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1374 <  }
1375 < };
1376 <
1377 < oper_operwall: T_OPERWALL '=' TBOOL ';'
1378 < {
1379 <  if (ypass == 2)
1380 <  {
1381 <    if (yylval.number)
1382 <      yy_aconf->port |= OPER_FLAG_OPERWALL;
1383 <    else
1384 <      yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1385 <  }
1193 >  if (conf_parser_ctx.pass == 2)
1194 >    yy_aconf->modes |= UMODE_LOCOPS;
1195   };
1196  
1197   oper_flags: IRCD_FLAGS
1198   {
1199 +  if (conf_parser_ctx.pass == 2)
1200 +    yy_aconf->port = 0;
1201   } '='  oper_flags_items ';';
1202  
1203   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1204 < oper_flags_item: NOT oper_flags_item_atom { not_atom = 1; }
1394 <                | oper_flags_item_atom { not_atom = 0; };
1395 <
1396 < oper_flags_item_atom: GLOBAL_KILL
1204 > oper_flags_item: GLOBAL_KILL
1205   {
1206 <  if (ypass == 2)
1207 <  {
1400 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1401 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1402 <  }
1206 >  if (conf_parser_ctx.pass == 2)
1207 >    yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1208   } | REMOTE
1209   {
1210 <  if (ypass == 2)
1211 <  {
1407 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1408 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1409 <  }
1210 >  if (conf_parser_ctx.pass == 2)
1211 >    yy_aconf->port |= OPER_FLAG_REMOTE;
1212   } | KLINE
1213   {
1214 <  if (ypass == 2)
1215 <  {
1414 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1415 <    else yy_aconf->port |= OPER_FLAG_K;
1416 <  }
1214 >  if (conf_parser_ctx.pass == 2)
1215 >    yy_aconf->port |= OPER_FLAG_K;
1216   } | UNKLINE
1217   {
1218 <  if (ypass == 2)
1219 <  {
1421 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1422 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1423 <  }
1218 >  if (conf_parser_ctx.pass == 2)
1219 >    yy_aconf->port |= OPER_FLAG_UNKLINE;
1220   } | XLINE
1221   {
1222 <  if (ypass == 2)
1223 <  {
1428 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1429 <    else yy_aconf->port |= OPER_FLAG_X;
1430 <  }
1222 >  if (conf_parser_ctx.pass == 2)
1223 >    yy_aconf->port |= OPER_FLAG_X;
1224   } | GLINE
1225   {
1226 <  if (ypass == 2)
1227 <  {
1435 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1436 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1437 <  }
1226 >  if (conf_parser_ctx.pass == 2)
1227 >    yy_aconf->port |= OPER_FLAG_GLINE;
1228   } | DIE
1229   {
1230 <  if (ypass == 2)
1231 <  {
1232 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1233 <    else yy_aconf->port |= OPER_FLAG_DIE;
1234 <  }
1230 >  if (conf_parser_ctx.pass == 2)
1231 >    yy_aconf->port |= OPER_FLAG_DIE;
1232 > } | T_RESTART
1233 > {
1234 >  if (conf_parser_ctx.pass == 2)
1235 >    yy_aconf->port |= OPER_FLAG_RESTART;
1236   } | REHASH
1237   {
1238 <  if (ypass == 2)
1239 <  {
1449 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1450 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1451 <  }
1238 >  if (conf_parser_ctx.pass == 2)
1239 >    yy_aconf->port |= OPER_FLAG_REHASH;
1240   } | ADMIN
1241   {
1242 <  if (ypass == 2)
1243 <  {
1456 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1457 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1458 <  }
1242 >  if (conf_parser_ctx.pass == 2)
1243 >    yy_aconf->port |= OPER_FLAG_ADMIN;
1244   } | HIDDEN_ADMIN
1245   {
1246 <  if (ypass == 2)
1247 <  {
1463 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1464 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1465 <  }
1246 >  if (conf_parser_ctx.pass == 2)
1247 >    yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1248   } | NICK_CHANGES
1249   {
1250 <  if (ypass == 2)
1251 <  {
1470 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1471 <    else yy_aconf->port |= OPER_FLAG_N;
1472 <  }
1250 >  if (conf_parser_ctx.pass == 2)
1251 >    yy_aconf->port |= OPER_FLAG_N;
1252   } | T_OPERWALL
1253   {
1254 <  if (ypass == 2)
1255 <  {
1256 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1257 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1258 <  }
1254 >  if (conf_parser_ctx.pass == 2)
1255 >    yy_aconf->port |= OPER_FLAG_OPERWALL;
1256 > } | T_GLOBOPS
1257 > {
1258 >  if (conf_parser_ctx.pass == 2)
1259 >    yy_aconf->port |= OPER_FLAG_GLOBOPS;
1260   } | OPER_SPY_T
1261   {
1262 <  if (ypass == 2)
1263 <  {
1484 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1485 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1486 <  }
1262 >  if (conf_parser_ctx.pass == 2)
1263 >    yy_aconf->port |= OPER_FLAG_OPER_SPY;
1264   } | HIDDEN_OPER
1265   {
1266 <  if (ypass == 2)
1267 <  {
1491 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1492 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1493 <  }
1266 >  if (conf_parser_ctx.pass == 2)
1267 >    yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1268   } | REMOTEBAN
1269   {
1270 <  if (ypass == 2)
1271 <  {
1272 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1499 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1500 <  }
1501 < } | ENCRYPTED
1270 >  if (conf_parser_ctx.pass == 2)
1271 >    yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1272 > } | MODULE
1273   {
1274 <  if (ypass == 2)
1275 <  {
1505 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1506 <    else SetConfEncrypted(yy_aconf);
1507 <  }
1274 >  if (conf_parser_ctx.pass == 2)
1275 >    yy_aconf->port |= OPER_FLAG_MODULE;
1276   };
1277  
1278  
# Line 1513 | Line 1281 | oper_flags_item_atom: GLOBAL_KILL
1281   ***************************************************************************/
1282   class_entry: CLASS
1283   {
1284 <  if (ypass == 1)
1284 >  if (conf_parser_ctx.pass == 1)
1285    {
1286      yy_conf = make_conf_item(CLASS_TYPE);
1287 <    yy_class = (struct ClassItem *)map_to_conf(yy_conf);
1287 >    yy_class = map_to_conf(yy_conf);
1288    }
1289 < } class_name_b '{' class_items '}' ';'
1289 > } '{' class_items '}' ';'
1290   {
1291 <  if (ypass == 1)
1291 >  if (conf_parser_ctx.pass == 1)
1292    {
1293 <    struct ConfItem *cconf;
1293 >    struct ConfItem *cconf = NULL;
1294      struct ClassItem *class = NULL;
1295  
1296      if (yy_class_name == NULL)
1529    {
1297        delete_conf_item(yy_conf);
1531    }
1298      else
1299      {
1300 <      cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1300 >      cconf = find_exact_name_conf(CLASS_TYPE, NULL, yy_class_name, NULL, NULL);
1301  
1302        if (cconf != NULL)                /* The class existed already */
1303        {
1304 +        int user_count = 0;
1305 +
1306          rebuild_cidr_class(cconf, yy_class);
1307 <        class = (struct ClassItem *) map_to_conf(cconf);
1308 <        *class = *yy_class;
1307 >
1308 >        class = map_to_conf(cconf);
1309 >
1310 >        user_count = class->curr_user_count;
1311 >        memcpy(class, yy_class, sizeof(*class));
1312 >        class->curr_user_count = user_count;
1313 >        class->active = 1;
1314 >
1315          delete_conf_item(yy_conf);
1316  
1317          MyFree(cconf->name);            /* Allows case change of class name */
# Line 1547 | Line 1321 | class_entry: CLASS
1321        {
1322          MyFree(yy_conf->name);          /* just in case it was allocated */
1323          yy_conf->name = yy_class_name;
1324 +        yy_class->active = 1;
1325        }
1326      }
1327 +
1328      yy_class_name = NULL;
1329    }
1330   };
1331  
1556 class_name_b: | class_name_t;
1557
1332   class_items:    class_items class_item | class_item;
1333   class_item:     class_name |
1334                  class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
# Line 1572 | Line 1346 | class_item:     class_name |
1346  
1347   class_name: NAME '=' QSTRING ';'
1348   {
1349 <  if (ypass == 1)
1576 <  {
1577 <    MyFree(yy_class_name);
1578 <    DupString(yy_class_name, yylval.string);
1579 <  }
1580 < };
1581 <
1582 < class_name_t: QSTRING
1583 < {
1584 <  if (ypass == 1)
1349 >  if (conf_parser_ctx.pass == 1)
1350    {
1351      MyFree(yy_class_name);
1352      DupString(yy_class_name, yylval.string);
# Line 1590 | Line 1355 | class_name_t: QSTRING
1355  
1356   class_ping_time: PING_TIME '=' timespec ';'
1357   {
1358 <  if (ypass == 1)
1358 >  if (conf_parser_ctx.pass == 1)
1359      PingFreq(yy_class) = $3;
1360   };
1361  
1362   class_ping_warning: PING_WARNING '=' timespec ';'
1363   {
1364 <  if (ypass == 1)
1364 >  if (conf_parser_ctx.pass == 1)
1365      PingWarning(yy_class) = $3;
1366   };
1367  
1368   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1369   {
1370 <  if (ypass == 1)
1370 >  if (conf_parser_ctx.pass == 1)
1371      MaxPerIp(yy_class) = $3;
1372   };
1373  
1374   class_connectfreq: CONNECTFREQ '=' timespec ';'
1375   {
1376 <  if (ypass == 1)
1376 >  if (conf_parser_ctx.pass == 1)
1377      ConFreq(yy_class) = $3;
1378   };
1379  
1380   class_max_number: MAX_NUMBER '=' NUMBER ';'
1381   {
1382 <  if (ypass == 1)
1382 >  if (conf_parser_ctx.pass == 1)
1383      MaxTotal(yy_class) = $3;
1384   };
1385  
1386   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1387   {
1388 <  if (ypass == 1)
1388 >  if (conf_parser_ctx.pass == 1)
1389      MaxGlobal(yy_class) = $3;
1390   };
1391  
1392   class_max_local: MAX_LOCAL '=' NUMBER ';'
1393   {
1394 <  if (ypass == 1)
1394 >  if (conf_parser_ctx.pass == 1)
1395      MaxLocal(yy_class) = $3;
1396   };
1397  
1398   class_max_ident: MAX_IDENT '=' NUMBER ';'
1399   {
1400 <  if (ypass == 1)
1400 >  if (conf_parser_ctx.pass == 1)
1401      MaxIdent(yy_class) = $3;
1402   };
1403  
1404   class_sendq: SENDQ '=' sizespec ';'
1405   {
1406 <  if (ypass == 1)
1406 >  if (conf_parser_ctx.pass == 1)
1407      MaxSendq(yy_class) = $3;
1408   };
1409  
1410   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1411   {
1412 <  if (ypass == 1)
1412 >  if (conf_parser_ctx.pass == 1)
1413      CidrBitlenIPV4(yy_class) = $3;
1414   };
1415  
1416   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1417   {
1418 <  if (ypass == 1)
1418 >  if (conf_parser_ctx.pass == 1)
1419      CidrBitlenIPV6(yy_class) = $3;
1420   };
1421  
1422   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1423   {
1424 <  if (ypass == 1)
1424 >  if (conf_parser_ctx.pass == 1)
1425      NumberPerCidr(yy_class) = $3;
1426   };
1427  
# Line 1665 | Line 1430 | class_number_per_cidr: NUMBER_PER_CIDR '
1430   ***************************************************************************/
1431   listen_entry: LISTEN
1432   {
1433 <  if (ypass == 2)
1433 >  if (conf_parser_ctx.pass == 2)
1434    {
1435      listener_address = NULL;
1436      listener_flags = 0;
1437    }
1438   } '{' listen_items '}' ';'
1439   {
1440 <  if (ypass == 2)
1440 >  if (conf_parser_ctx.pass == 2)
1441    {
1442      MyFree(listener_address);
1443      listener_address = NULL;
# Line 1681 | Line 1446 | listen_entry: LISTEN
1446  
1447   listen_flags: IRCD_FLAGS
1448   {
1449 +  listener_flags = 0;
1450   } '='  listen_flags_items ';';
1451  
1452   listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item;
1453   listen_flags_item: T_SSL
1454   {
1455 <  if (ypass == 2)
1455 >  if (conf_parser_ctx.pass == 2)
1456      listener_flags |= LISTENER_SSL;
1457   } | HIDDEN
1458   {
1459 <  if (ypass == 2)
1459 >  if (conf_parser_ctx.pass == 2)
1460      listener_flags |= LISTENER_HIDDEN;
1461 + } | T_SERVER
1462 + {
1463 +  if (conf_parser_ctx.pass == 2)
1464 +    listener_flags |= LISTENER_SERVER;
1465   };
1466  
1467 +
1468 +
1469   listen_items:   listen_items listen_item | listen_item;
1470 < listen_item:    listen_port | listen_flags | listen_address | listen_host | error ';' ;
1470 > listen_item:    listen_port | listen_flags | listen_address | listen_host | error ';';
1471  
1472 < listen_port: PORT '=' port_items ';' ;
1472 > listen_port: PORT '=' port_items { listener_flags = 0; } ';';
1473  
1474   port_items: port_items ',' port_item | port_item;
1475  
1476   port_item: NUMBER
1477   {
1478 <  if (ypass == 2)
1478 >  if (conf_parser_ctx.pass == 2)
1479    {
1480      if ((listener_flags & LISTENER_SSL))
1481   #ifdef HAVE_LIBCRYPTO
1482 <      if (!ServerInfo.ctx)
1482 >      if (!ServerInfo.server_ctx)
1483   #endif
1484        {
1485          yyerror("SSL not available - port closed");
1486          break;
1487        }
1488      add_listener($1, listener_address, listener_flags);
1717    listener_flags = 0;
1489    }
1490   } | NUMBER TWODOTS NUMBER
1491   {
1492 <  if (ypass == 2)
1492 >  if (conf_parser_ctx.pass == 2)
1493    {
1494      int i;
1495  
1496      if ((listener_flags & LISTENER_SSL))
1497   #ifdef HAVE_LIBCRYPTO
1498 <      if (!ServerInfo.ctx)
1498 >      if (!ServerInfo.server_ctx)
1499   #endif
1500        {
1501          yyerror("SSL not available - port closed");
# Line 1733 | Line 1504 | port_item: NUMBER
1504  
1505      for (i = $1; i <= $3; ++i)
1506        add_listener(i, listener_address, listener_flags);
1736
1737    listener_flags = 0;
1507    }
1508   };
1509  
1510   listen_address: IP '=' QSTRING ';'
1511   {
1512 <  if (ypass == 2)
1512 >  if (conf_parser_ctx.pass == 2)
1513    {
1514      MyFree(listener_address);
1515      DupString(listener_address, yylval.string);
# Line 1749 | Line 1518 | listen_address: IP '=' QSTRING ';'
1518  
1519   listen_host: HOST '=' QSTRING ';'
1520   {
1521 <  if (ypass == 2)
1521 >  if (conf_parser_ctx.pass == 2)
1522    {
1523      MyFree(listener_address);
1524      DupString(listener_address, yylval.string);
# Line 1761 | Line 1530 | listen_host: HOST '=' QSTRING ';'
1530   ***************************************************************************/
1531   auth_entry: IRCD_AUTH
1532   {
1533 <  if (ypass == 2)
1533 >  if (conf_parser_ctx.pass == 2)
1534    {
1535      yy_conf = make_conf_item(CLIENT_TYPE);
1536      yy_aconf = map_to_conf(yy_conf);
# Line 1773 | Line 1542 | auth_entry: IRCD_AUTH
1542    }
1543   } '{' auth_items '}' ';'
1544   {
1545 <  if (ypass == 2)
1545 >  if (conf_parser_ctx.pass == 2)
1546    {
1547      struct CollectItem *yy_tmp = NULL;
1548      dlink_node *ptr = NULL, *next_ptr = NULL;
# Line 1830 | Line 1599 | auth_entry: IRCD_AUTH
1599  
1600   auth_items:     auth_items auth_item | auth_item;
1601   auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1602 <                auth_kline_exempt | auth_need_ident |
1603 <                auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
1835 <                auth_spoof | auth_spoof_notice |
1836 <                auth_redir_serv | auth_redir_port | auth_can_flood |
1837 <                auth_need_password | auth_encrypted | error ';' ;
1602 >                auth_spoof | auth_redir_serv | auth_redir_port |
1603 >                auth_encrypted | error ';' ;
1604  
1605   auth_user: USER '=' QSTRING ';'
1606   {
1607 <  if (ypass == 2)
1607 >  if (conf_parser_ctx.pass == 2)
1608    {
1609 <    struct CollectItem *yy_tmp;
1609 >    struct CollectItem *yy_tmp = NULL;
1610 >    struct split_nuh_item nuh;
1611 >
1612 >    nuh.nuhmask  = yylval.string;
1613 >    nuh.nickptr  = NULL;
1614 >    nuh.userptr  = userbuf;
1615 >    nuh.hostptr  = hostbuf;
1616 >
1617 >    nuh.nicksize = 0;
1618 >    nuh.usersize = sizeof(userbuf);
1619 >    nuh.hostsize = sizeof(hostbuf);
1620 >
1621 >    split_nuh(&nuh);
1622  
1623      if (yy_aconf->user == NULL)
1624 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1624 >    {
1625 >      DupString(yy_aconf->user, userbuf);
1626 >      DupString(yy_aconf->host, hostbuf);
1627 >    }
1628      else
1629      {
1630        yy_tmp = MyMalloc(sizeof(struct CollectItem));
1631 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1631 >
1632 >      DupString(yy_tmp->user, userbuf);
1633 >      DupString(yy_tmp->host, hostbuf);
1634 >
1635        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1636      }
1637    }
# Line 1857 | Line 1641 | auth_user: USER '=' QSTRING ';'
1641  
1642   auth_passwd: PASSWORD '=' QSTRING ';'
1643   {
1644 <  if (ypass == 2)
1644 >  if (conf_parser_ctx.pass == 2)
1645    {
1646      /* be paranoid */
1647      if (yy_aconf->passwd != NULL)
# Line 1868 | Line 1652 | auth_passwd: PASSWORD '=' QSTRING ';'
1652    }
1653   };
1654  
1871 auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1872 {
1873  if (ypass == 2)
1874  {
1875    if (yylval.number)
1876      yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1877    else
1878      yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1879  }
1880 };
1881
1655   auth_class: CLASS '=' QSTRING ';'
1656   {
1657 <  if (ypass == 2)
1657 >  if (conf_parser_ctx.pass == 2)
1658    {
1659      MyFree(class_name);
1660      DupString(class_name, yylval.string);
# Line 1890 | Line 1663 | auth_class: CLASS '=' QSTRING ';'
1663  
1664   auth_encrypted: ENCRYPTED '=' TBOOL ';'
1665   {
1666 <  if (ypass == 2)
1666 >  if (conf_parser_ctx.pass == 2)
1667    {
1668      if (yylval.number)
1669        SetConfEncrypted(yy_aconf);
# Line 1904 | Line 1677 | auth_flags: IRCD_FLAGS
1677   } '='  auth_flags_items ';';
1678  
1679   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1680 < auth_flags_item: NOT auth_flags_item_atom { not_atom = 1; }
1908 <                | auth_flags_item_atom { not_atom = 0; };
1909 <
1910 < auth_flags_item_atom: SPOOF_NOTICE
1680 > auth_flags_item: SPOOF_NOTICE
1681   {
1682 <  if (ypass == 2)
1683 <  {
1914 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1915 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1916 <  }
1917 <
1682 >  if (conf_parser_ctx.pass == 2)
1683 >    yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1684   } | EXCEED_LIMIT
1685   {
1686 <  if (ypass == 2)
1687 <  {
1922 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1923 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1924 <  }
1686 >  if (conf_parser_ctx.pass == 2)
1687 >    yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1688   } | KLINE_EXEMPT
1689   {
1690 <  if (ypass == 2)
1691 <  {
1929 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1930 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1931 <  }
1690 >  if (conf_parser_ctx.pass == 2)
1691 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1692   } | NEED_IDENT
1693   {
1694 <  if (ypass == 2)
1695 <  {
1936 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
1937 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1938 <  }
1694 >  if (conf_parser_ctx.pass == 2)
1695 >    yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1696   } | CAN_FLOOD
1697   {
1698 <  if (ypass == 2)
1699 <  {
1943 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
1944 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1945 <  }
1946 < } | CAN_IDLE
1947 < {
1948 <  if (ypass == 2)
1949 <  {
1950 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
1951 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
1952 <  }
1698 >  if (conf_parser_ctx.pass == 2)
1699 >    yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1700   } | NO_TILDE
1701   {
1702 <  if (ypass == 2)
1703 <  {
1957 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
1958 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1959 <  }
1702 >  if (conf_parser_ctx.pass == 2)
1703 >    yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1704   } | GLINE_EXEMPT
1705   {
1706 <  if (ypass == 2)
1707 <  {
1964 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
1965 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1966 <  }
1706 >  if (conf_parser_ctx.pass == 2)
1707 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1708   } | RESV_EXEMPT
1709   {
1710 <  if (ypass == 2)
1711 <  {
1971 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
1972 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1973 <  }
1710 >  if (conf_parser_ctx.pass == 2)
1711 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1712   } | NEED_PASSWORD
1713   {
1714 <  if (ypass == 2)
1715 <  {
1978 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
1979 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1980 <  }
1981 < };
1982 <
1983 < auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
1984 < {
1985 <  if (ypass == 2)
1986 <  {
1987 <    if (yylval.number)
1988 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1989 <    else
1990 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1991 <  }
1992 < };
1993 <
1994 < auth_need_ident: NEED_IDENT '=' TBOOL ';'
1995 < {
1996 <  if (ypass == 2)
1997 <  {
1998 <    if (yylval.number)
1999 <      yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2000 <    else
2001 <      yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2002 <  }
2003 < };
2004 <
2005 < auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2006 < {
2007 <  if (ypass == 2)
2008 <  {
2009 <    if (yylval.number)
2010 <      yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
2011 <    else
2012 <      yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
2013 <  }
2014 < };
2015 <
2016 < auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2017 < {
2018 <  if (ypass == 2)
2019 <  {
2020 <    if (yylval.number)
2021 <      yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2022 <    else
2023 <      yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2024 <  }
2025 < };
2026 <
2027 < auth_no_tilde: NO_TILDE '=' TBOOL ';'
2028 < {
2029 <  if (ypass == 2)
2030 <  {
2031 <    if (yylval.number)
2032 <      yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2033 <    else
2034 <      yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2035 <  }
2036 < };
2037 <
2038 < auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2039 < {
2040 <  if (ypass == 2)
2041 <  {
2042 <    if (yylval.number)
2043 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2044 <    else
2045 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2046 <  }
1714 >  if (conf_parser_ctx.pass == 2)
1715 >    yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1716   };
1717  
1718   /* XXX - need check for illegal hostnames here */
1719   auth_spoof: SPOOF '=' QSTRING ';'
1720   {
1721 <  if (ypass == 2)
1721 >  if (conf_parser_ctx.pass == 2)
1722    {
1723      MyFree(yy_conf->name);
1724  
# Line 2060 | Line 1729 | auth_spoof: SPOOF '=' QSTRING ';'
1729      }
1730      else
1731      {
1732 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1732 >      ilog(LOG_TYPE_IRCD, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1733        yy_conf->name = NULL;
1734      }
1735    }
# Line 2068 | Line 1737 | auth_spoof: SPOOF '=' QSTRING ';'
1737  
1738   auth_redir_serv: REDIRSERV '=' QSTRING ';'
1739   {
1740 <  if (ypass == 2)
1740 >  if (conf_parser_ctx.pass == 2)
1741    {
1742      yy_aconf->flags |= CONF_FLAGS_REDIR;
1743      MyFree(yy_conf->name);
# Line 2078 | Line 1747 | auth_redir_serv: REDIRSERV '=' QSTRING '
1747  
1748   auth_redir_port: REDIRPORT '=' NUMBER ';'
1749   {
1750 <  if (ypass == 2)
1750 >  if (conf_parser_ctx.pass == 2)
1751    {
1752      yy_aconf->flags |= CONF_FLAGS_REDIR;
1753      yy_aconf->port = $3;
1754    }
1755   };
1756  
2088 auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2089 {
2090  if (ypass == 2)
2091  {
2092    if (yylval.number)
2093      yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2094    else
2095      yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2096  }
2097 };
2098
1757  
1758   /***************************************************************************
1759   *  section resv
1760   ***************************************************************************/
1761   resv_entry: RESV
1762   {
1763 <  if (ypass == 2)
1763 >  if (conf_parser_ctx.pass == 2)
1764    {
1765      MyFree(resv_reason);
1766      resv_reason = NULL;
1767    }
1768   } '{' resv_items '}' ';'
1769   {
1770 <  if (ypass == 2)
1770 >  if (conf_parser_ctx.pass == 2)
1771    {
1772      MyFree(resv_reason);
1773      resv_reason = NULL;
# Line 2121 | Line 1779 | resv_item:     resv_creason | resv_channel |
1779  
1780   resv_creason: REASON '=' QSTRING ';'
1781   {
1782 <  if (ypass == 2)
1782 >  if (conf_parser_ctx.pass == 2)
1783    {
1784      MyFree(resv_reason);
1785      DupString(resv_reason, yylval.string);
# Line 2130 | Line 1788 | resv_creason: REASON '=' QSTRING ';'
1788  
1789   resv_channel: CHANNEL '=' QSTRING ';'
1790   {
1791 <  if (ypass == 2)
1791 >  if (conf_parser_ctx.pass == 2)
1792    {
1793      if (IsChanPrefix(*yylval.string))
1794      {
# Line 2145 | Line 1803 | resv_channel: CHANNEL '=' QSTRING ';'
1803  
1804   resv_nick: NICK '=' QSTRING ';'
1805   {
1806 <  if (ypass == 2)
1806 >  if (conf_parser_ctx.pass == 2)
1807    {
1808      char def_reason[] = "No reason";
1809  
# Line 2154 | Line 1812 | resv_nick: NICK '=' QSTRING ';'
1812   };
1813  
1814   /***************************************************************************
1815 + *  section service
1816 + ***************************************************************************/
1817 + service_entry: T_SERVICE '{' service_items '}' ';';
1818 +
1819 + service_items:     service_items service_item | service_item;
1820 + service_item:      service_name | error;
1821 +
1822 + service_name: NAME '=' QSTRING ';'
1823 + {
1824 +  if (conf_parser_ctx.pass == 2)
1825 +  {
1826 +    if (valid_servname(yylval.string))
1827 +    {
1828 +      yy_conf = make_conf_item(SERVICE_TYPE);
1829 +      DupString(yy_conf->name, yylval.string);
1830 +    }
1831 +  }
1832 + };
1833 +
1834 + /***************************************************************************
1835   *  section shared, for sharing remote klines etc.
1836   ***************************************************************************/
1837   shared_entry: T_SHARED
1838   {
1839 <  if (ypass == 2)
1839 >  if (conf_parser_ctx.pass == 2)
1840    {
1841      yy_conf = make_conf_item(ULINE_TYPE);
1842      yy_match_item = map_to_conf(yy_conf);
# Line 2166 | Line 1844 | shared_entry: T_SHARED
1844    }
1845   } '{' shared_items '}' ';'
1846   {
1847 <  if (ypass == 2)
1847 >  if (conf_parser_ctx.pass == 2)
1848    {
1849      yy_conf = NULL;
1850    }
# Line 2177 | Line 1855 | shared_item:  shared_name | shared_user
1855  
1856   shared_name: NAME '=' QSTRING ';'
1857   {
1858 <  if (ypass == 2)
1858 >  if (conf_parser_ctx.pass == 2)
1859    {
1860      MyFree(yy_conf->name);
1861      DupString(yy_conf->name, yylval.string);
# Line 2186 | Line 1864 | shared_name: NAME '=' QSTRING ';'
1864  
1865   shared_user: USER '=' QSTRING ';'
1866   {
1867 <  if (ypass == 2)
1867 >  if (conf_parser_ctx.pass == 2)
1868    {
1869 <    split_nuh(yylval.string, NULL, &yy_match_item->user, &yy_match_item->host);
1869 >    struct split_nuh_item nuh;
1870 >
1871 >    nuh.nuhmask  = yylval.string;
1872 >    nuh.nickptr  = NULL;
1873 >    nuh.userptr  = userbuf;
1874 >    nuh.hostptr  = hostbuf;
1875 >
1876 >    nuh.nicksize = 0;
1877 >    nuh.usersize = sizeof(userbuf);
1878 >    nuh.hostsize = sizeof(hostbuf);
1879 >
1880 >    split_nuh(&nuh);
1881 >
1882 >    DupString(yy_match_item->user, userbuf);
1883 >    DupString(yy_match_item->host, hostbuf);
1884    }
1885   };
1886  
1887   shared_type: TYPE
1888   {
1889 <  if (ypass == 2)
1889 >  if (conf_parser_ctx.pass == 2)
1890      yy_match_item->action = 0;
1891   } '=' shared_types ';' ;
1892  
1893   shared_types: shared_types ',' shared_type_item | shared_type_item;
1894   shared_type_item: KLINE
1895   {
1896 <  if (ypass == 2)
1896 >  if (conf_parser_ctx.pass == 2)
1897      yy_match_item->action |= SHARED_KLINE;
1898   } | TKLINE
1899   {
1900 <  if (ypass == 2)
1900 >  if (conf_parser_ctx.pass == 2)
1901      yy_match_item->action |= SHARED_TKLINE;
1902   } | UNKLINE
1903   {
1904 <  if (ypass == 2)
1904 >  if (conf_parser_ctx.pass == 2)
1905      yy_match_item->action |= SHARED_UNKLINE;
1906   } | XLINE
1907   {
1908 <  if (ypass == 2)
1908 >  if (conf_parser_ctx.pass == 2)
1909      yy_match_item->action |= SHARED_XLINE;
1910   } | TXLINE
1911   {
1912 <  if (ypass == 2)
1912 >  if (conf_parser_ctx.pass == 2)
1913      yy_match_item->action |= SHARED_TXLINE;
1914   } | T_UNXLINE
1915   {
1916 <  if (ypass == 2)
1916 >  if (conf_parser_ctx.pass == 2)
1917      yy_match_item->action |= SHARED_UNXLINE;
1918   } | RESV
1919   {
1920 <  if (ypass == 2)
1920 >  if (conf_parser_ctx.pass == 2)
1921      yy_match_item->action |= SHARED_RESV;
1922   } | TRESV
1923   {
1924 <  if (ypass == 2)
1924 >  if (conf_parser_ctx.pass == 2)
1925      yy_match_item->action |= SHARED_TRESV;
1926   } | T_UNRESV
1927   {
1928 <  if (ypass == 2)
1928 >  if (conf_parser_ctx.pass == 2)
1929      yy_match_item->action |= SHARED_UNRESV;
1930   } | T_LOCOPS
1931   {
1932 <  if (ypass == 2)
1932 >  if (conf_parser_ctx.pass == 2)
1933      yy_match_item->action |= SHARED_LOCOPS;
1934   } | T_ALL
1935   {
1936 <  if (ypass == 2)
1936 >  if (conf_parser_ctx.pass == 2)
1937      yy_match_item->action = SHARED_ALL;
1938   };
1939  
# Line 2250 | Line 1942 | shared_type_item: KLINE
1942   ***************************************************************************/
1943   cluster_entry: T_CLUSTER
1944   {
1945 <  if (ypass == 2)
1945 >  if (conf_parser_ctx.pass == 2)
1946    {
1947      yy_conf = make_conf_item(CLUSTER_TYPE);
1948      yy_conf->flags = SHARED_ALL;
1949    }
1950   } '{' cluster_items '}' ';'
1951   {
1952 <  if (ypass == 2)
1952 >  if (conf_parser_ctx.pass == 2)
1953    {
1954      if (yy_conf->name == NULL)
1955        DupString(yy_conf->name, "*");
# Line 2270 | Line 1962 | cluster_item:  cluster_name | cluster_typ
1962  
1963   cluster_name: NAME '=' QSTRING ';'
1964   {
1965 <  if (ypass == 2)
1965 >  if (conf_parser_ctx.pass == 2)
1966      DupString(yy_conf->name, yylval.string);
1967   };
1968  
1969   cluster_type: TYPE
1970   {
1971 <  if (ypass == 2)
1971 >  if (conf_parser_ctx.pass == 2)
1972      yy_conf->flags = 0;
1973   } '=' cluster_types ';' ;
1974  
1975   cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1976   cluster_type_item: KLINE
1977   {
1978 <  if (ypass == 2)
1978 >  if (conf_parser_ctx.pass == 2)
1979      yy_conf->flags |= SHARED_KLINE;
1980   } | TKLINE
1981   {
1982 <  if (ypass == 2)
1982 >  if (conf_parser_ctx.pass == 2)
1983      yy_conf->flags |= SHARED_TKLINE;
1984   } | UNKLINE
1985   {
1986 <  if (ypass == 2)
1986 >  if (conf_parser_ctx.pass == 2)
1987      yy_conf->flags |= SHARED_UNKLINE;
1988   } | XLINE
1989   {
1990 <  if (ypass == 2)
1990 >  if (conf_parser_ctx.pass == 2)
1991      yy_conf->flags |= SHARED_XLINE;
1992   } | TXLINE
1993   {
1994 <  if (ypass == 2)
1994 >  if (conf_parser_ctx.pass == 2)
1995      yy_conf->flags |= SHARED_TXLINE;
1996   } | T_UNXLINE
1997   {
1998 <  if (ypass == 2)
1998 >  if (conf_parser_ctx.pass == 2)
1999      yy_conf->flags |= SHARED_UNXLINE;
2000   } | RESV
2001   {
2002 <  if (ypass == 2)
2002 >  if (conf_parser_ctx.pass == 2)
2003      yy_conf->flags |= SHARED_RESV;
2004   } | TRESV
2005   {
2006 <  if (ypass == 2)
2006 >  if (conf_parser_ctx.pass == 2)
2007      yy_conf->flags |= SHARED_TRESV;
2008   } | T_UNRESV
2009   {
2010 <  if (ypass == 2)
2010 >  if (conf_parser_ctx.pass == 2)
2011      yy_conf->flags |= SHARED_UNRESV;
2012   } | T_LOCOPS
2013   {
2014 <  if (ypass == 2)
2014 >  if (conf_parser_ctx.pass == 2)
2015      yy_conf->flags |= SHARED_LOCOPS;
2016   } | T_ALL
2017   {
2018 <  if (ypass == 2)
2018 >  if (conf_parser_ctx.pass == 2)
2019      yy_conf->flags = SHARED_ALL;
2020   };
2021  
# Line 2332 | Line 2024 | cluster_type_item: KLINE
2024   ***************************************************************************/
2025   connect_entry: CONNECT  
2026   {
2027 <  if (ypass == 2)
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;
2342
2343    if (ConfigFileEntry.burst_away)
2344      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 (ypass == 2)
2042 >  if (conf_parser_ctx.pass == 2)
2043    {
2044      struct CollectItem *yy_hconf=NULL;
2045      struct CollectItem *yy_lconf=NULL;
# Line 2365 | Line 2054 | connect_entry: CONNECT
2054            yy_aconf->passwd && yy_aconf->spasswd)
2055   #endif /* !HAVE_LIBCRYPTO */
2056          {
2057 <          if (conf_add_server(yy_conf, scount, class_name) >= 0)
2369 <          {
2370 <            ++scount;
2371 <          }
2372 <          else
2057 >          if (conf_add_server(yy_conf, class_name) == -1)
2058            {
2059              delete_conf_item(yy_conf);
2060              yy_conf = NULL;
# Line 2480 | Line 2165 | connect_entry: CONNECT
2165    }
2166   };
2167  
2483 connect_name_b: | connect_name_t;
2168   connect_items:  connect_items connect_item | connect_item;
2169   connect_item:   connect_name | connect_host | connect_vhost |
2170                  connect_send_password | connect_accept_password |
2171                  connect_aftype | connect_port |
2172 <                connect_fakename | connect_flags | connect_hub_mask |
2173 <                connect_leaf_mask | connect_class | connect_auto |
2490 <                connect_encrypted | connect_compressed | connect_cryptlink |
2172 >                connect_flags | connect_hub_mask | connect_leaf_mask |
2173 >                connect_class | connect_encrypted |
2174                  connect_rsa_public_key_file | connect_cipher_preference |
2175                  error ';' ;
2176  
2177   connect_name: NAME '=' QSTRING ';'
2178   {
2179 <  if (ypass == 2)
2497 <  {
2498 <    if (yy_conf->name != NULL)
2499 <      yyerror("Multiple connect name entry");
2500 <
2501 <    MyFree(yy_conf->name);
2502 <    DupString(yy_conf->name, yylval.string);
2503 <  }
2504 < };
2505 <
2506 < connect_name_t: QSTRING
2507 < {
2508 <  if (ypass == 2)
2179 >  if (conf_parser_ctx.pass == 2)
2180    {
2181      if (yy_conf->name != NULL)
2182        yyerror("Multiple connect name entry");
# Line 2517 | Line 2188 | connect_name_t: QSTRING
2188  
2189   connect_host: HOST '=' QSTRING ';'
2190   {
2191 <  if (ypass == 2)
2191 >  if (conf_parser_ctx.pass == 2)
2192    {
2193      MyFree(yy_aconf->host);
2194      DupString(yy_aconf->host, yylval.string);
# Line 2526 | Line 2197 | connect_host: HOST '=' QSTRING ';'
2197  
2198   connect_vhost: VHOST '=' QSTRING ';'
2199   {
2200 <  if (ypass == 2)
2200 >  if (conf_parser_ctx.pass == 2)
2201    {
2202      struct addrinfo hints, *res;
2203  
# Line 2536 | Line 2207 | connect_vhost: VHOST '=' QSTRING ';'
2207      hints.ai_socktype = SOCK_STREAM;
2208      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2209  
2210 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
2211 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2210 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
2211 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2212      else
2213      {
2214        assert(res != NULL);
# Line 2545 | Line 2216 | connect_vhost: VHOST '=' QSTRING ';'
2216        memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2217        yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2218        yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2219 <      irc_freeaddrinfo(res);
2219 >      freeaddrinfo(res);
2220      }
2221    }
2222   };
2223  
2224   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2225   {
2226 <  if (ypass == 2)
2226 >  if (conf_parser_ctx.pass == 2)
2227    {
2228      if ($3[0] == ':')
2229        yyerror("Server passwords cannot begin with a colon");
# Line 2570 | Line 2241 | connect_send_password: SEND_PASSWORD '='
2241  
2242   connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';'
2243   {
2244 <  if (ypass == 2)
2244 >  if (conf_parser_ctx.pass == 2)
2245    {
2246      if ($3[0] == ':')
2247        yyerror("Server passwords cannot begin with a colon");
# Line 2588 | Line 2259 | connect_accept_password: ACCEPT_PASSWORD
2259  
2260   connect_port: PORT '=' NUMBER ';'
2261   {
2262 <  if (ypass == 2)
2262 >  if (conf_parser_ctx.pass == 2)
2263      yy_aconf->port = $3;
2264   };
2265  
2266   connect_aftype: AFTYPE '=' T_IPV4 ';'
2267   {
2268 <  if (ypass == 2)
2268 >  if (conf_parser_ctx.pass == 2)
2269      yy_aconf->aftype = AF_INET;
2270   } | AFTYPE '=' T_IPV6 ';'
2271   {
2272   #ifdef IPV6
2273 <  if (ypass == 2)
2273 >  if (conf_parser_ctx.pass == 2)
2274      yy_aconf->aftype = AF_INET6;
2275   #endif
2276   };
2277  
2607 connect_fakename: FAKENAME '=' QSTRING ';'
2608 {
2609  if (ypass == 2)
2610  {
2611    MyFree(yy_aconf->fakename);
2612    DupString(yy_aconf->fakename, yylval.string);
2613  }
2614 };
2615
2278   connect_flags: IRCD_FLAGS
2279   {
2280   } '='  connect_flags_items ';';
2281  
2282   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2283 < connect_flags_item: NOT connect_flags_item_atom { not_atom = 1; }
2622 <                        | connect_flags_item_atom { not_atom = 0; };
2623 <
2624 < connect_flags_item_atom: LAZYLINK
2625 < {
2626 <  if (ypass == 2)
2627 <  {
2628 <    if (not_atom)ClearConfLazyLink(yy_aconf);
2629 <    else SetConfLazyLink(yy_aconf);
2630 <  }
2631 < } | COMPRESSED
2283 > connect_flags_item: COMPRESSED
2284   {
2285 <  if (ypass == 2)
2285 >  if (conf_parser_ctx.pass == 2)
2286   #ifndef HAVE_LIBZ
2287      yyerror("Ignoring flags = compressed; -- no zlib support");
2288   #else
2289   {
2290 <   if (not_atom)ClearConfCompressed(yy_aconf);
2639 <   else SetConfCompressed(yy_aconf);
2290 >   SetConfCompressed(yy_aconf);
2291   }
2292   #endif
2293   } | CRYPTLINK
2294   {
2295 <  if (ypass == 2)
2296 <  {
2646 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2647 <    else SetConfCryptLink(yy_aconf);
2648 <  }
2295 >  if (conf_parser_ctx.pass == 2)
2296 >    SetConfCryptLink(yy_aconf);
2297   } | AUTOCONN
2298   {
2299 <  if (ypass == 2)
2300 <  {
2653 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2654 <    else SetConfAllowAutoConn(yy_aconf);
2655 <  }
2299 >  if (conf_parser_ctx.pass == 2)
2300 >    SetConfAllowAutoConn(yy_aconf);
2301   } | BURST_AWAY
2302   {
2303 <  if (ypass == 2)
2304 <  {
2660 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2661 <    else SetConfAwayBurst(yy_aconf);
2662 <  }
2303 >  if (conf_parser_ctx.pass == 2)
2304 >    SetConfAwayBurst(yy_aconf);
2305   } | TOPICBURST
2306   {
2307 <  if (ypass == 2)
2308 <  {
2309 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2668 <    else SetConfTopicBurst(yy_aconf);
2669 <  }
2670 < }
2671 < ;
2307 >  if (conf_parser_ctx.pass == 2)
2308 >    SetConfTopicBurst(yy_aconf);
2309 > };
2310  
2311   connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2312   {
2313   #ifdef HAVE_LIBCRYPTO
2314 <  if (ypass == 2)
2314 >  if (conf_parser_ctx.pass == 2)
2315    {
2316      BIO *file;
2317  
# Line 2713 | Line 2351 | connect_rsa_public_key_file: RSA_PUBLIC_
2351  
2352   connect_encrypted: ENCRYPTED '=' TBOOL ';'
2353   {
2354 <  if (ypass == 2)
2354 >  if (conf_parser_ctx.pass == 2)
2355    {
2356      if (yylval.number)
2357        yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
# Line 2722 | Line 2360 | connect_encrypted: ENCRYPTED '=' TBOOL '
2360    }
2361   };
2362  
2725 connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2726 {
2727  if (ypass == 2)
2728  {
2729    if (yylval.number)
2730      yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
2731    else
2732      yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK;
2733  }
2734 };
2735
2736 connect_compressed: COMPRESSED '=' TBOOL ';'
2737 {
2738  if (ypass == 2)
2739  {
2740    if (yylval.number)
2741 #ifndef HAVE_LIBZ
2742      yyerror("Ignoring compressed=yes; -- no zlib support");
2743 #else
2744      yy_aconf->flags |= CONF_FLAGS_COMPRESSED;
2745 #endif
2746    else
2747      yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED;
2748  }
2749 };
2750
2751 connect_auto: AUTOCONN '=' TBOOL ';'
2752 {
2753  if (ypass == 2)
2754  {
2755    if (yylval.number)
2756      yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
2757    else
2758      yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
2759  }
2760 };
2761
2363   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2364   {
2365 <  if (ypass == 2)
2365 >  if (conf_parser_ctx.pass == 2)
2366    {
2367      struct CollectItem *yy_tmp;
2368  
# Line 2774 | Line 2375 | connect_hub_mask: HUB_MASK '=' QSTRING '
2375  
2376   connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2377   {
2378 <  if (ypass == 2)
2378 >  if (conf_parser_ctx.pass == 2)
2379    {
2380      struct CollectItem *yy_tmp;
2381  
# Line 2787 | Line 2388 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2388  
2389   connect_class: CLASS '=' QSTRING ';'
2390   {
2391 <  if (ypass == 2)
2391 >  if (conf_parser_ctx.pass == 2)
2392    {
2393      MyFree(class_name);
2394      DupString(class_name, yylval.string);
# Line 2797 | Line 2398 | connect_class: CLASS '=' QSTRING ';'
2398   connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2399   {
2400   #ifdef HAVE_LIBCRYPTO
2401 <  if (ypass == 2)
2401 >  if (conf_parser_ctx.pass == 2)
2402    {
2403      struct EncCapability *ecap;
2404      const char *cipher_name;
# Line 2821 | Line 2422 | connect_cipher_preference: CIPHER_PREFER
2422        yyerror("Invalid cipher");
2423    }
2424   #else
2425 <  if (ypass == 2)
2425 >  if (conf_parser_ctx.pass == 2)
2426      yyerror("Ignoring cipher_preference -- no OpenSSL support");
2427   #endif
2428   };
# Line 2831 | Line 2432 | connect_cipher_preference: CIPHER_PREFER
2432   ***************************************************************************/
2433   kill_entry: KILL
2434   {
2435 <  if (ypass == 2)
2435 >  if (conf_parser_ctx.pass == 2)
2436    {
2437      userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0';
2438      regex_ban = 0;
2439    }
2440   } '{' kill_items '}' ';'
2441   {
2442 <  if (ypass == 2)
2442 >  if (conf_parser_ctx.pass == 2)
2443    {
2444      if (userbuf[0] && hostbuf[0])
2445      {
2446        if (regex_ban)
2447        {
2448 <        pcre *exp_user = NULL;
2449 <        pcre *exp_host = NULL;
2448 > #ifdef HAVE_LIBPCRE
2449 >        void *exp_user = NULL;
2450 >        void *exp_host = NULL;
2451          const char *errptr = NULL;
2452  
2453          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2454              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2455          {
2456 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", errptr);
2456 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2457 >               errptr);
2458            break;
2459          }
2460  
2461 <        yy_conf = make_conf_item(RKLINE_TYPE);
2461 >        yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE));
2462          yy_aconf->regexuser = exp_user;
2463          yy_aconf->regexhost = exp_host;
2464  
# Line 2866 | Line 2469 | kill_entry: KILL
2469            DupString(yy_aconf->reason, reasonbuf);
2470          else
2471            DupString(yy_aconf->reason, "No reason");
2472 + #else
2473 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2474 +        break;
2475 + #endif
2476        }
2477        else
2478        {
2479 <        yy_conf = make_conf_item(KLINE_TYPE);
2873 <        yy_aconf = map_to_conf(yy_conf);
2479 >        yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2480  
2481          DupString(yy_aconf->user, userbuf);
2482          DupString(yy_aconf->host, hostbuf);
# Line 2882 | Line 2488 | kill_entry: KILL
2488          add_conf_by_address(CONF_KILL, yy_aconf);
2489        }
2490      }
2885    else
2886      delete_conf_item(yy_conf);
2491  
2888    yy_conf = NULL;
2492      yy_aconf = NULL;
2493    }
2494   };
# Line 2897 | Line 2500 | kill_type: TYPE
2500   kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2501   kill_type_item: REGEX_T
2502   {
2503 <  if (ypass == 2)
2503 >  if (conf_parser_ctx.pass == 2)
2504      regex_ban = 1;
2505   };
2506  
# Line 2906 | Line 2509 | kill_item:      kill_user | kill_reason
2509  
2510   kill_user: USER '=' QSTRING ';'
2511   {
2512 <  if (ypass == 2)
2512 >  if (conf_parser_ctx.pass == 2)
2513    {
2514 <    char *user = NULL, *host = NULL;
2514 >    struct split_nuh_item nuh;
2515  
2516 <    split_nuh(yylval.string, NULL, &user, &host);
2516 >    nuh.nuhmask  = yylval.string;
2517 >    nuh.nickptr  = NULL;
2518 >    nuh.userptr  = userbuf;
2519 >    nuh.hostptr  = hostbuf;
2520  
2521 <    strlcpy(userbuf, user, sizeof(userbuf));
2522 <    strlcpy(hostbuf, host, sizeof(hostbuf));
2521 >    nuh.nicksize = 0;
2522 >    nuh.usersize = sizeof(userbuf);
2523 >    nuh.hostsize = sizeof(hostbuf);
2524  
2525 <    MyFree(user);
2919 <    MyFree(host);
2525 >    split_nuh(&nuh);
2526    }
2527   };
2528  
2529   kill_reason: REASON '=' QSTRING ';'
2530   {
2531 <  if (ypass == 2)
2531 >  if (conf_parser_ctx.pass == 2)
2532      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2533   };
2534  
# Line 2931 | Line 2537 | kill_reason: REASON '=' QSTRING ';'
2537   ***************************************************************************/
2538   deny_entry: DENY
2539   {
2540 <  if (ypass == 2)
2541 <  {
2936 <    yy_conf = make_conf_item(DLINE_TYPE);
2937 <    yy_aconf = map_to_conf(yy_conf);
2938 <    /* default reason */
2939 <    DupString(yy_aconf->reason, "No reason");
2940 <  }
2540 >  if (conf_parser_ctx.pass == 2)
2541 >    hostbuf[0] = reasonbuf[0] = '\0';
2542   } '{' deny_items '}' ';'
2543   {
2544 <  if (ypass == 2)
2544 >  if (conf_parser_ctx.pass == 2)
2545    {
2546 <    if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
2546 >    if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
2547 >    {
2548 >      yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
2549 >      DupString(yy_aconf->host, hostbuf);
2550 >
2551 >      if (reasonbuf[0])
2552 >        DupString(yy_aconf->reason, reasonbuf);
2553 >      else
2554 >        DupString(yy_aconf->reason, "No reason");
2555        add_conf_by_address(CONF_DLINE, yy_aconf);
2556 <    else
2557 <      delete_conf_item(yy_conf);
2949 <    yy_conf = NULL;
2950 <    yy_aconf = NULL;
2556 >      yy_aconf = NULL;
2557 >    }
2558    }
2559   };
2560  
# Line 2956 | Line 2563 | deny_item:      deny_ip | deny_reason |
2563  
2564   deny_ip: IP '=' QSTRING ';'
2565   {
2566 <  if (ypass == 2)
2567 <  {
2961 <    MyFree(yy_aconf->host);
2962 <    DupString(yy_aconf->host, yylval.string);
2963 <  }
2566 >  if (conf_parser_ctx.pass == 2)
2567 >    strlcpy(hostbuf, yylval.string, sizeof(hostbuf));
2568   };
2569  
2570   deny_reason: REASON '=' QSTRING ';'
2571   {
2572 <  if (ypass == 2)
2573 <  {
2970 <    MyFree(yy_aconf->reason);
2971 <    DupString(yy_aconf->reason, yylval.string);
2972 <  }
2572 >  if (conf_parser_ctx.pass == 2)
2573 >    strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2574   };
2575  
2576   /***************************************************************************
# Line 2982 | Line 2583 | exempt_item:      exempt_ip | error;
2583  
2584   exempt_ip: IP '=' QSTRING ';'
2585   {
2586 <  if (ypass == 2)
2586 >  if (conf_parser_ctx.pass == 2)
2587    {
2588      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2589      {
2590 <      yy_conf = make_conf_item(EXEMPTDLINE_TYPE);
2990 <      yy_aconf = map_to_conf(yy_conf);
2590 >      yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE));
2591        DupString(yy_aconf->host, yylval.string);
2592  
2593        add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf);
2994
2995      yy_conf = NULL;
2594        yy_aconf = NULL;
2595      }
2596    }
# Line 3003 | Line 2601 | exempt_ip: IP '=' QSTRING ';'
2601   ***************************************************************************/
2602   gecos_entry: GECOS
2603   {
2604 <  if (ypass == 2)
2604 >  if (conf_parser_ctx.pass == 2)
2605    {
2606      regex_ban = 0;
2607      reasonbuf[0] = gecos_name[0] = '\0';
2608    }
2609   } '{' gecos_items '}' ';'
2610   {
2611 <  if (ypass == 2)
2611 >  if (conf_parser_ctx.pass == 2)
2612    {
2613      if (gecos_name[0])
2614      {
2615        if (regex_ban)
2616        {
2617 <        pcre *exp_p = NULL;
2617 > #ifdef HAVE_LIBPCRE
2618 >        void *exp_p = NULL;
2619          const char *errptr = NULL;
2620  
2621          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2622          {
2623 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", errptr);
2623 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2624 >               errptr);
2625            break;
2626          }
2627  
2628          yy_conf = make_conf_item(RXLINE_TYPE);
2629          yy_conf->regexpname = exp_p;
2630 + #else
2631 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2632 +        break;
2633 + #endif
2634        }
2635        else
2636          yy_conf = make_conf_item(XLINE_TYPE);
# Line 3049 | Line 2653 | gecos_flags: TYPE
2653   gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
2654   gecos_flags_item: REGEX_T
2655   {
2656 <  if (ypass == 2)
2656 >  if (conf_parser_ctx.pass == 2)
2657      regex_ban = 1;
2658   };
2659  
# Line 3058 | Line 2662 | gecos_item:  gecos_name | gecos_reason |
2662  
2663   gecos_name: NAME '=' QSTRING ';'
2664   {
2665 <  if (ypass == 2)
2665 >  if (conf_parser_ctx.pass == 2)
2666      strlcpy(gecos_name, yylval.string, sizeof(gecos_name));
2667   };
2668  
2669   gecos_reason: REASON '=' QSTRING ';'
2670   {
2671 <  if (ypass == 2)
2671 >  if (conf_parser_ctx.pass == 2)
2672      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2673   };
2674  
# Line 3088 | Line 2692 | general_item:       general_hide_spoof_i
2692                      general_pace_wait_simple | general_stats_P_oper_only |
2693                      general_short_motd | general_no_oper_flood |
2694                      general_true_no_oper_flood | general_oper_pass_resv |
2695 <                    general_idletime | general_message_locale |
2695 >                    general_message_locale |
2696                      general_oper_only_umodes | general_max_targets |
2697                      general_use_egd | general_egdpool_path |
2698                      general_oper_umodes | general_caller_id_wait |
# Line 3098 | Line 2702 | general_item:       general_hide_spoof_i
2702                      general_default_cipher_preference |
2703                      general_compression_level | general_client_flood |
2704                      general_throttle_time | general_havent_read_conf |
2705 <                    general_dot_in_ip6_addr | general_ping_cookie |
2706 <                    general_disable_auth | general_burst_away |
2705 >                    general_ping_cookie |
2706 >                    general_disable_auth |
2707                      general_tkline_expire_notices | general_gline_min_cidr |
2708                      general_gline_min_cidr6 | general_use_whois_actually |
2709 <                    general_reject_hold_time |
2709 >                    general_reject_hold_time | general_stats_e_disabled |
2710 >                    general_max_watch | general_services_name |
2711                      error;
2712  
2713  
2714 + general_max_watch: MAX_WATCH '=' NUMBER ';'
2715 + {
2716 +  ConfigFileEntry.max_watch = $3;
2717 + };
2718  
2719   general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2720   {
# Line 3117 | Line 2726 | general_gline_min_cidr6: GLINE_MIN_CIDR6
2726    ConfigFileEntry.gline_min_cidr6 = $3;
2727   };
2728  
3120 general_burst_away: BURST_AWAY '=' TBOOL ';'
3121 {
3122  ConfigFileEntry.burst_away = yylval.number;
3123 };
3124
2729   general_use_whois_actually: USE_WHOIS_ACTUALLY '=' TBOOL ';'
2730   {
2731    ConfigFileEntry.use_whois_actually = yylval.number;
# Line 3137 | Line 2741 | general_tkline_expire_notices: TKLINE_EX
2741    ConfigFileEntry.tkline_expire_notices = yylval.number;
2742   };
2743  
2744 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' NUMBER ';'
2744 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2745   {
2746    ConfigFileEntry.kill_chase_time_limit = $3;
2747   };
# Line 3194 | Line 2798 | general_ts_warn_delta: TS_WARN_DELTA '='
2798  
2799   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2800   {
2801 <  if (ypass == 2)
2801 >  if (conf_parser_ctx.pass == 2)
2802      ConfigFileEntry.ts_max_delta = $3;
2803   };
2804  
2805   general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2806   {
2807 <  if (($3 > 0) && ypass == 1)
2807 >  if (($3 > 0) && conf_parser_ctx.pass == 1)
2808    {
2809 <    ilog(L_CRIT, "You haven't read your config file properly.");
2810 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2811 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2809 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2810 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2811 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2812      exit(0);
2813    }
2814   };
# Line 3216 | Line 2820 | general_kline_with_reason: KLINE_WITH_RE
2820  
2821   general_kline_reason: KLINE_REASON '=' QSTRING ';'
2822   {
2823 <  if (ypass == 2)
2823 >  if (conf_parser_ctx.pass == 2)
2824    {
2825      MyFree(ConfigFileEntry.kline_reason);
2826      DupString(ConfigFileEntry.kline_reason, yylval.string);
# Line 3233 | Line 2837 | general_warn_no_nline: WARN_NO_NLINE '='
2837    ConfigFileEntry.warn_no_nline = yylval.number;
2838   };
2839  
2840 + general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2841 + {
2842 +  ConfigFileEntry.stats_e_disabled = yylval.number;
2843 + };
2844 +
2845   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2846   {
2847    ConfigFileEntry.stats_o_oper_only = yylval.number;
# Line 3301 | Line 2910 | general_oper_pass_resv: OPER_PASS_RESV '
2910  
2911   general_message_locale: MESSAGE_LOCALE '=' QSTRING ';'
2912   {
2913 <  if (ypass == 2)
2913 >  if (conf_parser_ctx.pass == 2)
2914    {
2915      if (strlen(yylval.string) > LOCALE_LENGTH-2)
2916        yylval.string[LOCALE_LENGTH-1] = '\0';
# Line 3310 | Line 2919 | general_message_locale: MESSAGE_LOCALE '
2919    }
2920   };
2921  
3313 general_idletime: IDLETIME '=' timespec ';'
3314 {
3315  ConfigFileEntry.idletime = $3;
3316 };
3317
2922   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2923   {
2924    ConfigFileEntry.dots_in_ident = $3;
# Line 3327 | Line 2931 | general_max_targets: MAX_TARGETS '=' NUM
2931  
2932   general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
2933   {
2934 <  if (ypass == 2)
2934 >  if (conf_parser_ctx.pass == 2)
2935    {
2936      MyFree(ConfigFileEntry.servlink_path);
2937      DupString(ConfigFileEntry.servlink_path, yylval.string);
# Line 3337 | Line 2941 | general_servlink_path: SERVLINK_PATH '='
2941   general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
2942   {
2943   #ifdef HAVE_LIBCRYPTO
2944 <  if (ypass == 2)
2944 >  if (conf_parser_ctx.pass == 2)
2945    {
2946      struct EncCapability *ecap;
2947      const char *cipher_name;
# Line 3361 | Line 2965 | general_default_cipher_preference: DEFAU
2965        yyerror("Invalid cipher");
2966    }
2967   #else
2968 <  if (ypass == 2)
2968 >  if (conf_parser_ctx.pass == 2)
2969      yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
2970   #endif
2971   };
2972  
2973   general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
2974   {
2975 <  if (ypass == 2)
2975 >  if (conf_parser_ctx.pass == 2)
2976    {
2977      ConfigFileEntry.compression_level = $3;
2978   #ifndef HAVE_LIBZ
# Line 3391 | Line 2995 | general_use_egd: USE_EGD '=' TBOOL ';'
2995  
2996   general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
2997   {
2998 <  if (ypass == 2)
2998 >  if (conf_parser_ctx.pass == 2)
2999    {
3000      MyFree(ConfigFileEntry.egdpool_path);
3001      DupString(ConfigFileEntry.egdpool_path, yylval.string);
3002    }
3003   };
3004  
3005 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
3006 + {
3007 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
3008 +  {
3009 +    MyFree(ConfigFileEntry.service_name);
3010 +    DupString(ConfigFileEntry.service_name, yylval.string);
3011 +  }
3012 + };
3013 +
3014   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
3015   {
3016    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3425 | Line 3038 | umode_oitem:     T_BOTS
3038   } | T_CCONN
3039   {
3040    ConfigFileEntry.oper_umodes |= UMODE_CCONN;
3041 + } | T_CCONN_FULL
3042 + {
3043 +  ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
3044   } | T_DEAF
3045   {
3046    ConfigFileEntry.oper_umodes |= UMODE_DEAF;
# Line 3487 | Line 3103 | umode_item:    T_BOTS
3103   } | T_CCONN
3104   {
3105    ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
3106 + } | T_CCONN_FULL
3107 + {
3108 +  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
3109   } | T_DEAF
3110   {
3111    ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
# Line 3557 | Line 3176 | general_client_flood: T_CLIENT_FLOOD '='
3176    ConfigFileEntry.client_flood = $3;
3177   };
3178  
3560 general_dot_in_ip6_addr: DOT_IN_IP6_ADDR '=' TBOOL ';'
3561 {
3562  ConfigFileEntry.dot_in_ip6_addr = yylval.number;
3563 };
3179  
3180   /***************************************************************************
3181   *  section glines
3182   ***************************************************************************/
3183   gline_entry: GLINES
3184   {
3185 <  if (ypass == 2)
3185 >  if (conf_parser_ctx.pass == 2)
3186    {
3187      yy_conf = make_conf_item(GDENY_TYPE);
3188      yy_aconf = map_to_conf(yy_conf);
3189    }
3190   } '{' gline_items '}' ';'
3191   {
3192 <  if (ypass == 2)
3192 >  if (conf_parser_ctx.pass == 2)
3193    {
3194      /*
3195       * since we re-allocate yy_conf/yy_aconf after the end of action=, at the
# Line 3600 | Line 3215 | gline_item:         gline_enable |
3215  
3216   gline_enable: ENABLE '=' TBOOL ';'
3217   {
3218 <  if (ypass == 2)
3218 >  if (conf_parser_ctx.pass == 2)
3219      ConfigFileEntry.glines = yylval.number;
3220   };
3221  
3222   gline_duration: DURATION '=' timespec ';'
3223   {
3224 <  if (ypass == 2)
3224 >  if (conf_parser_ctx.pass == 2)
3225      ConfigFileEntry.gline_time = $3;
3226   };
3227  
3228 < gline_logging: LOGGING
3228 > gline_logging: T_LOG
3229   {
3230 <  if (ypass == 2)
3230 >  if (conf_parser_ctx.pass == 2)
3231      ConfigFileEntry.gline_logging = 0;
3232   } '=' gline_logging_types ';';
3233   gline_logging_types:     gline_logging_types ',' gline_logging_type_item | gline_logging_type_item;
3234   gline_logging_type_item: T_REJECT
3235   {
3236 <  if (ypass == 2)
3236 >  if (conf_parser_ctx.pass == 2)
3237      ConfigFileEntry.gline_logging |= GDENY_REJECT;
3238   } | T_BLOCK
3239   {
3240 <  if (ypass == 2)
3240 >  if (conf_parser_ctx.pass == 2)
3241      ConfigFileEntry.gline_logging |= GDENY_BLOCK;
3242   };
3243  
3244   gline_user: USER '=' QSTRING ';'
3245   {
3246 <  if (ypass == 2)
3246 >  if (conf_parser_ctx.pass == 2)
3247    {
3248 <    struct CollectItem *yy_tmp = NULL;
3248 >    struct split_nuh_item nuh;
3249 >
3250 >    nuh.nuhmask  = yylval.string;
3251 >    nuh.nickptr  = NULL;
3252 >    nuh.userptr  = userbuf;
3253 >    nuh.hostptr  = hostbuf;
3254 >
3255 >    nuh.nicksize = 0;
3256 >    nuh.usersize = sizeof(userbuf);
3257 >    nuh.hostsize = sizeof(hostbuf);
3258 >
3259 >    split_nuh(&nuh);
3260  
3261      if (yy_aconf->user == NULL)
3262      {
3263 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
3263 >      DupString(yy_aconf->user, userbuf);
3264 >      DupString(yy_aconf->host, hostbuf);
3265      }
3266      else
3267      {
3268 <      yy_tmp = MyMalloc(sizeof(struct CollectItem));
3269 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
3268 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
3269 >
3270 >      DupString(yy_tmp->user, userbuf);
3271 >      DupString(yy_tmp->host, hostbuf);
3272 >
3273        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
3274      }
3275    }
# Line 3647 | Line 3277 | gline_user: USER '=' QSTRING ';'
3277  
3278   gline_server: NAME '=' QSTRING ';'
3279   {
3280 <  if (ypass == 2)  
3280 >  if (conf_parser_ctx.pass == 2)  
3281    {
3282      MyFree(yy_conf->name);
3283      DupString(yy_conf->name, yylval.string);
# Line 3656 | Line 3286 | gline_server: NAME '=' QSTRING ';'
3286  
3287   gline_action: ACTION
3288   {
3289 <  if (ypass == 2)
3289 >  if (conf_parser_ctx.pass == 2)
3290      yy_aconf->flags = 0;
3291   } '=' gdeny_types ';'
3292   {
3293 <  if (ypass == 2)
3293 >  if (conf_parser_ctx.pass == 2)
3294    {
3295      struct CollectItem *yy_tmp = NULL;
3296      dlink_node *ptr, *next_ptr;
# Line 3707 | Line 3337 | gline_action: ACTION
3337   gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item;
3338   gdeny_type_item: T_REJECT
3339   {
3340 <  if (ypass == 2)
3340 >  if (conf_parser_ctx.pass == 2)
3341      yy_aconf->flags |= GDENY_REJECT;
3342   } | T_BLOCK
3343   {
3344 <  if (ypass == 2)
3344 >  if (conf_parser_ctx.pass == 2)
3345      yy_aconf->flags |= GDENY_BLOCK;
3346   };
3347  
# Line 3725 | Line 3355 | channel_items:      channel_items channe
3355   channel_item:       channel_disable_local_channels | channel_use_except |
3356                      channel_use_invex | channel_use_knock |
3357                      channel_max_bans | channel_knock_delay |
3358 <                    channel_knock_delay_channel | channel_invite_ops_only |
3359 <                    channel_max_chans_per_user | channel_quiet_on_ban |
3360 <                    channel_default_split_user_count |
3361 <                    channel_default_split_server_count |
3362 <                    channel_no_create_on_split | channel_restrict_channels |
3363 <                    channel_no_join_on_split | channel_burst_topicwho |
3364 <                    channel_jflood_count | channel_jflood_time |
3365 <                    error;
3358 >                    channel_knock_delay_channel | channel_max_chans_per_user |
3359 >                    channel_quiet_on_ban | channel_default_split_user_count |
3360 >                    channel_default_split_server_count |
3361 >                    channel_no_create_on_split | channel_restrict_channels |
3362 >                    channel_no_join_on_split | channel_burst_topicwho |
3363 >                    channel_jflood_count | channel_jflood_time |
3364 >                    channel_disable_fake_channels | error;
3365 >
3366 > channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
3367 > {
3368 >  ConfigChannel.disable_fake_channels = yylval.number;
3369 > };
3370  
3371   channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';'
3372   {
# Line 3769 | Line 3403 | channel_knock_delay_channel: KNOCK_DELAY
3403    ConfigChannel.knock_delay_channel = $3;
3404   };
3405  
3772 channel_invite_ops_only: INVITE_OPS_ONLY '=' TBOOL ';'
3773 {
3774  ConfigChannel.invite_ops_only = yylval.number;
3775 };
3776
3406   channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';'
3407   {
3408    ConfigChannel.max_chans_per_user = $3;
# Line 3840 | Line 3469 | serverhide_item:    serverhide_flatten_l
3469  
3470   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
3471   {
3472 <  if (ypass == 2)
3472 >  if (conf_parser_ctx.pass == 2)
3473      ConfigServerHide.flatten_links = yylval.number;
3474   };
3475  
3476   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
3477   {
3478 <  if (ypass == 2)
3478 >  if (conf_parser_ctx.pass == 2)
3479      ConfigServerHide.hide_servers = yylval.number;
3480   };
3481  
3482   serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';'
3483   {
3484 <  if (ypass == 2)
3484 >  if (conf_parser_ctx.pass == 2)
3485    {
3486      MyFree(ConfigServerHide.hidden_name);
3487      DupString(ConfigServerHide.hidden_name, yylval.string);
# Line 3861 | Line 3490 | serverhide_hidden_name: HIDDEN_NAME '='
3490  
3491   serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3492   {
3493 <  if (ypass == 2)
3493 >  if (conf_parser_ctx.pass == 2)
3494    {
3495      if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3496      {
# Line 3875 | Line 3504 | serverhide_links_delay: LINKS_DELAY '='
3504  
3505   serverhide_hidden: HIDDEN '=' TBOOL ';'
3506   {
3507 <  if (ypass == 2)
3507 >  if (conf_parser_ctx.pass == 2)
3508      ConfigServerHide.hidden = yylval.number;
3509   };
3510  
3511   serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';'
3512   {
3513 <  if (ypass == 2)
3513 >  if (conf_parser_ctx.pass == 2)
3514      ConfigServerHide.disable_hidden = yylval.number;
3515   };
3516  
3517   serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';'
3518   {
3519 <  if (ypass == 2)
3519 >  if (conf_parser_ctx.pass == 2)
3520      ConfigServerHide.hide_server_ips = yylval.number;
3521   };

Diff Legend

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