ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-7.2/src/ircd_parser.y
(Generate patch)

Comparing ircd-hybrid-7.2/src/ircd_parser.y (file contents):
Revision 966 by michael, Wed Nov 7 22:47:44 2007 UTC vs.
Revision 967 by michael, Sun Aug 2 18:05:28 2009 UTC

# Line 300 | Line 300 | unhook_hub_leaf_confs(void)
300   %token  RSA_PRIVATE_KEY_FILE
301   %token  RSA_PUBLIC_KEY_FILE
302   %token  SSL_CERTIFICATE_FILE
303 + %token  T_SSL_CONNECTION_METHOD
304 + %token  T_SSLV3
305 + %token  T_TLSV1
306   %token  RESV
307   %token  RESV_EXEMPT
308   %token  SECONDS MINUTES HOURS DAYS WEEKS
# Line 470 | Line 473 | modules_item:   modules_module | modules
473   modules_module: MODULE '=' QSTRING ';'
474   {
475   #ifndef STATIC_MODULES /* NOOP in the static case */
476 <  if (ypass == 2)
476 >  if (conf_parser_ctx.pass == 2)
477    {
478      char *m_bn;
479  
# Line 487 | Line 490 | modules_module: MODULE '=' QSTRING ';'
490   modules_path: PATH '=' QSTRING ';'
491   {
492   #ifndef STATIC_MODULES
493 <  if (ypass == 2)
493 >  if (conf_parser_ctx.pass == 2)
494      mod_add_path(yylval.string);
495   #endif
496   };
497  
495 /***************************************************************************
496 *  section serverinfo
497 ***************************************************************************/
498 serverinfo_entry: SERVERINFO
499  '{' serverinfo_items '}' ';';
498  
499 < serverinfo_items:       serverinfo_items serverinfo_item |
500 <                        serverinfo_item ;
499 > serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
500 >
501 > serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
502   serverinfo_item:        serverinfo_name | serverinfo_vhost |
503                          serverinfo_hub | serverinfo_description |
504                          serverinfo_network_name | serverinfo_network_desc |
505                          serverinfo_max_clients |
506                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
507                          serverinfo_sid | serverinfo_ssl_certificate_file |
508 +                        serverinfo_ssl_connection_method |
509                          error ';' ;
510  
511 +
512 + serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
513 + {
514 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
515 +    ServerInfo.tls_version = 0;
516 + } '=' method_types ';'
517 + {
518 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
519 +  {
520 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
521 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
522 +    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
523 +      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
524 +  }
525 + };
526 +
527 + method_types: method_types ',' method_type_item | method_type_item;
528 + method_type_item: T_SSLV3
529 + {
530 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
531 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
532 + } | T_TLSV1
533 + {
534 +  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
535 +    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
536 + };
537 +
538   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
539   {
540   #ifdef HAVE_LIBCRYPTO
541 <  if (ypass == 2 && ServerInfo.ctx)
541 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
542    {
543      if (!ServerInfo.rsa_private_key_file)
544      {
# Line 519 | Line 546 | serverinfo_ssl_certificate_file: SSL_CER
546        break;
547      }
548  
549 <    if (SSL_CTX_use_certificate_file(ServerInfo.ctx,
550 <      yylval.string, SSL_FILETYPE_PEM) <= 0)
549 >    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
550 >                                     SSL_FILETYPE_PEM) <= 0)
551      {
552        yyerror(ERR_lib_error_string(ERR_get_error()));
553        break;
554      }
555  
556 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx,
557 <      ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0)
556 >    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
557 >                                    SSL_FILETYPE_PEM) <= 0)
558      {
559        yyerror(ERR_lib_error_string(ERR_get_error()));
560        break;
561      }
562  
563 <    if (!SSL_CTX_check_private_key(ServerInfo.ctx))
563 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
564      {
565 <      yyerror("RSA private key does not match the SSL certificate public key!");
565 >      yyerror(ERR_lib_error_string(ERR_get_error()));
566        break;
567      }
568    }
# Line 545 | Line 572 | serverinfo_ssl_certificate_file: SSL_CER
572   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
573   {
574   #ifdef HAVE_LIBCRYPTO
575 <  if (ypass == 1)
575 >  if (conf_parser_ctx.pass == 1)
576    {
577      BIO *file;
578  
# Line 605 | Line 632 | serverinfo_rsa_private_key_file: RSA_PRI
632   serverinfo_name: NAME '=' QSTRING ';'
633   {
634    /* this isn't rehashable */
635 <  if (ypass == 2)
635 >  if (conf_parser_ctx.pass == 2)
636    {
637      if (ServerInfo.name == NULL)
638      {
# Line 619 | Line 646 | serverinfo_name: NAME '=' QSTRING ';'
646   serverinfo_sid: IRCD_SID '=' QSTRING ';'
647   {
648    /* this isn't rehashable */
649 <  if (ypass == 2 && !ServerInfo.sid)
649 >  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
650    {
651      if (valid_sid(yylval.string))
652        DupString(ServerInfo.sid, yylval.string);
# Line 633 | Line 660 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
660  
661   serverinfo_description: DESCRIPTION '=' QSTRING ';'
662   {
663 <  if (ypass == 2)
663 >  if (conf_parser_ctx.pass == 2)
664    {
665      MyFree(ServerInfo.description);
666      DupString(ServerInfo.description,yylval.string);
# Line 642 | Line 669 | serverinfo_description: DESCRIPTION '='
669  
670   serverinfo_network_name: NETWORK_NAME '=' QSTRING ';'
671   {
672 <  if (ypass == 2)
672 >  if (conf_parser_ctx.pass == 2)
673    {
674      char *p;
675  
# Line 656 | Line 683 | serverinfo_network_name: NETWORK_NAME '=
683  
684   serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
685   {
686 <  if (ypass == 2)
686 >  if (conf_parser_ctx.pass == 2)
687    {
688      MyFree(ServerInfo.network_desc);
689      DupString(ServerInfo.network_desc, yylval.string);
# Line 665 | Line 692 | serverinfo_network_desc: NETWORK_DESC '=
692  
693   serverinfo_vhost: VHOST '=' QSTRING ';'
694   {
695 <  if (ypass == 2 && *yylval.string != '*')
695 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
696    {
697      struct addrinfo hints, *res;
698  
# Line 694 | Line 721 | serverinfo_vhost: VHOST '=' QSTRING ';'
721   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
722   {
723   #ifdef IPV6
724 <  if (ypass == 2 && *yylval.string != '*')
724 >  if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
725    {
726      struct addrinfo hints, *res;
727  
# Line 723 | Line 750 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
750  
751   serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
752   {
753 <  if (ypass == 2)
753 >  if (conf_parser_ctx.pass == 2)
754    {
755      recalc_fdlimit(NULL);
756  
# Line 746 | Line 773 | serverinfo_max_clients: T_MAX_CLIENTS '=
773  
774   serverinfo_hub: HUB '=' TBOOL ';'
775   {
776 <  if (ypass == 2)
776 >  if (conf_parser_ctx.pass == 2)
777    {
778      if (yylval.number)
779      {
# Line 774 | Line 801 | admin_item:  admin_name | admin_descript
801  
802   admin_name: NAME '=' QSTRING ';'
803   {
804 <  if (ypass == 2)
804 >  if (conf_parser_ctx.pass == 2)
805    {
806      MyFree(AdminInfo.name);
807      DupString(AdminInfo.name, yylval.string);
# Line 783 | Line 810 | admin_name: NAME '=' QSTRING ';'
810  
811   admin_email: EMAIL '=' QSTRING ';'
812   {
813 <  if (ypass == 2)
813 >  if (conf_parser_ctx.pass == 2)
814    {
815      MyFree(AdminInfo.email);
816      DupString(AdminInfo.email, yylval.string);
# Line 792 | Line 819 | admin_email: EMAIL '=' QSTRING ';'
819  
820   admin_description: DESCRIPTION '=' QSTRING ';'
821   {
822 <  if (ypass == 2)
822 >  if (conf_parser_ctx.pass == 2)
823    {
824      MyFree(AdminInfo.description);
825      DupString(AdminInfo.description, yylval.string);
# Line 827 | Line 854 | logging_oper_log:      OPER_LOG '=' QSTRING '
854  
855   logging_fuserlog: FUSERLOG '=' QSTRING ';'
856   {
857 <  if (ypass == 2)
857 >  if (conf_parser_ctx.pass == 2)
858      strlcpy(ConfigLoggingEntry.userlog, yylval.string,
859              sizeof(ConfigLoggingEntry.userlog));
860   };
861  
862   logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
863   {
864 <  if (ypass == 2)
864 >  if (conf_parser_ctx.pass == 2)
865      strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
866              sizeof(ConfigLoggingEntry.failed_operlog));
867   };
868  
869   logging_foperlog: FOPERLOG '=' QSTRING ';'
870   {
871 <  if (ypass == 2)
871 >  if (conf_parser_ctx.pass == 2)
872      strlcpy(ConfigLoggingEntry.operlog, yylval.string,
873              sizeof(ConfigLoggingEntry.operlog));
874   };
875  
876   logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
877   {
878 <  if (ypass == 2)
878 >  if (conf_parser_ctx.pass == 2)
879      strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
880              sizeof(ConfigLoggingEntry.operspylog));
881   };
882  
883   logging_fglinelog: FGLINELOG '=' QSTRING ';'
884   {
885 <  if (ypass == 2)
885 >  if (conf_parser_ctx.pass == 2)
886      strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
887              sizeof(ConfigLoggingEntry.glinelog));
888   };
889  
890   logging_fklinelog: FKLINELOG '=' QSTRING ';'
891   {
892 <  if (ypass == 2)
892 >  if (conf_parser_ctx.pass == 2)
893      strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
894              sizeof(ConfigLoggingEntry.klinelog));
895   };
896  
897   logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
898   {
899 <  if (ypass == 2)
899 >  if (conf_parser_ctx.pass == 2)
900      strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
901              sizeof(ConfigLoggingEntry.ioerrlog));
902   };
903  
904   logging_killlog: FKILLLOG '=' QSTRING ';'
905   {
906 <  if (ypass == 2)
906 >  if (conf_parser_ctx.pass == 2)
907      strlcpy(ConfigLoggingEntry.killlog, yylval.string,
908              sizeof(ConfigLoggingEntry.killlog));
909   };
910  
911   logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
912   {
913 <  if (ypass == 2)
913 >  if (conf_parser_ctx.pass == 2)
914      set_log_level(L_CRIT);
915   } | LOG_LEVEL '=' T_L_ERROR ';'
916   {
917 <  if (ypass == 2)
917 >  if (conf_parser_ctx.pass == 2)
918      set_log_level(L_ERROR);
919   } | LOG_LEVEL '=' T_L_WARN ';'
920   {
921 <  if (ypass == 2)
921 >  if (conf_parser_ctx.pass == 2)
922      set_log_level(L_WARN);
923   } | LOG_LEVEL '=' T_L_NOTICE ';'
924   {
925 <  if (ypass == 2)
925 >  if (conf_parser_ctx.pass == 2)
926      set_log_level(L_NOTICE);
927   } | LOG_LEVEL '=' T_L_TRACE ';'
928   {
929 <  if (ypass == 2)
929 >  if (conf_parser_ctx.pass == 2)
930      set_log_level(L_TRACE);
931   } | LOG_LEVEL '=' T_L_INFO ';'
932   {
933 <  if (ypass == 2)
933 >  if (conf_parser_ctx.pass == 2)
934      set_log_level(L_INFO);
935   } | LOG_LEVEL '=' T_L_DEBUG ';'
936   {
937 <  if (ypass == 2)
937 >  if (conf_parser_ctx.pass == 2)
938      set_log_level(L_DEBUG);
939   };
940  
941   logging_use_logging: USE_LOGGING '=' TBOOL ';'
942   {
943 <  if (ypass == 2)
943 >  if (conf_parser_ctx.pass == 2)
944      ConfigLoggingEntry.use_logging = yylval.number;
945   };
946  
# Line 922 | Line 949 | logging_use_logging: USE_LOGGING '=' TBO
949   ***************************************************************************/
950   oper_entry: OPERATOR
951   {
952 <  if (ypass == 2)
952 >  if (conf_parser_ctx.pass == 2)
953    {
954      yy_conf = make_conf_item(OPER_TYPE);
955      yy_aconf = map_to_conf(yy_conf);
# Line 935 | Line 962 | oper_entry: OPERATOR
962    }
963   } oper_name_b '{' oper_items '}' ';'
964   {
965 <  if (ypass == 2)
965 >  if (conf_parser_ctx.pass == 2)
966    {
967      struct CollectItem *yy_tmp;
968      dlink_node *ptr;
# Line 1027 | Line 1054 | oper_item:      oper_name | oper_user |
1054  
1055   oper_name: NAME '=' QSTRING ';'
1056   {
1057 <  if (ypass == 2)
1057 >  if (conf_parser_ctx.pass == 2)
1058    {
1059      if (strlen(yylval.string) > OPERNICKLEN)
1060        yylval.string[OPERNICKLEN] = '\0';
# Line 1039 | Line 1066 | oper_name: NAME '=' QSTRING ';'
1066  
1067   oper_name_t: QSTRING
1068   {
1069 <  if (ypass == 2)
1069 >  if (conf_parser_ctx.pass == 2)
1070    {
1071      if (strlen(yylval.string) > OPERNICKLEN)
1072        yylval.string[OPERNICKLEN] = '\0';
# Line 1051 | Line 1078 | oper_name_t: QSTRING
1078  
1079   oper_user: USER '=' QSTRING ';'
1080   {
1081 <  if (ypass == 2)
1081 >  if (conf_parser_ctx.pass == 2)
1082    {
1083      struct split_nuh_item nuh;
1084  
# Line 1085 | Line 1112 | oper_user: USER '=' QSTRING ';'
1112  
1113   oper_password: PASSWORD '=' QSTRING ';'
1114   {
1115 <  if (ypass == 2)
1115 >  if (conf_parser_ctx.pass == 2)
1116    {
1117      if (yy_aconf->passwd != NULL)
1118        memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
# Line 1097 | Line 1124 | oper_password: PASSWORD '=' QSTRING ';'
1124  
1125   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1126   {
1127 <  if (ypass == 2)
1127 >  if (conf_parser_ctx.pass == 2)
1128    {
1129      if (yylval.number)
1130        SetConfEncrypted(yy_aconf);
# Line 1109 | Line 1136 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1136   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1137   {
1138   #ifdef HAVE_LIBCRYPTO
1139 <  if (ypass == 2)
1139 >  if (conf_parser_ctx.pass == 2)
1140    {
1141      BIO *file;
1142  
# Line 1150 | Line 1177 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1177  
1178   oper_class: CLASS '=' QSTRING ';'
1179   {
1180 <  if (ypass == 2)
1180 >  if (conf_parser_ctx.pass == 2)
1181    {
1182      MyFree(class_name);
1183      DupString(class_name, yylval.string);
# Line 1159 | Line 1186 | oper_class: CLASS '=' QSTRING ';'
1186  
1187   oper_umodes: T_UMODES
1188   {
1189 <  if (ypass == 2)
1189 >  if (conf_parser_ctx.pass == 2)
1190      yy_aconf->modes = 0;
1191   } '='  oper_umodes_items ';' ;
1192  
1193   oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
1194   oper_umodes_item:  T_BOTS
1195   {
1196 <  if (ypass == 2)
1196 >  if (conf_parser_ctx.pass == 2)
1197      yy_aconf->modes |= UMODE_BOTS;
1198   } | T_CCONN
1199   {
1200 <  if (ypass == 2)
1200 >  if (conf_parser_ctx.pass == 2)
1201      yy_aconf->modes |= UMODE_CCONN;
1202   } | T_CCONN_FULL
1203   {
1204 <  if (ypass == 2)
1204 >  if (conf_parser_ctx.pass == 2)
1205      yy_aconf->modes |= UMODE_CCONN_FULL;
1206   } | T_DEAF
1207   {
1208 <  if (ypass == 2)
1208 >  if (conf_parser_ctx.pass == 2)
1209      yy_aconf->modes |= UMODE_DEAF;
1210   } | T_DEBUG
1211   {
1212 <  if (ypass == 2)
1212 >  if (conf_parser_ctx.pass == 2)
1213      yy_aconf->modes |= UMODE_DEBUG;
1214   } | T_FULL
1215   {
1216 <  if (ypass == 2)
1216 >  if (conf_parser_ctx.pass == 2)
1217      yy_aconf->modes |= UMODE_FULL;
1218   } | T_SKILL
1219   {
1220 <  if (ypass == 2)
1220 >  if (conf_parser_ctx.pass == 2)
1221      yy_aconf->modes |= UMODE_SKILL;
1222   } | T_NCHANGE
1223   {
1224 <  if (ypass == 2)
1224 >  if (conf_parser_ctx.pass == 2)
1225      yy_aconf->modes |= UMODE_NCHANGE;
1226   } | T_REJ
1227   {
1228 <  if (ypass == 2)
1228 >  if (conf_parser_ctx.pass == 2)
1229      yy_aconf->modes |= UMODE_REJ;
1230   } | T_UNAUTH
1231   {
1232 <  if (ypass == 2)
1232 >  if (conf_parser_ctx.pass == 2)
1233      yy_aconf->modes |= UMODE_UNAUTH;
1234   } | T_SPY
1235   {
1236 <  if (ypass == 2)
1236 >  if (conf_parser_ctx.pass == 2)
1237      yy_aconf->modes |= UMODE_SPY;
1238   } | T_EXTERNAL
1239   {
1240 <  if (ypass == 2)
1240 >  if (conf_parser_ctx.pass == 2)
1241      yy_aconf->modes |= UMODE_EXTERNAL;
1242   } | T_OPERWALL
1243   {
1244 <  if (ypass == 2)
1244 >  if (conf_parser_ctx.pass == 2)
1245      yy_aconf->modes |= UMODE_OPERWALL;
1246   } | T_SERVNOTICE
1247   {
1248 <  if (ypass == 2)
1248 >  if (conf_parser_ctx.pass == 2)
1249      yy_aconf->modes |= UMODE_SERVNOTICE;
1250   } | T_INVISIBLE
1251   {
1252 <  if (ypass == 2)
1252 >  if (conf_parser_ctx.pass == 2)
1253      yy_aconf->modes |= UMODE_INVISIBLE;
1254   } | T_WALLOP
1255   {
1256 <  if (ypass == 2)
1256 >  if (conf_parser_ctx.pass == 2)
1257      yy_aconf->modes |= UMODE_WALLOP;
1258   } | T_SOFTCALLERID
1259   {
1260 <  if (ypass == 2)
1260 >  if (conf_parser_ctx.pass == 2)
1261      yy_aconf->modes |= UMODE_SOFTCALLERID;
1262   } | T_CALLERID
1263   {
1264 <  if (ypass == 2)
1264 >  if (conf_parser_ctx.pass == 2)
1265      yy_aconf->modes |= UMODE_CALLERID;
1266   } | T_LOCOPS
1267   {
1268 <  if (ypass == 2)
1268 >  if (conf_parser_ctx.pass == 2)
1269      yy_aconf->modes |= UMODE_LOCOPS;
1270   };
1271  
1272   oper_global_kill: GLOBAL_KILL '=' TBOOL ';'
1273   {
1274 <  if (ypass == 2)
1274 >  if (conf_parser_ctx.pass == 2)
1275    {
1276      if (yylval.number)
1277        yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
# Line 1255 | Line 1282 | oper_global_kill: GLOBAL_KILL '=' TBOOL
1282  
1283   oper_remote: REMOTE '=' TBOOL ';'
1284   {
1285 <  if (ypass == 2)
1285 >  if (conf_parser_ctx.pass == 2)
1286    {
1287      if (yylval.number)
1288        yy_aconf->port |= OPER_FLAG_REMOTE;
# Line 1266 | Line 1293 | oper_remote: REMOTE '=' TBOOL ';'
1293  
1294   oper_remoteban: REMOTEBAN '=' TBOOL ';'
1295   {
1296 <  if (ypass == 2)
1296 >  if (conf_parser_ctx.pass == 2)
1297    {
1298      if (yylval.number)
1299        yy_aconf->port |= OPER_FLAG_REMOTEBAN;
# Line 1277 | Line 1304 | oper_remoteban: REMOTEBAN '=' TBOOL ';'
1304  
1305   oper_kline: KLINE '=' TBOOL ';'
1306   {
1307 <  if (ypass == 2)
1307 >  if (conf_parser_ctx.pass == 2)
1308    {
1309      if (yylval.number)
1310        yy_aconf->port |= OPER_FLAG_K;
# Line 1288 | Line 1315 | oper_kline: KLINE '=' TBOOL ';'
1315  
1316   oper_xline: XLINE '=' TBOOL ';'
1317   {
1318 <  if (ypass == 2)
1318 >  if (conf_parser_ctx.pass == 2)
1319    {
1320      if (yylval.number)
1321        yy_aconf->port |= OPER_FLAG_X;
# Line 1299 | Line 1326 | oper_xline: XLINE '=' TBOOL ';'
1326  
1327   oper_unkline: UNKLINE '=' TBOOL ';'
1328   {
1329 <  if (ypass == 2)
1329 >  if (conf_parser_ctx.pass == 2)
1330    {
1331      if (yylval.number)
1332        yy_aconf->port |= OPER_FLAG_UNKLINE;
# Line 1310 | Line 1337 | oper_unkline: UNKLINE '=' TBOOL ';'
1337  
1338   oper_gline: GLINE '=' TBOOL ';'
1339   {
1340 <  if (ypass == 2)
1340 >  if (conf_parser_ctx.pass == 2)
1341    {
1342      if (yylval.number)
1343        yy_aconf->port |= OPER_FLAG_GLINE;
# Line 1321 | Line 1348 | oper_gline: GLINE '=' TBOOL ';'
1348  
1349   oper_nick_changes: NICK_CHANGES '=' TBOOL ';'
1350   {
1351 <  if (ypass == 2)
1351 >  if (conf_parser_ctx.pass == 2)
1352    {
1353      if (yylval.number)
1354        yy_aconf->port |= OPER_FLAG_N;
# Line 1332 | Line 1359 | oper_nick_changes: NICK_CHANGES '=' TBOO
1359  
1360   oper_die: DIE '=' TBOOL ';'
1361   {
1362 <  if (ypass == 2)
1362 >  if (conf_parser_ctx.pass == 2)
1363    {
1364      if (yylval.number)
1365        yy_aconf->port |= OPER_FLAG_DIE;
# Line 1343 | Line 1370 | oper_die: DIE '=' TBOOL ';'
1370  
1371   oper_rehash: REHASH '=' TBOOL ';'
1372   {
1373 <  if (ypass == 2)
1373 >  if (conf_parser_ctx.pass == 2)
1374    {
1375      if (yylval.number)
1376        yy_aconf->port |= OPER_FLAG_REHASH;
# Line 1354 | Line 1381 | oper_rehash: REHASH '=' TBOOL ';'
1381  
1382   oper_admin: ADMIN '=' TBOOL ';'
1383   {
1384 <  if (ypass == 2)
1384 >  if (conf_parser_ctx.pass == 2)
1385    {
1386      if (yylval.number)
1387        yy_aconf->port |= OPER_FLAG_ADMIN;
# Line 1365 | Line 1392 | oper_admin: ADMIN '=' TBOOL ';'
1392  
1393   oper_hidden_admin: HIDDEN_ADMIN '=' TBOOL ';'
1394   {
1395 <  if (ypass == 2)
1395 >  if (conf_parser_ctx.pass == 2)
1396    {
1397      if (yylval.number)
1398        yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
# Line 1376 | Line 1403 | oper_hidden_admin: HIDDEN_ADMIN '=' TBOO
1403  
1404   oper_hidden_oper: HIDDEN_OPER '=' TBOOL ';'
1405   {
1406 <  if (ypass == 2)
1406 >  if (conf_parser_ctx.pass == 2)
1407    {
1408      if (yylval.number)
1409        yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
# Line 1387 | Line 1414 | oper_hidden_oper: HIDDEN_OPER '=' TBOOL
1414  
1415   oper_operwall: T_OPERWALL '=' TBOOL ';'
1416   {
1417 <  if (ypass == 2)
1417 >  if (conf_parser_ctx.pass == 2)
1418    {
1419      if (yylval.number)
1420        yy_aconf->port |= OPER_FLAG_OPERWALL;
# Line 1406 | Line 1433 | oper_flags_item: NOT { not_atom = 1; } o
1433  
1434   oper_flags_item_atom: GLOBAL_KILL
1435   {
1436 <  if (ypass == 2)
1436 >  if (conf_parser_ctx.pass == 2)
1437    {
1438      if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1439      else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1440    }
1441   } | REMOTE
1442   {
1443 <  if (ypass == 2)
1443 >  if (conf_parser_ctx.pass == 2)
1444    {
1445      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1446      else yy_aconf->port |= OPER_FLAG_REMOTE;
1447    }
1448   } | KLINE
1449   {
1450 <  if (ypass == 2)
1450 >  if (conf_parser_ctx.pass == 2)
1451    {
1452      if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1453      else yy_aconf->port |= OPER_FLAG_K;
1454    }
1455   } | UNKLINE
1456   {
1457 <  if (ypass == 2)
1457 >  if (conf_parser_ctx.pass == 2)
1458    {
1459      if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1460      else yy_aconf->port |= OPER_FLAG_UNKLINE;
1461    }
1462   } | XLINE
1463   {
1464 <  if (ypass == 2)
1464 >  if (conf_parser_ctx.pass == 2)
1465    {
1466      if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1467      else yy_aconf->port |= OPER_FLAG_X;
1468    }
1469   } | GLINE
1470   {
1471 <  if (ypass == 2)
1471 >  if (conf_parser_ctx.pass == 2)
1472    {
1473      if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1474      else yy_aconf->port |= OPER_FLAG_GLINE;
1475    }
1476   } | DIE
1477   {
1478 <  if (ypass == 2)
1478 >  if (conf_parser_ctx.pass == 2)
1479    {
1480      if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1481      else yy_aconf->port |= OPER_FLAG_DIE;
1482    }
1483   } | REHASH
1484   {
1485 <  if (ypass == 2)
1485 >  if (conf_parser_ctx.pass == 2)
1486    {
1487      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1488      else yy_aconf->port |= OPER_FLAG_REHASH;
1489    }
1490   } | ADMIN
1491   {
1492 <  if (ypass == 2)
1492 >  if (conf_parser_ctx.pass == 2)
1493    {
1494      if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1495      else yy_aconf->port |= OPER_FLAG_ADMIN;
1496    }
1497   } | HIDDEN_ADMIN
1498   {
1499 <  if (ypass == 2)
1499 >  if (conf_parser_ctx.pass == 2)
1500    {
1501      if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1502      else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1503    }
1504   } | NICK_CHANGES
1505   {
1506 <  if (ypass == 2)
1506 >  if (conf_parser_ctx.pass == 2)
1507    {
1508      if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1509      else yy_aconf->port |= OPER_FLAG_N;
1510    }
1511   } | T_OPERWALL
1512   {
1513 <  if (ypass == 2)
1513 >  if (conf_parser_ctx.pass == 2)
1514    {
1515      if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1516      else yy_aconf->port |= OPER_FLAG_OPERWALL;
1517    }
1518   } | OPER_SPY_T
1519   {
1520 <  if (ypass == 2)
1520 >  if (conf_parser_ctx.pass == 2)
1521    {
1522      if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1523      else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1524    }
1525   } | HIDDEN_OPER
1526   {
1527 <  if (ypass == 2)
1527 >  if (conf_parser_ctx.pass == 2)
1528    {
1529      if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1530      else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1531    }
1532   } | REMOTEBAN
1533   {
1534 <  if (ypass == 2)
1534 >  if (conf_parser_ctx.pass == 2)
1535    {
1536      if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1537      else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1538    }
1539   } | ENCRYPTED
1540   {
1541 <  if (ypass == 2)
1541 >  if (conf_parser_ctx.pass == 2)
1542    {
1543      if (not_atom) ClearConfEncrypted(yy_aconf);
1544      else SetConfEncrypted(yy_aconf);
# Line 1524 | Line 1551 | oper_flags_item_atom: GLOBAL_KILL
1551   ***************************************************************************/
1552   class_entry: CLASS
1553   {
1554 <  if (ypass == 1)
1554 >  if (conf_parser_ctx.pass == 1)
1555    {
1556      yy_conf = make_conf_item(CLASS_TYPE);
1557      yy_class = map_to_conf(yy_conf);
1558    }
1559   } class_name_b '{' class_items '}' ';'
1560   {
1561 <  if (ypass == 1)
1561 >  if (conf_parser_ctx.pass == 1)
1562    {
1563      struct ConfItem *cconf = NULL;
1564      struct ClassItem *class = NULL;
# Line 1591 | Line 1618 | class_item:     class_name |
1618  
1619   class_name: NAME '=' QSTRING ';'
1620   {
1621 <  if (ypass == 1)
1621 >  if (conf_parser_ctx.pass == 1)
1622    {
1623      MyFree(yy_class_name);
1624      DupString(yy_class_name, yylval.string);
# Line 1600 | Line 1627 | class_name: NAME '=' QSTRING ';'
1627  
1628   class_name_t: QSTRING
1629   {
1630 <  if (ypass == 1)
1630 >  if (conf_parser_ctx.pass == 1)
1631    {
1632      MyFree(yy_class_name);
1633      DupString(yy_class_name, yylval.string);
# Line 1609 | Line 1636 | class_name_t: QSTRING
1636  
1637   class_ping_time: PING_TIME '=' timespec ';'
1638   {
1639 <  if (ypass == 1)
1639 >  if (conf_parser_ctx.pass == 1)
1640      PingFreq(yy_class) = $3;
1641   };
1642  
1643   class_ping_warning: PING_WARNING '=' timespec ';'
1644   {
1645 <  if (ypass == 1)
1645 >  if (conf_parser_ctx.pass == 1)
1646      PingWarning(yy_class) = $3;
1647   };
1648  
1649   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1650   {
1651 <  if (ypass == 1)
1651 >  if (conf_parser_ctx.pass == 1)
1652      MaxPerIp(yy_class) = $3;
1653   };
1654  
1655   class_connectfreq: CONNECTFREQ '=' timespec ';'
1656   {
1657 <  if (ypass == 1)
1657 >  if (conf_parser_ctx.pass == 1)
1658      ConFreq(yy_class) = $3;
1659   };
1660  
1661   class_max_number: MAX_NUMBER '=' NUMBER ';'
1662   {
1663 <  if (ypass == 1)
1663 >  if (conf_parser_ctx.pass == 1)
1664      MaxTotal(yy_class) = $3;
1665   };
1666  
1667   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1668   {
1669 <  if (ypass == 1)
1669 >  if (conf_parser_ctx.pass == 1)
1670      MaxGlobal(yy_class) = $3;
1671   };
1672  
1673   class_max_local: MAX_LOCAL '=' NUMBER ';'
1674   {
1675 <  if (ypass == 1)
1675 >  if (conf_parser_ctx.pass == 1)
1676      MaxLocal(yy_class) = $3;
1677   };
1678  
1679   class_max_ident: MAX_IDENT '=' NUMBER ';'
1680   {
1681 <  if (ypass == 1)
1681 >  if (conf_parser_ctx.pass == 1)
1682      MaxIdent(yy_class) = $3;
1683   };
1684  
1685   class_sendq: SENDQ '=' sizespec ';'
1686   {
1687 <  if (ypass == 1)
1687 >  if (conf_parser_ctx.pass == 1)
1688      MaxSendq(yy_class) = $3;
1689   };
1690  
1691   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1692   {
1693 <  if (ypass == 1)
1693 >  if (conf_parser_ctx.pass == 1)
1694      CidrBitlenIPV4(yy_class) = $3;
1695   };
1696  
1697   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1698   {
1699 <  if (ypass == 1)
1699 >  if (conf_parser_ctx.pass == 1)
1700      CidrBitlenIPV6(yy_class) = $3;
1701   };
1702  
1703   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1704   {
1705 <  if (ypass == 1)
1705 >  if (conf_parser_ctx.pass == 1)
1706      NumberPerCidr(yy_class) = $3;
1707   };
1708  
# Line 1684 | Line 1711 | class_number_per_cidr: NUMBER_PER_CIDR '
1711   ***************************************************************************/
1712   listen_entry: LISTEN
1713   {
1714 <  if (ypass == 2)
1714 >  if (conf_parser_ctx.pass == 2)
1715    {
1716      listener_address = NULL;
1717      listener_flags = 0;
1718    }
1719   } '{' listen_items '}' ';'
1720   {
1721 <  if (ypass == 2)
1721 >  if (conf_parser_ctx.pass == 2)
1722    {
1723      MyFree(listener_address);
1724      listener_address = NULL;
# Line 1706 | Line 1733 | listen_flags: IRCD_FLAGS
1733   listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item;
1734   listen_flags_item: T_SSL
1735   {
1736 <  if (ypass == 2)
1736 >  if (conf_parser_ctx.pass == 2)
1737      listener_flags |= LISTENER_SSL;
1738   } | HIDDEN
1739   {
1740 <  if (ypass == 2)
1740 >  if (conf_parser_ctx.pass == 2)
1741      listener_flags |= LISTENER_HIDDEN;
1742   } | T_SERVER
1743   {
1744 <  if (ypass == 2)
1744 >  if (conf_parser_ctx.pass == 2)
1745      listener_flags |= LISTENER_SERVER;
1746   };
1747  
# Line 1729 | Line 1756 | port_items: port_items ',' port_item | p
1756  
1757   port_item: NUMBER
1758   {
1759 <  if (ypass == 2)
1759 >  if (conf_parser_ctx.pass == 2)
1760    {
1761      if ((listener_flags & LISTENER_SSL))
1762   #ifdef HAVE_LIBCRYPTO
1763 <      if (!ServerInfo.ctx)
1763 >      if (!ServerInfo.server_ctx)
1764   #endif
1765        {
1766          yyerror("SSL not available - port closed");
# Line 1743 | Line 1770 | port_item: NUMBER
1770    }
1771   } | NUMBER TWODOTS NUMBER
1772   {
1773 <  if (ypass == 2)
1773 >  if (conf_parser_ctx.pass == 2)
1774    {
1775      int i;
1776  
1777      if ((listener_flags & LISTENER_SSL))
1778   #ifdef HAVE_LIBCRYPTO
1779 <      if (!ServerInfo.ctx)
1779 >      if (!ServerInfo.server_ctx)
1780   #endif
1781        {
1782          yyerror("SSL not available - port closed");
# Line 1763 | Line 1790 | port_item: NUMBER
1790  
1791   listen_address: IP '=' QSTRING ';'
1792   {
1793 <  if (ypass == 2)
1793 >  if (conf_parser_ctx.pass == 2)
1794    {
1795      MyFree(listener_address);
1796      DupString(listener_address, yylval.string);
# Line 1772 | Line 1799 | listen_address: IP '=' QSTRING ';'
1799  
1800   listen_host: HOST '=' QSTRING ';'
1801   {
1802 <  if (ypass == 2)
1802 >  if (conf_parser_ctx.pass == 2)
1803    {
1804      MyFree(listener_address);
1805      DupString(listener_address, yylval.string);
# Line 1784 | Line 1811 | listen_host: HOST '=' QSTRING ';'
1811   ***************************************************************************/
1812   auth_entry: IRCD_AUTH
1813   {
1814 <  if (ypass == 2)
1814 >  if (conf_parser_ctx.pass == 2)
1815    {
1816      yy_conf = make_conf_item(CLIENT_TYPE);
1817      yy_aconf = map_to_conf(yy_conf);
# Line 1796 | Line 1823 | auth_entry: IRCD_AUTH
1823    }
1824   } '{' auth_items '}' ';'
1825   {
1826 <  if (ypass == 2)
1826 >  if (conf_parser_ctx.pass == 2)
1827    {
1828      struct CollectItem *yy_tmp = NULL;
1829      dlink_node *ptr = NULL, *next_ptr = NULL;
# Line 1861 | Line 1888 | auth_item:      auth_user | auth_passwd
1888  
1889   auth_user: USER '=' QSTRING ';'
1890   {
1891 <  if (ypass == 2)
1891 >  if (conf_parser_ctx.pass == 2)
1892    {
1893      struct CollectItem *yy_tmp = NULL;
1894      struct split_nuh_item nuh;
# Line 1898 | Line 1925 | auth_user: USER '=' QSTRING ';'
1925  
1926   auth_passwd: PASSWORD '=' QSTRING ';'
1927   {
1928 <  if (ypass == 2)
1928 >  if (conf_parser_ctx.pass == 2)
1929    {
1930      /* be paranoid */
1931      if (yy_aconf->passwd != NULL)
# Line 1911 | Line 1938 | auth_passwd: PASSWORD '=' QSTRING ';'
1938  
1939   auth_spoof_notice: SPOOF_NOTICE '=' TBOOL ';'
1940   {
1941 <  if (ypass == 2)
1941 >  if (conf_parser_ctx.pass == 2)
1942    {
1943      if (yylval.number)
1944        yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
# Line 1922 | Line 1949 | auth_spoof_notice: SPOOF_NOTICE '=' TBOO
1949  
1950   auth_class: CLASS '=' QSTRING ';'
1951   {
1952 <  if (ypass == 2)
1952 >  if (conf_parser_ctx.pass == 2)
1953    {
1954      MyFree(class_name);
1955      DupString(class_name, yylval.string);
# Line 1931 | Line 1958 | auth_class: CLASS '=' QSTRING ';'
1958  
1959   auth_encrypted: ENCRYPTED '=' TBOOL ';'
1960   {
1961 <  if (ypass == 2)
1961 >  if (conf_parser_ctx.pass == 2)
1962    {
1963      if (yylval.number)
1964        SetConfEncrypted(yy_aconf);
# Line 1950 | Line 1977 | auth_flags_item: NOT { not_atom = 1; } a
1977  
1978   auth_flags_item_atom: SPOOF_NOTICE
1979   {
1980 <  if (ypass == 2)
1980 >  if (conf_parser_ctx.pass == 2)
1981    {
1982      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1983      else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
# Line 1958 | Line 1985 | auth_flags_item_atom: SPOOF_NOTICE
1985  
1986   } | EXCEED_LIMIT
1987   {
1988 <  if (ypass == 2)
1988 >  if (conf_parser_ctx.pass == 2)
1989    {
1990      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1991      else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1992    }
1993   } | KLINE_EXEMPT
1994   {
1995 <  if (ypass == 2)
1995 >  if (conf_parser_ctx.pass == 2)
1996    {
1997      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1998      else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1999    }
2000   } | NEED_IDENT
2001   {
2002 <  if (ypass == 2)
2002 >  if (conf_parser_ctx.pass == 2)
2003    {
2004      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
2005      else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
2006    }
2007   } | CAN_FLOOD
2008   {
2009 <  if (ypass == 2)
2009 >  if (conf_parser_ctx.pass == 2)
2010    {
2011      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
2012      else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
2013    }
2014   } | CAN_IDLE
2015   {
2016 <  if (ypass == 2)
2016 >  if (conf_parser_ctx.pass == 2)
2017    {
2018      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
2019      else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
2020    }
2021   } | NO_TILDE
2022   {
2023 <  if (ypass == 2)
2023 >  if (conf_parser_ctx.pass == 2)
2024    {
2025      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
2026      else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
2027    }
2028   } | GLINE_EXEMPT
2029   {
2030 <  if (ypass == 2)
2030 >  if (conf_parser_ctx.pass == 2)
2031    {
2032      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
2033      else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
2034    }
2035   } | RESV_EXEMPT
2036   {
2037 <  if (ypass == 2)
2037 >  if (conf_parser_ctx.pass == 2)
2038    {
2039      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
2040      else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
2041    }
2042   } | NEED_PASSWORD
2043   {
2044 <  if (ypass == 2)
2044 >  if (conf_parser_ctx.pass == 2)
2045    {
2046      if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
2047      else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
# Line 2023 | Line 2050 | auth_flags_item_atom: SPOOF_NOTICE
2050  
2051   auth_kline_exempt: KLINE_EXEMPT '=' TBOOL ';'
2052   {
2053 <  if (ypass == 2)
2053 >  if (conf_parser_ctx.pass == 2)
2054    {
2055      if (yylval.number)
2056        yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
# Line 2034 | Line 2061 | auth_kline_exempt: KLINE_EXEMPT '=' TBOO
2061  
2062   auth_need_ident: NEED_IDENT '=' TBOOL ';'
2063   {
2064 <  if (ypass == 2)
2064 >  if (conf_parser_ctx.pass == 2)
2065    {
2066      if (yylval.number)
2067        yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
# Line 2045 | Line 2072 | auth_need_ident: NEED_IDENT '=' TBOOL ';
2072  
2073   auth_exceed_limit: EXCEED_LIMIT '=' TBOOL ';'
2074   {
2075 <  if (ypass == 2)
2075 >  if (conf_parser_ctx.pass == 2)
2076    {
2077      if (yylval.number)
2078        yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
# Line 2056 | Line 2083 | auth_exceed_limit: EXCEED_LIMIT '=' TBOO
2083  
2084   auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2085   {
2086 <  if (ypass == 2)
2086 >  if (conf_parser_ctx.pass == 2)
2087    {
2088      if (yylval.number)
2089        yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
# Line 2067 | Line 2094 | auth_can_flood: CAN_FLOOD '=' TBOOL ';'
2094  
2095   auth_no_tilde: NO_TILDE '=' TBOOL ';'
2096   {
2097 <  if (ypass == 2)
2097 >  if (conf_parser_ctx.pass == 2)
2098    {
2099      if (yylval.number)
2100        yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
# Line 2078 | Line 2105 | auth_no_tilde: NO_TILDE '=' TBOOL ';'
2105  
2106   auth_gline_exempt: GLINE_EXEMPT '=' TBOOL ';'
2107   {
2108 <  if (ypass == 2)
2108 >  if (conf_parser_ctx.pass == 2)
2109    {
2110      if (yylval.number)
2111        yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
# Line 2090 | Line 2117 | auth_gline_exempt: GLINE_EXEMPT '=' TBOO
2117   /* XXX - need check for illegal hostnames here */
2118   auth_spoof: SPOOF '=' QSTRING ';'
2119   {
2120 <  if (ypass == 2)
2120 >  if (conf_parser_ctx.pass == 2)
2121    {
2122      MyFree(yy_conf->name);
2123  
# Line 2109 | Line 2136 | auth_spoof: SPOOF '=' QSTRING ';'
2136  
2137   auth_redir_serv: REDIRSERV '=' QSTRING ';'
2138   {
2139 <  if (ypass == 2)
2139 >  if (conf_parser_ctx.pass == 2)
2140    {
2141      yy_aconf->flags |= CONF_FLAGS_REDIR;
2142      MyFree(yy_conf->name);
# Line 2119 | Line 2146 | auth_redir_serv: REDIRSERV '=' QSTRING '
2146  
2147   auth_redir_port: REDIRPORT '=' NUMBER ';'
2148   {
2149 <  if (ypass == 2)
2149 >  if (conf_parser_ctx.pass == 2)
2150    {
2151      yy_aconf->flags |= CONF_FLAGS_REDIR;
2152      yy_aconf->port = $3;
# Line 2128 | Line 2155 | auth_redir_port: REDIRPORT '=' NUMBER ';
2155  
2156   auth_need_password: NEED_PASSWORD '=' TBOOL ';'
2157   {
2158 <  if (ypass == 2)
2158 >  if (conf_parser_ctx.pass == 2)
2159    {
2160      if (yylval.number)
2161        yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
# Line 2143 | Line 2170 | auth_need_password: NEED_PASSWORD '=' TB
2170   ***************************************************************************/
2171   resv_entry: RESV
2172   {
2173 <  if (ypass == 2)
2173 >  if (conf_parser_ctx.pass == 2)
2174    {
2175      MyFree(resv_reason);
2176      resv_reason = NULL;
2177    }
2178   } '{' resv_items '}' ';'
2179   {
2180 <  if (ypass == 2)
2180 >  if (conf_parser_ctx.pass == 2)
2181    {
2182      MyFree(resv_reason);
2183      resv_reason = NULL;
# Line 2162 | Line 2189 | resv_item:     resv_creason | resv_channel |
2189  
2190   resv_creason: REASON '=' QSTRING ';'
2191   {
2192 <  if (ypass == 2)
2192 >  if (conf_parser_ctx.pass == 2)
2193    {
2194      MyFree(resv_reason);
2195      DupString(resv_reason, yylval.string);
# Line 2171 | Line 2198 | resv_creason: REASON '=' QSTRING ';'
2198  
2199   resv_channel: CHANNEL '=' QSTRING ';'
2200   {
2201 <  if (ypass == 2)
2201 >  if (conf_parser_ctx.pass == 2)
2202    {
2203      if (IsChanPrefix(*yylval.string))
2204      {
# Line 2186 | Line 2213 | resv_channel: CHANNEL '=' QSTRING ';'
2213  
2214   resv_nick: NICK '=' QSTRING ';'
2215   {
2216 <  if (ypass == 2)
2216 >  if (conf_parser_ctx.pass == 2)
2217    {
2218      char def_reason[] = "No reason";
2219  
# Line 2199 | Line 2226 | resv_nick: NICK '=' QSTRING ';'
2226   ***************************************************************************/
2227   shared_entry: T_SHARED
2228   {
2229 <  if (ypass == 2)
2229 >  if (conf_parser_ctx.pass == 2)
2230    {
2231      yy_conf = make_conf_item(ULINE_TYPE);
2232      yy_match_item = map_to_conf(yy_conf);
# Line 2207 | Line 2234 | shared_entry: T_SHARED
2234    }
2235   } '{' shared_items '}' ';'
2236   {
2237 <  if (ypass == 2)
2237 >  if (conf_parser_ctx.pass == 2)
2238    {
2239      yy_conf = NULL;
2240    }
# Line 2218 | Line 2245 | shared_item:  shared_name | shared_user
2245  
2246   shared_name: NAME '=' QSTRING ';'
2247   {
2248 <  if (ypass == 2)
2248 >  if (conf_parser_ctx.pass == 2)
2249    {
2250      MyFree(yy_conf->name);
2251      DupString(yy_conf->name, yylval.string);
# Line 2227 | Line 2254 | shared_name: NAME '=' QSTRING ';'
2254  
2255   shared_user: USER '=' QSTRING ';'
2256   {
2257 <  if (ypass == 2)
2257 >  if (conf_parser_ctx.pass == 2)
2258    {
2259      struct split_nuh_item nuh;
2260  
# Line 2249 | Line 2276 | shared_user: USER '=' QSTRING ';'
2276  
2277   shared_type: TYPE
2278   {
2279 <  if (ypass == 2)
2279 >  if (conf_parser_ctx.pass == 2)
2280      yy_match_item->action = 0;
2281   } '=' shared_types ';' ;
2282  
2283   shared_types: shared_types ',' shared_type_item | shared_type_item;
2284   shared_type_item: KLINE
2285   {
2286 <  if (ypass == 2)
2286 >  if (conf_parser_ctx.pass == 2)
2287      yy_match_item->action |= SHARED_KLINE;
2288   } | TKLINE
2289   {
2290 <  if (ypass == 2)
2290 >  if (conf_parser_ctx.pass == 2)
2291      yy_match_item->action |= SHARED_TKLINE;
2292   } | UNKLINE
2293   {
2294 <  if (ypass == 2)
2294 >  if (conf_parser_ctx.pass == 2)
2295      yy_match_item->action |= SHARED_UNKLINE;
2296   } | XLINE
2297   {
2298 <  if (ypass == 2)
2298 >  if (conf_parser_ctx.pass == 2)
2299      yy_match_item->action |= SHARED_XLINE;
2300   } | TXLINE
2301   {
2302 <  if (ypass == 2)
2302 >  if (conf_parser_ctx.pass == 2)
2303      yy_match_item->action |= SHARED_TXLINE;
2304   } | T_UNXLINE
2305   {
2306 <  if (ypass == 2)
2306 >  if (conf_parser_ctx.pass == 2)
2307      yy_match_item->action |= SHARED_UNXLINE;
2308   } | RESV
2309   {
2310 <  if (ypass == 2)
2310 >  if (conf_parser_ctx.pass == 2)
2311      yy_match_item->action |= SHARED_RESV;
2312   } | TRESV
2313   {
2314 <  if (ypass == 2)
2314 >  if (conf_parser_ctx.pass == 2)
2315      yy_match_item->action |= SHARED_TRESV;
2316   } | T_UNRESV
2317   {
2318 <  if (ypass == 2)
2318 >  if (conf_parser_ctx.pass == 2)
2319      yy_match_item->action |= SHARED_UNRESV;
2320   } | T_LOCOPS
2321   {
2322 <  if (ypass == 2)
2322 >  if (conf_parser_ctx.pass == 2)
2323      yy_match_item->action |= SHARED_LOCOPS;
2324   } | T_ALL
2325   {
2326 <  if (ypass == 2)
2326 >  if (conf_parser_ctx.pass == 2)
2327      yy_match_item->action = SHARED_ALL;
2328   };
2329  
# Line 2305 | Line 2332 | shared_type_item: KLINE
2332   ***************************************************************************/
2333   cluster_entry: T_CLUSTER
2334   {
2335 <  if (ypass == 2)
2335 >  if (conf_parser_ctx.pass == 2)
2336    {
2337      yy_conf = make_conf_item(CLUSTER_TYPE);
2338      yy_conf->flags = SHARED_ALL;
2339    }
2340   } '{' cluster_items '}' ';'
2341   {
2342 <  if (ypass == 2)
2342 >  if (conf_parser_ctx.pass == 2)
2343    {
2344      if (yy_conf->name == NULL)
2345        DupString(yy_conf->name, "*");
# Line 2325 | Line 2352 | cluster_item:  cluster_name | cluster_typ
2352  
2353   cluster_name: NAME '=' QSTRING ';'
2354   {
2355 <  if (ypass == 2)
2355 >  if (conf_parser_ctx.pass == 2)
2356      DupString(yy_conf->name, yylval.string);
2357   };
2358  
2359   cluster_type: TYPE
2360   {
2361 <  if (ypass == 2)
2361 >  if (conf_parser_ctx.pass == 2)
2362      yy_conf->flags = 0;
2363   } '=' cluster_types ';' ;
2364  
2365   cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2366   cluster_type_item: KLINE
2367   {
2368 <  if (ypass == 2)
2368 >  if (conf_parser_ctx.pass == 2)
2369      yy_conf->flags |= SHARED_KLINE;
2370   } | TKLINE
2371   {
2372 <  if (ypass == 2)
2372 >  if (conf_parser_ctx.pass == 2)
2373      yy_conf->flags |= SHARED_TKLINE;
2374   } | UNKLINE
2375   {
2376 <  if (ypass == 2)
2376 >  if (conf_parser_ctx.pass == 2)
2377      yy_conf->flags |= SHARED_UNKLINE;
2378   } | XLINE
2379   {
2380 <  if (ypass == 2)
2380 >  if (conf_parser_ctx.pass == 2)
2381      yy_conf->flags |= SHARED_XLINE;
2382   } | TXLINE
2383   {
2384 <  if (ypass == 2)
2384 >  if (conf_parser_ctx.pass == 2)
2385      yy_conf->flags |= SHARED_TXLINE;
2386   } | T_UNXLINE
2387   {
2388 <  if (ypass == 2)
2388 >  if (conf_parser_ctx.pass == 2)
2389      yy_conf->flags |= SHARED_UNXLINE;
2390   } | RESV
2391   {
2392 <  if (ypass == 2)
2392 >  if (conf_parser_ctx.pass == 2)
2393      yy_conf->flags |= SHARED_RESV;
2394   } | TRESV
2395   {
2396 <  if (ypass == 2)
2396 >  if (conf_parser_ctx.pass == 2)
2397      yy_conf->flags |= SHARED_TRESV;
2398   } | T_UNRESV
2399   {
2400 <  if (ypass == 2)
2400 >  if (conf_parser_ctx.pass == 2)
2401      yy_conf->flags |= SHARED_UNRESV;
2402   } | T_LOCOPS
2403   {
2404 <  if (ypass == 2)
2404 >  if (conf_parser_ctx.pass == 2)
2405      yy_conf->flags |= SHARED_LOCOPS;
2406   } | T_ALL
2407   {
2408 <  if (ypass == 2)
2408 >  if (conf_parser_ctx.pass == 2)
2409      yy_conf->flags = SHARED_ALL;
2410   };
2411  
# Line 2387 | Line 2414 | cluster_type_item: KLINE
2414   ***************************************************************************/
2415   connect_entry: CONNECT  
2416   {
2417 <  if (ypass == 2)
2417 >  if (conf_parser_ctx.pass == 2)
2418    {
2419      yy_conf = make_conf_item(SERVER_TYPE);
2420      yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
# Line 2405 | Line 2432 | connect_entry: CONNECT
2432    }
2433   } connect_name_b '{' connect_items '}' ';'
2434   {
2435 <  if (ypass == 2)
2435 >  if (conf_parser_ctx.pass == 2)
2436    {
2437      struct CollectItem *yy_hconf=NULL;
2438      struct CollectItem *yy_lconf=NULL;
# Line 2544 | Line 2571 | connect_item:   connect_name | connect_h
2571  
2572   connect_name: NAME '=' QSTRING ';'
2573   {
2574 <  if (ypass == 2)
2574 >  if (conf_parser_ctx.pass == 2)
2575    {
2576      if (yy_conf->name != NULL)
2577        yyerror("Multiple connect name entry");
# Line 2556 | Line 2583 | connect_name: NAME '=' QSTRING ';'
2583  
2584   connect_name_t: QSTRING
2585   {
2586 <  if (ypass == 2)
2586 >  if (conf_parser_ctx.pass == 2)
2587    {
2588      if (yy_conf->name != NULL)
2589        yyerror("Multiple connect name entry");
# Line 2568 | Line 2595 | connect_name_t: QSTRING
2595  
2596   connect_host: HOST '=' QSTRING ';'
2597   {
2598 <  if (ypass == 2)
2598 >  if (conf_parser_ctx.pass == 2)
2599    {
2600      MyFree(yy_aconf->host);
2601      DupString(yy_aconf->host, yylval.string);
# Line 2577 | Line 2604 | connect_host: HOST '=' QSTRING ';'
2604  
2605   connect_vhost: VHOST '=' QSTRING ';'
2606   {
2607 <  if (ypass == 2)
2607 >  if (conf_parser_ctx.pass == 2)
2608    {
2609      struct addrinfo hints, *res;
2610  
# Line 2603 | Line 2630 | connect_vhost: VHOST '=' QSTRING ';'
2630  
2631   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2632   {
2633 <  if (ypass == 2)
2633 >  if (conf_parser_ctx.pass == 2)
2634    {
2635      if ($3[0] == ':')
2636        yyerror("Server passwords cannot begin with a colon");
# Line 2621 | Line 2648 | connect_send_password: SEND_PASSWORD '='
2648  
2649   connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';'
2650   {
2651 <  if (ypass == 2)
2651 >  if (conf_parser_ctx.pass == 2)
2652    {
2653      if ($3[0] == ':')
2654        yyerror("Server passwords cannot begin with a colon");
# Line 2639 | Line 2666 | connect_accept_password: ACCEPT_PASSWORD
2666  
2667   connect_port: PORT '=' NUMBER ';'
2668   {
2669 <  if (ypass == 2)
2669 >  if (conf_parser_ctx.pass == 2)
2670      yy_aconf->port = $3;
2671   };
2672  
2673   connect_aftype: AFTYPE '=' T_IPV4 ';'
2674   {
2675 <  if (ypass == 2)
2675 >  if (conf_parser_ctx.pass == 2)
2676      yy_aconf->aftype = AF_INET;
2677   } | AFTYPE '=' T_IPV6 ';'
2678   {
2679   #ifdef IPV6
2680 <  if (ypass == 2)
2680 >  if (conf_parser_ctx.pass == 2)
2681      yy_aconf->aftype = AF_INET6;
2682   #endif
2683   };
2684  
2685   connect_fakename: FAKENAME '=' QSTRING ';'
2686   {
2687 <  if (ypass == 2)
2687 >  if (conf_parser_ctx.pass == 2)
2688    {
2689      MyFree(yy_aconf->fakename);
2690      DupString(yy_aconf->fakename, yylval.string);
# Line 2674 | Line 2701 | connect_flags_item: NOT  { not_atom = 1;
2701  
2702   connect_flags_item_atom: COMPRESSED
2703   {
2704 <  if (ypass == 2)
2704 >  if (conf_parser_ctx.pass == 2)
2705   #ifndef HAVE_LIBZ
2706      yyerror("Ignoring flags = compressed; -- no zlib support");
2707   #else
# Line 2685 | Line 2712 | connect_flags_item_atom: COMPRESSED
2712   #endif
2713   } | CRYPTLINK
2714   {
2715 <  if (ypass == 2)
2715 >  if (conf_parser_ctx.pass == 2)
2716    {
2717      if (not_atom)ClearConfCryptLink(yy_aconf);
2718      else SetConfCryptLink(yy_aconf);
2719    }
2720   } | AUTOCONN
2721   {
2722 <  if (ypass == 2)
2722 >  if (conf_parser_ctx.pass == 2)
2723    {
2724      if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2725      else SetConfAllowAutoConn(yy_aconf);
2726    }
2727   } | BURST_AWAY
2728   {
2729 <  if (ypass == 2)
2729 >  if (conf_parser_ctx.pass == 2)
2730    {
2731      if (not_atom)ClearConfAwayBurst(yy_aconf);
2732      else SetConfAwayBurst(yy_aconf);
2733    }
2734   } | TOPICBURST
2735   {
2736 <  if (ypass == 2)
2736 >  if (conf_parser_ctx.pass == 2)
2737    {
2738      if (not_atom)ClearConfTopicBurst(yy_aconf);
2739      else SetConfTopicBurst(yy_aconf);
# Line 2717 | Line 2744 | connect_flags_item_atom: COMPRESSED
2744   connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2745   {
2746   #ifdef HAVE_LIBCRYPTO
2747 <  if (ypass == 2)
2747 >  if (conf_parser_ctx.pass == 2)
2748    {
2749      BIO *file;
2750  
# Line 2757 | Line 2784 | connect_rsa_public_key_file: RSA_PUBLIC_
2784  
2785   connect_encrypted: ENCRYPTED '=' TBOOL ';'
2786   {
2787 <  if (ypass == 2)
2787 >  if (conf_parser_ctx.pass == 2)
2788    {
2789      if (yylval.number)
2790        yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
# Line 2768 | Line 2795 | connect_encrypted: ENCRYPTED '=' TBOOL '
2795  
2796   connect_cryptlink: CRYPTLINK '=' TBOOL ';'
2797   {
2798 <  if (ypass == 2)
2798 >  if (conf_parser_ctx.pass == 2)
2799    {
2800      if (yylval.number)
2801        yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
# Line 2779 | Line 2806 | connect_cryptlink: CRYPTLINK '=' TBOOL '
2806  
2807   connect_compressed: COMPRESSED '=' TBOOL ';'
2808   {
2809 <  if (ypass == 2)
2809 >  if (conf_parser_ctx.pass == 2)
2810    {
2811      if (yylval.number)
2812   #ifndef HAVE_LIBZ
# Line 2794 | Line 2821 | connect_compressed: COMPRESSED '=' TBOOL
2821  
2822   connect_auto: AUTOCONN '=' TBOOL ';'
2823   {
2824 <  if (ypass == 2)
2824 >  if (conf_parser_ctx.pass == 2)
2825    {
2826      if (yylval.number)
2827        yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
# Line 2805 | Line 2832 | connect_auto: AUTOCONN '=' TBOOL ';'
2832  
2833   connect_topicburst: TOPICBURST '=' TBOOL ';'
2834   {
2835 <  if (ypass == 2)
2835 >  if (conf_parser_ctx.pass == 2)
2836    {
2837      if (yylval.number)
2838        SetConfTopicBurst(yy_aconf);
# Line 2816 | Line 2843 | connect_topicburst: TOPICBURST '=' TBOOL
2843  
2844   connect_hub_mask: HUB_MASK '=' QSTRING ';'
2845   {
2846 <  if (ypass == 2)
2846 >  if (conf_parser_ctx.pass == 2)
2847    {
2848      struct CollectItem *yy_tmp;
2849  
# Line 2829 | Line 2856 | connect_hub_mask: HUB_MASK '=' QSTRING '
2856  
2857   connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2858   {
2859 <  if (ypass == 2)
2859 >  if (conf_parser_ctx.pass == 2)
2860    {
2861      struct CollectItem *yy_tmp;
2862  
# Line 2842 | Line 2869 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2869  
2870   connect_class: CLASS '=' QSTRING ';'
2871   {
2872 <  if (ypass == 2)
2872 >  if (conf_parser_ctx.pass == 2)
2873    {
2874      MyFree(class_name);
2875      DupString(class_name, yylval.string);
# Line 2852 | Line 2879 | connect_class: CLASS '=' QSTRING ';'
2879   connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2880   {
2881   #ifdef HAVE_LIBCRYPTO
2882 <  if (ypass == 2)
2882 >  if (conf_parser_ctx.pass == 2)
2883    {
2884      struct EncCapability *ecap;
2885      const char *cipher_name;
# Line 2876 | Line 2903 | connect_cipher_preference: CIPHER_PREFER
2903        yyerror("Invalid cipher");
2904    }
2905   #else
2906 <  if (ypass == 2)
2906 >  if (conf_parser_ctx.pass == 2)
2907      yyerror("Ignoring cipher_preference -- no OpenSSL support");
2908   #endif
2909   };
# Line 2886 | Line 2913 | connect_cipher_preference: CIPHER_PREFER
2913   ***************************************************************************/
2914   kill_entry: KILL
2915   {
2916 <  if (ypass == 2)
2916 >  if (conf_parser_ctx.pass == 2)
2917    {
2918      userbuf[0] = hostbuf[0] = reasonbuf[0] = '\0';
2919      regex_ban = 0;
2920    }
2921   } '{' kill_items '}' ';'
2922   {
2923 <  if (ypass == 2)
2923 >  if (conf_parser_ctx.pass == 2)
2924    {
2925      if (userbuf[0] && hostbuf[0])
2926      {
# Line 2955 | Line 2982 | kill_type: TYPE
2982   kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2983   kill_type_item: REGEX_T
2984   {
2985 <  if (ypass == 2)
2985 >  if (conf_parser_ctx.pass == 2)
2986      regex_ban = 1;
2987   };
2988  
# Line 2964 | Line 2991 | kill_item:      kill_user | kill_reason
2991  
2992   kill_user: USER '=' QSTRING ';'
2993   {
2994 <  if (ypass == 2)
2994 >  if (conf_parser_ctx.pass == 2)
2995    {
2996      struct split_nuh_item nuh;
2997  
# Line 2983 | Line 3010 | kill_user: USER '=' QSTRING ';'
3010  
3011   kill_reason: REASON '=' QSTRING ';'
3012   {
3013 <  if (ypass == 2)
3013 >  if (conf_parser_ctx.pass == 2)
3014      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
3015   };
3016  
# Line 2992 | Line 3019 | kill_reason: REASON '=' QSTRING ';'
3019   ***************************************************************************/
3020   deny_entry: DENY
3021   {
3022 <  if (ypass == 2)
3022 >  if (conf_parser_ctx.pass == 2)
3023    {
3024      yy_conf = make_conf_item(DLINE_TYPE);
3025      yy_aconf = map_to_conf(yy_conf);
# Line 3001 | Line 3028 | deny_entry: DENY
3028    }
3029   } '{' deny_items '}' ';'
3030   {
3031 <  if (ypass == 2)
3031 >  if (conf_parser_ctx.pass == 2)
3032    {
3033      if (yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
3034        add_conf_by_address(CONF_DLINE, yy_aconf);
# Line 3017 | Line 3044 | deny_item:      deny_ip | deny_reason |
3044  
3045   deny_ip: IP '=' QSTRING ';'
3046   {
3047 <  if (ypass == 2)
3047 >  if (conf_parser_ctx.pass == 2)
3048    {
3049      MyFree(yy_aconf->host);
3050      DupString(yy_aconf->host, yylval.string);
# Line 3026 | Line 3053 | deny_ip: IP '=' QSTRING ';'
3053  
3054   deny_reason: REASON '=' QSTRING ';'
3055   {
3056 <  if (ypass == 2)
3056 >  if (conf_parser_ctx.pass == 2)
3057    {
3058      MyFree(yy_aconf->reason);
3059      DupString(yy_aconf->reason, yylval.string);
# Line 3043 | Line 3070 | exempt_item:      exempt_ip | error;
3070  
3071   exempt_ip: IP '=' QSTRING ';'
3072   {
3073 <  if (ypass == 2)
3073 >  if (conf_parser_ctx.pass == 2)
3074    {
3075      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
3076      {
# Line 3064 | Line 3091 | exempt_ip: IP '=' QSTRING ';'
3091   ***************************************************************************/
3092   gecos_entry: GECOS
3093   {
3094 <  if (ypass == 2)
3094 >  if (conf_parser_ctx.pass == 2)
3095    {
3096      regex_ban = 0;
3097      reasonbuf[0] = gecos_name[0] = '\0';
3098    }
3099   } '{' gecos_items '}' ';'
3100   {
3101 <  if (ypass == 2)
3101 >  if (conf_parser_ctx.pass == 2)
3102    {
3103      if (gecos_name[0])
3104      {
# Line 3111 | Line 3138 | gecos_flags: TYPE
3138   gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
3139   gecos_flags_item: REGEX_T
3140   {
3141 <  if (ypass == 2)
3141 >  if (conf_parser_ctx.pass == 2)
3142      regex_ban = 1;
3143   };
3144  
# Line 3120 | Line 3147 | gecos_item:  gecos_name | gecos_reason |
3147  
3148   gecos_name: NAME '=' QSTRING ';'
3149   {
3150 <  if (ypass == 2)
3150 >  if (conf_parser_ctx.pass == 2)
3151      strlcpy(gecos_name, yylval.string, sizeof(gecos_name));
3152   };
3153  
3154   gecos_reason: REASON '=' QSTRING ';'
3155   {
3156 <  if (ypass == 2)
3156 >  if (conf_parser_ctx.pass == 2)
3157      strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
3158   };
3159  
# Line 3261 | Line 3288 | general_ts_warn_delta: TS_WARN_DELTA '='
3288  
3289   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
3290   {
3291 <  if (ypass == 2)
3291 >  if (conf_parser_ctx.pass == 2)
3292      ConfigFileEntry.ts_max_delta = $3;
3293   };
3294  
3295   general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
3296   {
3297 <  if (($3 > 0) && ypass == 1)
3297 >  if (($3 > 0) && conf_parser_ctx.pass == 1)
3298    {
3299      ilog(L_CRIT, "You haven't read your config file properly.");
3300      ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
# Line 3283 | Line 3310 | general_kline_with_reason: KLINE_WITH_RE
3310  
3311   general_kline_reason: KLINE_REASON '=' QSTRING ';'
3312   {
3313 <  if (ypass == 2)
3313 >  if (conf_parser_ctx.pass == 2)
3314    {
3315      MyFree(ConfigFileEntry.kline_reason);
3316      DupString(ConfigFileEntry.kline_reason, yylval.string);
# Line 3373 | Line 3400 | general_oper_pass_resv: OPER_PASS_RESV '
3400  
3401   general_message_locale: MESSAGE_LOCALE '=' QSTRING ';'
3402   {
3403 <  if (ypass == 2)
3403 >  if (conf_parser_ctx.pass == 2)
3404    {
3405      if (strlen(yylval.string) > LOCALE_LENGTH-2)
3406        yylval.string[LOCALE_LENGTH-1] = '\0';
# Line 3399 | Line 3426 | general_max_targets: MAX_TARGETS '=' NUM
3426  
3427   general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3428   {
3429 <  if (ypass == 2)
3429 >  if (conf_parser_ctx.pass == 2)
3430    {
3431      MyFree(ConfigFileEntry.servlink_path);
3432      DupString(ConfigFileEntry.servlink_path, yylval.string);
# Line 3409 | Line 3436 | general_servlink_path: SERVLINK_PATH '='
3436   general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3437   {
3438   #ifdef HAVE_LIBCRYPTO
3439 <  if (ypass == 2)
3439 >  if (conf_parser_ctx.pass == 2)
3440    {
3441      struct EncCapability *ecap;
3442      const char *cipher_name;
# Line 3433 | Line 3460 | general_default_cipher_preference: DEFAU
3460        yyerror("Invalid cipher");
3461    }
3462   #else
3463 <  if (ypass == 2)
3463 >  if (conf_parser_ctx.pass == 2)
3464      yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3465   #endif
3466   };
3467  
3468   general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3469   {
3470 <  if (ypass == 2)
3470 >  if (conf_parser_ctx.pass == 2)
3471    {
3472      ConfigFileEntry.compression_level = $3;
3473   #ifndef HAVE_LIBZ
# Line 3463 | Line 3490 | general_use_egd: USE_EGD '=' TBOOL ';'
3490  
3491   general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
3492   {
3493 <  if (ypass == 2)
3493 >  if (conf_parser_ctx.pass == 2)
3494    {
3495      MyFree(ConfigFileEntry.egdpool_path);
3496      DupString(ConfigFileEntry.egdpool_path, yylval.string);
# Line 3645 | Line 3672 | general_dot_in_ip6_addr: DOT_IN_IP6_ADDR
3672   ***************************************************************************/
3673   gline_entry: GLINES
3674   {
3675 <  if (ypass == 2)
3675 >  if (conf_parser_ctx.pass == 2)
3676    {
3677      yy_conf = make_conf_item(GDENY_TYPE);
3678      yy_aconf = map_to_conf(yy_conf);
3679    }
3680   } '{' gline_items '}' ';'
3681   {
3682 <  if (ypass == 2)
3682 >  if (conf_parser_ctx.pass == 2)
3683    {
3684      /*
3685       * since we re-allocate yy_conf/yy_aconf after the end of action=, at the
# Line 3678 | Line 3705 | gline_item:         gline_enable |
3705  
3706   gline_enable: ENABLE '=' TBOOL ';'
3707   {
3708 <  if (ypass == 2)
3708 >  if (conf_parser_ctx.pass == 2)
3709      ConfigFileEntry.glines = yylval.number;
3710   };
3711  
3712   gline_duration: DURATION '=' timespec ';'
3713   {
3714 <  if (ypass == 2)
3714 >  if (conf_parser_ctx.pass == 2)
3715      ConfigFileEntry.gline_time = $3;
3716   };
3717  
3718   gline_logging: LOGGING
3719   {
3720 <  if (ypass == 2)
3720 >  if (conf_parser_ctx.pass == 2)
3721      ConfigFileEntry.gline_logging = 0;
3722   } '=' gline_logging_types ';';
3723   gline_logging_types:     gline_logging_types ',' gline_logging_type_item | gline_logging_type_item;
3724   gline_logging_type_item: T_REJECT
3725   {
3726 <  if (ypass == 2)
3726 >  if (conf_parser_ctx.pass == 2)
3727      ConfigFileEntry.gline_logging |= GDENY_REJECT;
3728   } | T_BLOCK
3729   {
3730 <  if (ypass == 2)
3730 >  if (conf_parser_ctx.pass == 2)
3731      ConfigFileEntry.gline_logging |= GDENY_BLOCK;
3732   };
3733  
3734   gline_user: USER '=' QSTRING ';'
3735   {
3736 <  if (ypass == 2)
3736 >  if (conf_parser_ctx.pass == 2)
3737    {
3738      struct split_nuh_item nuh;
3739  
# Line 3740 | Line 3767 | gline_user: USER '=' QSTRING ';'
3767  
3768   gline_server: NAME '=' QSTRING ';'
3769   {
3770 <  if (ypass == 2)  
3770 >  if (conf_parser_ctx.pass == 2)  
3771    {
3772      MyFree(yy_conf->name);
3773      DupString(yy_conf->name, yylval.string);
# Line 3749 | Line 3776 | gline_server: NAME '=' QSTRING ';'
3776  
3777   gline_action: ACTION
3778   {
3779 <  if (ypass == 2)
3779 >  if (conf_parser_ctx.pass == 2)
3780      yy_aconf->flags = 0;
3781   } '=' gdeny_types ';'
3782   {
3783 <  if (ypass == 2)
3783 >  if (conf_parser_ctx.pass == 2)
3784    {
3785      struct CollectItem *yy_tmp = NULL;
3786      dlink_node *ptr, *next_ptr;
# Line 3800 | Line 3827 | gline_action: ACTION
3827   gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item;
3828   gdeny_type_item: T_REJECT
3829   {
3830 <  if (ypass == 2)
3830 >  if (conf_parser_ctx.pass == 2)
3831      yy_aconf->flags |= GDENY_REJECT;
3832   } | T_BLOCK
3833   {
3834 <  if (ypass == 2)
3834 >  if (conf_parser_ctx.pass == 2)
3835      yy_aconf->flags |= GDENY_BLOCK;
3836   };
3837  
# Line 3932 | Line 3959 | serverhide_item:    serverhide_flatten_l
3959  
3960   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
3961   {
3962 <  if (ypass == 2)
3962 >  if (conf_parser_ctx.pass == 2)
3963      ConfigServerHide.flatten_links = yylval.number;
3964   };
3965  
3966   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
3967   {
3968 <  if (ypass == 2)
3968 >  if (conf_parser_ctx.pass == 2)
3969      ConfigServerHide.hide_servers = yylval.number;
3970   };
3971  
3972   serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';'
3973   {
3974 <  if (ypass == 2)
3974 >  if (conf_parser_ctx.pass == 2)
3975    {
3976      MyFree(ConfigServerHide.hidden_name);
3977      DupString(ConfigServerHide.hidden_name, yylval.string);
# Line 3953 | Line 3980 | serverhide_hidden_name: HIDDEN_NAME '='
3980  
3981   serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3982   {
3983 <  if (ypass == 2)
3983 >  if (conf_parser_ctx.pass == 2)
3984    {
3985      if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3986      {
# Line 3967 | Line 3994 | serverhide_links_delay: LINKS_DELAY '='
3994  
3995   serverhide_hidden: HIDDEN '=' TBOOL ';'
3996   {
3997 <  if (ypass == 2)
3997 >  if (conf_parser_ctx.pass == 2)
3998      ConfigServerHide.hidden = yylval.number;
3999   };
4000  
4001   serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';'
4002   {
4003 <  if (ypass == 2)
4003 >  if (conf_parser_ctx.pass == 2)
4004      ConfigServerHide.disable_hidden = yylval.number;
4005   };
4006  
4007   serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';'
4008   {
4009 <  if (ypass == 2)
4009 >  if (conf_parser_ctx.pass == 2)
4010      ConfigServerHide.hide_server_ips = yylval.number;
4011   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines