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/trunk/src/conf_parser.y (file contents):
Revision 1851 by michael, Wed Apr 24 18:31:06 2013 UTC vs.
Revision 3435 by michael, Thu May 1 13:57:39 2014 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  conf_parser.y: Parses the ircd configuration file.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2005 by the past and present ircd coders, and others.
4 > *  Copyright (c) 2000-2014 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 18 | Line 17
17   *  along with this program; if not, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
19   *  USA
21 *
22 *  $Id$
20   */
21  
22 + /*! \file conf_parser.y
23 + * \brief Parses the ircd configuration file.
24 + * \version $Id$
25 + */
26 +
27 +
28   %{
29  
30   #define YY_NO_UNPUT
# Line 40 | Line 43
43   #include "irc_string.h"
44   #include "memory.h"
45   #include "modules.h"
46 < #include "s_serv.h"
46 > #include "server.h"
47   #include "hostmask.h"
48   #include "send.h"
49   #include "listener.h"
50   #include "resv.h"
51   #include "numeric.h"
52 < #include "s_user.h"
52 > #include "user.h"
53 > #include "motd.h"
54  
55   #ifdef HAVE_LIBCRYPTO
56   #include <openssl/rsa.h>
# Line 76 | Line 80 | static struct
80      bind,
81      file,
82      ciph,
83 +    cert,
84      rpass,
85      spass,
86      class;
# Line 150 | Line 155 | reset_block_state(void)
155   %token  CALLER_ID_WAIT
156   %token  CAN_FLOOD
157   %token  CHANNEL
158 < %token  CIDR_BITLEN_IPV4
159 < %token  CIDR_BITLEN_IPV6
158 > %token  CIDR_BITLEN_IPV4
159 > %token  CIDR_BITLEN_IPV6
160   %token  CLASS
161   %token  CONNECT
162   %token  CONNECTFREQ
163 + %token  CYCLE_ON_HOST_CHANGE
164   %token  DEFAULT_FLOODCOUNT
165   %token  DEFAULT_SPLIT_SERVER_COUNT
166   %token  DEFAULT_SPLIT_USER_COUNT
# Line 171 | Line 177 | reset_block_state(void)
177   %token  EXCEED_LIMIT
178   %token  EXEMPT
179   %token  FAILED_OPER_NOTICE
174 %token  IRCD_FLAGS
180   %token  FLATTEN_LINKS
181   %token  GECOS
182   %token  GENERAL
# Line 179 | Line 184 | reset_block_state(void)
184   %token  GLINE_DURATION
185   %token  GLINE_ENABLE
186   %token  GLINE_EXEMPT
182 %token  GLINE_REQUEST_DURATION
187   %token  GLINE_MIN_CIDR
188   %token  GLINE_MIN_CIDR6
189 + %token  GLINE_REQUEST_DURATION
190   %token  GLOBAL_KILL
186 %token  IRCD_AUTH
187 %token  NEED_IDENT
191   %token  HAVENT_READ_CONF
192   %token  HIDDEN
193 < %token  HIDDEN_NAME
193 > %token  HIDDEN_NAME
194 > %token  HIDE_IDLE_FROM_OPERS
195   %token  HIDE_SERVER_IPS
196   %token  HIDE_SERVERS
197   %token  HIDE_SERVICES
198 < %token  HIDE_SPOOF_IPS
198 > %token  HIDE_SPOOF_IPS
199   %token  HOST
200   %token  HUB
201   %token  HUB_MASK
202   %token  IGNORE_BOGUS_TS
203   %token  INVISIBLE_ON_CONNECT
204   %token  IP
205 + %token  IRCD_AUTH
206 + %token  IRCD_FLAGS
207 + %token  IRCD_SID
208 + %token  JOIN_FLOOD_COUNT
209 + %token  JOIN_FLOOD_TIME
210   %token  KILL
211 < %token  KILL_CHASE_TIME_LIMIT
211 > %token  KILL_CHASE_TIME_LIMIT
212   %token  KLINE
213   %token  KLINE_EXEMPT
214   %token  KNOCK_DELAY
# Line 207 | Line 216 | reset_block_state(void)
216   %token  LEAF_MASK
217   %token  LINKS_DELAY
218   %token  LISTEN
219 < %token  T_LOG
219 > %token  MASK
220   %token  MAX_ACCEPT
221   %token  MAX_BANS
222   %token  MAX_CHANS_PER_OPER
223   %token  MAX_CHANS_PER_USER
224   %token  MAX_GLOBAL
225   %token  MAX_IDENT
226 + %token  MAX_IDLE
227   %token  MAX_LOCAL
228   %token  MAX_NICK_CHANGES
229   %token  MAX_NICK_LENGTH
# Line 222 | Line 232 | reset_block_state(void)
232   %token  MAX_TARGETS
233   %token  MAX_TOPIC_LENGTH
234   %token  MAX_WATCH
235 + %token  MIN_IDLE
236   %token  MIN_NONWILDCARD
237   %token  MIN_NONWILDCARD_SIMPLE
227 %token  MIN_IDLE
228 %token  MAX_IDLE
229 %token  RANDOM_IDLE
230 %token  HIDE_IDLE_FROM_OPERS
238   %token  MODULE
239   %token  MODULES
240 + %token  MOTD
241   %token  NAME
242 + %token  NEED_IDENT
243   %token  NEED_PASSWORD
244   %token  NETWORK_DESC
245   %token  NETWORK_NAME
246   %token  NICK
238 %token  NICK_CHANGES
247   %token  NO_CREATE_ON_SPLIT
248   %token  NO_JOIN_ON_SPLIT
249   %token  NO_OPER_FLOOD
# Line 243 | Line 251 | reset_block_state(void)
251   %token  NUMBER
252   %token  NUMBER_PER_CIDR
253   %token  NUMBER_PER_IP
246 %token  OPERATOR
247 %token  OPERS_BYPASS_CALLERID
254   %token  OPER_ONLY_UMODES
255   %token  OPER_PASS_RESV
250 %token  OPER_SPY_T
256   %token  OPER_UMODES
257 < %token  JOIN_FLOOD_COUNT
258 < %token  JOIN_FLOOD_TIME
257 > %token  OPERATOR
258 > %token  OPERS_BYPASS_CALLERID
259   %token  PACE_WAIT
260   %token  PACE_WAIT_SIMPLE
261   %token  PASSWORD
# Line 259 | Line 264 | reset_block_state(void)
264   %token  PING_TIME
265   %token  PORT
266   %token  QSTRING
267 < %token  QUIET_ON_BAN
267 > %token  RANDOM_IDLE
268   %token  REASON
269   %token  REDIRPORT
270   %token  REDIRSERV
266 %token  REGEX_T
271   %token  REHASH
272   %token  REMOTE
273   %token  REMOTEBAN
270 %token  RESTRICT_CHANNELS
271 %token  RSA_PRIVATE_KEY_FILE
272 %token  RSA_PUBLIC_KEY_FILE
273 %token  SSL_CERTIFICATE_FILE
274 %token  SSL_DH_PARAM_FILE
275 %token  T_SSL_CLIENT_METHOD
276 %token  T_SSL_SERVER_METHOD
277 %token  T_SSLV3
278 %token  T_TLSV1
274   %token  RESV
275   %token  RESV_EXEMPT
276 + %token  RSA_PRIVATE_KEY_FILE
277 + %token  RSA_PUBLIC_KEY_FILE
278   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
282 %token  SENDQ
279   %token  SEND_PASSWORD
280 + %token  SENDQ
281   %token  SERVERHIDE
282   %token  SERVERINFO
286 %token  IRCD_SID
287 %token  TKLINE_EXPIRE_NOTICES
288 %token  T_SHARED
289 %token  T_CLUSTER
290 %token  TYPE
283   %token  SHORT_MOTD
284   %token  SPOOF
285   %token  SPOOF_NOTICE
286 + %token  SQUIT
287 + %token  SSL_CERTIFICATE_FILE
288 + %token  SSL_CERTIFICATE_FINGERPRINT
289 + %token  SSL_CONNECTION_REQUIRED
290 + %token  SSL_DH_PARAM_FILE
291   %token  STATS_E_DISABLED
292   %token  STATS_I_OPER_ONLY
293   %token  STATS_K_OPER_ONLY
294   %token  STATS_O_OPER_ONLY
295   %token  STATS_P_OPER_ONLY
296 < %token  TBOOL
300 < %token  TMASKED
301 < %token  TS_MAX_DELTA
302 < %token  TS_WARN_DELTA
303 < %token  TWODOTS
296 > %token  STATS_U_OPER_ONLY
297   %token  T_ALL
298   %token  T_BOTS
306 %token  T_SOFTCALLERID
299   %token  T_CALLERID
300   %token  T_CCONN
301 < %token  T_CCONN_FULL
310 < %token  T_SSL_CIPHER_LIST
301 > %token  T_CLUSTER
302   %token  T_DEAF
303   %token  T_DEBUG
304   %token  T_DLINE
305   %token  T_EXTERNAL
306 + %token  T_FARCONNECT
307 + %token  T_FILE
308   %token  T_FULL
309 + %token  T_GLOBOPS
310   %token  T_INVISIBLE
311   %token  T_IPV4
312   %token  T_IPV6
313   %token  T_LOCOPS
314 + %token  T_LOG
315   %token  T_MAX_CLIENTS
316   %token  T_NCHANGE
317 + %token  T_NONONREG
318   %token  T_OPERWALL
319   %token  T_RECVQ
320   %token  T_REJ
321 + %token  T_RESTART
322   %token  T_SERVER
323 + %token  T_SERVICE
324 + %token  T_SERVICES_NAME
325   %token  T_SERVNOTICE
326   %token  T_SET
327 + %token  T_SHARED
328 + %token  T_SIZE
329   %token  T_SKILL
330 + %token  T_SOFTCALLERID
331   %token  T_SPY
332   %token  T_SSL
333 + %token  T_SSL_CIPHER_LIST
334 + %token  T_SSL_CLIENT_METHOD
335 + %token  T_SSL_SERVER_METHOD
336 + %token  T_SSLV3
337 + %token  T_TLSV1
338   %token  T_UMODES
339   %token  T_UNAUTH
340   %token  T_UNDLINE
341   %token  T_UNLIMITED
342   %token  T_UNRESV
343   %token  T_UNXLINE
337 %token  T_GLOBOPS
344   %token  T_WALLOP
345 + %token  T_WALLOPS
346   %token  T_WEBIRC
347 < %token  T_RESTART
341 < %token  T_SERVICE
342 < %token  T_SERVICES_NAME
347 > %token  TBOOL
348   %token  THROTTLE_TIME
349 + %token  TKLINE_EXPIRE_NOTICES
350 + %token  TMASKED
351   %token  TRUE_NO_OPER_FLOOD
352 + %token  TS_MAX_DELTA
353 + %token  TS_WARN_DELTA
354 + %token  TWODOTS
355 + %token  TYPE
356   %token  UNKLINE
346 %token  USER
357   %token  USE_EGD
358   %token  USE_LOGGING
359 + %token  USER
360   %token  VHOST
361   %token  VHOST6
351 %token  XLINE
362   %token  WARN_NO_NLINE
363 < %token  T_SIZE
354 < %token  T_FILE
363 > %token  XLINE
364  
365 < %type <string> QSTRING
366 < %type <number> NUMBER
367 < %type <number> timespec
368 < %type <number> timespec_
369 < %type <number> sizespec
370 < %type <number> sizespec_
365 > %type  <string> QSTRING
366 > %type  <number> NUMBER
367 > %type  <number> timespec
368 > %type  <number> timespec_
369 > %type  <number> sizespec
370 > %type  <number> sizespec_
371  
372   %%
373 < conf:  
373 > conf:
374          | conf conf_item
375          ;
376  
# Line 369 | Line 378 | conf_item:        admin_entry
378                  | logging_entry
379                  | oper_entry
380                  | channel_entry
381 <                | class_entry
381 >                | class_entry
382                  | listen_entry
383                  | auth_entry
384                  | serverinfo_entry
# Line 385 | Line 394 | conf_item:        admin_entry
394                  | general_entry
395                  | gecos_entry
396                  | modules_entry
397 +                | motd_entry
398                  | error ';'
399                  | error '}'
400          ;
# Line 506 | Line 516 | server_method_type_item: T_SSLV3
516   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
517   {
518   #ifdef HAVE_LIBCRYPTO
519 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
519 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
520    {
521      if (!ServerInfo.rsa_private_key_file)
522      {
# Line 548 | Line 558 | serverinfo_ssl_certificate_file: SSL_CER
558   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
559   {
560   #ifdef HAVE_LIBCRYPTO
561 <  if (conf_parser_ctx.pass == 1)
552 <  {
553 <    BIO *file;
561 >  BIO *file = NULL;
562  
563 <    if (ServerInfo.rsa_private_key)
564 <    {
557 <      RSA_free(ServerInfo.rsa_private_key);
558 <      ServerInfo.rsa_private_key = NULL;
559 <    }
563 >  if (conf_parser_ctx.pass != 1)
564 >    break;
565  
566 <    if (ServerInfo.rsa_private_key_file)
567 <    {
568 <      MyFree(ServerInfo.rsa_private_key_file);
569 <      ServerInfo.rsa_private_key_file = NULL;
570 <    }
566 >  if (ServerInfo.rsa_private_key)
567 >  {
568 >    RSA_free(ServerInfo.rsa_private_key);
569 >    ServerInfo.rsa_private_key = NULL;
570 >  }
571  
572 <    ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
572 >  if (ServerInfo.rsa_private_key_file)
573 >  {
574 >    MyFree(ServerInfo.rsa_private_key_file);
575 >    ServerInfo.rsa_private_key_file = NULL;
576 >  }
577  
578 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
570 <    {
571 <      conf_error_report("File open failed, ignoring");
572 <      break;
573 <    }
578 >  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
579  
580 <    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
580 >  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
581 >  {
582 >    conf_error_report("File open failed, ignoring");
583 >    break;
584 >  }
585  
586 <    BIO_set_close(file, BIO_CLOSE);
578 <    BIO_free(file);
586 >  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
587  
588 <    if (ServerInfo.rsa_private_key == NULL)
589 <    {
582 <      conf_error_report("Couldn't extract key, ignoring");
583 <      break;
584 <    }
588 >  BIO_set_close(file, BIO_CLOSE);
589 >  BIO_free(file);
590  
591 <    if (!RSA_check_key(ServerInfo.rsa_private_key))
592 <    {
593 <      RSA_free(ServerInfo.rsa_private_key);
594 <      ServerInfo.rsa_private_key = NULL;
591 >  if (ServerInfo.rsa_private_key == NULL)
592 >  {
593 >    conf_error_report("Couldn't extract key, ignoring");
594 >    break;
595 >  }
596  
597 <      conf_error_report("Invalid key, ignoring");
598 <      break;
599 <    }
597 >  if (!RSA_check_key(ServerInfo.rsa_private_key))
598 >  {
599 >    RSA_free(ServerInfo.rsa_private_key);
600 >    ServerInfo.rsa_private_key = NULL;
601  
602 <    /* require 2048 bit (256 byte) key */
603 <    if (RSA_size(ServerInfo.rsa_private_key) != 256)
604 <    {
598 <      RSA_free(ServerInfo.rsa_private_key);
599 <      ServerInfo.rsa_private_key = NULL;
602 >    conf_error_report("Invalid key, ignoring");
603 >    break;
604 >  }
605  
606 <      conf_error_report("Not a 2048 bit key, ignoring");
607 <    }
606 >  if (RSA_size(ServerInfo.rsa_private_key) < 128)
607 >  {
608 >    RSA_free(ServerInfo.rsa_private_key);
609 >    ServerInfo.rsa_private_key = NULL;
610 >
611 >    conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 1024 bit key size");
612    }
613   #endif
614   };
# Line 640 | Line 649 | serverinfo_ssl_cipher_list: T_SSL_CIPHER
649   #endif
650   };
651  
652 < serverinfo_name: NAME '=' QSTRING ';'
652 > serverinfo_name: NAME '=' QSTRING ';'
653   {
654    /* this isn't rehashable */
655    if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
# Line 655 | Line 664 | serverinfo_name: NAME '=' QSTRING ';'
664    }
665   };
666  
667 < serverinfo_sid: IRCD_SID '=' QSTRING ';'
667 > serverinfo_sid: IRCD_SID '=' QSTRING ';'
668   {
669    /* this isn't rehashable */
670    if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
# Line 695 | Line 704 | serverinfo_network_name: NETWORK_NAME '=
704  
705   serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
706   {
707 <  if (conf_parser_ctx.pass == 2)
708 <  {
709 <    MyFree(ServerInfo.network_desc);
710 <    ServerInfo.network_desc = xstrdup(yylval.string);
711 <  }
707 >  if (conf_parser_ctx.pass != 2)
708 >    break;
709 >
710 >  MyFree(ServerInfo.network_desc);
711 >  ServerInfo.network_desc = xstrdup(yylval.string);
712   };
713  
714   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 829 | Line 838 | serverinfo_max_topic_length: MAX_TOPIC_L
838      ServerInfo.max_topic_length = $3;
839   };
840  
841 < serverinfo_hub: HUB '=' TBOOL ';'
841 > serverinfo_hub: HUB '=' TBOOL ';'
842   {
843    if (conf_parser_ctx.pass == 2)
844      ServerInfo.hub = yylval.number;
# Line 844 | Line 853 | admin_items: admin_items admin_item | ad
853   admin_item:  admin_name | admin_description |
854               admin_email | error ';' ;
855  
856 < admin_name: NAME '=' QSTRING ';'
856 > admin_name: NAME '=' QSTRING ';'
857   {
858 <  if (conf_parser_ctx.pass == 2)
859 <  {
860 <    MyFree(AdminInfo.name);
861 <    AdminInfo.name = xstrdup(yylval.string);
862 <  }
858 >  if (conf_parser_ctx.pass != 2)
859 >    break;
860 >
861 >  MyFree(AdminInfo.name);
862 >  AdminInfo.name = xstrdup(yylval.string);
863   };
864  
865   admin_email: EMAIL '=' QSTRING ';'
866   {
867 <  if (conf_parser_ctx.pass == 2)
868 <  {
869 <    MyFree(AdminInfo.email);
870 <    AdminInfo.email = xstrdup(yylval.string);
871 <  }
867 >  if (conf_parser_ctx.pass != 2)
868 >    break;
869 >
870 >  MyFree(AdminInfo.email);
871 >  AdminInfo.email = xstrdup(yylval.string);
872   };
873  
874   admin_description: DESCRIPTION '=' QSTRING ';'
875   {
876 +  if (conf_parser_ctx.pass != 2)
877 +    break;
878 +
879 +  MyFree(AdminInfo.description);
880 +  AdminInfo.description = xstrdup(yylval.string);
881 + };
882 +
883 + /***************************************************************************
884 + * motd section
885 + ***************************************************************************/
886 + motd_entry: MOTD
887 + {
888    if (conf_parser_ctx.pass == 2)
889 <  {
890 <    MyFree(AdminInfo.description);
891 <    AdminInfo.description = xstrdup(yylval.string);
892 <  }
889 >    reset_block_state();
890 > } '{' motd_items '}' ';'
891 > {
892 >  dlink_node *ptr = NULL;
893 >
894 >  if (conf_parser_ctx.pass != 2)
895 >    break;
896 >
897 >  if (!block_state.file.buf[0])
898 >    break;
899 >
900 >  DLINK_FOREACH(ptr, block_state.mask.list.head)
901 >    motd_add(ptr->data, block_state.file.buf);
902 > };
903 >
904 > motd_items: motd_items motd_item | motd_item;
905 > motd_item:  motd_mask | motd_file | error ';' ;
906 >
907 > motd_mask: MASK '=' QSTRING ';'
908 > {
909 >  if (conf_parser_ctx.pass == 2)
910 >    dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
911 > };
912 >
913 > motd_file: T_FILE '=' QSTRING ';'
914 > {
915 >  if (conf_parser_ctx.pass == 2)
916 >    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
917   };
918  
919   /***************************************************************************
# Line 941 | Line 986 | logging_file_type_item:  USER
986   {
987    if (conf_parser_ctx.pass == 2)
988      block_state.type.value = LOG_TYPE_GLINE;
989 + } | XLINE
990 + {
991 +  if (conf_parser_ctx.pass == 2)
992 +    block_state.type.value = LOG_TYPE_XLINE;
993 + } | RESV
994 + {
995 +  if (conf_parser_ctx.pass == 2)
996 +    block_state.type.value = LOG_TYPE_RESV;
997   } | T_DLINE
998   {
999    if (conf_parser_ctx.pass == 2)
# Line 963 | Line 1016 | logging_file_type_item:  USER
1016   /***************************************************************************
1017   * section oper
1018   ***************************************************************************/
1019 < oper_entry: OPERATOR
1019 > oper_entry: OPERATOR
1020   {
1021    if (conf_parser_ctx.pass != 2)
1022      break;
# Line 980 | Line 1033 | oper_entry: OPERATOR
1033    if (!block_state.name.buf[0])
1034      break;
1035   #ifdef HAVE_LIBCRYPTO
1036 <  if (!(block_state.file.buf[0] ||
1037 <        block_state.rpass.buf[0]))
1036 >  if (!block_state.file.buf[0] &&
1037 >      !block_state.rpass.buf[0])
1038      break;
1039   #else
1040    if (!block_state.rpass.buf[0])
# Line 1002 | Line 1055 | oper_entry: OPERATOR
1055      nuh.hostsize = sizeof(block_state.host.buf);
1056      split_nuh(&nuh);
1057  
1058 <    conf        = conf_make(CONF_OPER);
1059 <    conf->name  = xstrdup(block_state.name.buf);
1060 <    conf->user  = xstrdup(block_state.user.buf);
1061 <    conf->host  = xstrdup(block_state.host.buf);
1058 >    conf         = conf_make(CONF_OPER);
1059 >    conf->name   = xstrdup(block_state.name.buf);
1060 >    conf->user   = xstrdup(block_state.user.buf);
1061 >    conf->host   = xstrdup(block_state.host.buf);
1062 >
1063 >    if (block_state.cert.buf[0])
1064 >      conf->certfp = xstrdup(block_state.cert.buf);
1065  
1066      if (block_state.rpass.buf[0])
1067        conf->passwd = xstrdup(block_state.rpass.buf);
# Line 1043 | Line 1099 | oper_entry: OPERATOR
1099   oper_items:     oper_items oper_item | oper_item;
1100   oper_item:      oper_name | oper_user | oper_password |
1101                  oper_umodes | oper_class | oper_encrypted |
1102 <                oper_rsa_public_key_file | oper_flags | error ';' ;
1102 >                oper_rsa_public_key_file | oper_ssl_certificate_fingerprint |
1103 >                oper_ssl_connection_required |
1104 >                oper_flags | error ';' ;
1105  
1106   oper_name: NAME '=' QSTRING ';'
1107   {
# Line 1065 | Line 1123 | oper_password: PASSWORD '=' QSTRING ';'
1123  
1124   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1125   {
1126 <  if (conf_parser_ctx.pass == 2)
1127 <  {
1128 <    if (yylval.number)
1129 <      block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1130 <    else
1131 <      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1132 <  }
1126 >  if (conf_parser_ctx.pass != 2)
1127 >    break;
1128 >
1129 >  if (yylval.number)
1130 >    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1131 >  else
1132 >    block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1133   };
1134  
1135   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
# Line 1080 | Line 1138 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1138      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
1139   };
1140  
1141 + oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1142 + {
1143 +  if (conf_parser_ctx.pass == 2)
1144 +    strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf));
1145 + };
1146 +
1147 + oper_ssl_connection_required: SSL_CONNECTION_REQUIRED '=' TBOOL ';'
1148 + {
1149 +  if (conf_parser_ctx.pass != 2)
1150 +    break;
1151 +
1152 +  if (yylval.number)
1153 +    block_state.flags.value |= CONF_FLAGS_SSL;
1154 +  else
1155 +    block_state.flags.value &= ~CONF_FLAGS_SSL;
1156 + };
1157 +
1158   oper_class: CLASS '=' QSTRING ';'
1159   {
1160    if (conf_parser_ctx.pass == 2)
# Line 1101 | Line 1176 | oper_umodes_item:  T_BOTS
1176   {
1177    if (conf_parser_ctx.pass == 2)
1178      block_state.modes.value |= UMODE_CCONN;
1104 } | T_CCONN_FULL
1105 {
1106  if (conf_parser_ctx.pass == 2)
1107    block_state.modes.value |= UMODE_CCONN_FULL;
1179   } | T_DEAF
1180   {
1181    if (conf_parser_ctx.pass == 2)
# Line 1173 | Line 1244 | oper_umodes_item:  T_BOTS
1244   {
1245    if (conf_parser_ctx.pass == 2)
1246      block_state.modes.value |= UMODE_LOCOPS;
1247 + } | T_NONONREG
1248 + {
1249 +  if (conf_parser_ctx.pass == 2)
1250 +    block_state.modes.value |= UMODE_REGONLY;
1251 + } | T_FARCONNECT
1252 + {
1253 +  if (conf_parser_ctx.pass == 2)
1254 +    block_state.modes.value |= UMODE_FARCONNECT;
1255   };
1256  
1257   oper_flags: IRCD_FLAGS
# Line 1182 | Line 1261 | oper_flags: IRCD_FLAGS
1261   } '='  oper_flags_items ';';
1262  
1263   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1264 < oper_flags_item: GLOBAL_KILL
1264 > oper_flags_item: KILL ':' REMOTE
1265 > {
1266 >  if (conf_parser_ctx.pass == 2)
1267 >    block_state.port.value |= OPER_FLAG_KILL_REMOTE;
1268 > } | KILL
1269 > {
1270 >  if (conf_parser_ctx.pass == 2)
1271 >    block_state.port.value |= OPER_FLAG_KILL;
1272 > } | CONNECT ':' REMOTE
1273   {
1274    if (conf_parser_ctx.pass == 2)
1275 <    block_state.port.value |= OPER_FLAG_GLOBAL_KILL;
1276 < } | REMOTE
1275 >    block_state.port.value |= OPER_FLAG_CONNECT_REMOTE;
1276 > } | CONNECT
1277   {
1278    if (conf_parser_ctx.pass == 2)
1279 <    block_state.port.value |= OPER_FLAG_REMOTE;
1279 >    block_state.port.value |= OPER_FLAG_CONNECT;
1280 > } | SQUIT ':' REMOTE
1281 > {
1282 >  if (conf_parser_ctx.pass == 2)
1283 >    block_state.port.value |= OPER_FLAG_SQUIT_REMOTE;
1284 > } | SQUIT
1285 > {
1286 >  if (conf_parser_ctx.pass == 2)
1287 >    block_state.port.value |= OPER_FLAG_SQUIT;
1288   } | KLINE
1289   {
1290    if (conf_parser_ctx.pass == 2)
# Line 1209 | Line 1304 | oper_flags_item: GLOBAL_KILL
1304   } | XLINE
1305   {
1306    if (conf_parser_ctx.pass == 2)
1307 <    block_state.port.value |= OPER_FLAG_X;
1307 >    block_state.port.value |= OPER_FLAG_XLINE;
1308 > } | T_UNXLINE
1309 > {
1310 >  if (conf_parser_ctx.pass == 2)
1311 >    block_state.port.value |= OPER_FLAG_UNXLINE;
1312   } | GLINE
1313   {
1314    if (conf_parser_ctx.pass == 2)
# Line 1230 | Line 1329 | oper_flags_item: GLOBAL_KILL
1329   {
1330    if (conf_parser_ctx.pass == 2)
1331      block_state.port.value |= OPER_FLAG_ADMIN;
1233 } | NICK_CHANGES
1234 {
1235  if (conf_parser_ctx.pass == 2)
1236    block_state.port.value |= OPER_FLAG_N;
1332   } | T_OPERWALL
1333   {
1334    if (conf_parser_ctx.pass == 2)
# Line 1242 | Line 1337 | oper_flags_item: GLOBAL_KILL
1337   {
1338    if (conf_parser_ctx.pass == 2)
1339      block_state.port.value |= OPER_FLAG_GLOBOPS;
1340 < } | OPER_SPY_T
1340 > } | T_WALLOPS
1341   {
1342    if (conf_parser_ctx.pass == 2)
1343 <    block_state.port.value |= OPER_FLAG_OPER_SPY;
1343 >    block_state.port.value |= OPER_FLAG_WALLOPS;
1344 > } | T_LOCOPS
1345 > {
1346 >  if (conf_parser_ctx.pass == 2)
1347 >    block_state.port.value |= OPER_FLAG_LOCOPS;
1348   } | REMOTEBAN
1349   {
1350    if (conf_parser_ctx.pass == 2)
# Line 1342 | Line 1441 | class_item:     class_name |
1441                  class_flags |
1442                  error ';' ;
1443  
1444 < class_name: NAME '=' QSTRING ';'
1444 > class_name: NAME '=' QSTRING ';'
1445   {
1446    if (conf_parser_ctx.pass == 1)
1447      strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf));
# Line 1568 | Line 1667 | auth_entry: IRCD_AUTH
1667      split_nuh(&nuh);
1668  
1669      conf        = conf_make(CONF_CLIENT);
1670 <    conf->user  = xstrdup(collapse(block_state.user.buf));
1671 <    conf->host  = xstrdup(collapse(block_state.host.buf));
1670 >    conf->user  = xstrdup(block_state.user.buf);
1671 >    conf->host  = xstrdup(block_state.host.buf);
1672  
1673      if (block_state.rpass.buf[0])
1674        conf->passwd = xstrdup(block_state.rpass.buf);
1675      if (block_state.name.buf[0])
1676 <      conf->passwd = xstrdup(block_state.name.buf);
1676 >      conf->name = xstrdup(block_state.name.buf);
1677  
1678      conf->flags = block_state.flags.value;
1679      conf->port  = block_state.port.value;
# Line 1582 | Line 1681 | auth_entry: IRCD_AUTH
1681      conf_add_class_to_conf(conf, block_state.class.buf);
1682      add_conf_by_address(CONF_CLIENT, conf);
1683    }
1684 < };
1684 > };
1685  
1686   auth_items:     auth_items auth_item | auth_item;
1687   auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
# Line 1621 | Line 1720 | auth_encrypted: ENCRYPTED '=' TBOOL ';'
1720   auth_flags: IRCD_FLAGS
1721   {
1722    if (conf_parser_ctx.pass == 2)
1723 <    block_state.flags.value &= CONF_FLAGS_ENCRYPTED;
1723 >    block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP);
1724   } '='  auth_flags_items ';';
1725  
1726   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
# Line 1667 | Line 1766 | auth_flags_item: SPOOF_NOTICE
1766      block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD;
1767   };
1768  
1769 < auth_spoof: SPOOF '=' QSTRING ';'
1769 > auth_spoof: SPOOF '=' QSTRING ';'
1770   {
1771    if (conf_parser_ctx.pass != 2)
1772      break;
# Line 1712 | Line 1811 | resv_entry: RESV
1811    strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf));
1812   } '{' resv_items '}' ';'
1813   {
1814 <  if (IsChanPrefix(block_state.name.buf[0]))
1815 <    create_channel_resv(block_state.name.buf, block_state.rpass.buf);
1816 <  else if (block_state.name.buf[0])
1817 <    create_nick_resv(block_state.name.buf, block_state.rpass.buf);
1814 >  if (conf_parser_ctx.pass != 2)
1815 >    break;
1816 >
1817 >  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1818   };
1819  
1820   resv_items:     resv_items resv_item | resv_item;
1821 < resv_item:      resv_reason | resv_channel | resv_nick | error ';' ;
1821 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1822  
1823 < resv_reason: REASON '=' QSTRING ';'
1823 > resv_mask: MASK '=' QSTRING ';'
1824   {
1825    if (conf_parser_ctx.pass == 2)
1826 <    strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1826 >    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1827   };
1828  
1829 < resv_channel: CHANNEL '=' QSTRING ';'
1829 > resv_reason: REASON '=' QSTRING ';'
1830   {
1831    if (conf_parser_ctx.pass == 2)
1832 <    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1832 >    strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1833   };
1834  
1835 < resv_nick: NICK '=' QSTRING ';'
1835 > resv_exempt: EXEMPT '=' QSTRING ';'
1836   {
1837    if (conf_parser_ctx.pass == 2)
1838 <    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1838 >    dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
1839   };
1840  
1841 +
1842   /***************************************************************************
1843   *  section service
1844   ***************************************************************************/
# Line 1749 | Line 1849 | service_item:      service_name | error;
1849  
1850   service_name: NAME '=' QSTRING ';'
1851   {
1852 <  if (conf_parser_ctx.pass == 2)
1852 >  if (conf_parser_ctx.pass != 2)
1853 >    break;
1854 >
1855 >  if (valid_servname(yylval.string))
1856    {
1857 <    if (valid_servname(yylval.string))
1858 <    {
1756 <      struct MaskItem *conf = conf_make(CONF_SERVICE);
1757 <      conf->name = xstrdup(yylval.string);
1758 <    }
1857 >    struct MaskItem *conf = conf_make(CONF_SERVICE);
1858 >    conf->name = xstrdup(yylval.string);
1859    }
1860   };
1861  
# Line 1784 | Line 1884 | shared_entry: T_SHARED
1884    conf->flags = block_state.flags.value;
1885    conf->name = xstrdup(block_state.name.buf);
1886    conf->user = xstrdup(block_state.user.buf);
1887 <  conf->user = xstrdup(block_state.host.buf);
1887 >  conf->host = xstrdup(block_state.host.buf);
1888   };
1889  
1890   shared_items: shared_items shared_item | shared_item;
# Line 1949 | Line 2049 | cluster_type_item: KLINE
2049   /***************************************************************************
2050   *  section connect
2051   ***************************************************************************/
2052 < connect_entry: CONNECT  
2052 > connect_entry: CONNECT
2053   {
2054  
2055    if (conf_parser_ctx.pass != 2)
2056      break;
2057  
2058    reset_block_state();
2059 +  block_state.aftype.value = AF_INET;
2060    block_state.port.value = PORTNUM;
2061   } '{' connect_items '}' ';'
2062   {
# Line 1969 | Line 2070 | connect_entry: CONNECT
2070        !block_state.host.buf[0])
2071      break;
2072  
2073 <  if (!(block_state.rpass.buf[0] ||
2074 <        block_state.spass.buf[0]))
2073 >  if (!block_state.rpass.buf[0] ||
2074 >      !block_state.spass.buf[0])
2075      break;
2076  
2077    if (has_wildcards(block_state.name.buf) ||
# Line 1985 | Line 2086 | connect_entry: CONNECT
2086    conf->name = xstrdup(block_state.name.buf);
2087    conf->passwd = xstrdup(block_state.rpass.buf);
2088    conf->spasswd = xstrdup(block_state.spass.buf);
2089 <  conf->cipher_list = xstrdup(block_state.ciph.buf);
2089 >
2090 >  if (block_state.cert.buf[0])
2091 >    conf->certfp = xstrdup(block_state.cert.buf);
2092 >
2093 >  if (block_state.ciph.buf[0])
2094 >    conf->cipher_list = xstrdup(block_state.ciph.buf);
2095  
2096    dlinkMoveList(&block_state.leaf.list, &conf->leaf_list);
2097    dlinkMoveList(&block_state.hub.list, &conf->hub_list);
# Line 2018 | Line 2124 | connect_entry: CONNECT
2124   connect_items:  connect_items connect_item | connect_item;
2125   connect_item:   connect_name | connect_host | connect_vhost |
2126                  connect_send_password | connect_accept_password |
2127 +                connect_ssl_certificate_fingerprint |
2128                  connect_aftype | connect_port | connect_ssl_cipher_list |
2129                  connect_flags | connect_hub_mask | connect_leaf_mask |
2130 <                connect_class | connect_encrypted |
2130 >                connect_class | connect_encrypted |
2131                  error ';' ;
2132  
2133   connect_name: NAME '=' QSTRING ';'
# Line 2029 | Line 2136 | connect_name: NAME '=' QSTRING ';'
2136      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2137   };
2138  
2139 < connect_host: HOST '=' QSTRING ';'
2139 > connect_host: HOST '=' QSTRING ';'
2140   {
2141    if (conf_parser_ctx.pass == 2)
2142      strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf));
2143   };
2144  
2145 < connect_vhost: VHOST '=' QSTRING ';'
2145 > connect_vhost: VHOST '=' QSTRING ';'
2146   {
2147    if (conf_parser_ctx.pass == 2)
2148      strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf));
2149   };
2150 <
2150 >
2151   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2152   {
2153    if (conf_parser_ctx.pass != 2)
# Line 2067 | Line 2174 | connect_accept_password: ACCEPT_PASSWORD
2174      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2175   };
2176  
2177 + connect_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
2178 + {
2179 +  if (conf_parser_ctx.pass == 2)
2180 +    strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf));
2181 + };
2182 +
2183   connect_port: PORT '=' NUMBER ';'
2184   {
2185    if (conf_parser_ctx.pass == 2)
# Line 2112 | Line 2225 | connect_encrypted: ENCRYPTED '=' TBOOL '
2225    }
2226   };
2227  
2228 < connect_hub_mask: HUB_MASK '=' QSTRING ';'
2228 > connect_hub_mask: HUB_MASK '=' QSTRING ';'
2229   {
2230    if (conf_parser_ctx.pass == 2)
2231      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list);
2232   };
2233  
2234 < connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2234 > connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2235   {
2236    if (conf_parser_ctx.pass == 2)
2237      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list);
# Line 2160 | Line 2273 | kill_entry: KILL
2273        !block_state.host.buf[0])
2274      break;
2275  
2276 +  conf = conf_make(CONF_KLINE);
2277 +  conf->user = xstrdup(block_state.user.buf);
2278 +  conf->host = xstrdup(block_state.host.buf);
2279  
2280 <  if (block_state.port.value == 1)
2281 <  {
2166 < #ifdef HAVE_LIBPCRE
2167 <    void *exp_user = NULL;
2168 <    void *exp_host = NULL;
2169 <    const char *errptr = NULL;
2170 <
2171 <    if (!(exp_user = ircd_pcre_compile(block_state.user.buf, &errptr)) ||
2172 <        !(exp_host = ircd_pcre_compile(block_state.host.buf, &errptr)))
2173 <    {
2174 <      ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2175 <           errptr);
2176 <      break;
2177 <    }
2178 <
2179 <    conf = conf_make(CONF_RKLINE);
2180 <    conf->regexuser = exp_user;
2181 <    conf->regexhost = exp_host;
2182 <
2183 <    conf->user = xstrdup(block_state.user.buf);
2184 <    conf->host = xstrdup(block_state.host.buf);
2185 <
2186 <    if (block_state.rpass.buf[0])
2187 <      conf->reason = xstrdup(block_state.rpass.buf);
2188 <    else
2189 <      conf->reason = xstrdup(CONF_NOREASON);
2190 < #else
2191 <    ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2192 <    break;
2193 < #endif
2194 <  }
2280 >  if (block_state.rpass.buf[0])
2281 >    conf->reason = xstrdup(block_state.rpass.buf);
2282    else
2283 <  {
2284 <    conf = conf_make(CONF_KLINE);
2198 <
2199 <    conf->user = xstrdup(block_state.user.buf);
2200 <    conf->host = xstrdup(block_state.host.buf);
2201 <
2202 <    if (block_state.rpass.buf[0])
2203 <      conf->reason = xstrdup(block_state.rpass.buf);
2204 <    else
2205 <      conf->reason = xstrdup(CONF_NOREASON);
2206 <    add_conf_by_address(CONF_KLINE, conf);
2207 <  }
2208 < };
2209 <
2210 < kill_type: TYPE
2211 < {
2212 <  if (conf_parser_ctx.pass == 2)
2213 <    block_state.port.value = 0;
2214 < } '='  kill_type_items ';';
2215 <
2216 < kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2217 < kill_type_item: REGEX_T
2218 < {
2219 <  if (conf_parser_ctx.pass == 2)
2220 <    block_state.port.value = 1;
2283 >    conf->reason = xstrdup(CONF_NOREASON);
2284 >  add_conf_by_address(CONF_KLINE, conf);
2285   };
2286  
2287   kill_items:     kill_items kill_item | kill_item;
2288 < kill_item:      kill_user | kill_reason | kill_type | error;
2288 > kill_item:      kill_user | kill_reason | error;
2289  
2290   kill_user: USER '=' QSTRING ';'
2291   {
# Line 2243 | Line 2307 | kill_user: USER '=' QSTRING ';'
2307    }
2308   };
2309  
2310 < kill_reason: REASON '=' QSTRING ';'
2310 > kill_reason: REASON '=' QSTRING ';'
2311   {
2312    if (conf_parser_ctx.pass == 2)
2313      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2252 | Line 2316 | kill_reason: REASON '=' QSTRING ';'
2316   /***************************************************************************
2317   *  section deny
2318   ***************************************************************************/
2319 < deny_entry: DENY
2319 > deny_entry: DENY
2320   {
2321    if (conf_parser_ctx.pass == 2)
2322      reset_block_state();
# Line 2277 | Line 2341 | deny_entry: DENY
2341        conf->reason = xstrdup(CONF_NOREASON);
2342      add_conf_by_address(CONF_DLINE, conf);
2343    }
2344 < };
2344 > };
2345  
2346   deny_items:     deny_items deny_item | deny_item;
2347   deny_item:      deny_ip | deny_reason | error;
# Line 2288 | Line 2352 | deny_ip: IP '=' QSTRING ';'
2352      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
2353   };
2354  
2355 < deny_reason: REASON '=' QSTRING ';'
2355 > deny_reason: REASON '=' QSTRING ';'
2356   {
2357    if (conf_parser_ctx.pass == 2)
2358      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2333 | Line 2397 | gecos_entry: GECOS
2397    if (!block_state.name.buf[0])
2398      break;
2399  
2400 <  if (block_state.port.value == 1)
2337 <  {
2338 < #ifdef HAVE_LIBPCRE
2339 <    void *exp_p = NULL;
2340 <    const char *errptr = NULL;
2341 <
2342 <    if (!(exp_p = ircd_pcre_compile(block_state.name.buf, &errptr)))
2343 <    {
2344 <      ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2345 <           errptr);
2346 <      break;
2347 <    }
2348 <
2349 <    conf = conf_make(CONF_RXLINE);
2350 <    conf->regexuser = exp_p;
2351 < #else
2352 <    conf_error_report("Failed to add regular expression based X-Line: no PCRE support");
2353 <    break;
2354 < #endif
2355 <  }
2356 <  else
2357 <    conf = conf_make(CONF_XLINE);
2358 <
2400 >  conf = conf_make(CONF_XLINE);
2401    conf->name = xstrdup(block_state.name.buf);
2402  
2403    if (block_state.rpass.buf[0])
# Line 2364 | Line 2406 | gecos_entry: GECOS
2406      conf->reason = xstrdup(CONF_NOREASON);
2407   };
2408  
2367 gecos_flags: TYPE
2368 {
2369  if (conf_parser_ctx.pass == 2)
2370    block_state.port.value = 0;
2371 } '='  gecos_flags_items ';';
2372
2373 gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
2374 gecos_flags_item: REGEX_T
2375 {
2376  if (conf_parser_ctx.pass == 2)
2377    block_state.port.value = 1;
2378 };
2379
2409   gecos_items: gecos_items gecos_item | gecos_item;
2410 < gecos_item:  gecos_name | gecos_reason | gecos_flags | error;
2410 > gecos_item:  gecos_name | gecos_reason | error;
2411  
2412 < gecos_name: NAME '=' QSTRING ';'
2412 > gecos_name: NAME '=' QSTRING ';'
2413   {
2414    if (conf_parser_ctx.pass == 2)
2415      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2416   };
2417  
2418 < gecos_reason: REASON '=' QSTRING ';'
2418 > gecos_reason: REASON '=' QSTRING ';'
2419   {
2420    if (conf_parser_ctx.pass == 2)
2421      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2410 | Line 2439 | general_item:       general_hide_spoof_i
2439                      general_stats_o_oper_only | general_stats_k_oper_only |
2440                      general_pace_wait | general_stats_i_oper_only |
2441                      general_pace_wait_simple | general_stats_P_oper_only |
2442 +                    general_stats_u_oper_only |
2443                      general_short_motd | general_no_oper_flood |
2444                      general_true_no_oper_flood | general_oper_pass_resv |
2445                      general_oper_only_umodes | general_max_targets |
# Line 2417 | Line 2447 | general_item:       general_hide_spoof_i
2447                      general_oper_umodes | general_caller_id_wait |
2448                      general_opers_bypass_callerid | general_default_floodcount |
2449                      general_min_nonwildcard | general_min_nonwildcard_simple |
2420                    general_disable_remote_commands |
2450                      general_throttle_time | general_havent_read_conf |
2451                      general_ping_cookie |
2452 <                    general_disable_auth |
2452 >                    general_disable_auth |
2453                      general_tkline_expire_notices | general_gline_enable |
2454                      general_gline_duration | general_gline_request_duration |
2455                      general_gline_min_cidr |
2456                      general_gline_min_cidr6 |
2457                      general_stats_e_disabled |
2458                      general_max_watch | general_services_name |
2459 +                    general_cycle_on_host_change |
2460                      error;
2461  
2462  
# Line 2435 | Line 2465 | general_max_watch: MAX_WATCH '=' NUMBER
2465    ConfigFileEntry.max_watch = $3;
2466   };
2467  
2468 + general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2469 + {
2470 +  if (conf_parser_ctx.pass == 2)
2471 +    ConfigFileEntry.cycle_on_host_change = yylval.number;
2472 + };
2473 +
2474   general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2475   {
2476    if (conf_parser_ctx.pass == 2)
# Line 2483 | Line 2519 | general_ignore_bogus_ts: IGNORE_BOGUS_TS
2519    ConfigFileEntry.ignore_bogus_ts = yylval.number;
2520   };
2521  
2486 general_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2487 {
2488  ConfigFileEntry.disable_remote = yylval.number;
2489 };
2490
2522   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2523   {
2524    ConfigFileEntry.failed_oper_notice = yylval.number;
# Line 2500 | Line 2531 | general_anti_nick_flood: ANTI_NICK_FLOOD
2531  
2532   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2533   {
2534 <  ConfigFileEntry.max_nick_time = $3;
2534 >  ConfigFileEntry.max_nick_time = $3;
2535   };
2536  
2537   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
# Line 2565 | Line 2596 | general_stats_P_oper_only: STATS_P_OPER_
2596    ConfigFileEntry.stats_P_oper_only = yylval.number;
2597   };
2598  
2599 + general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2600 + {
2601 +  ConfigFileEntry.stats_u_oper_only = yylval.number;
2602 + };
2603 +
2604   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2605   {
2606    ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
# Line 2605 | Line 2641 | general_short_motd: SHORT_MOTD '=' TBOOL
2641   {
2642    ConfigFileEntry.short_motd = yylval.number;
2643   };
2644 <  
2644 >
2645   general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2646   {
2647    ConfigFileEntry.no_oper_flood = yylval.number;
# Line 2666 | Line 2702 | general_disable_auth: DISABLE_AUTH '=' T
2702  
2703   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2704   {
2705 <  ConfigFileEntry.throttle_time = yylval.number;
2705 >  ConfigFileEntry.throttle_time = $3;
2706   };
2707  
2708   general_oper_umodes: OPER_UMODES
# Line 2681 | Line 2717 | umode_oitem:     T_BOTS
2717   } | T_CCONN
2718   {
2719    ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2684 } | T_CCONN_FULL
2685 {
2686  ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
2720   } | T_DEAF
2721   {
2722    ConfigFileEntry.oper_umodes |= UMODE_DEAF;
# Line 2735 | Line 2768 | umode_oitem:     T_BOTS
2768   } | T_LOCOPS
2769   {
2770    ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2771 + } | T_NONONREG
2772 + {
2773 +  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2774 + } | T_FARCONNECT
2775 + {
2776 +  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2777   };
2778  
2779 < general_oper_only_umodes: OPER_ONLY_UMODES
2779 > general_oper_only_umodes: OPER_ONLY_UMODES
2780   {
2781    ConfigFileEntry.oper_only_umodes = 0;
2782   } '='  umode_items ';' ;
2783  
2784   umode_items:    umode_items ',' umode_item | umode_item;
2785 < umode_item:     T_BOTS
2785 > umode_item:     T_BOTS
2786   {
2787    ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2788   } | T_CCONN
2789   {
2790    ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2752 } | T_CCONN_FULL
2753 {
2754  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
2791   } | T_DEAF
2792   {
2793    ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
# Line 2759 | Line 2795 | umode_item:    T_BOTS
2795   {
2796    ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2797   } | T_FULL
2798 < {
2798 > {
2799    ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2800   } | T_SKILL
2801   {
# Line 2803 | Line 2839 | umode_item:    T_BOTS
2839   } | T_LOCOPS
2840   {
2841    ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2842 + } | T_NONONREG
2843 + {
2844 +  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2845 + } | T_FARCONNECT
2846 + {
2847 +  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2848   };
2849  
2850   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
# Line 2831 | Line 2873 | channel_items:      channel_items channe
2873   channel_item:       channel_max_bans |
2874                      channel_knock_delay | channel_knock_delay_channel |
2875                      channel_max_chans_per_user | channel_max_chans_per_oper |
2876 <                    channel_quiet_on_ban | channel_default_split_user_count |
2876 >                    channel_default_split_user_count |
2877                      channel_default_split_server_count |
2878 <                    channel_no_create_on_split | channel_restrict_channels |
2878 >                    channel_no_create_on_split |
2879                      channel_no_join_on_split |
2880                      channel_jflood_count | channel_jflood_time |
2881                      channel_disable_fake_channels | error;
# Line 2843 | Line 2885 | channel_disable_fake_channels: DISABLE_F
2885    ConfigChannel.disable_fake_channels = yylval.number;
2886   };
2887  
2846 channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';'
2847 {
2848  ConfigChannel.restrict_channels = yylval.number;
2849 };
2850
2888   channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2889   {
2890    ConfigChannel.knock_delay = $3;
# Line 2868 | Line 2905 | channel_max_chans_per_oper: MAX_CHANS_PE
2905    ConfigChannel.max_chans_per_oper = $3;
2906   };
2907  
2871 channel_quiet_on_ban: QUIET_ON_BAN '=' TBOOL ';'
2872 {
2873  ConfigChannel.quiet_on_ban = yylval.number;
2874 };
2875
2908   channel_max_bans: MAX_BANS '=' NUMBER ';'
2909   {
2910    ConfigChannel.max_bans = $3;
# Line 2905 | Line 2937 | channel_jflood_count: JOIN_FLOOD_COUNT '
2937  
2938   channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
2939   {
2940 <  GlobalSetOptions.joinfloodtime = yylval.number;
2940 >  GlobalSetOptions.joinfloodtime = $3;
2941   };
2942  
2943   /***************************************************************************
# Line 2915 | Line 2947 | serverhide_entry: SERVERHIDE
2947    '{' serverhide_items '}' ';';
2948  
2949   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2950 < serverhide_item:    serverhide_flatten_links | serverhide_hide_servers |
2950 > serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
2951 >                    serverhide_hide_servers |
2952                      serverhide_hide_services |
2953                      serverhide_links_delay |
2954                      serverhide_hidden | serverhide_hidden_name |
# Line 2928 | Line 2961 | serverhide_flatten_links: FLATTEN_LINKS
2961      ConfigServerHide.flatten_links = yylval.number;
2962   };
2963  
2964 + serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2965 + {
2966 +  if (conf_parser_ctx.pass == 2)
2967 +    ConfigServerHide.disable_remote_commands = yylval.number;
2968 + };
2969 +
2970   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
2971   {
2972    if (conf_parser_ctx.pass == 2)

Diff Legend

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