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 341 by michael, Tue Dec 27 13:43:46 2005 UTC vs.
Revision 1024 by michael, Sun Nov 1 23:14:25 2009 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"
40   #include "irc_getaddrinfo.h"
41   #include "sprintf_irc.h"
42   #include "memory.h"
43   #include "modules.h"
44 < #include "s_serv.h" /* for CAP_LL / IsCapable */
44 > #include "s_serv.h"
45   #include "hostmask.h"
46   #include "send.h"
47   #include "listener.h"
# Line 73 | Line 72 | static char hostbuf[IRCD_BUFSIZE];
72   static char reasonbuf[REASONLEN + 1];
73   static char gecos_name[REALLEN * 4];
74  
76 extern dlink_list gdeny_items; /* XXX */
77
75   static char *resv_reason = NULL;
76   static char *listener_address = NULL;
77   static int not_atom = 0;
78  
79 < struct CollectItem {
79 > struct CollectItem
80 > {
81    dlink_node node;
82    char *name;
83    char *user;
# Line 169 | Line 167 | unhook_hub_leaf_confs(void)
167   %token  DESCRIPTION
168   %token  DIE
169   %token  DISABLE_AUTH
170 + %token  DISABLE_FAKE_CHANNELS
171   %token  DISABLE_HIDDEN
172   %token  DISABLE_LOCAL_CHANNELS
173   %token  DISABLE_REMOTE_COMMANDS
# Line 228 | Line 227 | unhook_hub_leaf_confs(void)
227   %token  KLINE_WITH_REASON
228   %token  KNOCK_DELAY
229   %token  KNOCK_DELAY_CHANNEL
231 %token  LAZYLINK
230   %token  LEAF_MASK
231   %token  LINKS_DELAY
232   %token  LISTEN
# Line 245 | Line 243 | unhook_hub_leaf_confs(void)
243   %token  MAX_NICK_TIME
244   %token  MAX_NUMBER
245   %token  MAX_TARGETS
246 + %token  MAX_WATCH
247   %token  MESSAGE_LOCALE
248   %token  MIN_NONWILDCARD
249   %token  MIN_NONWILDCARD_SIMPLE
# Line 298 | Line 297 | unhook_hub_leaf_confs(void)
297   %token  RSA_PRIVATE_KEY_FILE
298   %token  RSA_PUBLIC_KEY_FILE
299   %token  SSL_CERTIFICATE_FILE
300 + %token  T_SSL_CONNECTION_METHOD
301 + %token  T_SSLV3
302 + %token  T_TLSV1
303   %token  RESV
304   %token  RESV_EXEMPT
305   %token  SECONDS MINUTES HOURS DAYS WEEKS
# Line 315 | Line 317 | unhook_hub_leaf_confs(void)
317   %token  SILENT
318   %token  SPOOF
319   %token  SPOOF_NOTICE
320 + %token  STATS_E_DISABLED
321   %token  STATS_I_OPER_ONLY
322   %token  STATS_K_OPER_ONLY
323   %token  STATS_O_OPER_ONLY
# Line 330 | Line 333 | unhook_hub_leaf_confs(void)
333   %token  T_SOFTCALLERID
334   %token  T_CALLERID
335   %token  T_CCONN
336 + %token  T_CCONN_FULL
337   %token  T_CLIENT_FLOOD
338   %token  T_DEAF
339   %token  T_DEBUG
# Line 352 | Line 356 | unhook_hub_leaf_confs(void)
356   %token  T_NCHANGE
357   %token  T_OPERWALL
358   %token  T_REJ
359 + %token  T_SERVER
360   %token  T_SERVNOTICE
361   %token  T_SKILL
362   %token  T_SPY
# Line 465 | Line 470 | modules_item:   modules_module | modules
470   modules_module: MODULE '=' QSTRING ';'
471   {
472   #ifndef STATIC_MODULES /* NOOP in the static case */
473 <  if (ypass == 2)
474 <  {
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 <  }
473 >  if (conf_parser_ctx.pass == 2)
474 >    add_conf_module(libio_basename(yylval.string));
475   #endif
476   };
477  
478   modules_path: PATH '=' QSTRING ';'
479   {
480   #ifndef STATIC_MODULES
481 <  if (ypass == 2)
481 >  if (conf_parser_ctx.pass == 2)
482      mod_add_path(yylval.string);
483   #endif
484   };
485  
490 /***************************************************************************
491 *  section serverinfo
492 ***************************************************************************/
493 serverinfo_entry: SERVERINFO
494  '{' serverinfo_items '}' ';';
486  
487 < serverinfo_items:       serverinfo_items serverinfo_item |
488 <                        serverinfo_item ;
487 > serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
488 >
489 > serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
490   serverinfo_item:        serverinfo_name | serverinfo_vhost |
491                          serverinfo_hub | serverinfo_description |
492                          serverinfo_network_name | serverinfo_network_desc |
493                          serverinfo_max_clients |
494                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
495                          serverinfo_sid | serverinfo_ssl_certificate_file |
496 +                        serverinfo_ssl_connection_method |
497                          error ';' ;
498  
499 +
500 + serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
501 + {
502 + #ifdef HAVE_LIBCRYPTO
503 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
504 +    ServerInfo.tls_version = 0;
505 + #endif
506 + } '=' method_types ';'
507 + {
508 + #ifdef HAVE_LIBCRYPTO
509 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
510 +  {
511 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
512 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
513 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
514 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
515 +  }
516 + #endif
517 + };
518 +
519 + method_types: method_types ',' method_type_item | method_type_item;
520 + method_type_item: T_SSLV3
521 + {
522 + #ifdef HAVE_LIBCRYPTO
523 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
524 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
525 + #endif
526 + } | T_TLSV1
527 + {
528 + #ifdef HAVE_LIBCRYPTO
529 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
530 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
531 + #endif
532 + };
533 +
534   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
535   {
536   #ifdef HAVE_LIBCRYPTO
537 <  if (ypass == 2 && ServerInfo.ctx)
537 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
538    {
539      if (!ServerInfo.rsa_private_key_file)
540      {
# Line 514 | Line 542 | serverinfo_ssl_certificate_file: SSL_CER
542        break;
543      }
544  
545 <    if (SSL_CTX_use_certificate_file(ServerInfo.ctx,
546 <      yylval.string, SSL_FILETYPE_PEM) <= 0)
545 >    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
546 >                                     SSL_FILETYPE_PEM) <= 0)
547      {
548        yyerror(ERR_lib_error_string(ERR_get_error()));
549        break;
550      }
551  
552 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx,
553 <      ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0)
552 >    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
553 >                                    SSL_FILETYPE_PEM) <= 0)
554      {
555        yyerror(ERR_lib_error_string(ERR_get_error()));
556        break;
557      }
558  
559 <    if (!SSL_CTX_check_private_key(ServerInfo.ctx))
559 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
560      {
561 <      yyerror("RSA private key does not match the SSL certificate public key!");
561 >      yyerror(ERR_lib_error_string(ERR_get_error()));
562        break;
563      }
564    }
# Line 540 | Line 568 | serverinfo_ssl_certificate_file: SSL_CER
568   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
569   {
570   #ifdef HAVE_LIBCRYPTO
571 <  if (ypass == 1)
571 >  if (conf_parser_ctx.pass == 1)
572    {
573      BIO *file;
574  
# Line 600 | Line 628 | serverinfo_rsa_private_key_file: RSA_PRI
628   serverinfo_name: NAME '=' QSTRING ';'
629   {
630    /* this isn't rehashable */
631 <  if (ypass == 2)
631 >  if (conf_parser_ctx.pass == 2)
632    {
633      if (ServerInfo.name == NULL)
634      {
# Line 614 | Line 642 | serverinfo_name: NAME '=' QSTRING ';'
642   serverinfo_sid: IRCD_SID '=' QSTRING ';'
643   {
644    /* this isn't rehashable */
645 <  if (ypass == 2 && !ServerInfo.sid)
645 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
646    {
647 <    if ((strlen(yylval.string) == IRC_MAXSID) && IsDigit(yylval.string[0])
620 <        && IsAlNum(yylval.string[1]) && IsAlNum(yylval.string[2]))
621 <    {
647 >    if (valid_sid(yylval.string))
648        DupString(ServerInfo.sid, yylval.string);
623    }
649      else
650      {
651        ilog(L_ERROR, "Ignoring config file entry SID -- invalid SID. Aborting.");
# Line 631 | Line 656 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
656  
657   serverinfo_description: DESCRIPTION '=' QSTRING ';'
658   {
659 <  if (ypass == 2)
659 >  if (conf_parser_ctx.pass == 2)
660    {
661      MyFree(ServerInfo.description);
662      DupString(ServerInfo.description,yylval.string);
# Line 640 | Line 665 | serverinfo_description: DESCRIPTION '='
665  
666   serverinfo_network_name: NETWORK_NAME '=' QSTRING ';'
667   {
668 <  if (ypass == 2)
668 >  if (conf_parser_ctx.pass == 2)
669    {
670      char *p;
671  
# Line 654 | Line 679 | serverinfo_network_name: NETWORK_NAME '=
679  
680   serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
681   {
682 <  if (ypass == 2)
682 >  if (conf_parser_ctx.pass == 2)
683    {
684      MyFree(ServerInfo.network_desc);
685      DupString(ServerInfo.network_desc, yylval.string);
# Line 663 | Line 688 | serverinfo_network_desc: NETWORK_DESC '=
688  
689   serverinfo_vhost: VHOST '=' QSTRING ';'
690   {
691 <  if (ypass == 2 && *yylval.string != '*')
691 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
692    {
693      struct addrinfo hints, *res;
694  
# Line 692 | Line 717 | serverinfo_vhost: VHOST '=' QSTRING ';'
717   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
718   {
719   #ifdef IPV6
720 <  if (ypass == 2 && *yylval.string != '*')
720 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
721    {
722      struct addrinfo hints, *res;
723  
# Line 721 | Line 746 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
746  
747   serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
748   {
749 <  if (ypass == 2)
749 >  if (conf_parser_ctx.pass == 2)
750    {
751      recalc_fdlimit(NULL);
752  
# Line 744 | Line 769 | serverinfo_max_clients: T_MAX_CLIENTS '=
769  
770   serverinfo_hub: HUB '=' TBOOL ';'
771   {
772 <  if (ypass == 2)
772 >  if (conf_parser_ctx.pass == 2)
773    {
774      if (yylval.number)
775      {
776 <      /* Don't become a hub if we have a lazylink active. */
777 <      if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
778 <      {
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 <      }
776 >      ServerInfo.hub = 1;
777 >      delete_capability("HUB");
778 >      add_capability("HUB", CAP_HUB, 1);
779      }
780      else if (ServerInfo.hub)
781      {
768      dlink_node *ptr = NULL;
782  
783        ServerInfo.hub = 0;
784        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      }
785      }
786    }
787   };
# Line 800 | Line 797 | admin_item:  admin_name | admin_descript
797  
798   admin_name: NAME '=' QSTRING ';'
799   {
800 <  if (ypass == 2)
800 >  if (conf_parser_ctx.pass == 2)
801    {
802      MyFree(AdminInfo.name);
803      DupString(AdminInfo.name, yylval.string);
# Line 809 | Line 806 | admin_name: NAME '=' QSTRING ';'
806  
807   admin_email: EMAIL '=' QSTRING ';'
808   {
809 <  if (ypass == 2)
809 >  if (conf_parser_ctx.pass == 2)
810    {
811      MyFree(AdminInfo.email);
812      DupString(AdminInfo.email, yylval.string);
# Line 818 | Line 815 | admin_email: EMAIL '=' QSTRING ';'
815  
816   admin_description: DESCRIPTION '=' QSTRING ';'
817   {
818 <  if (ypass == 2)
818 >  if (conf_parser_ctx.pass == 2)
819    {
820      MyFree(AdminInfo.description);
821      DupString(AdminInfo.description, yylval.string);
# Line 853 | Line 850 | logging_oper_log:      OPER_LOG '=' QSTRING '
850  
851   logging_fuserlog: FUSERLOG '=' QSTRING ';'
852   {
853 <  if (ypass == 2)
853 >  if (conf_parser_ctx.pass == 2)
854      strlcpy(ConfigLoggingEntry.userlog, yylval.string,
855              sizeof(ConfigLoggingEntry.userlog));
856   };
857  
858   logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
859   {
860 <  if (ypass == 2)
860 >  if (conf_parser_ctx.pass == 2)
861      strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
862              sizeof(ConfigLoggingEntry.failed_operlog));
863   };
864  
865   logging_foperlog: FOPERLOG '=' QSTRING ';'
866   {
867 <  if (ypass == 2)
867 >  if (conf_parser_ctx.pass == 2)
868      strlcpy(ConfigLoggingEntry.operlog, yylval.string,
869              sizeof(ConfigLoggingEntry.operlog));
870   };
871  
872   logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
873   {
874 <  if (ypass == 2)
874 >  if (conf_parser_ctx.pass == 2)
875      strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
876              sizeof(ConfigLoggingEntry.operspylog));
877   };
878  
879   logging_fglinelog: FGLINELOG '=' QSTRING ';'
880   {
881 <  if (ypass == 2)
881 >  if (conf_parser_ctx.pass == 2)
882      strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
883              sizeof(ConfigLoggingEntry.glinelog));
884   };
885  
886   logging_fklinelog: FKLINELOG '=' QSTRING ';'
887   {
888 <  if (ypass == 2)
888 >  if (conf_parser_ctx.pass == 2)
889      strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
890              sizeof(ConfigLoggingEntry.klinelog));
891   };
892  
893   logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
894   {
895 <  if (ypass == 2)
895 >  if (conf_parser_ctx.pass == 2)
896      strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
897              sizeof(ConfigLoggingEntry.ioerrlog));
898   };
899  
900   logging_killlog: FKILLLOG '=' QSTRING ';'
901   {
902 <  if (ypass == 2)
902 >  if (conf_parser_ctx.pass == 2)
903      strlcpy(ConfigLoggingEntry.killlog, yylval.string,
904              sizeof(ConfigLoggingEntry.killlog));
905   };
906  
907   logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
908   {
909 <  if (ypass == 2)
909 >  if (conf_parser_ctx.pass == 2)
910      set_log_level(L_CRIT);
911   } | LOG_LEVEL '=' T_L_ERROR ';'
912   {
913 <  if (ypass == 2)
913 >  if (conf_parser_ctx.pass == 2)
914      set_log_level(L_ERROR);
915   } | LOG_LEVEL '=' T_L_WARN ';'
916   {
917 <  if (ypass == 2)
917 >  if (conf_parser_ctx.pass == 2)
918      set_log_level(L_WARN);
919   } | LOG_LEVEL '=' T_L_NOTICE ';'
920   {
921 <  if (ypass == 2)
921 >  if (conf_parser_ctx.pass == 2)
922      set_log_level(L_NOTICE);
923   } | LOG_LEVEL '=' T_L_TRACE ';'
924   {
925 <  if (ypass == 2)
925 >  if (conf_parser_ctx.pass == 2)
926      set_log_level(L_TRACE);
927   } | LOG_LEVEL '=' T_L_INFO ';'
928   {
929 <  if (ypass == 2)
929 >  if (conf_parser_ctx.pass == 2)
930      set_log_level(L_INFO);
931   } | LOG_LEVEL '=' T_L_DEBUG ';'
932   {
933 <  if (ypass == 2)
933 >  if (conf_parser_ctx.pass == 2)
934      set_log_level(L_DEBUG);
935   };
936  
937   logging_use_logging: USE_LOGGING '=' TBOOL ';'
938   {
939 <  if (ypass == 2)
939 >  if (conf_parser_ctx.pass == 2)
940      ConfigLoggingEntry.use_logging = yylval.number;
941   };
942  
# Line 948 | Line 945 | logging_use_logging: USE_LOGGING '=' TBO
945   ***************************************************************************/
946   oper_entry: OPERATOR
947   {
948 <  if (ypass == 2)
948 >  if (conf_parser_ctx.pass == 2)
949    {
950      yy_conf = make_conf_item(OPER_TYPE);
951      yy_aconf = map_to_conf(yy_conf);
# Line 961 | Line 958 | oper_entry: OPERATOR
958    }
959   } oper_name_b '{' oper_items '}' ';'
960   {
961 <  if (ypass == 2)
961 >  if (conf_parser_ctx.pass == 2)
962    {
963      struct CollectItem *yy_tmp;
964      dlink_node *ptr;
# Line 1053 | Line 1050 | oper_item:      oper_name | oper_user |
1050  
1051   oper_name: NAME '=' QSTRING ';'
1052   {
1053 <  if (ypass == 2)
1053 >  if (conf_parser_ctx.pass == 2)
1054    {
1055      if (strlen(yylval.string) > OPERNICKLEN)
1056        yylval.string[OPERNICKLEN] = '\0';
# Line 1065 | Line 1062 | oper_name: NAME '=' QSTRING ';'
1062  
1063   oper_name_t: QSTRING
1064   {
1065 <  if (ypass == 2)
1065 >  if (conf_parser_ctx.pass == 2)
1066    {
1067      if (strlen(yylval.string) > OPERNICKLEN)
1068        yylval.string[OPERNICKLEN] = '\0';
# Line 1077 | Line 1074 | oper_name_t: QSTRING
1074  
1075   oper_user: USER '=' QSTRING ';'
1076   {
1077 <  if (ypass == 2)
1077 >  if (conf_parser_ctx.pass == 2)
1078    {
1079 <    struct CollectItem *yy_tmp;
1079 >    struct split_nuh_item nuh;
1080 >
1081 >    nuh.nuhmask  = yylval.string;
1082 >    nuh.nickptr  = NULL;
1083 >    nuh.userptr  = userbuf;
1084 >    nuh.hostptr  = hostbuf;
1085 >
1086 >    nuh.nicksize = 0;
1087 >    nuh.usersize = sizeof(userbuf);
1088 >    nuh.hostsize = sizeof(hostbuf);
1089 >
1090 >    split_nuh(&nuh);
1091  
1092      if (yy_aconf->user == NULL)
1093      {
1094 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1094 >      DupString(yy_aconf->user, userbuf);
1095 >      DupString(yy_aconf->host, hostbuf);
1096      }
1097      else
1098      {
1099 <      yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
1100 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1099 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
1100 >
1101 >      DupString(yy_tmp->user, userbuf);
1102 >      DupString(yy_tmp->host, hostbuf);
1103 >
1104        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1105      }
1106    }
# Line 1096 | Line 1108 | oper_user: USER '=' QSTRING ';'
1108  
1109   oper_password: PASSWORD '=' QSTRING ';'
1110   {
1111 <  if (ypass == 2)
1111 >  if (conf_parser_ctx.pass == 2)
1112    {
1113      if (yy_aconf->passwd != NULL)
1114        memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
# Line 1108 | Line 1120 | oper_password: PASSWORD '=' QSTRING ';'
1120  
1121   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1122   {
1123 <  if (ypass == 2)
1123 >  if (conf_parser_ctx.pass == 2)
1124    {
1125      if (yylval.number)
1126        SetConfEncrypted(yy_aconf);
# Line 1120 | Line 1132 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1132   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1133   {
1134   #ifdef HAVE_LIBCRYPTO
1135 <  if (ypass == 2)
1135 >  if (conf_parser_ctx.pass == 2)
1136    {
1137      BIO *file;
1138  
# Line 1161 | Line 1173 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1173  
1174   oper_class: CLASS '=' QSTRING ';'
1175   {
1176 <  if (ypass == 2)
1176 >  if (conf_parser_ctx.pass == 2)
1177    {
1178      MyFree(class_name);
1179      DupString(class_name, yylval.string);
# Line 1170 | Line 1182 | oper_class: CLASS '=' QSTRING ';'
1182  
1183   oper_umodes: T_UMODES
1184   {
1185 <  if (ypass == 2)
1185 >  if (conf_parser_ctx.pass == 2)
1186      yy_aconf->modes = 0;
1187   } '='  oper_umodes_items ';' ;
1188  
1189   oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
1190   oper_umodes_item:  T_BOTS
1191   {
1192 <  if (ypass == 2)
1192 >  if (conf_parser_ctx.pass == 2)
1193      yy_aconf->modes |= UMODE_BOTS;
1194   } | T_CCONN
1195   {
1196 <  if (ypass == 2)
1196 >  if (conf_parser_ctx.pass == 2)
1197      yy_aconf->modes |= UMODE_CCONN;
1198 + } | T_CCONN_FULL
1199 + {
1200 +  if (conf_parser_ctx.pass == 2)
1201 +    yy_aconf->modes |= UMODE_CCONN_FULL;
1202   } | T_DEAF
1203   {
1204 <  if (ypass == 2)
1204 >  if (conf_parser_ctx.pass == 2)
1205      yy_aconf->modes |= UMODE_DEAF;
1206   } | T_DEBUG
1207   {
1208 <  if (ypass == 2)
1208 >  if (conf_parser_ctx.pass == 2)
1209      yy_aconf->modes |= UMODE_DEBUG;
1210   } | T_FULL
1211   {
1212 <  if (ypass == 2)
1212 >  if (conf_parser_ctx.pass == 2)
1213      yy_aconf->modes |= UMODE_FULL;
1214   } | T_SKILL
1215   {
1216 <  if (ypass == 2)
1216 >  if (conf_parser_ctx.pass == 2)
1217      yy_aconf->modes |= UMODE_SKILL;
1218   } | T_NCHANGE
1219   {
1220 <  if (ypass == 2)
1220 >  if (conf_parser_ctx.pass == 2)
1221      yy_aconf->modes |= UMODE_NCHANGE;
1222   } | T_REJ
1223   {
1224 <  if (ypass == 2)
1224 >  if (conf_parser_ctx.pass == 2)
1225      yy_aconf->modes |= UMODE_REJ;
1226   } | T_UNAUTH
1227   {
1228 <  if (ypass == 2)
1228 >  if (conf_parser_ctx.pass == 2)
1229      yy_aconf->modes |= UMODE_UNAUTH;
1230   } | T_SPY
1231   {
1232 <  if (ypass == 2)
1232 >  if (conf_parser_ctx.pass == 2)
1233      yy_aconf->modes |= UMODE_SPY;
1234   } | T_EXTERNAL
1235   {
1236 <  if (ypass == 2)
1236 >  if (conf_parser_ctx.pass == 2)
1237      yy_aconf->modes |= UMODE_EXTERNAL;
1238   } | T_OPERWALL
1239   {
1240 <  if (ypass == 2)
1240 >  if (conf_parser_ctx.pass == 2)
1241      yy_aconf->modes |= UMODE_OPERWALL;
1242   } | T_SERVNOTICE
1243   {
1244 <  if (ypass == 2)
1244 >  if (conf_parser_ctx.pass == 2)
1245      yy_aconf->modes |= UMODE_SERVNOTICE;
1246   } | T_INVISIBLE
1247   {
1248 <  if (ypass == 2)
1248 >  if (conf_parser_ctx.pass == 2)
1249      yy_aconf->modes |= UMODE_INVISIBLE;
1250   } | T_WALLOP
1251   {
1252 <  if (ypass == 2)
1252 >  if (conf_parser_ctx.pass == 2)
1253      yy_aconf->modes |= UMODE_WALLOP;
1254   } | T_SOFTCALLERID
1255   {
1256 <  if (ypass == 2)
1256 >  if (conf_parser_ctx.pass == 2)
1257      yy_aconf->modes |= UMODE_SOFTCALLERID;
1258   } | T_CALLERID
1259   {
1260 <  if (ypass == 2)
1260 >  if (conf_parser_ctx.pass == 2)
1261      yy_aconf->modes |= UMODE_CALLERID;
1262   } | T_LOCOPS
1263   {
1264 <  if (ypass == 2)
1264 >  if (conf_parser_ctx.pass == 2)
1265      yy_aconf->modes |= UMODE_LOCOPS;
1266   };
1267  
1268   oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1269   {
1270 <  if (ypass == 2)
1270 >  if (conf_parser_ctx.pass == 2)
1271    {
1272      if (yylval.number)
1273        yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
# Line 1262 | Line 1278 | oper_global_kill: GLOBAL_KILL '=' TBOOL
1278  
1279   oper_remote: REMOTE '=' TBOOL ';'
1280   {
1281 <  if (ypass == 2)
1281 >  if (conf_parser_ctx.pass == 2)
1282    {
1283      if (yylval.number)
1284        yy_aconf->port |= OPER_FLAG_REMOTE;
# Line 1273 | Line 1289 | oper_remote: REMOTE '=' TBOOL ';'
1289  
1290   oper_remoteban: REMOTEBAN '=' TBOOL ';'
1291   {
1292 <  if (ypass == 2)
1292 >  if (conf_parser_ctx.pass == 2)
1293    {
1294      if (yylval.number)
1295        yy_aconf->port |= OPER_FLAG_REMOTEBAN;
# Line 1284 | Line 1300 | oper_remoteban: REMOTEBAN '=' TBOOL ';'
1300  
1301   oper_kline: KLINE '=' TBOOL ';'
1302   {
1303 <  if (ypass == 2)
1303 >  if (conf_parser_ctx.pass == 2)
1304    {
1305      if (yylval.number)
1306        yy_aconf->port |= OPER_FLAG_K;
# Line 1295 | Line 1311 | oper_kline: KLINE '=' TBOOL ';'
1311  
1312   oper_xline: XLINE '=' TBOOL ';'
1313   {
1314 <  if (ypass == 2)
1314 >  if (conf_parser_ctx.pass == 2)
1315    {
1316      if (yylval.number)
1317        yy_aconf->port |= OPER_FLAG_X;
# Line 1306 | Line 1322 | oper_xline: XLINE '=' TBOOL ';'
1322  
1323   oper_unkline: UNKLINE '=' TBOOL ';'
1324   {
1325 <  if (ypass == 2)
1325 >  if (conf_parser_ctx.pass == 2)
1326    {
1327      if (yylval.number)
1328        yy_aconf->port |= OPER_FLAG_UNKLINE;
# Line 1317 | Line 1333 | oper_unkline: UNKLINE '=' TBOOL ';'
1333  
1334   oper_gline: GLINE '=' TBOOL ';'
1335   {
1336 <  if (ypass == 2)
1336 >  if (conf_parser_ctx.pass == 2)
1337    {
1338      if (yylval.number)
1339        yy_aconf->port |= OPER_FLAG_GLINE;
# Line 1328 | Line 1344 | oper_gline: GLINE '=' TBOOL ';'
1344  
1345   oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1346   {
1347 <  if (ypass == 2)
1347 >  if (conf_parser_ctx.pass == 2)
1348    {
1349      if (yylval.number)
1350        yy_aconf->port |= OPER_FLAG_N;
# Line 1339 | Line 1355 | oper_nick_changes: NICK_CHANGES '=' TBOO
1355  
1356   oper_die: DIE '=' TBOOL ';'
1357   {
1358 <  if (ypass == 2)
1358 >  if (conf_parser_ctx.pass == 2)
1359    {
1360      if (yylval.number)
1361        yy_aconf->port |= OPER_FLAG_DIE;
# Line 1350 | Line 1366 | oper_die: DIE '=' TBOOL ';'
1366  
1367   oper_rehash: REHASH '=' TBOOL ';'
1368   {
1369 <  if (ypass == 2)
1369 >  if (conf_parser_ctx.pass == 2)
1370    {
1371      if (yylval.number)
1372        yy_aconf->port |= OPER_FLAG_REHASH;
# Line 1361 | Line 1377 | oper_rehash: REHASH '=' TBOOL ';'
1377  
1378   oper_admin: ADMIN '=' TBOOL ';'
1379   {
1380 <  if (ypass == 2)
1380 >  if (conf_parser_ctx.pass == 2)
1381    {
1382      if (yylval.number)
1383        yy_aconf->port |= OPER_FLAG_ADMIN;
# Line 1372 | Line 1388 | oper_admin: ADMIN '=' TBOOL ';'
1388  
1389   oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1390   {
1391 <  if (ypass == 2)
1391 >  if (conf_parser_ctx.pass == 2)
1392    {
1393      if (yylval.number)
1394        yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
# Line 1383 | Line 1399 | oper_hidden_admin: HIDDEN_ADMIN '=' TBOO
1399  
1400   oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1401   {
1402 <  if (ypass == 2)
1402 >  if (conf_parser_ctx.pass == 2)
1403    {
1404      if (yylval.number)
1405        yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
# Line 1394 | Line 1410 | oper_hidden_oper: HIDDEN_OPER '=' TBOOL
1410  
1411   oper_operwall: T_OPERWALL '=' TBOOL ';'
1412   {
1413 <  if (ypass == 2)
1413 >  if (conf_parser_ctx.pass == 2)
1414    {
1415      if (yylval.number)
1416        yy_aconf->port |= OPER_FLAG_OPERWALL;
# Line 1413 | Line 1429 | oper_flags_item: NOT { not_atom = 1; } o
1429  
1430   oper_flags_item_atom: GLOBAL_KILL
1431   {
1432 <  if (ypass == 2)
1432 >  if (conf_parser_ctx.pass == 2)
1433    {
1434      if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1435      else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1436    }
1437   } | REMOTE
1438   {
1439 <  if (ypass == 2)
1439 >  if (conf_parser_ctx.pass == 2)
1440    {
1441      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1442      else yy_aconf->port |= OPER_FLAG_REMOTE;
1443    }
1444   } | KLINE
1445   {
1446 <  if (ypass == 2)
1446 >  if (conf_parser_ctx.pass == 2)
1447    {
1448      if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1449      else yy_aconf->port |= OPER_FLAG_K;
1450    }
1451   } | UNKLINE
1452   {
1453 <  if (ypass == 2)
1453 >  if (conf_parser_ctx.pass == 2)
1454    {
1455      if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1456      else yy_aconf->port |= OPER_FLAG_UNKLINE;
1457    }
1458   } | XLINE
1459   {
1460 <  if (ypass == 2)
1460 >  if (conf_parser_ctx.pass == 2)
1461    {
1462      if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1463      else yy_aconf->port |= OPER_FLAG_X;
1464    }
1465   } | GLINE
1466   {
1467 <  if (ypass == 2)
1467 >  if (conf_parser_ctx.pass == 2)
1468    {
1469      if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1470      else yy_aconf->port |= OPER_FLAG_GLINE;
1471    }
1472   } | DIE
1473   {
1474 <  if (ypass == 2)
1474 >  if (conf_parser_ctx.pass == 2)
1475    {
1476      if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1477      else yy_aconf->port |= OPER_FLAG_DIE;
1478    }
1479   } | REHASH
1480   {
1481 <  if (ypass == 2)
1481 >  if (conf_parser_ctx.pass == 2)
1482    {
1483      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1484      else yy_aconf->port |= OPER_FLAG_REHASH;
1485    }
1486   } | ADMIN
1487   {
1488 <  if (ypass == 2)
1488 >  if (conf_parser_ctx.pass == 2)
1489    {
1490      if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1491      else yy_aconf->port |= OPER_FLAG_ADMIN;
1492    }
1493   } | HIDDEN_ADMIN
1494   {
1495 <  if (ypass == 2)
1495 >  if (conf_parser_ctx.pass == 2)
1496    {
1497      if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1498      else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1499    }
1500   } | NICK_CHANGES
1501   {
1502 <  if (ypass == 2)
1502 >  if (conf_parser_ctx.pass == 2)
1503    {
1504      if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1505      else yy_aconf->port |= OPER_FLAG_N;
1506    }
1507   } | T_OPERWALL
1508   {
1509 <  if (ypass == 2)
1509 >  if (conf_parser_ctx.pass == 2)
1510    {
1511      if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1512      else yy_aconf->port |= OPER_FLAG_OPERWALL;
1513    }
1514   } | OPER_SPY_T
1515   {
1516 <  if (ypass == 2)
1516 >  if (conf_parser_ctx.pass == 2)
1517    {
1518      if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1519      else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1520    }
1521   } | HIDDEN_OPER
1522   {
1523 <  if (ypass == 2)
1523 >  if (conf_parser_ctx.pass == 2)
1524    {
1525      if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1526      else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1527    }
1528   } | REMOTEBAN
1529   {
1530 <  if (ypass == 2)
1530 >  if (conf_parser_ctx.pass == 2)
1531    {
1532      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1533      else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1534    }
1535   } | ENCRYPTED
1536   {
1537 <  if (ypass == 2)
1537 >  if (conf_parser_ctx.pass == 2)
1538    {
1539      if (not_atom) ClearConfEncrypted(yy_aconf);
1540      else SetConfEncrypted(yy_aconf);
# Line 1531 | Line 1547 | oper_flags_item_atom: GLOBAL_KILL
1547   ***************************************************************************/
1548   class_entry: CLASS
1549   {
1550 <  if (ypass == 1)
1550 >  if (conf_parser_ctx.pass == 1)
1551    {
1552      yy_conf = make_conf_item(CLASS_TYPE);
1553 <    yy_class = (struct ClassItem *)map_to_conf(yy_conf);
1553 >    yy_class = map_to_conf(yy_conf);
1554    }
1555   } class_name_b '{' class_items '}' ';'
1556   {
1557 <  if (ypass == 1)
1557 >  if (conf_parser_ctx.pass == 1)
1558    {
1559 <    struct ConfItem *cconf;
1559 >    struct ConfItem *cconf = NULL;
1560      struct ClassItem *class = NULL;
1561  
1562      if (yy_class_name == NULL)
1547    {
1563        delete_conf_item(yy_conf);
1549    }
1564      else
1565      {
1566        cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1567  
1568        if (cconf != NULL)                /* The class existed already */
1569        {
1570 +        int user_count = 0;
1571 +
1572          rebuild_cidr_class(cconf, yy_class);
1573 <        class = (struct ClassItem *) map_to_conf(cconf);
1574 <        *class = *yy_class;
1573 >
1574 >        class = map_to_conf(cconf);
1575 >
1576 >        user_count = class->curr_user_count;
1577 >        memcpy(class, yy_class, sizeof(*class));
1578 >        class->curr_user_count = user_count;
1579 >        class->active = 1;
1580 >
1581          delete_conf_item(yy_conf);
1582  
1583          MyFree(cconf->name);            /* Allows case change of class name */
# Line 1565 | Line 1587 | class_entry: CLASS
1587        {
1588          MyFree(yy_conf->name);          /* just in case it was allocated */
1589          yy_conf->name = yy_class_name;
1590 +        yy_class->active = 1;
1591        }
1592      }
1593 +
1594      yy_class_name = NULL;
1595    }
1596   };
# Line 1590 | Line 1614 | class_item:     class_name |
1614  
1615   class_name: NAME '=' QSTRING ';'
1616   {
1617 <  if (ypass == 1)
1617 >  if (conf_parser_ctx.pass == 1)
1618    {
1619      MyFree(yy_class_name);
1620      DupString(yy_class_name, yylval.string);
# Line 1599 | Line 1623 | class_name: NAME '=' QSTRING ';'
1623  
1624   class_name_t: QSTRING
1625   {
1626 <  if (ypass == 1)
1626 >  if (conf_parser_ctx.pass == 1)
1627    {
1628      MyFree(yy_class_name);
1629      DupString(yy_class_name, yylval.string);
# Line 1608 | Line 1632 | class_name_t: QSTRING
1632  
1633   class_ping_time: PING_TIME '=' timespec ';'
1634   {
1635 <  if (ypass == 1)
1635 >  if (conf_parser_ctx.pass == 1)
1636      PingFreq(yy_class) = $3;
1637   };
1638  
1639   class_ping_warning: PING_WARNING '=' timespec ';'
1640   {
1641 <  if (ypass == 1)
1641 >  if (conf_parser_ctx.pass == 1)
1642      PingWarning(yy_class) = $3;
1643   };
1644  
1645   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1646   {
1647 <  if (ypass == 1)
1647 >  if (conf_parser_ctx.pass == 1)
1648      MaxPerIp(yy_class) = $3;
1649   };
1650  
1651   class_connectfreq: CONNECTFREQ '=' timespec ';'
1652   {
1653 <  if (ypass == 1)
1653 >  if (conf_parser_ctx.pass == 1)
1654      ConFreq(yy_class) = $3;
1655   };
1656  
1657   class_max_number: MAX_NUMBER '=' NUMBER ';'
1658   {
1659 <  if (ypass == 1)
1659 >  if (conf_parser_ctx.pass == 1)
1660      MaxTotal(yy_class) = $3;
1661   };
1662  
1663   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1664   {
1665 <  if (ypass == 1)
1665 >  if (conf_parser_ctx.pass == 1)
1666      MaxGlobal(yy_class) = $3;
1667   };
1668  
1669   class_max_local: MAX_LOCAL '=' NUMBER ';'
1670   {
1671 <  if (ypass == 1)
1671 >  if (conf_parser_ctx.pass == 1)
1672      MaxLocal(yy_class) = $3;
1673   };
1674  
1675   class_max_ident: MAX_IDENT '=' NUMBER ';'
1676   {
1677 <  if (ypass == 1)
1677 >  if (conf_parser_ctx.pass == 1)
1678      MaxIdent(yy_class) = $3;
1679   };
1680  
1681   class_sendq: SENDQ '=' sizespec ';'
1682   {
1683 <  if (ypass == 1)
1683 >  if (conf_parser_ctx.pass == 1)
1684      MaxSendq(yy_class) = $3;
1685   };
1686  
1687   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1688   {
1689 <  if (ypass == 1)
1689 >  if (conf_parser_ctx.pass == 1)
1690      CidrBitlenIPV4(yy_class) = $3;
1691   };
1692  
1693   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1694   {
1695 <  if (ypass == 1)
1695 >  if (conf_parser_ctx.pass == 1)
1696      CidrBitlenIPV6(yy_class) = $3;
1697   };
1698  
1699   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1700   {
1701 <  if (ypass == 1)
1701 >  if (conf_parser_ctx.pass == 1)
1702      NumberPerCidr(yy_class) = $3;
1703   };
1704  
# Line 1683 | Line 1707 | class_number_per_cidr: NUMBER_PER_CIDR '
1707   ***************************************************************************/
1708   listen_entry: LISTEN
1709   {
1710 <  if (ypass == 2)
1710 >  if (conf_parser_ctx.pass == 2)
1711    {
1712      listener_address = NULL;
1713      listener_flags = 0;
1714    }
1715   } '{' listen_items '}' ';'
1716   {
1717 <  if (ypass == 2)
1717 >  if (conf_parser_ctx.pass == 2)
1718    {
1719      MyFree(listener_address);
1720      listener_address = NULL;
# Line 1699 | Line 1723 | listen_entry: LISTEN
1723  
1724   listen_flags: IRCD_FLAGS
1725   {
1726 +  listener_flags = 0;
1727   } '='  listen_flags_items ';';
1728  
1729   listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item;
1730   listen_flags_item: T_SSL
1731   {
1732 <  if (ypass == 2)
1732 >  if (conf_parser_ctx.pass == 2)
1733      listener_flags |= LISTENER_SSL;
1734   } | HIDDEN
1735   {
1736 <  if (ypass == 2)
1736 >  if (conf_parser_ctx.pass == 2)
1737      listener_flags |= LISTENER_HIDDEN;
1738 + } | T_SERVER
1739 + {
1740 +  if (conf_parser_ctx.pass == 2)
1741 +    listener_flags |= LISTENER_SERVER;
1742   };
1743  
1744 +
1745 +
1746   listen_items:   listen_items listen_item | listen_item;
1747 < listen_item:    listen_port | listen_flags | listen_address | listen_host | error ';' ;
1747 > listen_item:    listen_port | listen_flags | listen_address | listen_host | error ';';
1748  
1749 < listen_port: PORT '=' port_items ';' ;
1749 > listen_port: PORT '=' port_items { listener_flags = 0; } ';';
1750  
1751   port_items: port_items ',' port_item | port_item;
1752  
1753   port_item: NUMBER
1754   {
1755 <  if (ypass == 2)
1755 >  if (conf_parser_ctx.pass == 2)
1756    {
1757      if ((listener_flags & LISTENER_SSL))
1758   #ifdef HAVE_LIBCRYPTO
1759 <      if (!ServerInfo.ctx)
1759 >      if (!ServerInfo.server_ctx)
1760   #endif
1761        {
1762          yyerror("SSL not available - port closed");
1763          break;
1764        }
1765      add_listener($1, listener_address, listener_flags);
1735    listener_flags = 0;
1766    }
1767   } | NUMBER TWODOTS NUMBER
1768   {
1769 <  if (ypass == 2)
1769 >  if (conf_parser_ctx.pass == 2)
1770    {
1771      int i;
1772  
1773      if ((listener_flags & LISTENER_SSL))
1774   #ifdef HAVE_LIBCRYPTO
1775 <      if (!ServerInfo.ctx)
1775 >      if (!ServerInfo.server_ctx)
1776   #endif
1777        {
1778          yyerror("SSL not available - port closed");
# Line 1751 | Line 1781 | port_item: NUMBER
1781  
1782      for (i = $1; i <= $3; ++i)
1783        add_listener(i, listener_address, listener_flags);
1754
1755    listener_flags = 0;
1784    }
1785   };
1786  
1787   listen_address: IP '=' QSTRING ';'
1788   {
1789 <  if (ypass == 2)
1789 >  if (conf_parser_ctx.pass == 2)
1790    {
1791      MyFree(listener_address);
1792      DupString(listener_address, yylval.string);
# Line 1767 | Line 1795 | listen_address: IP '=' QSTRING ';'
1795  
1796   listen_host: HOST '=' QSTRING ';'
1797   {
1798 <  if (ypass == 2)
1798 >  if (conf_parser_ctx.pass == 2)
1799    {
1800      MyFree(listener_address);
1801      DupString(listener_address, yylval.string);
# Line 1779 | Line 1807 | listen_host: HOST '=' QSTRING ';'
1807   ***************************************************************************/
1808   auth_entry: IRCD_AUTH
1809   {
1810 <  if (ypass == 2)
1810 >  if (conf_parser_ctx.pass == 2)
1811    {
1812      yy_conf = make_conf_item(CLIENT_TYPE);
1813      yy_aconf = map_to_conf(yy_conf);
# Line 1791 | Line 1819 | auth_entry: IRCD_AUTH
1819    }
1820   } '{' auth_items '}' ';'
1821   {
1822 <  if (ypass == 2)
1822 >  if (conf_parser_ctx.pass == 2)
1823    {
1824      struct CollectItem *yy_tmp = NULL;
1825      dlink_node *ptr = NULL, *next_ptr = NULL;
# Line 1856 | Line 1884 | auth_item:      auth_user | auth_passwd
1884  
1885   auth_user: USER '=' QSTRING ';'
1886   {
1887 <  if (ypass == 2)
1887 >  if (conf_parser_ctx.pass == 2)
1888    {
1889 <    struct CollectItem *yy_tmp;
1889 >    struct CollectItem *yy_tmp = NULL;
1890 >    struct split_nuh_item nuh;
1891 >
1892 >    nuh.nuhmask  = yylval.string;
1893 >    nuh.nickptr  = NULL;
1894 >    nuh.userptr  = userbuf;
1895 >    nuh.hostptr  = hostbuf;
1896 >
1897 >    nuh.nicksize = 0;
1898 >    nuh.usersize = sizeof(userbuf);
1899 >    nuh.hostsize = sizeof(hostbuf);
1900 >
1901 >    split_nuh(&nuh);
1902  
1903      if (yy_aconf->user == NULL)
1904 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
1904 >    {
1905 >      DupString(yy_aconf->user, userbuf);
1906 >      DupString(yy_aconf->host, hostbuf);
1907 >    }
1908      else
1909      {
1910        yy_tmp = MyMalloc(sizeof(struct CollectItem));
1911 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
1911 >
1912 >      DupString(yy_tmp->user, userbuf);
1913 >      DupString(yy_tmp->host, hostbuf);
1914 >
1915        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
1916      }
1917    }
# Line 1875 | Line 1921 | auth_user: USER '=' QSTRING ';'
1921  
1922   auth_passwd: PASSWORD '=' QSTRING ';'
1923   {
1924 <  if (ypass == 2)
1924 >  if (conf_parser_ctx.pass == 2)
1925    {
1926      /* be paranoid */
1927      if (yy_aconf->passwd != NULL)
# Line 1888 | Line 1934 | auth_passwd: PASSWORD '=' QSTRING ';'
1934  
1935   auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1936   {
1937 <  if (ypass == 2)
1937 >  if (conf_parser_ctx.pass == 2)
1938    {
1939      if (yylval.number)
1940        yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
# Line 1899 | Line 1945 | auth_spoof_notice: SPOOF_NOTICE '=' TBOO
1945  
1946   auth_class: CLASS '=' QSTRING ';'
1947   {
1948 <  if (ypass == 2)
1948 >  if (conf_parser_ctx.pass == 2)
1949    {
1950      MyFree(class_name);
1951      DupString(class_name, yylval.string);
# Line 1908 | Line 1954 | auth_class: CLASS '=' QSTRING ';'
1954  
1955   auth_encrypted: ENCRYPTED '=' TBOOL ';'
1956   {
1957 <  if (ypass == 2)
1957 >  if (conf_parser_ctx.pass == 2)
1958    {
1959      if (yylval.number)
1960        SetConfEncrypted(yy_aconf);
# Line 1927 | Line 1973 | auth_flags_item: NOT { not_atom = 1; } a
1973  
1974   auth_flags_item_atom: SPOOF_NOTICE
1975   {
1976 <  if (ypass == 2)
1976 >  if (conf_parser_ctx.pass == 2)
1977    {
1978      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1979      else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
# Line 1935 | Line 1981 | auth_flags_item_atom: SPOOF_NOTICE
1981  
1982   } | EXCEED_LIMIT
1983   {
1984 <  if (ypass == 2)
1984 >  if (conf_parser_ctx.pass == 2)
1985    {
1986      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1987      else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1988    }
1989   } | KLINE_EXEMPT
1990   {
1991 <  if (ypass == 2)
1991 >  if (conf_parser_ctx.pass == 2)
1992    {
1993      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1994      else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1995    }
1996   } | NEED_IDENT
1997   {
1998 <  if (ypass == 2)
1998 >  if (conf_parser_ctx.pass == 2)
1999    {
2000      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2001      else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2002    }
2003   } | CAN_FLOOD
2004   {
2005 <  if (ypass == 2)
2005 >  if (conf_parser_ctx.pass == 2)
2006    {
2007      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2008      else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2009    }
2010   } | CAN_IDLE
2011   {
2012 <  if (ypass == 2)
2012 >  if (conf_parser_ctx.pass == 2)
2013    {
2014      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
2015      else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
2016    }
2017   } | NO_TILDE
2018   {
2019 <  if (ypass == 2)
2019 >  if (conf_parser_ctx.pass == 2)
2020    {
2021      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2022      else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2023    }
2024   } | GLINE_EXEMPT
2025   {
2026 <  if (ypass == 2)
2026 >  if (conf_parser_ctx.pass == 2)
2027    {
2028      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2029      else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2030    }
2031   } | RESV_EXEMPT
2032   {
2033 <  if (ypass == 2)
2033 >  if (conf_parser_ctx.pass == 2)
2034    {
2035      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
2036      else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
2037    }
2038   } | NEED_PASSWORD
2039   {
2040 <  if (ypass == 2)
2040 >  if (conf_parser_ctx.pass == 2)
2041    {
2042      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2043      else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
# Line 2000 | Line 2046 | auth_flags_item_atom: SPOOF_NOTICE
2046  
2047   auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
2048   {
2049 <  if (ypass == 2)
2049 >  if (conf_parser_ctx.pass == 2)
2050    {
2051      if (yylval.number)
2052        yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
# Line 2011 | Line 2057 | auth_kline_exempt: KLINE_EXEMPT '=' TBOO
2057  
2058   auth_need_ident: NEED_IDENT '=' TBOOL ';'
2059   {
2060 <  if (ypass == 2)
2060 >  if (conf_parser_ctx.pass == 2)
2061    {
2062      if (yylval.number)
2063        yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
# Line 2022 | Line 2068 | auth_need_ident: NEED_IDENT '=' TBOOL ';
2068  
2069   auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2070   {
2071 <  if (ypass == 2)
2071 >  if (conf_parser_ctx.pass == 2)
2072    {
2073      if (yylval.number)
2074        yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
# Line 2033 | Line 2079 | auth_exceed_limit: EXCEED_LIMIT '=' TBOO
2079  
2080   auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2081   {
2082 <  if (ypass == 2)
2082 >  if (conf_parser_ctx.pass == 2)
2083    {
2084      if (yylval.number)
2085        yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
# Line 2044 | Line 2090 | auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2090  
2091   auth_no_tilde: NO_TILDE '=' TBOOL ';'
2092   {
2093 <  if (ypass == 2)
2093 >  if (conf_parser_ctx.pass == 2)
2094    {
2095      if (yylval.number)
2096        yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
# Line 2055 | Line 2101 | auth_no_tilde: NO_TILDE '=' TBOOL ';'
2101  
2102   auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2103   {
2104 <  if (ypass == 2)
2104 >  if (conf_parser_ctx.pass == 2)
2105    {
2106      if (yylval.number)
2107        yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
# Line 2067 | Line 2113 | auth_gline_exempt: GLINE_EXEMPT '=' TBOO
2113   /* XXX - need check for illegal hostnames here */
2114   auth_spoof: SPOOF '=' QSTRING ';'
2115   {
2116 <  if (ypass == 2)
2116 >  if (conf_parser_ctx.pass == 2)
2117    {
2118      MyFree(yy_conf->name);
2119  
# Line 2086 | Line 2132 | auth_spoof: SPOOF '=' QSTRING ';'
2132  
2133   auth_redir_serv: REDIRSERV '=' QSTRING ';'
2134   {
2135 <  if (ypass == 2)
2135 >  if (conf_parser_ctx.pass == 2)
2136    {
2137      yy_aconf->flags |= CONF_FLAGS_REDIR;
2138      MyFree(yy_conf->name);
# Line 2096 | Line 2142 | auth_redir_serv: REDIRSERV '=' QSTRING '
2142  
2143   auth_redir_port: REDIRPORT '=' NUMBER ';'
2144   {
2145 <  if (ypass == 2)
2145 >  if (conf_parser_ctx.pass == 2)
2146    {
2147      yy_aconf->flags |= CONF_FLAGS_REDIR;
2148      yy_aconf->port = $3;
# Line 2105 | Line 2151 | auth_redir_port: REDIRPORT '=' NUMBER ';
2151  
2152   auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2153   {
2154 <  if (ypass == 2)
2154 >  if (conf_parser_ctx.pass == 2)
2155    {
2156      if (yylval.number)
2157        yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
# Line 2120 | Line 2166 | auth_need_password: NEED_PASSWORD '=' TB
2166   ***************************************************************************/
2167   resv_entry: RESV
2168   {
2169 <  if (ypass == 2)
2169 >  if (conf_parser_ctx.pass == 2)
2170    {
2171      MyFree(resv_reason);
2172      resv_reason = NULL;
2173    }
2174   } '{' resv_items '}' ';'
2175   {
2176 <  if (ypass == 2)
2176 >  if (conf_parser_ctx.pass == 2)
2177    {
2178      MyFree(resv_reason);
2179      resv_reason = NULL;
# Line 2139 | Line 2185 | resv_item:     resv_creason | resv_channel |
2185  
2186   resv_creason: REASON '=' QSTRING ';'
2187   {
2188 <  if (ypass == 2)
2188 >  if (conf_parser_ctx.pass == 2)
2189    {
2190      MyFree(resv_reason);
2191      DupString(resv_reason, yylval.string);
# Line 2148 | Line 2194 | resv_creason: REASON '=' QSTRING ';'
2194  
2195   resv_channel: CHANNEL '=' QSTRING ';'
2196   {
2197 <  if (ypass == 2)
2197 >  if (conf_parser_ctx.pass == 2)
2198    {
2199      if (IsChanPrefix(*yylval.string))
2200      {
# Line 2163 | Line 2209 | resv_channel: CHANNEL '=' QSTRING ';'
2209  
2210   resv_nick: NICK '=' QSTRING ';'
2211   {
2212 <  if (ypass == 2)
2212 >  if (conf_parser_ctx.pass == 2)
2213    {
2214      char def_reason[] = "No reason";
2215  
# Line 2176 | Line 2222 | resv_nick: NICK '=' QSTRING ';'
2222   ***************************************************************************/
2223   shared_entry: T_SHARED
2224   {
2225 <  if (ypass == 2)
2225 >  if (conf_parser_ctx.pass == 2)
2226    {
2227      yy_conf = make_conf_item(ULINE_TYPE);
2228      yy_match_item = map_to_conf(yy_conf);
# Line 2184 | Line 2230 | shared_entry: T_SHARED
2230    }
2231   } '{' shared_items '}' ';'
2232   {
2233 <  if (ypass == 2)
2233 >  if (conf_parser_ctx.pass == 2)
2234    {
2235      yy_conf = NULL;
2236    }
# Line 2195 | Line 2241 | shared_item:  shared_name | shared_user
2241  
2242   shared_name: NAME '=' QSTRING ';'
2243   {
2244 <  if (ypass == 2)
2244 >  if (conf_parser_ctx.pass == 2)
2245    {
2246      MyFree(yy_conf->name);
2247      DupString(yy_conf->name, yylval.string);
# Line 2204 | Line 2250 | shared_name: NAME '=' QSTRING ';'
2250  
2251   shared_user: USER '=' QSTRING ';'
2252   {
2253 <  if (ypass == 2)
2253 >  if (conf_parser_ctx.pass == 2)
2254    {
2255 <    split_nuh(yylval.string, NULL, &yy_match_item->user, &yy_match_item->host);
2255 >    struct split_nuh_item nuh;
2256 >
2257 >    nuh.nuhmask  = yylval.string;
2258 >    nuh.nickptr  = NULL;
2259 >    nuh.userptr  = userbuf;
2260 >    nuh.hostptr  = hostbuf;
2261 >
2262 >    nuh.nicksize = 0;
2263 >    nuh.usersize = sizeof(userbuf);
2264 >    nuh.hostsize = sizeof(hostbuf);
2265 >
2266 >    split_nuh(&nuh);
2267 >
2268 >    DupString(yy_match_item->user, userbuf);
2269 >    DupString(yy_match_item->host, hostbuf);
2270    }
2271   };
2272  
2273   shared_type: TYPE
2274   {
2275 <  if (ypass == 2)
2275 >  if (conf_parser_ctx.pass == 2)
2276      yy_match_item->action = 0;
2277   } '=' shared_types ';' ;
2278  
2279   shared_types: shared_types ',' shared_type_item | shared_type_item;
2280   shared_type_item: KLINE
2281   {
2282 <  if (ypass == 2)
2282 >  if (conf_parser_ctx.pass == 2)
2283      yy_match_item->action |= SHARED_KLINE;
2284   } | TKLINE
2285   {
2286 <  if (ypass == 2)
2286 >  if (conf_parser_ctx.pass == 2)
2287      yy_match_item->action |= SHARED_TKLINE;
2288   } | UNKLINE
2289   {
2290 <  if (ypass == 2)
2290 >  if (conf_parser_ctx.pass == 2)
2291      yy_match_item->action |= SHARED_UNKLINE;
2292   } | XLINE
2293   {
2294 <  if (ypass == 2)
2294 >  if (conf_parser_ctx.pass == 2)
2295      yy_match_item->action |= SHARED_XLINE;
2296   } | TXLINE
2297   {
2298 <  if (ypass == 2)
2298 >  if (conf_parser_ctx.pass == 2)
2299      yy_match_item->action |= SHARED_TXLINE;
2300   } | T_UNXLINE
2301   {
2302 <  if (ypass == 2)
2302 >  if (conf_parser_ctx.pass == 2)
2303      yy_match_item->action |= SHARED_UNXLINE;
2304   } | RESV
2305   {
2306 <  if (ypass == 2)
2306 >  if (conf_parser_ctx.pass == 2)
2307      yy_match_item->action |= SHARED_RESV;
2308   } | TRESV
2309   {
2310 <  if (ypass == 2)
2310 >  if (conf_parser_ctx.pass == 2)
2311      yy_match_item->action |= SHARED_TRESV;
2312   } | T_UNRESV
2313   {
2314 <  if (ypass == 2)
2314 >  if (conf_parser_ctx.pass == 2)
2315      yy_match_item->action |= SHARED_UNRESV;
2316   } | T_LOCOPS
2317   {
2318 <  if (ypass == 2)
2318 >  if (conf_parser_ctx.pass == 2)
2319      yy_match_item->action |= SHARED_LOCOPS;
2320   } | T_ALL
2321   {
2322 <  if (ypass == 2)
2322 >  if (conf_parser_ctx.pass == 2)
2323      yy_match_item->action = SHARED_ALL;
2324   };
2325  
# Line 2268 | Line 2328 | shared_type_item: KLINE
2328   ***************************************************************************/
2329   cluster_entry: T_CLUSTER
2330   {
2331 <  if (ypass == 2)
2331 >  if (conf_parser_ctx.pass == 2)
2332    {
2333      yy_conf = make_conf_item(CLUSTER_TYPE);
2334      yy_conf->flags = SHARED_ALL;
2335    }
2336   } '{' cluster_items '}' ';'
2337   {
2338 <  if (ypass == 2)
2338 >  if (conf_parser_ctx.pass == 2)
2339    {
2340      if (yy_conf->name == NULL)
2341        DupString(yy_conf->name, "*");
# Line 2288 | Line 2348 | cluster_item:  cluster_name | cluster_typ
2348  
2349   cluster_name: NAME '=' QSTRING ';'
2350   {
2351 <  if (ypass == 2)
2351 >  if (conf_parser_ctx.pass == 2)
2352      DupString(yy_conf->name, yylval.string);
2353   };
2354  
2355   cluster_type: TYPE
2356   {
2357 <  if (ypass == 2)
2357 >  if (conf_parser_ctx.pass == 2)
2358      yy_conf->flags = 0;
2359   } '=' cluster_types ';' ;
2360  
2361   cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2362   cluster_type_item: KLINE
2363   {
2364 <  if (ypass == 2)
2364 >  if (conf_parser_ctx.pass == 2)
2365      yy_conf->flags |= SHARED_KLINE;
2366   } | TKLINE
2367   {
2368 <  if (ypass == 2)
2368 >  if (conf_parser_ctx.pass == 2)
2369      yy_conf->flags |= SHARED_TKLINE;
2370   } | UNKLINE
2371   {
2372 <  if (ypass == 2)
2372 >  if (conf_parser_ctx.pass == 2)
2373      yy_conf->flags |= SHARED_UNKLINE;
2374   } | XLINE
2375   {
2376 <  if (ypass == 2)
2376 >  if (conf_parser_ctx.pass == 2)
2377      yy_conf->flags |= SHARED_XLINE;
2378   } | TXLINE
2379   {
2380 <  if (ypass == 2)
2380 >  if (conf_parser_ctx.pass == 2)
2381      yy_conf->flags |= SHARED_TXLINE;
2382   } | T_UNXLINE
2383   {
2384 <  if (ypass == 2)
2384 >  if (conf_parser_ctx.pass == 2)
2385      yy_conf->flags |= SHARED_UNXLINE;
2386   } | RESV
2387   {
2388 <  if (ypass == 2)
2388 >  if (conf_parser_ctx.pass == 2)
2389      yy_conf->flags |= SHARED_RESV;
2390   } | TRESV
2391   {
2392 <  if (ypass == 2)
2392 >  if (conf_parser_ctx.pass == 2)
2393      yy_conf->flags |= SHARED_TRESV;
2394   } | T_UNRESV
2395   {
2396 <  if (ypass == 2)
2396 >  if (conf_parser_ctx.pass == 2)
2397      yy_conf->flags |= SHARED_UNRESV;
2398   } | T_LOCOPS
2399   {
2400 <  if (ypass == 2)
2400 >  if (conf_parser_ctx.pass == 2)
2401      yy_conf->flags |= SHARED_LOCOPS;
2402   } | T_ALL
2403   {
2404 <  if (ypass == 2)
2404 >  if (conf_parser_ctx.pass == 2)
2405      yy_conf->flags = SHARED_ALL;
2406   };
2407  
# Line 2350 | Line 2410 | cluster_type_item: KLINE
2410   ***************************************************************************/
2411   connect_entry: CONNECT  
2412   {
2413 <  if (ypass == 2)
2413 >  if (conf_parser_ctx.pass == 2)
2414    {
2415      yy_conf = make_conf_item(SERVER_TYPE);
2416      yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
# Line 2368 | Line 2428 | connect_entry: CONNECT
2428    }
2429   } connect_name_b '{' connect_items '}' ';'
2430   {
2431 <  if (ypass == 2)
2431 >  if (conf_parser_ctx.pass == 2)
2432    {
2433      struct CollectItem *yy_hconf=NULL;
2434      struct CollectItem *yy_lconf=NULL;
# Line 2383 | Line 2443 | connect_entry: CONNECT
2443            yy_aconf->passwd && yy_aconf->spasswd)
2444   #endif /* !HAVE_LIBCRYPTO */
2445          {
2446 <          if (conf_add_server(yy_conf, scount, class_name) >= 0)
2387 <          {
2388 <            ++scount;
2389 <          }
2390 <          else
2446 >          if (conf_add_server(yy_conf, class_name) == -1)
2447            {
2448              delete_conf_item(yy_conf);
2449              yy_conf = NULL;
# Line 2511 | Line 2567 | connect_item:   connect_name | connect_h
2567  
2568   connect_name: NAME '=' QSTRING ';'
2569   {
2570 <  if (ypass == 2)
2570 >  if (conf_parser_ctx.pass == 2)
2571    {
2572      if (yy_conf->name != NULL)
2573        yyerror("Multiple connect name entry");
# Line 2523 | Line 2579 | connect_name: NAME '=' QSTRING ';'
2579  
2580   connect_name_t: QSTRING
2581   {
2582 <  if (ypass == 2)
2582 >  if (conf_parser_ctx.pass == 2)
2583    {
2584      if (yy_conf->name != NULL)
2585        yyerror("Multiple connect name entry");
# Line 2535 | Line 2591 | connect_name_t: QSTRING
2591  
2592   connect_host: HOST '=' QSTRING ';'
2593   {
2594 <  if (ypass == 2)
2594 >  if (conf_parser_ctx.pass == 2)
2595    {
2596      MyFree(yy_aconf->host);
2597      DupString(yy_aconf->host, yylval.string);
# Line 2544 | Line 2600 | connect_host: HOST '=' QSTRING ';'
2600  
2601   connect_vhost: VHOST '=' QSTRING ';'
2602   {
2603 <  if (ypass == 2)
2603 >  if (conf_parser_ctx.pass == 2)
2604    {
2605      struct addrinfo hints, *res;
2606  
# Line 2570 | Line 2626 | connect_vhost: VHOST '=' QSTRING ';'
2626  
2627   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2628   {
2629 <  if (ypass == 2)
2629 >  if (conf_parser_ctx.pass == 2)
2630    {
2631      if ($3[0] == ':')
2632        yyerror("Server passwords cannot begin with a colon");
# Line 2588 | Line 2644 | connect_send_password: SEND_PASSWORD '='
2644  
2645   connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';'
2646   {
2647 <  if (ypass == 2)
2647 >  if (conf_parser_ctx.pass == 2)
2648    {
2649      if ($3[0] == ':')
2650        yyerror("Server passwords cannot begin with a colon");
# Line 2606 | Line 2662 | connect_accept_password: ACCEPT_PASSWORD
2662  
2663   connect_port: PORT '=' NUMBER ';'
2664   {
2665 <  if (ypass == 2)
2665 >  if (conf_parser_ctx.pass == 2)
2666      yy_aconf->port = $3;
2667   };
2668  
2669   connect_aftype: AFTYPE '=' T_IPV4 ';'
2670   {
2671 <  if (ypass == 2)
2671 >  if (conf_parser_ctx.pass == 2)
2672      yy_aconf->aftype = AF_INET;
2673   } | AFTYPE '=' T_IPV6 ';'
2674   {
2675   #ifdef IPV6
2676 <  if (ypass == 2)
2676 >  if (conf_parser_ctx.pass == 2)
2677      yy_aconf->aftype = AF_INET6;
2678   #endif
2679   };
2680  
2681   connect_fakename: FAKENAME '=' QSTRING ';'
2682   {
2683 <  if (ypass == 2)
2683 >  if (conf_parser_ctx.pass == 2)
2684    {
2685      MyFree(yy_aconf->fakename);
2686      DupString(yy_aconf->fakename, yylval.string);
# Line 2639 | Line 2695 | connect_flags_items: connect_flags_items
2695   connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2696                          |  { not_atom = 0; } connect_flags_item_atom;
2697  
2698 < connect_flags_item_atom: LAZYLINK
2698 > connect_flags_item_atom: COMPRESSED
2699   {
2700 <  if (ypass == 2)
2645 <  {
2646 <    if (not_atom)ClearConfLazyLink(yy_aconf);
2647 <    else SetConfLazyLink(yy_aconf);
2648 <  }
2649 < } | COMPRESSED
2650 < {
2651 <  if (ypass == 2)
2700 >  if (conf_parser_ctx.pass == 2)
2701   #ifndef HAVE_LIBZ
2702      yyerror("Ignoring flags = compressed; -- no zlib support");
2703   #else
# Line 2659 | Line 2708 | connect_flags_item_atom: LAZYLINK
2708   #endif
2709   } | CRYPTLINK
2710   {
2711 <  if (ypass == 2)
2711 >  if (conf_parser_ctx.pass == 2)
2712    {
2713      if (not_atom)ClearConfCryptLink(yy_aconf);
2714      else SetConfCryptLink(yy_aconf);
2715    }
2716   } | AUTOCONN
2717   {
2718 <  if (ypass == 2)
2718 >  if (conf_parser_ctx.pass == 2)
2719    {
2720      if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2721      else SetConfAllowAutoConn(yy_aconf);
2722    }
2723   } | BURST_AWAY
2724   {
2725 <  if (ypass == 2)
2725 >  if (conf_parser_ctx.pass == 2)
2726    {
2727      if (not_atom)ClearConfAwayBurst(yy_aconf);
2728      else SetConfAwayBurst(yy_aconf);
2729    }
2730   } | TOPICBURST
2731   {
2732 <  if (ypass == 2)
2732 >  if (conf_parser_ctx.pass == 2)
2733    {
2734      if (not_atom)ClearConfTopicBurst(yy_aconf);
2735      else SetConfTopicBurst(yy_aconf);
# Line 2691 | Line 2740 | connect_flags_item_atom: LAZYLINK
2740   connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2741   {
2742   #ifdef HAVE_LIBCRYPTO
2743 <  if (ypass == 2)
2743 >  if (conf_parser_ctx.pass == 2)
2744    {
2745      BIO *file;
2746  
# Line 2731 | Line 2780 | connect_rsa_public_key_file: RSA_PUBLIC_
2780  
2781   connect_encrypted: ENCRYPTED '=' TBOOL ';'
2782   {
2783 <  if (ypass == 2)
2783 >  if (conf_parser_ctx.pass == 2)
2784    {
2785      if (yylval.number)
2786        yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
# Line 2742 | Line 2791 | connect_encrypted: ENCRYPTED '=' TBOOL '
2791  
2792   connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2793   {
2794 <  if (ypass == 2)
2794 >  if (conf_parser_ctx.pass == 2)
2795    {
2796      if (yylval.number)
2797        yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
# Line 2753 | Line 2802 | connect_cryptlink: CRYPTLINK '=' TBOOL '
2802  
2803   connect_compressed: COMPRESSED '=' TBOOL ';'
2804   {
2805 <  if (ypass == 2)
2805 >  if (conf_parser_ctx.pass == 2)
2806    {
2807      if (yylval.number)
2808   #ifndef HAVE_LIBZ
# Line 2768 | Line 2817 | connect_compressed: COMPRESSED '=' TBOOL
2817  
2818   connect_auto: AUTOCONN '=' TBOOL ';'
2819   {
2820 <  if (ypass == 2)
2820 >  if (conf_parser_ctx.pass == 2)
2821    {
2822      if (yylval.number)
2823        yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
# Line 2779 | Line 2828 | connect_auto: AUTOCONN '=' TBOOL ';'
2828  
2829   connect_topicburst: TOPICBURST '=' TBOOL ';'
2830   {
2831 <  if (ypass == 2)
2831 >  if (conf_parser_ctx.pass == 2)
2832    {
2833      if (yylval.number)
2834 <      SetConfTopicBurst(yy_aconf)
2834 >      SetConfTopicBurst(yy_aconf);
2835      else
2836        ClearConfTopicBurst(yy_aconf);
2837    }
# Line 2790 | Line 2839 | connect_topicburst: TOPICBURST '=' TBOOL
2839  
2840   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2841   {
2842 <  if (ypass == 2)
2842 >  if (conf_parser_ctx.pass == 2)
2843    {
2844      struct CollectItem *yy_tmp;
2845  
# Line 2803 | Line 2852 | connect_hub_mask: HUB_MASK '=' QSTRING '
2852  
2853   connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2854   {
2855 <  if (ypass == 2)
2855 >  if (conf_parser_ctx.pass == 2)
2856    {
2857      struct CollectItem *yy_tmp;
2858  
# Line 2816 | Line 2865 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2865  
2866   connect_class: CLASS '=' QSTRING ';'
2867   {
2868 <  if (ypass == 2)
2868 >  if (conf_parser_ctx.pass == 2)
2869    {
2870      MyFree(class_name);
2871      DupString(class_name, yylval.string);
# Line 2826 | Line 2875 | connect_class: CLASS '=' QSTRING ';'
2875   connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2876   {
2877   #ifdef HAVE_LIBCRYPTO
2878 <  if (ypass == 2)
2878 >  if (conf_parser_ctx.pass == 2)
2879    {
2880      struct EncCapability *ecap;
2881      const char *cipher_name;
# Line 2850 | Line 2899 | connect_cipher_preference: CIPHER_PREFER
2899        yyerror("Invalid cipher");
2900    }
2901   #else
2902 <  if (ypass == 2)
2902 >  if (conf_parser_ctx.pass == 2)
2903      yyerror("Ignoring cipher_preference -- no OpenSSL support");
2904   #endif
2905   };
# Line 2860 | Line 2909 | connect_cipher_preference: CIPHER_PREFER
2909   ***************************************************************************/
2910   kill_entry: KILL
2911   {
2912 <  if (ypass == 2)
2912 >  if (conf_parser_ctx.pass == 2)
2913    {
2914      userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0';
2915      regex_ban = 0;
2916    }
2917   } '{' kill_items '}' ';'
2918   {
2919 <  if (ypass == 2)
2919 >  if (conf_parser_ctx.pass == 2)
2920    {
2921      if (userbuf[0] && hostbuf[0])
2922      {
2923        if (regex_ban)
2924        {
2925 <        pcre *exp_user = NULL;
2926 <        pcre *exp_host = NULL;
2925 > #ifdef HAVE_LIBPCRE
2926 >        void *exp_user = NULL;
2927 >        void *exp_host = NULL;
2928          const char *errptr = NULL;
2929  
2930          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2931              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2932          {
2933 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s", errptr);
2933 >          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s",
2934 >               errptr);
2935            break;
2936          }
2937  
2938 <        yy_conf = make_conf_item(RKLINE_TYPE);
2938 >        yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE));
2939          yy_aconf->regexuser = exp_user;
2940          yy_aconf->regexhost = exp_host;
2941  
# Line 2895 | Line 2946 | kill_entry: KILL
2946            DupString(yy_aconf->reason, reasonbuf);
2947          else
2948            DupString(yy_aconf->reason, "No reason");
2949 + #else
2950 +        ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support");
2951 +        break;
2952 + #endif
2953        }
2954        else
2955        {
2956 <        yy_conf = make_conf_item(KLINE_TYPE);
2902 <        yy_aconf = map_to_conf(yy_conf);
2956 >        yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2957  
2958          DupString(yy_aconf->user, userbuf);
2959          DupString(yy_aconf->host, hostbuf);
# Line 2911 | Line 2965 | kill_entry: KILL
2965          add_conf_by_address(CONF_KILL, yy_aconf);
2966        }
2967      }
2914    else
2915      delete_conf_item(yy_conf);
2968  
2917    yy_conf = NULL;
2969      yy_aconf = NULL;
2970    }
2971   };
# Line 2926 | Line 2977 | kill_type: TYPE
2977   kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2978   kill_type_item: REGEX_T
2979   {
2980 <  if (ypass == 2)
2980 >  if (conf_parser_ctx.pass == 2)
2981      regex_ban = 1;
2982   };
2983  
# Line 2935 | Line 2986 | kill_item:      kill_user | kill_reason
2986  
2987   kill_user: USER '=' QSTRING ';'
2988   {
2989 <  if (ypass == 2)
2989 >  if (conf_parser_ctx.pass == 2)
2990    {
2991 <    char *user = NULL, *host = NULL;
2991 >    struct split_nuh_item nuh;
2992  
2993 <    split_nuh(yylval.string, NULL, &user, &host);
2993 >    nuh.nuhmask  = yylval.string;
2994 >    nuh.nickptr  = NULL;
2995 >    nuh.userptr  = userbuf;
2996 >    nuh.hostptr  = hostbuf;
2997  
2998 <    strlcpy(userbuf, user, sizeof(userbuf));
2999 <    strlcpy(hostbuf, host, sizeof(hostbuf));
2998 >    nuh.nicksize = 0;
2999 >    nuh.usersize = sizeof(userbuf);
3000 >    nuh.hostsize = sizeof(hostbuf);
3001  
3002 <    MyFree(user);
2948 <    MyFree(host);
3002 >    split_nuh(&nuh);
3003    }
3004   };
3005  
3006   kill_reason: REASON '=' QSTRING ';'
3007   {
3008 <  if (ypass == 2)
3008 >  if (conf_parser_ctx.pass == 2)
3009      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
3010   };
3011  
# Line 2960 | Line 3014 | kill_reason: REASON '=' QSTRING ';'
3014   ***************************************************************************/
3015   deny_entry: DENY
3016   {
3017 <  if (ypass == 2)
3018 <  {
2965 <    yy_conf = make_conf_item(DLINE_TYPE);
2966 <    yy_aconf = map_to_conf(yy_conf);
2967 <    /* default reason */
2968 <    DupString(yy_aconf->reason, "No reason");
2969 <  }
3017 >  if (conf_parser_ctx.pass == 2)
3018 >    hostbuf[0] = reasonbuf[0] = '\0';
3019   } '{' deny_items '}' ';'
3020   {
3021 <  if (ypass == 2)
3021 >  if (conf_parser_ctx.pass == 2)
3022    {
3023 <    if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
3023 >    if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
3024 >    {
3025 >      yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
3026 >      DupString(yy_aconf->host, hostbuf);
3027 >
3028 >      if (reasonbuf[0])
3029 >        DupString(yy_aconf->reason, reasonbuf);
3030 >      else
3031 >        DupString(yy_aconf->reason, "No reason");
3032        add_conf_by_address(CONF_DLINE, yy_aconf);
3033 <    else
3034 <      delete_conf_item(yy_conf);
2978 <    yy_conf = NULL;
2979 <    yy_aconf = NULL;
3033 >      yy_aconf = NULL;
3034 >    }
3035    }
3036   };
3037  
# Line 2985 | Line 3040 | deny_item:      deny_ip | deny_reason |
3040  
3041   deny_ip: IP '=' QSTRING ';'
3042   {
3043 <  if (ypass == 2)
3044 <  {
2990 <    MyFree(yy_aconf->host);
2991 <    DupString(yy_aconf->host, yylval.string);
2992 <  }
3043 >  if (conf_parser_ctx.pass == 2)
3044 >    strlcpy(hostbuf, yylval.string, sizeof(hostbuf));
3045   };
3046  
3047   deny_reason: REASON '=' QSTRING ';'
3048   {
3049 <  if (ypass == 2)
3050 <  {
2999 <    MyFree(yy_aconf->reason);
3000 <    DupString(yy_aconf->reason, yylval.string);
3001 <  }
3049 >  if (conf_parser_ctx.pass == 2)
3050 >    strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
3051   };
3052  
3053   /***************************************************************************
# Line 3011 | Line 3060 | exempt_item:      exempt_ip | error;
3060  
3061   exempt_ip: IP '=' QSTRING ';'
3062   {
3063 <  if (ypass == 2)
3063 >  if (conf_parser_ctx.pass == 2)
3064    {
3065      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
3066      {
3067 <      yy_conf = make_conf_item(EXEMPTDLINE_TYPE);
3019 <      yy_aconf = map_to_conf(yy_conf);
3067 >      yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE));
3068        DupString(yy_aconf->host, yylval.string);
3069  
3070        add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf);
3023
3024      yy_conf = NULL;
3071        yy_aconf = NULL;
3072      }
3073    }
# Line 3032 | Line 3078 | exempt_ip: IP '=' QSTRING ';'
3078   ***************************************************************************/
3079   gecos_entry: GECOS
3080   {
3081 <  if (ypass == 2)
3081 >  if (conf_parser_ctx.pass == 2)
3082    {
3083      regex_ban = 0;
3084      reasonbuf[0] = gecos_name[0] = '\0';
3085    }
3086   } '{' gecos_items '}' ';'
3087   {
3088 <  if (ypass == 2)
3088 >  if (conf_parser_ctx.pass == 2)
3089    {
3090      if (gecos_name[0])
3091      {
3092        if (regex_ban)
3093        {
3094 <        pcre *exp_p = NULL;
3094 > #ifdef HAVE_LIBPCRE
3095 >        void *exp_p = NULL;
3096          const char *errptr = NULL;
3097  
3098          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
3099          {
3100 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s", errptr);
3100 >          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s",
3101 >               errptr);
3102            break;
3103          }
3104  
3105          yy_conf = make_conf_item(RXLINE_TYPE);
3106          yy_conf->regexpname = exp_p;
3107 + #else
3108 +        ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support");
3109 +        break;
3110 + #endif
3111        }
3112        else
3113          yy_conf = make_conf_item(XLINE_TYPE);
# Line 3078 | Line 3130 | gecos_flags: TYPE
3130   gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
3131   gecos_flags_item: REGEX_T
3132   {
3133 <  if (ypass == 2)
3133 >  if (conf_parser_ctx.pass == 2)
3134      regex_ban = 1;
3135   };
3136  
# Line 3087 | Line 3139 | gecos_item:  gecos_name | gecos_reason |
3139  
3140   gecos_name: NAME '=' QSTRING ';'
3141   {
3142 <  if (ypass == 2)
3142 >  if (conf_parser_ctx.pass == 2)
3143      strlcpy(gecos_name, yylval.string, sizeof(gecos_name));
3144   };
3145  
3146   gecos_reason: REASON '=' QSTRING ';'
3147   {
3148 <  if (ypass == 2)
3148 >  if (conf_parser_ctx.pass == 2)
3149      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
3150   };
3151  
# Line 3131 | Line 3183 | general_item:       general_hide_spoof_i
3183                      general_disable_auth | general_burst_away |
3184                      general_tkline_expire_notices | general_gline_min_cidr |
3185                      general_gline_min_cidr6 | general_use_whois_actually |
3186 <                    general_reject_hold_time |
3186 >                    general_reject_hold_time | general_stats_e_disabled |
3187 >                    general_max_watch |
3188                      error;
3189  
3190  
3191 + general_max_watch: MAX_WATCH '=' NUMBER ';'
3192 + {
3193 +  ConfigFileEntry.max_watch = $3;
3194 + };
3195  
3196   general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
3197   {
# Line 3223 | Line 3280 | general_ts_warn_delta: TS_WARN_DELTA '='
3280  
3281   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
3282   {
3283 <  if (ypass == 2)
3283 >  if (conf_parser_ctx.pass == 2)
3284      ConfigFileEntry.ts_max_delta = $3;
3285   };
3286  
3287   general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
3288   {
3289 <  if (($3 > 0) && ypass == 1)
3289 >  if (($3 > 0) && conf_parser_ctx.pass == 1)
3290    {
3291      ilog(L_CRIT, "You haven't read your config file properly.");
3292      ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
# Line 3245 | Line 3302 | general_kline_with_reason: KLINE_WITH_RE
3302  
3303   general_kline_reason: KLINE_REASON '=' QSTRING ';'
3304   {
3305 <  if (ypass == 2)
3305 >  if (conf_parser_ctx.pass == 2)
3306    {
3307      MyFree(ConfigFileEntry.kline_reason);
3308      DupString(ConfigFileEntry.kline_reason, yylval.string);
# Line 3262 | Line 3319 | general_warn_no_nline: WARN_NO_NLINE '='
3319    ConfigFileEntry.warn_no_nline = yylval.number;
3320   };
3321  
3322 + general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
3323 + {
3324 +  ConfigFileEntry.stats_e_disabled = yylval.number;
3325 + };
3326 +
3327   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
3328   {
3329    ConfigFileEntry.stats_o_oper_only = yylval.number;
# Line 3330 | Line 3392 | general_oper_pass_resv: OPER_PASS_RESV '
3392  
3393   general_message_locale: MESSAGE_LOCALE '=' QSTRING ';'
3394   {
3395 <  if (ypass == 2)
3395 >  if (conf_parser_ctx.pass == 2)
3396    {
3397      if (strlen(yylval.string) > LOCALE_LENGTH-2)
3398        yylval.string[LOCALE_LENGTH-1] = '\0';
# Line 3356 | Line 3418 | general_max_targets: MAX_TARGETS '=' NUM
3418  
3419   general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3420   {
3421 <  if (ypass == 2)
3421 >  if (conf_parser_ctx.pass == 2)
3422    {
3423      MyFree(ConfigFileEntry.servlink_path);
3424      DupString(ConfigFileEntry.servlink_path, yylval.string);
# Line 3366 | Line 3428 | general_servlink_path: SERVLINK_PATH '='
3428   general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3429   {
3430   #ifdef HAVE_LIBCRYPTO
3431 <  if (ypass == 2)
3431 >  if (conf_parser_ctx.pass == 2)
3432    {
3433      struct EncCapability *ecap;
3434      const char *cipher_name;
# Line 3390 | Line 3452 | general_default_cipher_preference: DEFAU
3452        yyerror("Invalid cipher");
3453    }
3454   #else
3455 <  if (ypass == 2)
3455 >  if (conf_parser_ctx.pass == 2)
3456      yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3457   #endif
3458   };
3459  
3460   general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3461   {
3462 <  if (ypass == 2)
3462 >  if (conf_parser_ctx.pass == 2)
3463    {
3464      ConfigFileEntry.compression_level = $3;
3465   #ifndef HAVE_LIBZ
# Line 3420 | Line 3482 | general_use_egd: USE_EGD '=' TBOOL ';'
3482  
3483   general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
3484   {
3485 <  if (ypass == 2)
3485 >  if (conf_parser_ctx.pass == 2)
3486    {
3487      MyFree(ConfigFileEntry.egdpool_path);
3488      DupString(ConfigFileEntry.egdpool_path, yylval.string);
# Line 3454 | Line 3516 | umode_oitem:     T_BOTS
3516   } | T_CCONN
3517   {
3518    ConfigFileEntry.oper_umodes |= UMODE_CCONN;
3519 + } | T_CCONN_FULL
3520 + {
3521 +  ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
3522   } | T_DEAF
3523   {
3524    ConfigFileEntry.oper_umodes |= UMODE_DEAF;
# Line 3516 | Line 3581 | umode_item:    T_BOTS
3581   } | T_CCONN
3582   {
3583    ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
3584 + } | T_CCONN_FULL
3585 + {
3586 +  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
3587   } | T_DEAF
3588   {
3589    ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
# Line 3596 | Line 3664 | general_dot_in_ip6_addr: DOT_IN_IP6_ADDR
3664   ***************************************************************************/
3665   gline_entry: GLINES
3666   {
3667 <  if (ypass == 2)
3667 >  if (conf_parser_ctx.pass == 2)
3668    {
3669      yy_conf = make_conf_item(GDENY_TYPE);
3670      yy_aconf = map_to_conf(yy_conf);
3671    }
3672   } '{' gline_items '}' ';'
3673   {
3674 <  if (ypass == 2)
3674 >  if (conf_parser_ctx.pass == 2)
3675    {
3676      /*
3677       * since we re-allocate yy_conf/yy_aconf after the end of action=, at the
# Line 3629 | Line 3697 | gline_item:         gline_enable |
3697  
3698   gline_enable: ENABLE '=' TBOOL ';'
3699   {
3700 <  if (ypass == 2)
3700 >  if (conf_parser_ctx.pass == 2)
3701      ConfigFileEntry.glines = yylval.number;
3702   };
3703  
3704   gline_duration: DURATION '=' timespec ';'
3705   {
3706 <  if (ypass == 2)
3706 >  if (conf_parser_ctx.pass == 2)
3707      ConfigFileEntry.gline_time = $3;
3708   };
3709  
3710   gline_logging: LOGGING
3711   {
3712 <  if (ypass == 2)
3712 >  if (conf_parser_ctx.pass == 2)
3713      ConfigFileEntry.gline_logging = 0;
3714   } '=' gline_logging_types ';';
3715   gline_logging_types:     gline_logging_types ',' gline_logging_type_item | gline_logging_type_item;
3716   gline_logging_type_item: T_REJECT
3717   {
3718 <  if (ypass == 2)
3718 >  if (conf_parser_ctx.pass == 2)
3719      ConfigFileEntry.gline_logging |= GDENY_REJECT;
3720   } | T_BLOCK
3721   {
3722 <  if (ypass == 2)
3722 >  if (conf_parser_ctx.pass == 2)
3723      ConfigFileEntry.gline_logging |= GDENY_BLOCK;
3724   };
3725  
3726   gline_user: USER '=' QSTRING ';'
3727   {
3728 <  if (ypass == 2)
3728 >  if (conf_parser_ctx.pass == 2)
3729    {
3730 <    struct CollectItem *yy_tmp = NULL;
3730 >    struct split_nuh_item nuh;
3731 >
3732 >    nuh.nuhmask  = yylval.string;
3733 >    nuh.nickptr  = NULL;
3734 >    nuh.userptr  = userbuf;
3735 >    nuh.hostptr  = hostbuf;
3736 >
3737 >    nuh.nicksize = 0;
3738 >    nuh.usersize = sizeof(userbuf);
3739 >    nuh.hostsize = sizeof(hostbuf);
3740 >
3741 >    split_nuh(&nuh);
3742  
3743      if (yy_aconf->user == NULL)
3744      {
3745 <      split_nuh(yylval.string, NULL, &yy_aconf->user, &yy_aconf->host);
3745 >      DupString(yy_aconf->user, userbuf);
3746 >      DupString(yy_aconf->host, hostbuf);
3747      }
3748      else
3749      {
3750 <      yy_tmp = MyMalloc(sizeof(struct CollectItem));
3751 <      split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host);
3750 >      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
3751 >
3752 >      DupString(yy_tmp->user, userbuf);
3753 >      DupString(yy_tmp->host, hostbuf);
3754 >
3755        dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
3756      }
3757    }
# Line 3676 | Line 3759 | gline_user: USER '=' QSTRING ';'
3759  
3760   gline_server: NAME '=' QSTRING ';'
3761   {
3762 <  if (ypass == 2)  
3762 >  if (conf_parser_ctx.pass == 2)  
3763    {
3764      MyFree(yy_conf->name);
3765      DupString(yy_conf->name, yylval.string);
# Line 3685 | Line 3768 | gline_server: NAME '=' QSTRING ';'
3768  
3769   gline_action: ACTION
3770   {
3771 <  if (ypass == 2)
3771 >  if (conf_parser_ctx.pass == 2)
3772      yy_aconf->flags = 0;
3773   } '=' gdeny_types ';'
3774   {
3775 <  if (ypass == 2)
3775 >  if (conf_parser_ctx.pass == 2)
3776    {
3777      struct CollectItem *yy_tmp = NULL;
3778      dlink_node *ptr, *next_ptr;
# Line 3736 | Line 3819 | gline_action: ACTION
3819   gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item;
3820   gdeny_type_item: T_REJECT
3821   {
3822 <  if (ypass == 2)
3822 >  if (conf_parser_ctx.pass == 2)
3823      yy_aconf->flags |= GDENY_REJECT;
3824   } | T_BLOCK
3825   {
3826 <  if (ypass == 2)
3826 >  if (conf_parser_ctx.pass == 2)
3827      yy_aconf->flags |= GDENY_BLOCK;
3828   };
3829  
# Line 3760 | Line 3843 | channel_item:       channel_disable_loca
3843                      channel_no_create_on_split | channel_restrict_channels |
3844                      channel_no_join_on_split | channel_burst_topicwho |
3845                      channel_jflood_count | channel_jflood_time |
3846 <                    error;
3846 >                    channel_disable_fake_channels | error;
3847 >
3848 > channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
3849 > {
3850 >  ConfigChannel.disable_fake_channels = yylval.number;
3851 > };
3852  
3853   channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';'
3854   {
# Line 3863 | Line 3951 | serverhide_item:    serverhide_flatten_l
3951  
3952   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
3953   {
3954 <  if (ypass == 2)
3954 >  if (conf_parser_ctx.pass == 2)
3955      ConfigServerHide.flatten_links = yylval.number;
3956   };
3957  
3958   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
3959   {
3960 <  if (ypass == 2)
3960 >  if (conf_parser_ctx.pass == 2)
3961      ConfigServerHide.hide_servers = yylval.number;
3962   };
3963  
3964   serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';'
3965   {
3966 <  if (ypass == 2)
3966 >  if (conf_parser_ctx.pass == 2)
3967    {
3968      MyFree(ConfigServerHide.hidden_name);
3969      DupString(ConfigServerHide.hidden_name, yylval.string);
# Line 3884 | Line 3972 | serverhide_hidden_name: HIDDEN_NAME '='
3972  
3973   serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3974   {
3975 <  if (ypass == 2)
3975 >  if (conf_parser_ctx.pass == 2)
3976    {
3977      if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3978      {
# Line 3898 | Line 3986 | serverhide_links_delay: LINKS_DELAY '='
3986  
3987   serverhide_hidden: HIDDEN '=' TBOOL ';'
3988   {
3989 <  if (ypass == 2)
3989 >  if (conf_parser_ctx.pass == 2)
3990      ConfigServerHide.hidden = yylval.number;
3991   };
3992  
3993   serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';'
3994   {
3995 <  if (ypass == 2)
3995 >  if (conf_parser_ctx.pass == 2)
3996      ConfigServerHide.disable_hidden = yylval.number;
3997   };
3998  
3999   serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';'
4000   {
4001 <  if (ypass == 2)
4001 >  if (conf_parser_ctx.pass == 2)
4002      ConfigServerHide.hide_server_ips = yylval.number;
4003   };

Diff Legend

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