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 440 by michael, Sat Feb 11 23:11:38 2006 UTC vs.
ircd-hybrid-8/src/ircd_parser.y (file contents), Revision 1250 by michael, Sat Oct 1 10:48:16 2011 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
# Line 298 | 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 315 | 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 330 | 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 340 | Line 328 | unhook_hub_leaf_confs(void)
328   %token  T_IPV4
329   %token  T_IPV6
330   %token  T_LOCOPS
343 %token  T_LOGPATH
344 %token  T_L_CRIT
345 %token  T_L_DEBUG
346 %token  T_L_ERROR
347 %token  T_L_INFO
348 %token  T_L_NOTICE
349 %token  T_L_TRACE
350 %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 380 | 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 403 | 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 464 | 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)
469 <  {
470 <    char *m_bn;
471 <
472 <    m_bn = basename(yylval.string);
473 <
474 <    /* I suppose we should just ignore it if it is already loaded(since
475 <     * otherwise we would flood the opers on rehash) -A1kmm.
476 <     */
477 <    add_conf_module(yylval.string);
478 <  }
479 < #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
485 <  if (ypass == 2)
463 >  if (conf_parser_ctx.pass == 2)
464      mod_add_path(yylval.string);
487 #endif
465   };
466  
490 /***************************************************************************
491 *  section serverinfo
492 ***************************************************************************/
493 serverinfo_entry: SERVERINFO
494  '{' 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 514 | 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 540 | 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 600 | 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)
609 <        DupString(ServerInfo.name, yylval.string);
618 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
619 >      exit(0);
620      }
621    }
622   };
# Line 614 | 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])
620 <        && IsAlNum(yylval.string[1]) && IsAlNum(yylval.string[2]))
621 <    {
629 >    if (valid_sid(yylval.string))
630        DupString(ServerInfo.sid, yylval.string);
623    }
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 631 | 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 640 | 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 654 | 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 663 | 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 673 | 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 682 | 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 692 | 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 702 | 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 711 | 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 721 | 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 744 | Line 751 | serverinfo_max_clients: T_MAX_CLIENTS '=
751  
752   serverinfo_hub: HUB '=' TBOOL ';'
753   {
754 <  if (ypass == 2)
755 <  {
749 <    if (yylval.number)
750 <    {
751 <      /* Don't become a hub if we have a lazylink active. */
752 <      if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
753 <      {
754 <        sendto_realops_flags(UMODE_ALL, L_ALL,
755 <                             "Ignoring config file line hub=yes; "
756 <                             "due to active LazyLink (%s)", uplink->name);
757 <      }
758 <      else
759 <      {
760 <        ServerInfo.hub = 1;
761 <        uplink = NULL;
762 <        delete_capability("HUB");
763 <        add_capability("HUB", CAP_HUB, 1);
764 <      }
765 <    }
766 <    else if (ServerInfo.hub)
767 <    {
768 <      dlink_node *ptr = NULL;
769 <
770 <      ServerInfo.hub = 0;
771 <      delete_capability("HUB");
772 <
773 <      /* Don't become a leaf if we have a lazylink active. */
774 <      DLINK_FOREACH(ptr, serv_list.head)
775 <      {
776 <        const struct Client *acptr = ptr->data;
777 <        if (MyConnect(acptr) && IsCapable(acptr, CAP_LL))
778 <        {
779 <          sendto_realops_flags(UMODE_ALL, L_ALL,
780 <                               "Ignoring config file line hub=no; "
781 <                               "due to active LazyLink (%s)",
782 <                               acptr->name);
783 <          add_capability("HUB", CAP_HUB, 1);
784 <          ServerInfo.hub = 1;
785 <          break;
786 <        }
787 <      }
788 <    }
789 <  }
754 >  if (conf_parser_ctx.pass == 2)
755 >    ServerInfo.hub = yylval.number;
756   };
757  
758   /***************************************************************************
# Line 800 | 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 809 | 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 818 | 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 828 | Line 794 | admin_description: DESCRIPTION '=' QSTRI
794   /***************************************************************************
795   *  section logging
796   ***************************************************************************/
797 < /* XXX */
798 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
797 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
798 > logging_items:          logging_items logging_item | logging_item ;
799  
800 < logging_items:          logging_items logging_item |
835 <                        logging_item ;
836 <
837 < logging_item:           logging_path | logging_oper_log |
838 <                        logging_log_level |
839 <                        logging_use_logging | logging_fuserlog |
840 <                        logging_foperlog | logging_fglinelog |
841 <                        logging_fklinelog | logging_killlog |
842 <                        logging_foperspylog | logging_ioerrlog |
843 <                        logging_ffailed_operlog |
800 > logging_item:           logging_use_logging | logging_timestamp | logging_file_entry |
801                          error ';' ;
802  
803 < logging_path:           T_LOGPATH '=' QSTRING ';'
847 <                        {
848 <                        };
849 <
850 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
851 <                        {
852 <                        };
853 <
854 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
803 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
804   {
805 <  if (ypass == 2)
806 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
858 <            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,
865 <            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 < };
874 <
875 < 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,
879 <            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 < {
884 <  if (ypass == 2)
885 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
886 <            sizeof(ConfigLoggingEntry.glinelog));
887 < };
826 > logging_file_items: logging_file_items logging_file_item |
827 >                    logging_file_item ;
828  
829 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
830 < {
891 <  if (ypass == 2)
892 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
893 <            sizeof(ConfigLoggingEntry.klinelog));
894 < };
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,
900 <            sizeof(ConfigLoggingEntry.ioerrlog));
901 < };
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)
906 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
907 <            sizeof(ConfigLoggingEntry.killlog));
842 >  lsize = 0;
843   };
844  
845 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
911 < {
912 <  if (ypass == 2)
913 <    set_log_level(L_CRIT);
914 < } | LOG_LEVEL '=' T_L_ERROR ';'
915 < {
916 <  if (ypass == 2)
917 <    set_log_level(L_ERROR);
918 < } | LOG_LEVEL '=' T_L_WARN ';'
919 < {
920 <  if (ypass == 2)
921 <    set_log_level(L_WARN);
922 < } | LOG_LEVEL '=' T_L_NOTICE ';'
923 < {
924 <  if (ypass == 2)
925 <    set_log_level(L_NOTICE);
926 < } | LOG_LEVEL '=' T_L_TRACE ';'
927 < {
928 <  if (ypass == 2)
929 <    set_log_level(L_TRACE);
930 < } | LOG_LEVEL '=' T_L_INFO ';'
931 < {
932 <  if (ypass == 2)
933 <    set_log_level(L_INFO);
934 < } | 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 961 | Line 898 | oper_entry: OPERATOR
898    }
899   } oper_name_b '{' 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 1042 | Line 979 | oper_entry: OPERATOR
979  
980   oper_name_b: | oper_name_t;
981   oper_items:     oper_items oper_item | oper_item;
982 < oper_item:      oper_name | oper_user | oper_password | oper_hidden_admin |
983 <                oper_hidden_oper | oper_umodes |
984 <                oper_class | oper_global_kill | oper_remote |
1048 <                oper_kline | oper_xline | oper_unkline |
1049 <                oper_gline | oper_nick_changes | oper_remoteban |
1050 <                oper_die | oper_rehash | oper_admin | oper_operwall |
1051 <                oper_encrypted | oper_rsa_public_key_file |
1052 <                oper_flags | error ';' ;
982 > oper_item:      oper_name | oper_user | oper_password |
983 >                oper_umodes | oper_class | oper_encrypted |
984 >                oper_rsa_public_key_file | oper_flags | error ';' ;
985  
986   oper_name: NAME '=' QSTRING ';'
987   {
988 <  if (ypass == 2)
988 >  if (conf_parser_ctx.pass == 2)
989    {
990      if (strlen(yylval.string) > OPERNICKLEN)
991        yylval.string[OPERNICKLEN] = '\0';
# Line 1065 | Line 997 | oper_name: NAME '=' QSTRING ';'
997  
998   oper_name_t: QSTRING
999   {
1000 <  if (ypass == 2)
1000 >  if (conf_parser_ctx.pass == 2)
1001    {
1002      if (strlen(yylval.string) > OPERNICKLEN)
1003        yylval.string[OPERNICKLEN] = '\0';
# Line 1077 | Line 1009 | oper_name_t: QSTRING
1009  
1010   oper_user: USER '=' QSTRING ';'
1011   {
1012 <  if (ypass == 2)
1012 >  if (conf_parser_ctx.pass == 2)
1013    {
1014 <    struct CollectItem *yy_tmp;
1014 >    struct split_nuh_item nuh;
1015 >
1016 >    nuh.nuhmask  = yylval.string;
1017 >    nuh.nickptr  = NULL;
1018 >    nuh.userptr  = userbuf;
1019 >    nuh.hostptr  = hostbuf;
1020 >
1021 >    nuh.nicksize = 0;
1022 >    nuh.usersize = sizeof(userbuf);
1023 >    nuh.hostsize = sizeof(hostbuf);
1024 >
1025 >    split_nuh(&nuh);
1026  
1027      if (yy_aconf->user == NULL)
1028      {
1029 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1029 >      DupString(yy_aconf->user, userbuf);
1030 >      DupString(yy_aconf->host, hostbuf);
1031      }
1032      else
1033      {
1034 <      yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
1035 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1034 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
1035 >
1036 >      DupString(yy_tmp->user, userbuf);
1037 >      DupString(yy_tmp->host, hostbuf);
1038 >
1039        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1040      }
1041    }
# Line 1096 | Line 1043 | oper_user: USER '=' QSTRING ';'
1043  
1044   oper_password: PASSWORD '=' QSTRING ';'
1045   {
1046 <  if (ypass == 2)
1046 >  if (conf_parser_ctx.pass == 2)
1047    {
1048      if (yy_aconf->passwd != NULL)
1049        memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
# Line 1108 | Line 1055 | oper_password: PASSWORD '=' QSTRING ';'
1055  
1056   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1057   {
1058 <  if (ypass == 2)
1058 >  if (conf_parser_ctx.pass == 2)
1059    {
1060      if (yylval.number)
1061        SetConfEncrypted(yy_aconf);
# Line 1120 | Line 1067 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1067   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1068   {
1069   #ifdef HAVE_LIBCRYPTO
1070 <  if (ypass == 2)
1070 >  if (conf_parser_ctx.pass == 2)
1071    {
1072      BIO *file;
1073  
# Line 1161 | Line 1108 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1108  
1109   oper_class: CLASS '=' QSTRING ';'
1110   {
1111 <  if (ypass == 2)
1111 >  if (conf_parser_ctx.pass == 2)
1112    {
1113      MyFree(class_name);
1114      DupString(class_name, yylval.string);
# Line 1170 | Line 1117 | oper_class: CLASS '=' QSTRING ';'
1117  
1118   oper_umodes: T_UMODES
1119   {
1120 <  if (ypass == 2)
1120 >  if (conf_parser_ctx.pass == 2)
1121      yy_aconf->modes = 0;
1122   } '='  oper_umodes_items ';' ;
1123  
1124   oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
1125   oper_umodes_item:  T_BOTS
1126   {
1127 <  if (ypass == 2)
1127 >  if (conf_parser_ctx.pass == 2)
1128      yy_aconf->modes |= UMODE_BOTS;
1129   } | T_CCONN
1130   {
1131 <  if (ypass == 2)
1131 >  if (conf_parser_ctx.pass == 2)
1132      yy_aconf->modes |= UMODE_CCONN;
1133 + } | T_CCONN_FULL
1134 + {
1135 +  if (conf_parser_ctx.pass == 2)
1136 +    yy_aconf->modes |= UMODE_CCONN_FULL;
1137   } | T_DEAF
1138   {
1139 <  if (ypass == 2)
1139 >  if (conf_parser_ctx.pass == 2)
1140      yy_aconf->modes |= UMODE_DEAF;
1141   } | T_DEBUG
1142   {
1143 <  if (ypass == 2)
1143 >  if (conf_parser_ctx.pass == 2)
1144      yy_aconf->modes |= UMODE_DEBUG;
1145   } | T_FULL
1146   {
1147 <  if (ypass == 2)
1147 >  if (conf_parser_ctx.pass == 2)
1148      yy_aconf->modes |= UMODE_FULL;
1149   } | T_SKILL
1150   {
1151 <  if (ypass == 2)
1151 >  if (conf_parser_ctx.pass == 2)
1152      yy_aconf->modes |= UMODE_SKILL;
1153   } | T_NCHANGE
1154   {
1155 <  if (ypass == 2)
1155 >  if (conf_parser_ctx.pass == 2)
1156      yy_aconf->modes |= UMODE_NCHANGE;
1157   } | T_REJ
1158   {
1159 <  if (ypass == 2)
1159 >  if (conf_parser_ctx.pass == 2)
1160      yy_aconf->modes |= UMODE_REJ;
1161   } | T_UNAUTH
1162   {
1163 <  if (ypass == 2)
1163 >  if (conf_parser_ctx.pass == 2)
1164      yy_aconf->modes |= UMODE_UNAUTH;
1165   } | T_SPY
1166   {
1167 <  if (ypass == 2)
1167 >  if (conf_parser_ctx.pass == 2)
1168      yy_aconf->modes |= UMODE_SPY;
1169   } | T_EXTERNAL
1170   {
1171 <  if (ypass == 2)
1171 >  if (conf_parser_ctx.pass == 2)
1172      yy_aconf->modes |= UMODE_EXTERNAL;
1173   } | T_OPERWALL
1174   {
1175 <  if (ypass == 2)
1175 >  if (conf_parser_ctx.pass == 2)
1176      yy_aconf->modes |= UMODE_OPERWALL;
1177   } | T_SERVNOTICE
1178   {
1179 <  if (ypass == 2)
1179 >  if (conf_parser_ctx.pass == 2)
1180      yy_aconf->modes |= UMODE_SERVNOTICE;
1181   } | T_INVISIBLE
1182   {
1183 <  if (ypass == 2)
1183 >  if (conf_parser_ctx.pass == 2)
1184      yy_aconf->modes |= UMODE_INVISIBLE;
1185   } | T_WALLOP
1186   {
1187 <  if (ypass == 2)
1187 >  if (conf_parser_ctx.pass == 2)
1188      yy_aconf->modes |= UMODE_WALLOP;
1189   } | T_SOFTCALLERID
1190   {
1191 <  if (ypass == 2)
1191 >  if (conf_parser_ctx.pass == 2)
1192      yy_aconf->modes |= UMODE_SOFTCALLERID;
1193   } | T_CALLERID
1194   {
1195 <  if (ypass == 2)
1195 >  if (conf_parser_ctx.pass == 2)
1196      yy_aconf->modes |= UMODE_CALLERID;
1197   } | T_LOCOPS
1198   {
1199 <  if (ypass == 2)
1199 >  if (conf_parser_ctx.pass == 2)
1200      yy_aconf->modes |= UMODE_LOCOPS;
1201   };
1202  
1252 oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1253 {
1254  if (ypass == 2)
1255  {
1256    if (yylval.number)
1257      yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1258    else
1259      yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1260  }
1261 };
1262
1263 oper_remote: REMOTE '=' TBOOL ';'
1264 {
1265  if (ypass == 2)
1266  {
1267    if (yylval.number)
1268      yy_aconf->port |= OPER_FLAG_REMOTE;
1269    else
1270      yy_aconf->port &= ~OPER_FLAG_REMOTE;
1271  }
1272 };
1273
1274 oper_remoteban: REMOTEBAN '=' TBOOL ';'
1275 {
1276  if (ypass == 2)
1277  {
1278    if (yylval.number)
1279      yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1280    else
1281      yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1282  }
1283 };
1284
1285 oper_kline: KLINE '=' TBOOL ';'
1286 {
1287  if (ypass == 2)
1288  {
1289    if (yylval.number)
1290      yy_aconf->port |= OPER_FLAG_K;
1291    else
1292      yy_aconf->port &= ~OPER_FLAG_K;
1293  }
1294 };
1295
1296 oper_xline: XLINE '=' TBOOL ';'
1297 {
1298  if (ypass == 2)
1299  {
1300    if (yylval.number)
1301      yy_aconf->port |= OPER_FLAG_X;
1302    else
1303      yy_aconf->port &= ~OPER_FLAG_X;
1304  }
1305 };
1306
1307 oper_unkline: UNKLINE '=' TBOOL ';'
1308 {
1309  if (ypass == 2)
1310  {
1311    if (yylval.number)
1312      yy_aconf->port |= OPER_FLAG_UNKLINE;
1313    else
1314      yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1315  }
1316 };
1317
1318 oper_gline: GLINE '=' TBOOL ';'
1319 {
1320  if (ypass == 2)
1321  {
1322    if (yylval.number)
1323      yy_aconf->port |= OPER_FLAG_GLINE;
1324    else
1325      yy_aconf->port &= ~OPER_FLAG_GLINE;
1326  }
1327 };
1328
1329 oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1330 {
1331  if (ypass == 2)
1332  {
1333    if (yylval.number)
1334      yy_aconf->port |= OPER_FLAG_N;
1335    else
1336      yy_aconf->port &= ~OPER_FLAG_N;
1337  }
1338 };
1339
1340 oper_die: DIE '=' TBOOL ';'
1341 {
1342  if (ypass == 2)
1343  {
1344    if (yylval.number)
1345      yy_aconf->port |= OPER_FLAG_DIE;
1346    else
1347      yy_aconf->port &= ~OPER_FLAG_DIE;
1348  }
1349 };
1350
1351 oper_rehash: REHASH '=' TBOOL ';'
1352 {
1353  if (ypass == 2)
1354  {
1355    if (yylval.number)
1356      yy_aconf->port |= OPER_FLAG_REHASH;
1357    else
1358      yy_aconf->port &= ~OPER_FLAG_REHASH;
1359  }
1360 };
1361
1362 oper_admin: ADMIN '=' TBOOL ';'
1363 {
1364  if (ypass == 2)
1365  {
1366    if (yylval.number)
1367      yy_aconf->port |= OPER_FLAG_ADMIN;
1368    else
1369      yy_aconf->port &= ~OPER_FLAG_ADMIN;
1370  }
1371 };
1372
1373 oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1374 {
1375  if (ypass == 2)
1376  {
1377    if (yylval.number)
1378      yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1379    else
1380      yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1381  }
1382 };
1383
1384 oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1385 {
1386  if (ypass == 2)
1387  {
1388    if (yylval.number)
1389      yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1390    else
1391      yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1392  }
1393 };
1394
1395 oper_operwall: T_OPERWALL '=' TBOOL ';'
1396 {
1397  if (ypass == 2)
1398  {
1399    if (yylval.number)
1400      yy_aconf->port |= OPER_FLAG_OPERWALL;
1401    else
1402      yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1403  }
1404 };
1405
1203   oper_flags: IRCD_FLAGS
1204   {
1205 +  if (conf_parser_ctx.pass == 2)
1206 +    yy_aconf->port = 0;
1207   } '='  oper_flags_items ';';
1208  
1209   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1210 < oper_flags_item: NOT { not_atom = 1; } oper_flags_item_atom
1412 <                | { not_atom = 0; } oper_flags_item_atom;
1413 <
1414 < oper_flags_item_atom: GLOBAL_KILL
1210 > oper_flags_item: GLOBAL_KILL
1211   {
1212 <  if (ypass == 2)
1213 <  {
1418 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1419 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1420 <  }
1212 >  if (conf_parser_ctx.pass == 2)
1213 >    yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1214   } | REMOTE
1215   {
1216 <  if (ypass == 2)
1217 <  {
1425 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1426 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1427 <  }
1216 >  if (conf_parser_ctx.pass == 2)
1217 >    yy_aconf->port |= OPER_FLAG_REMOTE;
1218   } | KLINE
1219   {
1220 <  if (ypass == 2)
1221 <  {
1432 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1433 <    else yy_aconf->port |= OPER_FLAG_K;
1434 <  }
1220 >  if (conf_parser_ctx.pass == 2)
1221 >    yy_aconf->port |= OPER_FLAG_K;
1222   } | UNKLINE
1223   {
1224 <  if (ypass == 2)
1225 <  {
1439 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1440 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1441 <  }
1224 >  if (conf_parser_ctx.pass == 2)
1225 >    yy_aconf->port |= OPER_FLAG_UNKLINE;
1226   } | XLINE
1227   {
1228 <  if (ypass == 2)
1229 <  {
1446 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1447 <    else yy_aconf->port |= OPER_FLAG_X;
1448 <  }
1228 >  if (conf_parser_ctx.pass == 2)
1229 >    yy_aconf->port |= OPER_FLAG_X;
1230   } | GLINE
1231   {
1232 <  if (ypass == 2)
1233 <  {
1453 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1454 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1455 <  }
1232 >  if (conf_parser_ctx.pass == 2)
1233 >    yy_aconf->port |= OPER_FLAG_GLINE;
1234   } | DIE
1235   {
1236 <  if (ypass == 2)
1237 <  {
1238 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1239 <    else yy_aconf->port |= OPER_FLAG_DIE;
1240 <  }
1236 >  if (conf_parser_ctx.pass == 2)
1237 >    yy_aconf->port |= OPER_FLAG_DIE;
1238 > } | T_RESTART
1239 > {
1240 >  if (conf_parser_ctx.pass == 2)
1241 >    yy_aconf->port |= OPER_FLAG_RESTART;
1242   } | REHASH
1243   {
1244 <  if (ypass == 2)
1245 <  {
1467 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1468 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1469 <  }
1244 >  if (conf_parser_ctx.pass == 2)
1245 >    yy_aconf->port |= OPER_FLAG_REHASH;
1246   } | ADMIN
1247   {
1248 <  if (ypass == 2)
1249 <  {
1474 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1475 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1476 <  }
1248 >  if (conf_parser_ctx.pass == 2)
1249 >    yy_aconf->port |= OPER_FLAG_ADMIN;
1250   } | HIDDEN_ADMIN
1251   {
1252 <  if (ypass == 2)
1253 <  {
1481 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1482 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1483 <  }
1252 >  if (conf_parser_ctx.pass == 2)
1253 >    yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1254   } | NICK_CHANGES
1255   {
1256 <  if (ypass == 2)
1257 <  {
1488 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1489 <    else yy_aconf->port |= OPER_FLAG_N;
1490 <  }
1256 >  if (conf_parser_ctx.pass == 2)
1257 >    yy_aconf->port |= OPER_FLAG_N;
1258   } | T_OPERWALL
1259   {
1260 <  if (ypass == 2)
1261 <  {
1262 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1263 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1264 <  }
1260 >  if (conf_parser_ctx.pass == 2)
1261 >    yy_aconf->port |= OPER_FLAG_OPERWALL;
1262 > } | T_GLOBOPS
1263 > {
1264 >  if (conf_parser_ctx.pass == 2)
1265 >    yy_aconf->port |= OPER_FLAG_GLOBOPS;
1266   } | OPER_SPY_T
1267   {
1268 <  if (ypass == 2)
1269 <  {
1502 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1503 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1504 <  }
1268 >  if (conf_parser_ctx.pass == 2)
1269 >    yy_aconf->port |= OPER_FLAG_OPER_SPY;
1270   } | HIDDEN_OPER
1271   {
1272 <  if (ypass == 2)
1273 <  {
1509 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1510 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1511 <  }
1272 >  if (conf_parser_ctx.pass == 2)
1273 >    yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1274   } | REMOTEBAN
1275   {
1276 <  if (ypass == 2)
1277 <  {
1278 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1517 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1518 <  }
1519 < } | ENCRYPTED
1276 >  if (conf_parser_ctx.pass == 2)
1277 >    yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1278 > } | MODULE
1279   {
1280 <  if (ypass == 2)
1281 <  {
1523 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1524 <    else SetConfEncrypted(yy_aconf);
1525 <  }
1280 >  if (conf_parser_ctx.pass == 2)
1281 >    yy_aconf->port |= OPER_FLAG_MODULE;
1282   };
1283  
1284  
# Line 1531 | Line 1287 | oper_flags_item_atom: GLOBAL_KILL
1287   ***************************************************************************/
1288   class_entry: CLASS
1289   {
1290 <  if (ypass == 1)
1290 >  if (conf_parser_ctx.pass == 1)
1291    {
1292      yy_conf = make_conf_item(CLASS_TYPE);
1293 <    yy_class = (struct ClassItem *)map_to_conf(yy_conf);
1293 >    yy_class = map_to_conf(yy_conf);
1294    }
1295   } class_name_b '{' class_items '}' ';'
1296   {
1297 <  if (ypass == 1)
1297 >  if (conf_parser_ctx.pass == 1)
1298    {
1299 <    struct ConfItem *cconf;
1299 >    struct ConfItem *cconf = NULL;
1300      struct ClassItem *class = NULL;
1301  
1302      if (yy_class_name == NULL)
1547    {
1303        delete_conf_item(yy_conf);
1549    }
1304      else
1305      {
1306        cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1307  
1308        if (cconf != NULL)                /* The class existed already */
1309        {
1310 +        int user_count = 0;
1311 +
1312          rebuild_cidr_class(cconf, yy_class);
1313 <        class = (struct ClassItem *) map_to_conf(cconf);
1314 <        *class = *yy_class;
1313 >
1314 >        class = map_to_conf(cconf);
1315 >
1316 >        user_count = class->curr_user_count;
1317 >        memcpy(class, yy_class, sizeof(*class));
1318 >        class->curr_user_count = user_count;
1319 >        class->active = 1;
1320 >
1321          delete_conf_item(yy_conf);
1322  
1323          MyFree(cconf->name);            /* Allows case change of class name */
# Line 1565 | Line 1327 | class_entry: CLASS
1327        {
1328          MyFree(yy_conf->name);          /* just in case it was allocated */
1329          yy_conf->name = yy_class_name;
1330 +        yy_class->active = 1;
1331        }
1332      }
1333 +
1334      yy_class_name = NULL;
1335    }
1336   };
# Line 1590 | Line 1354 | class_item:     class_name |
1354  
1355   class_name: NAME '=' QSTRING ';'
1356   {
1357 <  if (ypass == 1)
1357 >  if (conf_parser_ctx.pass == 1)
1358    {
1359      MyFree(yy_class_name);
1360      DupString(yy_class_name, yylval.string);
# Line 1599 | Line 1363 | class_name: NAME '=' QSTRING ';'
1363  
1364   class_name_t: QSTRING
1365   {
1366 <  if (ypass == 1)
1366 >  if (conf_parser_ctx.pass == 1)
1367    {
1368      MyFree(yy_class_name);
1369      DupString(yy_class_name, yylval.string);
# Line 1608 | Line 1372 | class_name_t: QSTRING
1372  
1373   class_ping_time: PING_TIME '=' timespec ';'
1374   {
1375 <  if (ypass == 1)
1375 >  if (conf_parser_ctx.pass == 1)
1376      PingFreq(yy_class) = $3;
1377   };
1378  
1379   class_ping_warning: PING_WARNING '=' timespec ';'
1380   {
1381 <  if (ypass == 1)
1381 >  if (conf_parser_ctx.pass == 1)
1382      PingWarning(yy_class) = $3;
1383   };
1384  
1385   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1386   {
1387 <  if (ypass == 1)
1387 >  if (conf_parser_ctx.pass == 1)
1388      MaxPerIp(yy_class) = $3;
1389   };
1390  
1391   class_connectfreq: CONNECTFREQ '=' timespec ';'
1392   {
1393 <  if (ypass == 1)
1393 >  if (conf_parser_ctx.pass == 1)
1394      ConFreq(yy_class) = $3;
1395   };
1396  
1397   class_max_number: MAX_NUMBER '=' NUMBER ';'
1398   {
1399 <  if (ypass == 1)
1399 >  if (conf_parser_ctx.pass == 1)
1400      MaxTotal(yy_class) = $3;
1401   };
1402  
1403   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1404   {
1405 <  if (ypass == 1)
1405 >  if (conf_parser_ctx.pass == 1)
1406      MaxGlobal(yy_class) = $3;
1407   };
1408  
1409   class_max_local: MAX_LOCAL '=' NUMBER ';'
1410   {
1411 <  if (ypass == 1)
1411 >  if (conf_parser_ctx.pass == 1)
1412      MaxLocal(yy_class) = $3;
1413   };
1414  
1415   class_max_ident: MAX_IDENT '=' NUMBER ';'
1416   {
1417 <  if (ypass == 1)
1417 >  if (conf_parser_ctx.pass == 1)
1418      MaxIdent(yy_class) = $3;
1419   };
1420  
1421   class_sendq: SENDQ '=' sizespec ';'
1422   {
1423 <  if (ypass == 1)
1423 >  if (conf_parser_ctx.pass == 1)
1424      MaxSendq(yy_class) = $3;
1425   };
1426  
1427   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1428   {
1429 <  if (ypass == 1)
1429 >  if (conf_parser_ctx.pass == 1)
1430      CidrBitlenIPV4(yy_class) = $3;
1431   };
1432  
1433   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1434   {
1435 <  if (ypass == 1)
1435 >  if (conf_parser_ctx.pass == 1)
1436      CidrBitlenIPV6(yy_class) = $3;
1437   };
1438  
1439   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1440   {
1441 <  if (ypass == 1)
1441 >  if (conf_parser_ctx.pass == 1)
1442      NumberPerCidr(yy_class) = $3;
1443   };
1444  
# Line 1683 | Line 1447 | class_number_per_cidr: NUMBER_PER_CIDR '
1447   ***************************************************************************/
1448   listen_entry: LISTEN
1449   {
1450 <  if (ypass == 2)
1450 >  if (conf_parser_ctx.pass == 2)
1451    {
1452      listener_address = NULL;
1453      listener_flags = 0;
1454    }
1455   } '{' listen_items '}' ';'
1456   {
1457 <  if (ypass == 2)
1457 >  if (conf_parser_ctx.pass == 2)
1458    {
1459      MyFree(listener_address);
1460      listener_address = NULL;
# Line 1705 | Line 1469 | listen_flags: IRCD_FLAGS
1469   listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item;
1470   listen_flags_item: T_SSL
1471   {
1472 <  if (ypass == 2)
1472 >  if (conf_parser_ctx.pass == 2)
1473      listener_flags |= LISTENER_SSL;
1474   } | HIDDEN
1475   {
1476 <  if (ypass == 2)
1476 >  if (conf_parser_ctx.pass == 2)
1477      listener_flags |= LISTENER_HIDDEN;
1478 + } | T_SERVER
1479 + {
1480 +  if (conf_parser_ctx.pass == 2)
1481 +    listener_flags |= LISTENER_SERVER;
1482   };
1483  
1484 +
1485 +
1486   listen_items:   listen_items listen_item | listen_item;
1487   listen_item:    listen_port | listen_flags | listen_address | listen_host | error ';';
1488  
# Line 1722 | Line 1492 | port_items: port_items ',' port_item | p
1492  
1493   port_item: NUMBER
1494   {
1495 <  if (ypass == 2)
1495 >  if (conf_parser_ctx.pass == 2)
1496    {
1497      if ((listener_flags & LISTENER_SSL))
1498   #ifdef HAVE_LIBCRYPTO
1499 <      if (!ServerInfo.ctx)
1499 >      if (!ServerInfo.server_ctx)
1500   #endif
1501        {
1502          yyerror("SSL not available - port closed");
# Line 1736 | Line 1506 | port_item: NUMBER
1506    }
1507   } | NUMBER TWODOTS NUMBER
1508   {
1509 <  if (ypass == 2)
1509 >  if (conf_parser_ctx.pass == 2)
1510    {
1511      int i;
1512  
1513      if ((listener_flags & LISTENER_SSL))
1514   #ifdef HAVE_LIBCRYPTO
1515 <      if (!ServerInfo.ctx)
1515 >      if (!ServerInfo.server_ctx)
1516   #endif
1517        {
1518          yyerror("SSL not available - port closed");
# Line 1756 | Line 1526 | port_item: NUMBER
1526  
1527   listen_address: IP '=' QSTRING ';'
1528   {
1529 <  if (ypass == 2)
1529 >  if (conf_parser_ctx.pass == 2)
1530    {
1531      MyFree(listener_address);
1532      DupString(listener_address, yylval.string);
# Line 1765 | Line 1535 | listen_address: IP '=' QSTRING ';'
1535  
1536   listen_host: HOST '=' QSTRING ';'
1537   {
1538 <  if (ypass == 2)
1538 >  if (conf_parser_ctx.pass == 2)
1539    {
1540      MyFree(listener_address);
1541      DupString(listener_address, yylval.string);
# Line 1777 | Line 1547 | listen_host: HOST '=' QSTRING ';'
1547   ***************************************************************************/
1548   auth_entry: IRCD_AUTH
1549   {
1550 <  if (ypass == 2)
1550 >  if (conf_parser_ctx.pass == 2)
1551    {
1552      yy_conf = make_conf_item(CLIENT_TYPE);
1553      yy_aconf = map_to_conf(yy_conf);
# Line 1789 | Line 1559 | auth_entry: IRCD_AUTH
1559    }
1560   } '{' auth_items '}' ';'
1561   {
1562 <  if (ypass == 2)
1562 >  if (conf_parser_ctx.pass == 2)
1563    {
1564      struct CollectItem *yy_tmp = NULL;
1565      dlink_node *ptr = NULL, *next_ptr = NULL;
# Line 1846 | Line 1616 | auth_entry: IRCD_AUTH
1616  
1617   auth_items:     auth_items auth_item | auth_item;
1618   auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1619 <                auth_kline_exempt | auth_need_ident |
1620 <                auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
1851 <                auth_spoof | auth_spoof_notice |
1852 <                auth_redir_serv | auth_redir_port | auth_can_flood |
1853 <                auth_need_password | auth_encrypted | error ';' ;
1619 >                auth_spoof | auth_redir_serv | auth_redir_port |
1620 >                auth_encrypted | error ';' ;
1621  
1622   auth_user: USER '=' QSTRING ';'
1623   {
1624 <  if (ypass == 2)
1624 >  if (conf_parser_ctx.pass == 2)
1625    {
1626 <    struct CollectItem *yy_tmp;
1626 >    struct CollectItem *yy_tmp = NULL;
1627 >    struct split_nuh_item nuh;
1628 >
1629 >    nuh.nuhmask  = yylval.string;
1630 >    nuh.nickptr  = NULL;
1631 >    nuh.userptr  = userbuf;
1632 >    nuh.hostptr  = hostbuf;
1633 >
1634 >    nuh.nicksize = 0;
1635 >    nuh.usersize = sizeof(userbuf);
1636 >    nuh.hostsize = sizeof(hostbuf);
1637 >
1638 >    split_nuh(&nuh);
1639  
1640      if (yy_aconf->user == NULL)
1641 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1641 >    {
1642 >      DupString(yy_aconf->user, userbuf);
1643 >      DupString(yy_aconf->host, hostbuf);
1644 >    }
1645      else
1646      {
1647        yy_tmp = MyMalloc(sizeof(struct CollectItem));
1648 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1648 >
1649 >      DupString(yy_tmp->user, userbuf);
1650 >      DupString(yy_tmp->host, hostbuf);
1651 >
1652        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1653      }
1654    }
# Line 1873 | Line 1658 | auth_user: USER '=' QSTRING ';'
1658  
1659   auth_passwd: PASSWORD '=' QSTRING ';'
1660   {
1661 <  if (ypass == 2)
1661 >  if (conf_parser_ctx.pass == 2)
1662    {
1663      /* be paranoid */
1664      if (yy_aconf->passwd != NULL)
# Line 1884 | Line 1669 | auth_passwd: PASSWORD '=' QSTRING ';'
1669    }
1670   };
1671  
1887 auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1888 {
1889  if (ypass == 2)
1890  {
1891    if (yylval.number)
1892      yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1893    else
1894      yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1895  }
1896 };
1897
1672   auth_class: CLASS '=' QSTRING ';'
1673   {
1674 <  if (ypass == 2)
1674 >  if (conf_parser_ctx.pass == 2)
1675    {
1676      MyFree(class_name);
1677      DupString(class_name, yylval.string);
# Line 1906 | Line 1680 | auth_class: CLASS '=' QSTRING ';'
1680  
1681   auth_encrypted: ENCRYPTED '=' TBOOL ';'
1682   {
1683 <  if (ypass == 2)
1683 >  if (conf_parser_ctx.pass == 2)
1684    {
1685      if (yylval.number)
1686        SetConfEncrypted(yy_aconf);
# Line 1920 | Line 1694 | auth_flags: IRCD_FLAGS
1694   } '='  auth_flags_items ';';
1695  
1696   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1697 < auth_flags_item: NOT { not_atom = 1; } auth_flags_item_atom
1924 <                | { not_atom = 0; } auth_flags_item_atom;
1925 <
1926 < auth_flags_item_atom: SPOOF_NOTICE
1697 > auth_flags_item: SPOOF_NOTICE
1698   {
1699 <  if (ypass == 2)
1700 <  {
1930 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1931 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1932 <  }
1933 <
1699 >  if (conf_parser_ctx.pass == 2)
1700 >    yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1701   } | EXCEED_LIMIT
1702   {
1703 <  if (ypass == 2)
1704 <  {
1938 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1939 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1940 <  }
1703 >  if (conf_parser_ctx.pass == 2)
1704 >    yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1705   } | KLINE_EXEMPT
1706   {
1707 <  if (ypass == 2)
1708 <  {
1945 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1946 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1947 <  }
1707 >  if (conf_parser_ctx.pass == 2)
1708 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1709   } | NEED_IDENT
1710   {
1711 <  if (ypass == 2)
1712 <  {
1952 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
1953 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1954 <  }
1711 >  if (conf_parser_ctx.pass == 2)
1712 >    yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1713   } | CAN_FLOOD
1714   {
1715 <  if (ypass == 2)
1716 <  {
1959 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
1960 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1961 <  }
1962 < } | CAN_IDLE
1963 < {
1964 <  if (ypass == 2)
1965 <  {
1966 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
1967 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
1968 <  }
1715 >  if (conf_parser_ctx.pass == 2)
1716 >    yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1717   } | NO_TILDE
1718   {
1719 <  if (ypass == 2)
1720 <  {
1973 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
1974 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1975 <  }
1719 >  if (conf_parser_ctx.pass == 2)
1720 >    yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1721   } | GLINE_EXEMPT
1722   {
1723 <  if (ypass == 2)
1724 <  {
1980 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
1981 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1982 <  }
1723 >  if (conf_parser_ctx.pass == 2)
1724 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1725   } | RESV_EXEMPT
1726   {
1727 <  if (ypass == 2)
1728 <  {
1987 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
1988 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1989 <  }
1727 >  if (conf_parser_ctx.pass == 2)
1728 >    yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1729   } | NEED_PASSWORD
1730   {
1731 <  if (ypass == 2)
1732 <  {
1994 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
1995 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1996 <  }
1997 < };
1998 <
1999 < auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
2000 < {
2001 <  if (ypass == 2)
2002 <  {
2003 <    if (yylval.number)
2004 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
2005 <    else
2006 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
2007 <  }
2008 < };
2009 <
2010 < auth_need_ident: NEED_IDENT '=' TBOOL ';'
2011 < {
2012 <  if (ypass == 2)
2013 <  {
2014 <    if (yylval.number)
2015 <      yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2016 <    else
2017 <      yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2018 <  }
2019 < };
2020 <
2021 < auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2022 < {
2023 <  if (ypass == 2)
2024 <  {
2025 <    if (yylval.number)
2026 <      yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
2027 <    else
2028 <      yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
2029 <  }
2030 < };
2031 <
2032 < auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2033 < {
2034 <  if (ypass == 2)
2035 <  {
2036 <    if (yylval.number)
2037 <      yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2038 <    else
2039 <      yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2040 <  }
2041 < };
2042 <
2043 < auth_no_tilde: NO_TILDE '=' TBOOL ';'
2044 < {
2045 <  if (ypass == 2)
2046 <  {
2047 <    if (yylval.number)
2048 <      yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2049 <    else
2050 <      yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2051 <  }
2052 < };
2053 <
2054 < auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2055 < {
2056 <  if (ypass == 2)
2057 <  {
2058 <    if (yylval.number)
2059 <      yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2060 <    else
2061 <      yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2062 <  }
1731 >  if (conf_parser_ctx.pass == 2)
1732 >    yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1733   };
1734  
1735   /* XXX - need check for illegal hostnames here */
1736   auth_spoof: SPOOF '=' QSTRING ';'
1737   {
1738 <  if (ypass == 2)
1738 >  if (conf_parser_ctx.pass == 2)
1739    {
1740      MyFree(yy_conf->name);
1741  
# Line 2076 | Line 1746 | auth_spoof: SPOOF '=' QSTRING ';'
1746      }
1747      else
1748      {
1749 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1749 >      ilog(LOG_TYPE_IRCD, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1750        yy_conf->name = NULL;
1751      }
1752    }
# Line 2084 | Line 1754 | auth_spoof: SPOOF '=' QSTRING ';'
1754  
1755   auth_redir_serv: REDIRSERV '=' QSTRING ';'
1756   {
1757 <  if (ypass == 2)
1757 >  if (conf_parser_ctx.pass == 2)
1758    {
1759      yy_aconf->flags |= CONF_FLAGS_REDIR;
1760      MyFree(yy_conf->name);
# Line 2094 | Line 1764 | auth_redir_serv: REDIRSERV '=' QSTRING '
1764  
1765   auth_redir_port: REDIRPORT '=' NUMBER ';'
1766   {
1767 <  if (ypass == 2)
1767 >  if (conf_parser_ctx.pass == 2)
1768    {
1769      yy_aconf->flags |= CONF_FLAGS_REDIR;
1770      yy_aconf->port = $3;
1771    }
1772   };
1773  
2104 auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2105 {
2106  if (ypass == 2)
2107  {
2108    if (yylval.number)
2109      yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
2110    else
2111      yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2112  }
2113 };
2114
1774  
1775   /***************************************************************************
1776   *  section resv
1777   ***************************************************************************/
1778   resv_entry: RESV
1779   {
1780 <  if (ypass == 2)
1780 >  if (conf_parser_ctx.pass == 2)
1781    {
1782      MyFree(resv_reason);
1783      resv_reason = NULL;
1784    }
1785   } '{' resv_items '}' ';'
1786   {
1787 <  if (ypass == 2)
1787 >  if (conf_parser_ctx.pass == 2)
1788    {
1789      MyFree(resv_reason);
1790      resv_reason = NULL;
# Line 2137 | Line 1796 | resv_item:     resv_creason | resv_channel |
1796  
1797   resv_creason: REASON '=' QSTRING ';'
1798   {
1799 <  if (ypass == 2)
1799 >  if (conf_parser_ctx.pass == 2)
1800    {
1801      MyFree(resv_reason);
1802      DupString(resv_reason, yylval.string);
# Line 2146 | Line 1805 | resv_creason: REASON '=' QSTRING ';'
1805  
1806   resv_channel: CHANNEL '=' QSTRING ';'
1807   {
1808 <  if (ypass == 2)
1808 >  if (conf_parser_ctx.pass == 2)
1809    {
1810      if (IsChanPrefix(*yylval.string))
1811      {
# Line 2161 | Line 1820 | resv_channel: CHANNEL '=' QSTRING ';'
1820  
1821   resv_nick: NICK '=' QSTRING ';'
1822   {
1823 <  if (ypass == 2)
1823 >  if (conf_parser_ctx.pass == 2)
1824    {
1825      char def_reason[] = "No reason";
1826  
# Line 2170 | Line 1829 | resv_nick: NICK '=' QSTRING ';'
1829   };
1830  
1831   /***************************************************************************
1832 + *  section service
1833 + ***************************************************************************/
1834 + service_entry: T_SERVICE '{' service_items '}' ';';
1835 +
1836 + service_items:     service_items service_item | service_item;
1837 + service_item:      service_name | error;
1838 +
1839 + service_name: NAME '=' QSTRING ';'
1840 + {
1841 +  if (conf_parser_ctx.pass == 2)
1842 +  {
1843 +    if (valid_servname(yylval.string))
1844 +    {
1845 +      yy_conf = make_conf_item(SERVICE_TYPE);
1846 +      DupString(yy_conf->name, yylval.string);
1847 +    }
1848 +  }
1849 + };
1850 +
1851 + /***************************************************************************
1852   *  section shared, for sharing remote klines etc.
1853   ***************************************************************************/
1854   shared_entry: T_SHARED
1855   {
1856 <  if (ypass == 2)
1856 >  if (conf_parser_ctx.pass == 2)
1857    {
1858      yy_conf = make_conf_item(ULINE_TYPE);
1859      yy_match_item = map_to_conf(yy_conf);
# Line 2182 | Line 1861 | shared_entry: T_SHARED
1861    }
1862   } '{' shared_items '}' ';'
1863   {
1864 <  if (ypass == 2)
1864 >  if (conf_parser_ctx.pass == 2)
1865    {
1866      yy_conf = NULL;
1867    }
# Line 2193 | Line 1872 | shared_item:  shared_name | shared_user
1872  
1873   shared_name: NAME '=' QSTRING ';'
1874   {
1875 <  if (ypass == 2)
1875 >  if (conf_parser_ctx.pass == 2)
1876    {
1877      MyFree(yy_conf->name);
1878      DupString(yy_conf->name, yylval.string);
# Line 2202 | Line 1881 | shared_name: NAME '=' QSTRING ';'
1881  
1882   shared_user: USER '=' QSTRING ';'
1883   {
1884 <  if (ypass == 2)
1884 >  if (conf_parser_ctx.pass == 2)
1885    {
1886 <    split_nuh(yylval.string, NULL, &yy_match_item->user, &yy_match_item->host);
1886 >    struct split_nuh_item nuh;
1887 >
1888 >    nuh.nuhmask  = yylval.string;
1889 >    nuh.nickptr  = NULL;
1890 >    nuh.userptr  = userbuf;
1891 >    nuh.hostptr  = hostbuf;
1892 >
1893 >    nuh.nicksize = 0;
1894 >    nuh.usersize = sizeof(userbuf);
1895 >    nuh.hostsize = sizeof(hostbuf);
1896 >
1897 >    split_nuh(&nuh);
1898 >
1899 >    DupString(yy_match_item->user, userbuf);
1900 >    DupString(yy_match_item->host, hostbuf);
1901    }
1902   };
1903  
1904   shared_type: TYPE
1905   {
1906 <  if (ypass == 2)
1906 >  if (conf_parser_ctx.pass == 2)
1907      yy_match_item->action = 0;
1908   } '=' shared_types ';' ;
1909  
1910   shared_types: shared_types ',' shared_type_item | shared_type_item;
1911   shared_type_item: KLINE
1912   {
1913 <  if (ypass == 2)
1913 >  if (conf_parser_ctx.pass == 2)
1914      yy_match_item->action |= SHARED_KLINE;
1915   } | TKLINE
1916   {
1917 <  if (ypass == 2)
1917 >  if (conf_parser_ctx.pass == 2)
1918      yy_match_item->action |= SHARED_TKLINE;
1919   } | UNKLINE
1920   {
1921 <  if (ypass == 2)
1921 >  if (conf_parser_ctx.pass == 2)
1922      yy_match_item->action |= SHARED_UNKLINE;
1923   } | XLINE
1924   {
1925 <  if (ypass == 2)
1925 >  if (conf_parser_ctx.pass == 2)
1926      yy_match_item->action |= SHARED_XLINE;
1927   } | TXLINE
1928   {
1929 <  if (ypass == 2)
1929 >  if (conf_parser_ctx.pass == 2)
1930      yy_match_item->action |= SHARED_TXLINE;
1931   } | T_UNXLINE
1932   {
1933 <  if (ypass == 2)
1933 >  if (conf_parser_ctx.pass == 2)
1934      yy_match_item->action |= SHARED_UNXLINE;
1935   } | RESV
1936   {
1937 <  if (ypass == 2)
1937 >  if (conf_parser_ctx.pass == 2)
1938      yy_match_item->action |= SHARED_RESV;
1939   } | TRESV
1940   {
1941 <  if (ypass == 2)
1941 >  if (conf_parser_ctx.pass == 2)
1942      yy_match_item->action |= SHARED_TRESV;
1943   } | T_UNRESV
1944   {
1945 <  if (ypass == 2)
1945 >  if (conf_parser_ctx.pass == 2)
1946      yy_match_item->action |= SHARED_UNRESV;
1947   } | T_LOCOPS
1948   {
1949 <  if (ypass == 2)
1949 >  if (conf_parser_ctx.pass == 2)
1950      yy_match_item->action |= SHARED_LOCOPS;
1951   } | T_ALL
1952   {
1953 <  if (ypass == 2)
1953 >  if (conf_parser_ctx.pass == 2)
1954      yy_match_item->action = SHARED_ALL;
1955   };
1956  
# Line 2266 | Line 1959 | shared_type_item: KLINE
1959   ***************************************************************************/
1960   cluster_entry: T_CLUSTER
1961   {
1962 <  if (ypass == 2)
1962 >  if (conf_parser_ctx.pass == 2)
1963    {
1964      yy_conf = make_conf_item(CLUSTER_TYPE);
1965      yy_conf->flags = SHARED_ALL;
1966    }
1967   } '{' cluster_items '}' ';'
1968   {
1969 <  if (ypass == 2)
1969 >  if (conf_parser_ctx.pass == 2)
1970    {
1971      if (yy_conf->name == NULL)
1972        DupString(yy_conf->name, "*");
# Line 2286 | Line 1979 | cluster_item:  cluster_name | cluster_typ
1979  
1980   cluster_name: NAME '=' QSTRING ';'
1981   {
1982 <  if (ypass == 2)
1982 >  if (conf_parser_ctx.pass == 2)
1983      DupString(yy_conf->name, yylval.string);
1984   };
1985  
1986   cluster_type: TYPE
1987   {
1988 <  if (ypass == 2)
1988 >  if (conf_parser_ctx.pass == 2)
1989      yy_conf->flags = 0;
1990   } '=' cluster_types ';' ;
1991  
1992   cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1993   cluster_type_item: KLINE
1994   {
1995 <  if (ypass == 2)
1995 >  if (conf_parser_ctx.pass == 2)
1996      yy_conf->flags |= SHARED_KLINE;
1997   } | TKLINE
1998   {
1999 <  if (ypass == 2)
1999 >  if (conf_parser_ctx.pass == 2)
2000      yy_conf->flags |= SHARED_TKLINE;
2001   } | UNKLINE
2002   {
2003 <  if (ypass == 2)
2003 >  if (conf_parser_ctx.pass == 2)
2004      yy_conf->flags |= SHARED_UNKLINE;
2005   } | XLINE
2006   {
2007 <  if (ypass == 2)
2007 >  if (conf_parser_ctx.pass == 2)
2008      yy_conf->flags |= SHARED_XLINE;
2009   } | TXLINE
2010   {
2011 <  if (ypass == 2)
2011 >  if (conf_parser_ctx.pass == 2)
2012      yy_conf->flags |= SHARED_TXLINE;
2013   } | T_UNXLINE
2014   {
2015 <  if (ypass == 2)
2015 >  if (conf_parser_ctx.pass == 2)
2016      yy_conf->flags |= SHARED_UNXLINE;
2017   } | RESV
2018   {
2019 <  if (ypass == 2)
2019 >  if (conf_parser_ctx.pass == 2)
2020      yy_conf->flags |= SHARED_RESV;
2021   } | TRESV
2022   {
2023 <  if (ypass == 2)
2023 >  if (conf_parser_ctx.pass == 2)
2024      yy_conf->flags |= SHARED_TRESV;
2025   } | T_UNRESV
2026   {
2027 <  if (ypass == 2)
2027 >  if (conf_parser_ctx.pass == 2)
2028      yy_conf->flags |= SHARED_UNRESV;
2029   } | T_LOCOPS
2030   {
2031 <  if (ypass == 2)
2031 >  if (conf_parser_ctx.pass == 2)
2032      yy_conf->flags |= SHARED_LOCOPS;
2033   } | T_ALL
2034   {
2035 <  if (ypass == 2)
2035 >  if (conf_parser_ctx.pass == 2)
2036      yy_conf->flags = SHARED_ALL;
2037   };
2038  
# Line 2348 | Line 2041 | cluster_type_item: KLINE
2041   ***************************************************************************/
2042   connect_entry: CONNECT  
2043   {
2044 <  if (ypass == 2)
2044 >  if (conf_parser_ctx.pass == 2)
2045    {
2046      yy_conf = make_conf_item(SERVER_TYPE);
2047      yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
# Line 2366 | Line 2059 | connect_entry: CONNECT
2059    }
2060   } connect_name_b '{' connect_items '}' ';'
2061   {
2062 <  if (ypass == 2)
2062 >  if (conf_parser_ctx.pass == 2)
2063    {
2064      struct CollectItem *yy_hconf=NULL;
2065      struct CollectItem *yy_lconf=NULL;
# Line 2381 | Line 2074 | connect_entry: CONNECT
2074            yy_aconf->passwd && yy_aconf->spasswd)
2075   #endif /* !HAVE_LIBCRYPTO */
2076          {
2077 <          if (conf_add_server(yy_conf, scount, class_name) >= 0)
2385 <          {
2386 <            ++scount;
2387 <          }
2388 <          else
2077 >          if (conf_add_server(yy_conf, class_name) == -1)
2078            {
2079              delete_conf_item(yy_conf);
2080              yy_conf = NULL;
# Line 2501 | Line 2190 | connect_items:  connect_items connect_it
2190   connect_item:   connect_name | connect_host | connect_vhost |
2191                  connect_send_password | connect_accept_password |
2192                  connect_aftype | connect_port |
2193 <                connect_fakename | connect_flags | connect_hub_mask |
2194 <                connect_leaf_mask | connect_class | connect_auto |
2506 <                connect_encrypted | connect_compressed | connect_cryptlink |
2193 >                connect_flags | connect_hub_mask | connect_leaf_mask |
2194 >                connect_class | connect_encrypted |
2195                  connect_rsa_public_key_file | connect_cipher_preference |
2196 <                connect_topicburst | error ';' ;
2196 >                error ';' ;
2197  
2198   connect_name: NAME '=' QSTRING ';'
2199   {
2200 <  if (ypass == 2)
2200 >  if (conf_parser_ctx.pass == 2)
2201    {
2202      if (yy_conf->name != NULL)
2203        yyerror("Multiple connect name entry");
# Line 2521 | Line 2209 | connect_name: NAME '=' QSTRING ';'
2209  
2210   connect_name_t: QSTRING
2211   {
2212 <  if (ypass == 2)
2212 >  if (conf_parser_ctx.pass == 2)
2213    {
2214      if (yy_conf->name != NULL)
2215        yyerror("Multiple connect name entry");
# Line 2533 | Line 2221 | connect_name_t: QSTRING
2221  
2222   connect_host: HOST '=' QSTRING ';'
2223   {
2224 <  if (ypass == 2)
2224 >  if (conf_parser_ctx.pass == 2)
2225    {
2226      MyFree(yy_aconf->host);
2227      DupString(yy_aconf->host, yylval.string);
# Line 2542 | Line 2230 | connect_host: HOST '=' QSTRING ';'
2230  
2231   connect_vhost: VHOST '=' QSTRING ';'
2232   {
2233 <  if (ypass == 2)
2233 >  if (conf_parser_ctx.pass == 2)
2234    {
2235      struct addrinfo hints, *res;
2236  
# Line 2552 | Line 2240 | connect_vhost: VHOST '=' QSTRING ';'
2240      hints.ai_socktype = SOCK_STREAM;
2241      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2242  
2243 <    if (irc_getaddrinfo(yylval.string, NULL, &hints, &res))
2244 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2243 >    if (getaddrinfo(yylval.string, NULL, &hints, &res))
2244 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2245      else
2246      {
2247        assert(res != NULL);
# Line 2561 | Line 2249 | connect_vhost: VHOST '=' QSTRING ';'
2249        memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2250        yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2251        yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2252 <      irc_freeaddrinfo(res);
2252 >      freeaddrinfo(res);
2253      }
2254    }
2255   };
2256  
2257   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2258   {
2259 <  if (ypass == 2)
2259 >  if (conf_parser_ctx.pass == 2)
2260    {
2261      if ($3[0] == ':')
2262        yyerror("Server passwords cannot begin with a colon");
# Line 2586 | Line 2274 | connect_send_password: SEND_PASSWORD '='
2274  
2275   connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';'
2276   {
2277 <  if (ypass == 2)
2277 >  if (conf_parser_ctx.pass == 2)
2278    {
2279      if ($3[0] == ':')
2280        yyerror("Server passwords cannot begin with a colon");
# Line 2604 | Line 2292 | connect_accept_password: ACCEPT_PASSWORD
2292  
2293   connect_port: PORT '=' NUMBER ';'
2294   {
2295 <  if (ypass == 2)
2295 >  if (conf_parser_ctx.pass == 2)
2296      yy_aconf->port = $3;
2297   };
2298  
2299   connect_aftype: AFTYPE '=' T_IPV4 ';'
2300   {
2301 <  if (ypass == 2)
2301 >  if (conf_parser_ctx.pass == 2)
2302      yy_aconf->aftype = AF_INET;
2303   } | AFTYPE '=' T_IPV6 ';'
2304   {
2305   #ifdef IPV6
2306 <  if (ypass == 2)
2306 >  if (conf_parser_ctx.pass == 2)
2307      yy_aconf->aftype = AF_INET6;
2308   #endif
2309   };
2310  
2623 connect_fakename: FAKENAME '=' QSTRING ';'
2624 {
2625  if (ypass == 2)
2626  {
2627    MyFree(yy_aconf->fakename);
2628    DupString(yy_aconf->fakename, yylval.string);
2629  }
2630 };
2631
2311   connect_flags: IRCD_FLAGS
2312   {
2313   } '='  connect_flags_items ';';
2314  
2315   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2316 < connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2638 <                        |  { not_atom = 0; } connect_flags_item_atom;
2639 <
2640 < connect_flags_item_atom: LAZYLINK
2641 < {
2642 <  if (ypass == 2)
2643 <  {
2644 <    if (not_atom)ClearConfLazyLink(yy_aconf);
2645 <    else SetConfLazyLink(yy_aconf);
2646 <  }
2647 < } | COMPRESSED
2316 > connect_flags_item: COMPRESSED
2317   {
2318 <  if (ypass == 2)
2318 >  if (conf_parser_ctx.pass == 2)
2319   #ifndef HAVE_LIBZ
2320      yyerror("Ignoring flags = compressed; -- no zlib support");
2321   #else
2322   {
2323 <   if (not_atom)ClearConfCompressed(yy_aconf);
2655 <   else SetConfCompressed(yy_aconf);
2323 >   SetConfCompressed(yy_aconf);
2324   }
2325   #endif
2326   } | CRYPTLINK
2327   {
2328 <  if (ypass == 2)
2329 <  {
2662 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2663 <    else SetConfCryptLink(yy_aconf);
2664 <  }
2328 >  if (conf_parser_ctx.pass == 2)
2329 >    SetConfCryptLink(yy_aconf);
2330   } | AUTOCONN
2331   {
2332 <  if (ypass == 2)
2333 <  {
2669 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2670 <    else SetConfAllowAutoConn(yy_aconf);
2671 <  }
2332 >  if (conf_parser_ctx.pass == 2)
2333 >    SetConfAllowAutoConn(yy_aconf);
2334   } | BURST_AWAY
2335   {
2336 <  if (ypass == 2)
2337 <  {
2676 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2677 <    else SetConfAwayBurst(yy_aconf);
2678 <  }
2336 >  if (conf_parser_ctx.pass == 2)
2337 >    SetConfAwayBurst(yy_aconf);
2338   } | TOPICBURST
2339   {
2340 <  if (ypass == 2)
2341 <  {
2342 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2684 <    else SetConfTopicBurst(yy_aconf);
2685 <  }
2686 < }
2687 < ;
2340 >  if (conf_parser_ctx.pass == 2)
2341 >    SetConfTopicBurst(yy_aconf);
2342 > };
2343  
2344   connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2345   {
2346   #ifdef HAVE_LIBCRYPTO
2347 <  if (ypass == 2)
2347 >  if (conf_parser_ctx.pass == 2)
2348    {
2349      BIO *file;
2350  
# Line 2729 | Line 2384 | connect_rsa_public_key_file: RSA_PUBLIC_
2384  
2385   connect_encrypted: ENCRYPTED '=' TBOOL ';'
2386   {
2387 <  if (ypass == 2)
2387 >  if (conf_parser_ctx.pass == 2)
2388    {
2389      if (yylval.number)
2390        yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
# Line 2738 | Line 2393 | connect_encrypted: ENCRYPTED '=' TBOOL '
2393    }
2394   };
2395  
2741 connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2742 {
2743  if (ypass == 2)
2744  {
2745    if (yylval.number)
2746      yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
2747    else
2748      yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK;
2749  }
2750 };
2751
2752 connect_compressed: COMPRESSED '=' TBOOL ';'
2753 {
2754  if (ypass == 2)
2755  {
2756    if (yylval.number)
2757 #ifndef HAVE_LIBZ
2758      yyerror("Ignoring compressed=yes; -- no zlib support");
2759 #else
2760      yy_aconf->flags |= CONF_FLAGS_COMPRESSED;
2761 #endif
2762    else
2763      yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED;
2764  }
2765 };
2766
2767 connect_auto: AUTOCONN '=' TBOOL ';'
2768 {
2769  if (ypass == 2)
2770  {
2771    if (yylval.number)
2772      yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
2773    else
2774      yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
2775  }
2776 };
2777
2778 connect_topicburst: TOPICBURST '=' TBOOL ';'
2779 {
2780  if (ypass == 2)
2781  {
2782    if (yylval.number)
2783      SetConfTopicBurst(yy_aconf);
2784    else
2785      ClearConfTopicBurst(yy_aconf);
2786  }
2787 };
2788
2396   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2397   {
2398 <  if (ypass == 2)
2398 >  if (conf_parser_ctx.pass == 2)
2399    {
2400      struct CollectItem *yy_tmp;
2401  
# Line 2801 | Line 2408 | connect_hub_mask: HUB_MASK '=' QSTRING '
2408  
2409   connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2410   {
2411 <  if (ypass == 2)
2411 >  if (conf_parser_ctx.pass == 2)
2412    {
2413      struct CollectItem *yy_tmp;
2414  
# Line 2814 | Line 2421 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2421  
2422   connect_class: CLASS '=' QSTRING ';'
2423   {
2424 <  if (ypass == 2)
2424 >  if (conf_parser_ctx.pass == 2)
2425    {
2426      MyFree(class_name);
2427      DupString(class_name, yylval.string);
# Line 2824 | Line 2431 | connect_class: CLASS '=' QSTRING ';'
2431   connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2432   {
2433   #ifdef HAVE_LIBCRYPTO
2434 <  if (ypass == 2)
2434 >  if (conf_parser_ctx.pass == 2)
2435    {
2436      struct EncCapability *ecap;
2437      const char *cipher_name;
# Line 2848 | Line 2455 | connect_cipher_preference: CIPHER_PREFER
2455        yyerror("Invalid cipher");
2456    }
2457   #else
2458 <  if (ypass == 2)
2458 >  if (conf_parser_ctx.pass == 2)
2459      yyerror("Ignoring cipher_preference -- no OpenSSL support");
2460   #endif
2461   };
# Line 2858 | Line 2465 | connect_cipher_preference: CIPHER_PREFER
2465   ***************************************************************************/
2466   kill_entry: KILL
2467   {
2468 <  if (ypass == 2)
2468 >  if (conf_parser_ctx.pass == 2)
2469    {
2470      userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0';
2471      regex_ban = 0;
2472    }
2473   } '{' kill_items '}' ';'
2474   {
2475 <  if (ypass == 2)
2475 >  if (conf_parser_ctx.pass == 2)
2476    {
2477      if (userbuf[0] && hostbuf[0])
2478      {
2479        if (regex_ban)
2480        {
2481 <        pcre *exp_user = NULL;
2482 <        pcre *exp_host = NULL;
2481 > #ifdef HAVE_LIBPCRE
2482 >        void *exp_user = NULL;
2483 >        void *exp_host = NULL;
2484          const char *errptr = NULL;
2485  
2486          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2487              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2488          {
2489 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", errptr);
2489 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2490 >               errptr);
2491            break;
2492          }
2493  
2494 <        yy_conf = make_conf_item(RKLINE_TYPE);
2494 >        yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE));
2495          yy_aconf->regexuser = exp_user;
2496          yy_aconf->regexhost = exp_host;
2497  
# Line 2893 | Line 2502 | kill_entry: KILL
2502            DupString(yy_aconf->reason, reasonbuf);
2503          else
2504            DupString(yy_aconf->reason, "No reason");
2505 + #else
2506 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2507 +        break;
2508 + #endif
2509        }
2510        else
2511        {
2512 <        yy_conf = make_conf_item(KLINE_TYPE);
2900 <        yy_aconf = map_to_conf(yy_conf);
2512 >        yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2513  
2514          DupString(yy_aconf->user, userbuf);
2515          DupString(yy_aconf->host, hostbuf);
# Line 2909 | Line 2521 | kill_entry: KILL
2521          add_conf_by_address(CONF_KILL, yy_aconf);
2522        }
2523      }
2912    else
2913      delete_conf_item(yy_conf);
2524  
2915    yy_conf = NULL;
2525      yy_aconf = NULL;
2526    }
2527   };
# Line 2924 | Line 2533 | kill_type: TYPE
2533   kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2534   kill_type_item: REGEX_T
2535   {
2536 <  if (ypass == 2)
2536 >  if (conf_parser_ctx.pass == 2)
2537      regex_ban = 1;
2538   };
2539  
# Line 2933 | Line 2542 | kill_item:      kill_user | kill_reason
2542  
2543   kill_user: USER '=' QSTRING ';'
2544   {
2545 <  if (ypass == 2)
2545 >  if (conf_parser_ctx.pass == 2)
2546    {
2547 <    char *user = NULL, *host = NULL;
2547 >    struct split_nuh_item nuh;
2548  
2549 <    split_nuh(yylval.string, NULL, &user, &host);
2549 >    nuh.nuhmask  = yylval.string;
2550 >    nuh.nickptr  = NULL;
2551 >    nuh.userptr  = userbuf;
2552 >    nuh.hostptr  = hostbuf;
2553  
2554 <    strlcpy(userbuf, user, sizeof(userbuf));
2555 <    strlcpy(hostbuf, host, sizeof(hostbuf));
2554 >    nuh.nicksize = 0;
2555 >    nuh.usersize = sizeof(userbuf);
2556 >    nuh.hostsize = sizeof(hostbuf);
2557  
2558 <    MyFree(user);
2946 <    MyFree(host);
2558 >    split_nuh(&nuh);
2559    }
2560   };
2561  
2562   kill_reason: REASON '=' QSTRING ';'
2563   {
2564 <  if (ypass == 2)
2564 >  if (conf_parser_ctx.pass == 2)
2565      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2566   };
2567  
# Line 2958 | Line 2570 | kill_reason: REASON '=' QSTRING ';'
2570   ***************************************************************************/
2571   deny_entry: DENY
2572   {
2573 <  if (ypass == 2)
2574 <  {
2963 <    yy_conf = make_conf_item(DLINE_TYPE);
2964 <    yy_aconf = map_to_conf(yy_conf);
2965 <    /* default reason */
2966 <    DupString(yy_aconf->reason, "No reason");
2967 <  }
2573 >  if (conf_parser_ctx.pass == 2)
2574 >    hostbuf[0] = reasonbuf[0] = '\0';
2575   } '{' deny_items '}' ';'
2576   {
2577 <  if (ypass == 2)
2577 >  if (conf_parser_ctx.pass == 2)
2578    {
2579 <    if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
2579 >    if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
2580 >    {
2581 >      yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
2582 >      DupString(yy_aconf->host, hostbuf);
2583 >
2584 >      if (reasonbuf[0])
2585 >        DupString(yy_aconf->reason, reasonbuf);
2586 >      else
2587 >        DupString(yy_aconf->reason, "No reason");
2588        add_conf_by_address(CONF_DLINE, yy_aconf);
2589 <    else
2590 <      delete_conf_item(yy_conf);
2976 <    yy_conf = NULL;
2977 <    yy_aconf = NULL;
2589 >      yy_aconf = NULL;
2590 >    }
2591    }
2592   };
2593  
# Line 2983 | Line 2596 | deny_item:      deny_ip | deny_reason |
2596  
2597   deny_ip: IP '=' QSTRING ';'
2598   {
2599 <  if (ypass == 2)
2600 <  {
2988 <    MyFree(yy_aconf->host);
2989 <    DupString(yy_aconf->host, yylval.string);
2990 <  }
2599 >  if (conf_parser_ctx.pass == 2)
2600 >    strlcpy(hostbuf, yylval.string, sizeof(hostbuf));
2601   };
2602  
2603   deny_reason: REASON '=' QSTRING ';'
2604   {
2605 <  if (ypass == 2)
2606 <  {
2997 <    MyFree(yy_aconf->reason);
2998 <    DupString(yy_aconf->reason, yylval.string);
2999 <  }
2605 >  if (conf_parser_ctx.pass == 2)
2606 >    strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2607   };
2608  
2609   /***************************************************************************
# Line 3009 | Line 2616 | exempt_item:      exempt_ip | error;
2616  
2617   exempt_ip: IP '=' QSTRING ';'
2618   {
2619 <  if (ypass == 2)
2619 >  if (conf_parser_ctx.pass == 2)
2620    {
2621      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2622      {
2623 <      yy_conf = make_conf_item(EXEMPTDLINE_TYPE);
3017 <      yy_aconf = map_to_conf(yy_conf);
2623 >      yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE));
2624        DupString(yy_aconf->host, yylval.string);
2625  
2626        add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf);
3021
3022      yy_conf = NULL;
2627        yy_aconf = NULL;
2628      }
2629    }
# Line 3030 | Line 2634 | exempt_ip: IP '=' QSTRING ';'
2634   ***************************************************************************/
2635   gecos_entry: GECOS
2636   {
2637 <  if (ypass == 2)
2637 >  if (conf_parser_ctx.pass == 2)
2638    {
2639      regex_ban = 0;
2640      reasonbuf[0] = gecos_name[0] = '\0';
2641    }
2642   } '{' gecos_items '}' ';'
2643   {
2644 <  if (ypass == 2)
2644 >  if (conf_parser_ctx.pass == 2)
2645    {
2646      if (gecos_name[0])
2647      {
2648        if (regex_ban)
2649        {
2650 <        pcre *exp_p = NULL;
2650 > #ifdef HAVE_LIBPCRE
2651 >        void *exp_p = NULL;
2652          const char *errptr = NULL;
2653  
2654          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2655          {
2656 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", errptr);
2656 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2657 >               errptr);
2658            break;
2659          }
2660  
2661          yy_conf = make_conf_item(RXLINE_TYPE);
2662          yy_conf->regexpname = exp_p;
2663 + #else
2664 +        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2665 +        break;
2666 + #endif
2667        }
2668        else
2669          yy_conf = make_conf_item(XLINE_TYPE);
# Line 3076 | Line 2686 | gecos_flags: TYPE
2686   gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
2687   gecos_flags_item: REGEX_T
2688   {
2689 <  if (ypass == 2)
2689 >  if (conf_parser_ctx.pass == 2)
2690      regex_ban = 1;
2691   };
2692  
# Line 3085 | Line 2695 | gecos_item:  gecos_name | gecos_reason |
2695  
2696   gecos_name: NAME '=' QSTRING ';'
2697   {
2698 <  if (ypass == 2)
2698 >  if (conf_parser_ctx.pass == 2)
2699      strlcpy(gecos_name, yylval.string, sizeof(gecos_name));
2700   };
2701  
2702   gecos_reason: REASON '=' QSTRING ';'
2703   {
2704 <  if (ypass == 2)
2704 >  if (conf_parser_ctx.pass == 2)
2705      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
2706   };
2707  
# Line 3115 | Line 2725 | general_item:       general_hide_spoof_i
2725                      general_pace_wait_simple | general_stats_P_oper_only |
2726                      general_short_motd | general_no_oper_flood |
2727                      general_true_no_oper_flood | general_oper_pass_resv |
2728 <                    general_idletime | general_message_locale |
2728 >                    general_message_locale |
2729                      general_oper_only_umodes | general_max_targets |
2730                      general_use_egd | general_egdpool_path |
2731                      general_oper_umodes | general_caller_id_wait |
# Line 3125 | Line 2735 | general_item:       general_hide_spoof_i
2735                      general_default_cipher_preference |
2736                      general_compression_level | general_client_flood |
2737                      general_throttle_time | general_havent_read_conf |
2738 <                    general_dot_in_ip6_addr | general_ping_cookie |
2738 >                    general_ping_cookie |
2739                      general_disable_auth | general_burst_away |
2740                      general_tkline_expire_notices | general_gline_min_cidr |
2741                      general_gline_min_cidr6 | general_use_whois_actually |
2742 <                    general_reject_hold_time |
2742 >                    general_reject_hold_time | general_stats_e_disabled |
2743 >                    general_max_watch | general_services_name |
2744                      error;
2745  
2746  
2747 + general_max_watch: MAX_WATCH '=' NUMBER ';'
2748 + {
2749 +  ConfigFileEntry.max_watch = $3;
2750 + };
2751  
2752   general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2753   {
# Line 3164 | Line 2779 | general_tkline_expire_notices: TKLINE_EX
2779    ConfigFileEntry.tkline_expire_notices = yylval.number;
2780   };
2781  
2782 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' NUMBER ';'
2782 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2783   {
2784    ConfigFileEntry.kill_chase_time_limit = $3;
2785   };
# Line 3221 | Line 2836 | general_ts_warn_delta: TS_WARN_DELTA '='
2836  
2837   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2838   {
2839 <  if (ypass == 2)
2839 >  if (conf_parser_ctx.pass == 2)
2840      ConfigFileEntry.ts_max_delta = $3;
2841   };
2842  
2843   general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2844   {
2845 <  if (($3 > 0) && ypass == 1)
2845 >  if (($3 > 0) && conf_parser_ctx.pass == 1)
2846    {
2847 <    ilog(L_CRIT, "You haven't read your config file properly.");
2848 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2849 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2847 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2848 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2849 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2850      exit(0);
2851    }
2852   };
# Line 3243 | Line 2858 | general_kline_with_reason: KLINE_WITH_RE
2858  
2859   general_kline_reason: KLINE_REASON '=' QSTRING ';'
2860   {
2861 <  if (ypass == 2)
2861 >  if (conf_parser_ctx.pass == 2)
2862    {
2863      MyFree(ConfigFileEntry.kline_reason);
2864      DupString(ConfigFileEntry.kline_reason, yylval.string);
# Line 3260 | Line 2875 | general_warn_no_nline: WARN_NO_NLINE '='
2875    ConfigFileEntry.warn_no_nline = yylval.number;
2876   };
2877  
2878 + general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2879 + {
2880 +  ConfigFileEntry.stats_e_disabled = yylval.number;
2881 + };
2882 +
2883   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2884   {
2885    ConfigFileEntry.stats_o_oper_only = yylval.number;
# Line 3328 | Line 2948 | general_oper_pass_resv: OPER_PASS_RESV '
2948  
2949   general_message_locale: MESSAGE_LOCALE '=' QSTRING ';'
2950   {
2951 <  if (ypass == 2)
2951 >  if (conf_parser_ctx.pass == 2)
2952    {
2953      if (strlen(yylval.string) > LOCALE_LENGTH-2)
2954        yylval.string[LOCALE_LENGTH-1] = '\0';
# Line 3337 | Line 2957 | general_message_locale: MESSAGE_LOCALE '
2957    }
2958   };
2959  
3340 general_idletime: IDLETIME '=' timespec ';'
3341 {
3342  ConfigFileEntry.idletime = $3;
3343 };
3344
2960   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2961   {
2962    ConfigFileEntry.dots_in_ident = $3;
# Line 3354 | Line 2969 | general_max_targets: MAX_TARGETS '=' NUM
2969  
2970   general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
2971   {
2972 <  if (ypass == 2)
2972 >  if (conf_parser_ctx.pass == 2)
2973    {
2974      MyFree(ConfigFileEntry.servlink_path);
2975      DupString(ConfigFileEntry.servlink_path, yylval.string);
# Line 3364 | Line 2979 | general_servlink_path: SERVLINK_PATH '='
2979   general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
2980   {
2981   #ifdef HAVE_LIBCRYPTO
2982 <  if (ypass == 2)
2982 >  if (conf_parser_ctx.pass == 2)
2983    {
2984      struct EncCapability *ecap;
2985      const char *cipher_name;
# Line 3388 | Line 3003 | general_default_cipher_preference: DEFAU
3003        yyerror("Invalid cipher");
3004    }
3005   #else
3006 <  if (ypass == 2)
3006 >  if (conf_parser_ctx.pass == 2)
3007      yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3008   #endif
3009   };
3010  
3011   general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3012   {
3013 <  if (ypass == 2)
3013 >  if (conf_parser_ctx.pass == 2)
3014    {
3015      ConfigFileEntry.compression_level = $3;
3016   #ifndef HAVE_LIBZ
# Line 3418 | Line 3033 | general_use_egd: USE_EGD '=' TBOOL ';'
3033  
3034   general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
3035   {
3036 <  if (ypass == 2)
3036 >  if (conf_parser_ctx.pass == 2)
3037    {
3038      MyFree(ConfigFileEntry.egdpool_path);
3039      DupString(ConfigFileEntry.egdpool_path, yylval.string);
3040    }
3041   };
3042  
3043 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
3044 + {
3045 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
3046 +  {
3047 +    MyFree(ConfigFileEntry.service_name);
3048 +    DupString(ConfigFileEntry.service_name, yylval.string);
3049 +  }
3050 + };
3051 +
3052   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
3053   {
3054    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3452 | Line 3076 | umode_oitem:     T_BOTS
3076   } | T_CCONN
3077   {
3078    ConfigFileEntry.oper_umodes |= UMODE_CCONN;
3079 + } | T_CCONN_FULL
3080 + {
3081 +  ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
3082   } | T_DEAF
3083   {
3084    ConfigFileEntry.oper_umodes |= UMODE_DEAF;
# Line 3514 | Line 3141 | umode_item:    T_BOTS
3141   } | T_CCONN
3142   {
3143    ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
3144 + } | T_CCONN_FULL
3145 + {
3146 +  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
3147   } | T_DEAF
3148   {
3149    ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
# Line 3584 | Line 3214 | general_client_flood: T_CLIENT_FLOOD '='
3214    ConfigFileEntry.client_flood = $3;
3215   };
3216  
3587 general_dot_in_ip6_addr: DOT_IN_IP6_ADDR '=' TBOOL ';'
3588 {
3589  ConfigFileEntry.dot_in_ip6_addr = yylval.number;
3590 };
3217  
3218   /***************************************************************************
3219   *  section glines
3220   ***************************************************************************/
3221   gline_entry: GLINES
3222   {
3223 <  if (ypass == 2)
3223 >  if (conf_parser_ctx.pass == 2)
3224    {
3225      yy_conf = make_conf_item(GDENY_TYPE);
3226      yy_aconf = map_to_conf(yy_conf);
3227    }
3228   } '{' gline_items '}' ';'
3229   {
3230 <  if (ypass == 2)
3230 >  if (conf_parser_ctx.pass == 2)
3231    {
3232      /*
3233       * since we re-allocate yy_conf/yy_aconf after the end of action=, at the
# Line 3627 | Line 3253 | gline_item:         gline_enable |
3253  
3254   gline_enable: ENABLE '=' TBOOL ';'
3255   {
3256 <  if (ypass == 2)
3256 >  if (conf_parser_ctx.pass == 2)
3257      ConfigFileEntry.glines = yylval.number;
3258   };
3259  
3260   gline_duration: DURATION '=' timespec ';'
3261   {
3262 <  if (ypass == 2)
3262 >  if (conf_parser_ctx.pass == 2)
3263      ConfigFileEntry.gline_time = $3;
3264   };
3265  
3266 < gline_logging: LOGGING
3266 > gline_logging: T_LOG
3267   {
3268 <  if (ypass == 2)
3268 >  if (conf_parser_ctx.pass == 2)
3269      ConfigFileEntry.gline_logging = 0;
3270   } '=' gline_logging_types ';';
3271   gline_logging_types:     gline_logging_types ',' gline_logging_type_item | gline_logging_type_item;
3272   gline_logging_type_item: T_REJECT
3273   {
3274 <  if (ypass == 2)
3274 >  if (conf_parser_ctx.pass == 2)
3275      ConfigFileEntry.gline_logging |= GDENY_REJECT;
3276   } | T_BLOCK
3277   {
3278 <  if (ypass == 2)
3278 >  if (conf_parser_ctx.pass == 2)
3279      ConfigFileEntry.gline_logging |= GDENY_BLOCK;
3280   };
3281  
3282   gline_user: USER '=' QSTRING ';'
3283   {
3284 <  if (ypass == 2)
3284 >  if (conf_parser_ctx.pass == 2)
3285    {
3286 <    struct CollectItem *yy_tmp = NULL;
3286 >    struct split_nuh_item nuh;
3287 >
3288 >    nuh.nuhmask  = yylval.string;
3289 >    nuh.nickptr  = NULL;
3290 >    nuh.userptr  = userbuf;
3291 >    nuh.hostptr  = hostbuf;
3292 >
3293 >    nuh.nicksize = 0;
3294 >    nuh.usersize = sizeof(userbuf);
3295 >    nuh.hostsize = sizeof(hostbuf);
3296 >
3297 >    split_nuh(&nuh);
3298  
3299      if (yy_aconf->user == NULL)
3300      {
3301 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
3301 >      DupString(yy_aconf->user, userbuf);
3302 >      DupString(yy_aconf->host, hostbuf);
3303      }
3304      else
3305      {
3306 <      yy_tmp = MyMalloc(sizeof(struct CollectItem));
3307 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
3306 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
3307 >
3308 >      DupString(yy_tmp->user, userbuf);
3309 >      DupString(yy_tmp->host, hostbuf);
3310 >
3311        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
3312      }
3313    }
# Line 3674 | Line 3315 | gline_user: USER '=' QSTRING ';'
3315  
3316   gline_server: NAME '=' QSTRING ';'
3317   {
3318 <  if (ypass == 2)  
3318 >  if (conf_parser_ctx.pass == 2)  
3319    {
3320      MyFree(yy_conf->name);
3321      DupString(yy_conf->name, yylval.string);
# Line 3683 | Line 3324 | gline_server: NAME '=' QSTRING ';'
3324  
3325   gline_action: ACTION
3326   {
3327 <  if (ypass == 2)
3327 >  if (conf_parser_ctx.pass == 2)
3328      yy_aconf->flags = 0;
3329   } '=' gdeny_types ';'
3330   {
3331 <  if (ypass == 2)
3331 >  if (conf_parser_ctx.pass == 2)
3332    {
3333      struct CollectItem *yy_tmp = NULL;
3334      dlink_node *ptr, *next_ptr;
# Line 3734 | Line 3375 | gline_action: ACTION
3375   gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item;
3376   gdeny_type_item: T_REJECT
3377   {
3378 <  if (ypass == 2)
3378 >  if (conf_parser_ctx.pass == 2)
3379      yy_aconf->flags |= GDENY_REJECT;
3380   } | T_BLOCK
3381   {
3382 <  if (ypass == 2)
3382 >  if (conf_parser_ctx.pass == 2)
3383      yy_aconf->flags |= GDENY_BLOCK;
3384   };
3385  
# Line 3758 | Line 3399 | channel_item:       channel_disable_loca
3399                      channel_no_create_on_split | channel_restrict_channels |
3400                      channel_no_join_on_split | channel_burst_topicwho |
3401                      channel_jflood_count | channel_jflood_time |
3402 <                    error;
3402 >                    channel_disable_fake_channels | error;
3403 >
3404 > channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
3405 > {
3406 >  ConfigChannel.disable_fake_channels = yylval.number;
3407 > };
3408  
3409   channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';'
3410   {
# Line 3861 | Line 3507 | serverhide_item:    serverhide_flatten_l
3507  
3508   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
3509   {
3510 <  if (ypass == 2)
3510 >  if (conf_parser_ctx.pass == 2)
3511      ConfigServerHide.flatten_links = yylval.number;
3512   };
3513  
3514   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
3515   {
3516 <  if (ypass == 2)
3516 >  if (conf_parser_ctx.pass == 2)
3517      ConfigServerHide.hide_servers = yylval.number;
3518   };
3519  
3520   serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';'
3521   {
3522 <  if (ypass == 2)
3522 >  if (conf_parser_ctx.pass == 2)
3523    {
3524      MyFree(ConfigServerHide.hidden_name);
3525      DupString(ConfigServerHide.hidden_name, yylval.string);
# Line 3882 | Line 3528 | serverhide_hidden_name: HIDDEN_NAME '='
3528  
3529   serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3530   {
3531 <  if (ypass == 2)
3531 >  if (conf_parser_ctx.pass == 2)
3532    {
3533      if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3534      {
# Line 3896 | Line 3542 | serverhide_links_delay: LINKS_DELAY '='
3542  
3543   serverhide_hidden: HIDDEN '=' TBOOL ';'
3544   {
3545 <  if (ypass == 2)
3545 >  if (conf_parser_ctx.pass == 2)
3546      ConfigServerHide.hidden = yylval.number;
3547   };
3548  
3549   serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';'
3550   {
3551 <  if (ypass == 2)
3551 >  if (conf_parser_ctx.pass == 2)
3552      ConfigServerHide.disable_hidden = yylval.number;
3553   };
3554  
3555   serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';'
3556   {
3557 <  if (ypass == 2)
3557 >  if (conf_parser_ctx.pass == 2)
3558      ConfigServerHide.hide_server_ips = yylval.number;
3559   };

Diff Legend

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