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 1736 by michael, Sun Jan 13 09:31:46 2013 UTC vs.
Revision 2196 by michael, Tue Jun 4 18:30:12 2013 UTC

# Line 38 | Line 38
38   #include "log.h"
39   #include "client.h"     /* for UMODE_ALL only */
40   #include "irc_string.h"
41 #include "sprintf_irc.h"
41   #include "memory.h"
42   #include "modules.h"
43   #include "s_serv.h"
# Line 48 | Line 47
47   #include "resv.h"
48   #include "numeric.h"
49   #include "s_user.h"
50 + #include "motd.h"
51  
52   #ifdef HAVE_LIBCRYPTO
53   #include <openssl/rsa.h>
# Line 56 | Line 56
56   #include <openssl/dh.h>
57   #endif
58  
59 + #include "rsa.h"
60 +
61   int yylex(void);
62  
63   static struct
# Line 90 | Line 92 | static struct
92      ping_freq,
93      max_perip,
94      con_freq,
95 +    min_idle,
96 +    max_idle,
97      max_total,
98      max_global,
99      max_local,
# Line 147 | Line 151 | reset_block_state(void)
151   %token  CALLER_ID_WAIT
152   %token  CAN_FLOOD
153   %token  CHANNEL
154 < %token  CIDR_BITLEN_IPV4
155 < %token  CIDR_BITLEN_IPV6
154 > %token  CIDR_BITLEN_IPV4
155 > %token  CIDR_BITLEN_IPV6
156   %token  CLASS
157   %token  CONNECT
158   %token  CONNECTFREQ
# Line 168 | Line 172 | reset_block_state(void)
172   %token  EXCEED_LIMIT
173   %token  EXEMPT
174   %token  FAILED_OPER_NOTICE
171 %token  IRCD_FLAGS
175   %token  FLATTEN_LINKS
176   %token  GECOS
177   %token  GENERAL
# Line 176 | Line 179 | reset_block_state(void)
179   %token  GLINE_DURATION
180   %token  GLINE_ENABLE
181   %token  GLINE_EXEMPT
179 %token  GLINE_REQUEST_DURATION
182   %token  GLINE_MIN_CIDR
183   %token  GLINE_MIN_CIDR6
184 + %token  GLINE_REQUEST_DURATION
185   %token  GLOBAL_KILL
183 %token  IRCD_AUTH
184 %token  NEED_IDENT
186   %token  HAVENT_READ_CONF
187   %token  HIDDEN
188 < %token  HIDDEN_NAME
188 > %token  HIDDEN_NAME
189 > %token  HIDE_IDLE_FROM_OPERS
190   %token  HIDE_SERVER_IPS
191   %token  HIDE_SERVERS
192 < %token  HIDE_SPOOF_IPS
192 > %token  HIDE_SERVICES
193 > %token  HIDE_SPOOF_IPS
194   %token  HOST
195   %token  HUB
196   %token  HUB_MASK
197   %token  IGNORE_BOGUS_TS
198   %token  INVISIBLE_ON_CONNECT
199   %token  IP
200 + %token  IRCD_AUTH
201 + %token  IRCD_FLAGS
202 + %token  IRCD_SID
203 + %token  JOIN_FLOOD_COUNT
204 + %token  JOIN_FLOOD_TIME
205   %token  KILL
206 < %token  KILL_CHASE_TIME_LIMIT
206 > %token  KILL_CHASE_TIME_LIMIT
207   %token  KLINE
208   %token  KLINE_EXEMPT
209   %token  KNOCK_DELAY
# Line 203 | Line 211 | reset_block_state(void)
211   %token  LEAF_MASK
212   %token  LINKS_DELAY
213   %token  LISTEN
214 < %token  T_LOG
214 > %token  MASK
215   %token  MAX_ACCEPT
216   %token  MAX_BANS
217   %token  MAX_CHANS_PER_OPER
218   %token  MAX_CHANS_PER_USER
219   %token  MAX_GLOBAL
220   %token  MAX_IDENT
221 + %token  MAX_IDLE
222   %token  MAX_LOCAL
223   %token  MAX_NICK_CHANGES
224 + %token  MAX_NICK_LENGTH
225   %token  MAX_NICK_TIME
226   %token  MAX_NUMBER
227   %token  MAX_TARGETS
228 + %token  MAX_TOPIC_LENGTH
229   %token  MAX_WATCH
230 < %token  MESSAGE_LOCALE
230 > %token  MIN_IDLE
231   %token  MIN_NONWILDCARD
232   %token  MIN_NONWILDCARD_SIMPLE
233   %token  MODULE
234   %token  MODULES
235 + %token  MOTD
236   %token  NAME
237 + %token  NEED_IDENT
238   %token  NEED_PASSWORD
239   %token  NETWORK_DESC
240   %token  NETWORK_NAME
241   %token  NICK
229 %token  NICK_CHANGES
242   %token  NO_CREATE_ON_SPLIT
243   %token  NO_JOIN_ON_SPLIT
244   %token  NO_OPER_FLOOD
# Line 234 | Line 246 | reset_block_state(void)
246   %token  NUMBER
247   %token  NUMBER_PER_CIDR
248   %token  NUMBER_PER_IP
237 %token  OPERATOR
238 %token  OPERS_BYPASS_CALLERID
249   %token  OPER_ONLY_UMODES
250   %token  OPER_PASS_RESV
241 %token  OPER_SPY_T
251   %token  OPER_UMODES
252 < %token  JOIN_FLOOD_COUNT
253 < %token  JOIN_FLOOD_TIME
252 > %token  OPERATOR
253 > %token  OPERS_BYPASS_CALLERID
254   %token  PACE_WAIT
255   %token  PACE_WAIT_SIMPLE
256   %token  PASSWORD
# Line 250 | Line 259 | reset_block_state(void)
259   %token  PING_TIME
260   %token  PORT
261   %token  QSTRING
262 < %token  QUIET_ON_BAN
262 > %token  RANDOM_IDLE
263   %token  REASON
264   %token  REDIRPORT
265   %token  REDIRSERV
257 %token  REGEX_T
266   %token  REHASH
267   %token  REMOTE
268   %token  REMOTEBAN
261 %token  RESTRICT_CHANNELS
262 %token  RSA_PRIVATE_KEY_FILE
263 %token  RSA_PUBLIC_KEY_FILE
264 %token  SSL_CERTIFICATE_FILE
265 %token  SSL_DH_PARAM_FILE
266 %token  T_SSL_CLIENT_METHOD
267 %token  T_SSL_SERVER_METHOD
268 %token  T_SSLV3
269 %token  T_TLSV1
269   %token  RESV
270   %token  RESV_EXEMPT
271 < %token  SECONDS MINUTES HOURS DAYS WEEKS
272 < %token  SENDQ
271 > %token  RSA_PRIVATE_KEY_FILE
272 > %token  RSA_PUBLIC_KEY_FILE
273 > %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
274   %token  SEND_PASSWORD
275 + %token  SENDQ
276   %token  SERVERHIDE
277   %token  SERVERINFO
277 %token  IRCD_SID
278 %token  TKLINE_EXPIRE_NOTICES
279 %token  T_SHARED
280 %token  T_CLUSTER
281 %token  TYPE
278   %token  SHORT_MOTD
279   %token  SPOOF
280   %token  SPOOF_NOTICE
281 + %token  SQUIT
282 + %token  SSL_CERTIFICATE_FILE
283 + %token  SSL_DH_PARAM_FILE
284   %token  STATS_E_DISABLED
285   %token  STATS_I_OPER_ONLY
286   %token  STATS_K_OPER_ONLY
287   %token  STATS_O_OPER_ONLY
288   %token  STATS_P_OPER_ONLY
290 %token  TBOOL
291 %token  TMASKED
292 %token  TS_MAX_DELTA
293 %token  TS_WARN_DELTA
294 %token  TWODOTS
289   %token  T_ALL
290   %token  T_BOTS
297 %token  T_SOFTCALLERID
291   %token  T_CALLERID
292   %token  T_CCONN
293 < %token  T_CCONN_FULL
301 < %token  T_SSL_CIPHER_LIST
293 > %token  T_CLUSTER
294   %token  T_DEAF
295   %token  T_DEBUG
296   %token  T_DLINE
297   %token  T_EXTERNAL
298 + %token  T_FARCONNECT
299 + %token  T_FILE
300   %token  T_FULL
301 + %token  T_GLOBOPS
302   %token  T_INVISIBLE
303   %token  T_IPV4
304   %token  T_IPV6
305   %token  T_LOCOPS
306 + %token  T_LOG
307   %token  T_MAX_CLIENTS
308   %token  T_NCHANGE
309 + %token  T_NONONREG
310   %token  T_OPERWALL
311   %token  T_RECVQ
312   %token  T_REJ
313 + %token  T_RESTART
314   %token  T_SERVER
315 + %token  T_SERVICE
316 + %token  T_SERVICES_NAME
317   %token  T_SERVNOTICE
318   %token  T_SET
319 + %token  T_SHARED
320 + %token  T_SIZE
321   %token  T_SKILL
322 + %token  T_SOFTCALLERID
323   %token  T_SPY
324   %token  T_SSL
325 + %token  T_SSL_CIPHER_LIST
326 + %token  T_SSL_CLIENT_METHOD
327 + %token  T_SSL_SERVER_METHOD
328 + %token  T_SSLV3
329 + %token  T_TLSV1
330   %token  T_UMODES
331   %token  T_UNAUTH
332   %token  T_UNDLINE
333   %token  T_UNLIMITED
334   %token  T_UNRESV
335   %token  T_UNXLINE
328 %token  T_GLOBOPS
336   %token  T_WALLOP
337 + %token  T_WALLOPS
338   %token  T_WEBIRC
339 < %token  T_RESTART
332 < %token  T_SERVICE
333 < %token  T_SERVICES_NAME
339 > %token  TBOOL
340   %token  THROTTLE_TIME
341 + %token  TKLINE_EXPIRE_NOTICES
342 + %token  TMASKED
343   %token  TRUE_NO_OPER_FLOOD
344 + %token  TS_MAX_DELTA
345 + %token  TS_WARN_DELTA
346 + %token  TWODOTS
347 + %token  TYPE
348   %token  UNKLINE
337 %token  USER
349   %token  USE_EGD
350   %token  USE_LOGGING
351 + %token  USER
352   %token  VHOST
353   %token  VHOST6
342 %token  XLINE
354   %token  WARN_NO_NLINE
355 < %token  T_SIZE
345 < %token  T_FILE
355 > %token  XLINE
356  
357 < %type <string> QSTRING
358 < %type <number> NUMBER
359 < %type <number> timespec
360 < %type <number> timespec_
361 < %type <number> sizespec
362 < %type <number> sizespec_
357 > %type  <string> QSTRING
358 > %type  <number> NUMBER
359 > %type  <number> timespec
360 > %type  <number> timespec_
361 > %type  <number> sizespec
362 > %type  <number> sizespec_
363  
364   %%
365   conf:  
# Line 376 | Line 386 | conf_item:        admin_entry
386                  | general_entry
387                  | gecos_entry
388                  | modules_entry
389 +                | motd_entry
390                  | error ';'
391                  | error '}'
392          ;
# Line 406 | Line 417 | timespec:      NUMBER timespec_
417                  {
418                          $$ = $1 * 60 * 60 * 24 * 7 + $3;
419                  }
420 +                | NUMBER MONTHS timespec_
421 +                {
422 +                        $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3;
423 +                }
424 +                | NUMBER YEARS timespec_
425 +                {
426 +                        $$ = $1 * 60 * 60 * 24 * 365 + $3;
427 +                }
428                  ;
429  
430   sizespec_:      { $$ = 0; } | sizespec;
# Line 444 | Line 463 | serverinfo_items:       serverinfo_items
463   serverinfo_item:        serverinfo_name | serverinfo_vhost |
464                          serverinfo_hub | serverinfo_description |
465                          serverinfo_network_name | serverinfo_network_desc |
466 <                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
466 >                        serverinfo_max_clients | serverinfo_max_nick_length |
467 >                        serverinfo_max_topic_length | serverinfo_ssl_dh_param_file |
468                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
469                          serverinfo_sid | serverinfo_ssl_certificate_file |
470                          serverinfo_ssl_client_method | serverinfo_ssl_server_method |
# Line 492 | Line 512 | serverinfo_ssl_certificate_file: SSL_CER
512    {
513      if (!ServerInfo.rsa_private_key_file)
514      {
515 <      yyerror("No rsa_private_key_file specified, SSL disabled");
515 >      conf_error_report("No rsa_private_key_file specified, SSL disabled");
516        break;
517      }
518  
# Line 501 | Line 521 | serverinfo_ssl_certificate_file: SSL_CER
521          SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
522                                       SSL_FILETYPE_PEM) <= 0)
523      {
524 <      yyerror(ERR_lib_error_string(ERR_get_error()));
524 >      report_crypto_errors();
525 >      conf_error_report("Could not open/read certificate file");
526        break;
527      }
528  
# Line 510 | Line 531 | serverinfo_ssl_certificate_file: SSL_CER
531          SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
532                                      SSL_FILETYPE_PEM) <= 0)
533      {
534 <      yyerror(ERR_lib_error_string(ERR_get_error()));
534 >      report_crypto_errors();
535 >      conf_error_report("Could not read RSA private key");
536        break;
537      }
538  
539      if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
540          !SSL_CTX_check_private_key(ServerInfo.client_ctx))
541      {
542 <      yyerror(ERR_lib_error_string(ERR_get_error()));
542 >      report_crypto_errors();
543 >      conf_error_report("Could not read RSA private key");
544        break;
545      }
546    }
# Line 527 | Line 550 | serverinfo_ssl_certificate_file: SSL_CER
550   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
551   {
552   #ifdef HAVE_LIBCRYPTO
553 <  if (conf_parser_ctx.pass == 1)
531 <  {
532 <    BIO *file;
553 >  BIO *file = NULL;
554  
555 <    if (ServerInfo.rsa_private_key)
556 <    {
536 <      RSA_free(ServerInfo.rsa_private_key);
537 <      ServerInfo.rsa_private_key = NULL;
538 <    }
555 >  if (conf_parser_ctx.pass != 1)
556 >    break;
557  
558 <    if (ServerInfo.rsa_private_key_file)
559 <    {
560 <      MyFree(ServerInfo.rsa_private_key_file);
561 <      ServerInfo.rsa_private_key_file = NULL;
562 <    }
558 >  if (ServerInfo.rsa_private_key)
559 >  {
560 >    RSA_free(ServerInfo.rsa_private_key);
561 >    ServerInfo.rsa_private_key = NULL;
562 >  }
563  
564 <    ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
564 >  if (ServerInfo.rsa_private_key_file)
565 >  {
566 >    MyFree(ServerInfo.rsa_private_key_file);
567 >    ServerInfo.rsa_private_key_file = NULL;
568 >  }
569  
570 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
549 <    {
550 <      yyerror("File open failed, ignoring");
551 <      break;
552 <    }
570 >  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
571  
572 <    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
572 >  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
573 >  {
574 >    conf_error_report("File open failed, ignoring");
575 >    break;
576 >  }
577  
578 <    BIO_set_close(file, BIO_CLOSE);
557 <    BIO_free(file);
578 >  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
579  
580 <    if (ServerInfo.rsa_private_key == NULL)
581 <    {
561 <      yyerror("Couldn't extract key, ignoring");
562 <      break;
563 <    }
580 >  BIO_set_close(file, BIO_CLOSE);
581 >  BIO_free(file);
582  
583 <    if (!RSA_check_key(ServerInfo.rsa_private_key))
584 <    {
585 <      RSA_free(ServerInfo.rsa_private_key);
586 <      ServerInfo.rsa_private_key = NULL;
583 >  if (ServerInfo.rsa_private_key == NULL)
584 >  {
585 >    conf_error_report("Couldn't extract key, ignoring");
586 >    break;
587 >  }
588  
589 <      yyerror("Invalid key, ignoring");
590 <      break;
591 <    }
589 >  if (!RSA_check_key(ServerInfo.rsa_private_key))
590 >  {
591 >    RSA_free(ServerInfo.rsa_private_key);
592 >    ServerInfo.rsa_private_key = NULL;
593  
594 <    /* require 2048 bit (256 byte) key */
595 <    if (RSA_size(ServerInfo.rsa_private_key) != 256)
596 <    {
577 <      RSA_free(ServerInfo.rsa_private_key);
578 <      ServerInfo.rsa_private_key = NULL;
594 >    conf_error_report("Invalid key, ignoring");
595 >    break;
596 >  }
597  
598 <      yyerror("Not a 2048 bit key, ignoring");
599 <    }
598 >  /* require 2048 bit (256 byte) key */
599 >  if (RSA_size(ServerInfo.rsa_private_key) != 256)
600 >  {
601 >    RSA_free(ServerInfo.rsa_private_key);
602 >    ServerInfo.rsa_private_key = NULL;
603 >
604 >    conf_error_report("Not a 2048 bit key, ignoring");
605    }
606   #endif
607   };
# Line 600 | Line 623 | serverinfo_ssl_dh_param_file: SSL_DH_PAR
623        if (dh)
624        {
625          if (DH_size(dh) < 128)
626 <          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
626 >          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
627          else
628            SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
629  
# Line 628 | Line 651 | serverinfo_name: NAME '=' QSTRING ';'
651        ServerInfo.name = xstrdup(yylval.string);
652      else
653      {
654 <      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
654 >      conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
655        exit(0);
656      }
657    }
# Line 643 | Line 666 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
666        ServerInfo.sid = xstrdup(yylval.string);
667      else
668      {
669 <      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
669 >      conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
670        exit(0);
671      }
672    }
# Line 674 | Line 697 | serverinfo_network_name: NETWORK_NAME '=
697  
698   serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
699   {
700 <  if (conf_parser_ctx.pass == 2)
701 <  {
702 <    MyFree(ServerInfo.network_desc);
703 <    ServerInfo.network_desc = xstrdup(yylval.string);
704 <  }
700 >  if (conf_parser_ctx.pass != 2)
701 >    break;
702 >
703 >  MyFree(ServerInfo.network_desc);
704 >  ServerInfo.network_desc = xstrdup(yylval.string);
705   };
706  
707   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 749 | Line 772 | serverinfo_max_clients: T_MAX_CLIENTS '=
772      char buf[IRCD_BUFSIZE];
773  
774      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
775 <    yyerror(buf);
775 >    conf_error_report(buf);
776      ServerInfo.max_clients = MAXCLIENTS_MIN;
777    }
778    else if ($3 > MAXCLIENTS_MAX)
# Line 757 | Line 780 | serverinfo_max_clients: T_MAX_CLIENTS '=
780      char buf[IRCD_BUFSIZE];
781  
782      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
783 <    yyerror(buf);
783 >    conf_error_report(buf);
784      ServerInfo.max_clients = MAXCLIENTS_MAX;
785    }
786    else
787      ServerInfo.max_clients = $3;
788   };
789  
790 + serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
791 + {
792 +  if (conf_parser_ctx.pass != 2)
793 +    break;
794 +
795 +  if ($3 < 9)
796 +  {
797 +    conf_error_report("max_nick_length too low, setting to 9");
798 +    ServerInfo.max_nick_length = 9;
799 +  }
800 +  else if ($3 > NICKLEN)
801 +  {
802 +    char buf[IRCD_BUFSIZE];
803 +
804 +    snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
805 +    conf_error_report(buf);
806 +    ServerInfo.max_nick_length = NICKLEN;
807 +  }
808 +  else
809 +    ServerInfo.max_nick_length = $3;
810 + };
811 +
812 + serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
813 + {
814 +  if (conf_parser_ctx.pass != 2)
815 +    break;
816 +
817 +  if ($3 < 80)
818 +  {
819 +    conf_error_report("max_topic_length too low, setting to 80");
820 +    ServerInfo.max_topic_length = 80;
821 +  }
822 +  else if ($3 > TOPICLEN)
823 +  {
824 +    char buf[IRCD_BUFSIZE];
825 +
826 +    snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
827 +    conf_error_report(buf);
828 +    ServerInfo.max_topic_length = TOPICLEN;
829 +  }
830 +  else
831 +    ServerInfo.max_topic_length = $3;
832 + };
833 +
834   serverinfo_hub: HUB '=' TBOOL ';'
835   {
836    if (conf_parser_ctx.pass == 2)
# Line 781 | Line 848 | admin_item:  admin_name | admin_descript
848  
849   admin_name: NAME '=' QSTRING ';'
850   {
851 <  if (conf_parser_ctx.pass == 2)
852 <  {
853 <    MyFree(AdminInfo.name);
854 <    AdminInfo.name = xstrdup(yylval.string);
855 <  }
851 >  if (conf_parser_ctx.pass != 2)
852 >    break;
853 >
854 >  MyFree(AdminInfo.name);
855 >  AdminInfo.name = xstrdup(yylval.string);
856   };
857  
858   admin_email: EMAIL '=' QSTRING ';'
859   {
860 <  if (conf_parser_ctx.pass == 2)
861 <  {
862 <    MyFree(AdminInfo.email);
863 <    AdminInfo.email = xstrdup(yylval.string);
864 <  }
860 >  if (conf_parser_ctx.pass != 2)
861 >    break;
862 >
863 >  MyFree(AdminInfo.email);
864 >  AdminInfo.email = xstrdup(yylval.string);
865   };
866  
867   admin_description: DESCRIPTION '=' QSTRING ';'
868   {
869 +  if (conf_parser_ctx.pass != 2)
870 +    break;
871 +
872 +  MyFree(AdminInfo.description);
873 +  AdminInfo.description = xstrdup(yylval.string);
874 + };
875 +
876 + /***************************************************************************
877 + * motd section
878 + ***************************************************************************/
879 + motd_entry: MOTD
880 + {
881    if (conf_parser_ctx.pass == 2)
882 <  {
883 <    MyFree(AdminInfo.description);
884 <    AdminInfo.description = xstrdup(yylval.string);
885 <  }
882 >    reset_block_state();
883 > } '{' motd_items '}' ';'
884 > {
885 >  dlink_node *ptr = NULL;
886 >
887 >  if (conf_parser_ctx.pass != 2)
888 >    break;
889 >
890 >  if (!block_state.file.buf[0])
891 >    break;
892 >
893 >  DLINK_FOREACH(ptr, block_state.mask.list.head)
894 >    motd_add(ptr->data, block_state.file.buf);
895 > };
896 >
897 > motd_items: motd_items motd_item | motd_item;
898 > motd_item:  motd_mask | motd_file | error ';' ;
899 >
900 > motd_mask: MASK '=' QSTRING ';'
901 > {
902 >  if (conf_parser_ctx.pass == 2)
903 >    dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
904 > };
905 >
906 > motd_file: T_FILE '=' QSTRING ';'
907 > {
908 >  if (conf_parser_ctx.pass == 2)
909 >    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
910   };
911  
912   /***************************************************************************
# Line 831 | Line 934 | logging_file_entry:
934      break;
935  
936    if (block_state.type.value && block_state.file.buf[0])
937 <    log_add_file(block_state.type.value, block_state.size.value,
937 >    log_set_file(block_state.type.value, block_state.size.value,
938                   block_state.file.buf);
939   };
940  
# Line 915 | Line 1018 | oper_entry: OPERATOR
1018    if (!block_state.name.buf[0])
1019      break;
1020   #ifdef HAVE_LIBCRYPTO
1021 <  if (!(block_state.file.buf[0] ||
1022 <        block_state.rpass.buf[0]))
1021 >  if (!block_state.file.buf[0] &&
1022 >      !block_state.rpass.buf[0])
1023      break;
1024   #else
1025    if (!block_state.rpass.buf[0])
# Line 960 | Line 1063 | oper_entry: OPERATOR
1063  
1064        if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1065        {
1066 <        yyerror("Ignoring rsa_public_key_file -- file doesn't exist");
1066 >        conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist");
1067          break;
1068        }
1069  
1070        if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1071 <      {
969 <        yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
970 <        break;
971 <      }
1071 >        conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1072  
1073        conf->rsa_public_key = pkey;
1074        BIO_set_close(file, BIO_CLOSE);
# Line 1003 | Line 1103 | oper_password: PASSWORD '=' QSTRING ';'
1103  
1104   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1105   {
1106 <  if (conf_parser_ctx.pass == 2)
1107 <  {
1108 <    if (yylval.number)
1109 <      block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1110 <    else
1111 <      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1112 <  }
1106 >  if (conf_parser_ctx.pass != 2)
1107 >    break;
1108 >
1109 >  if (yylval.number)
1110 >    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1111 >  else
1112 >    block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1113   };
1114  
1115   oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
# Line 1039 | Line 1139 | oper_umodes_item:  T_BOTS
1139   {
1140    if (conf_parser_ctx.pass == 2)
1141      block_state.modes.value |= UMODE_CCONN;
1042 } | T_CCONN_FULL
1043 {
1044  if (conf_parser_ctx.pass == 2)
1045    block_state.modes.value |= UMODE_CCONN_FULL;
1142   } | T_DEAF
1143   {
1144    if (conf_parser_ctx.pass == 2)
# Line 1111 | Line 1207 | oper_umodes_item:  T_BOTS
1207   {
1208    if (conf_parser_ctx.pass == 2)
1209      block_state.modes.value |= UMODE_LOCOPS;
1210 + } | T_NONONREG
1211 + {
1212 +  if (conf_parser_ctx.pass == 2)
1213 +    block_state.modes.value |= UMODE_REGONLY;
1214 + } | T_FARCONNECT
1215 + {
1216 +  if (conf_parser_ctx.pass == 2)
1217 +    block_state.modes.value |= UMODE_FARCONNECT;
1218   };
1219  
1220   oper_flags: IRCD_FLAGS
# Line 1120 | Line 1224 | oper_flags: IRCD_FLAGS
1224   } '='  oper_flags_items ';';
1225  
1226   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1227 < oper_flags_item: GLOBAL_KILL
1227 > oper_flags_item: KILL ':' REMOTE
1228 > {
1229 >  if (conf_parser_ctx.pass == 2)
1230 >    block_state.port.value |= OPER_FLAG_KILL_REMOTE;
1231 > } | KILL
1232 > {
1233 >  if (conf_parser_ctx.pass == 2)
1234 >    block_state.port.value |= OPER_FLAG_KILL;
1235 > } | CONNECT ':' REMOTE
1236 > {
1237 >  if (conf_parser_ctx.pass == 2)
1238 >    block_state.port.value |= OPER_FLAG_CONNECT_REMOTE;
1239 > } | CONNECT
1240 > {
1241 >  if (conf_parser_ctx.pass == 2)
1242 >    block_state.port.value |= OPER_FLAG_CONNECT;
1243 > } | SQUIT ':' REMOTE
1244   {
1245    if (conf_parser_ctx.pass == 2)
1246 <    block_state.port.value |= OPER_FLAG_GLOBAL_KILL;
1247 < } | REMOTE
1246 >    block_state.port.value |= OPER_FLAG_SQUIT_REMOTE;
1247 > } | SQUIT
1248   {
1249    if (conf_parser_ctx.pass == 2)
1250 <    block_state.port.value |= OPER_FLAG_REMOTE;
1250 >    block_state.port.value |= OPER_FLAG_SQUIT;
1251   } | KLINE
1252   {
1253    if (conf_parser_ctx.pass == 2)
# Line 1168 | Line 1288 | oper_flags_item: GLOBAL_KILL
1288   {
1289    if (conf_parser_ctx.pass == 2)
1290      block_state.port.value |= OPER_FLAG_ADMIN;
1171 } | NICK_CHANGES
1172 {
1173  if (conf_parser_ctx.pass == 2)
1174    block_state.port.value |= OPER_FLAG_N;
1291   } | T_OPERWALL
1292   {
1293    if (conf_parser_ctx.pass == 2)
# Line 1180 | Line 1296 | oper_flags_item: GLOBAL_KILL
1296   {
1297    if (conf_parser_ctx.pass == 2)
1298      block_state.port.value |= OPER_FLAG_GLOBOPS;
1299 < } | OPER_SPY_T
1299 > } | T_WALLOPS
1300 > {
1301 >  if (conf_parser_ctx.pass == 2)
1302 >    block_state.port.value |= OPER_FLAG_WALLOPS;
1303 > } | T_LOCOPS
1304   {
1305    if (conf_parser_ctx.pass == 2)
1306 <    block_state.port.value |= OPER_FLAG_OPER_SPY;
1306 >    block_state.port.value |= OPER_FLAG_LOCOPS;
1307   } | REMOTEBAN
1308   {
1309    if (conf_parser_ctx.pass == 2)
# Line 1214 | Line 1334 | class_entry: CLASS
1334    block_state.max_total.value = MAXIMUM_LINKS_DEFAULT;
1335    block_state.max_sendq.value = DEFAULT_SENDQ;
1336    block_state.max_recvq.value = DEFAULT_RECVQ;
1217
1337   } '{' class_items '}' ';'
1338   {
1339    struct ClassItem *class = NULL;
# Line 1241 | Line 1360 | class_entry: CLASS
1360    class->max_sendq = block_state.max_sendq.value;
1361    class->max_recvq = block_state.max_recvq.value;
1362  
1363 +  if (block_state.min_idle.value > block_state.max_idle.value)
1364 +  {
1365 +    block_state.min_idle.value = 0;
1366 +    block_state.max_idle.value = 0;
1367 +    block_state.flags.value &= ~CLASS_FLAGS_FAKE_IDLE;
1368 +  }
1369 +
1370 +  class->flags = block_state.flags.value;
1371 +  class->min_idle = block_state.min_idle.value;
1372 +  class->max_idle = block_state.max_idle.value;
1373 +
1374    if (class->number_per_cidr && block_state.number_per_cidr.value)
1375      if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1376          (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
# Line 1265 | Line 1395 | class_item:     class_name |
1395                  class_max_local |
1396                  class_max_ident |
1397                  class_sendq | class_recvq |
1398 +                class_min_idle |
1399 +                class_max_idle |
1400 +                class_flags |
1401                  error ';' ;
1402  
1403   class_name: NAME '=' QSTRING ';'
# Line 1346 | Line 1479 | class_number_per_cidr: NUMBER_PER_CIDR '
1479      block_state.number_per_cidr.value = $3;
1480   };
1481  
1482 + class_min_idle: MIN_IDLE '=' timespec ';'
1483 + {
1484 +  if (conf_parser_ctx.pass != 1)
1485 +    break;
1486 +
1487 +  block_state.min_idle.value = $3;
1488 +  block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE;
1489 + };
1490 +
1491 + class_max_idle: MAX_IDLE '=' timespec ';'
1492 + {
1493 +  if (conf_parser_ctx.pass != 1)
1494 +    break;
1495 +
1496 +  block_state.max_idle.value = $3;
1497 +  block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE;
1498 + };
1499 +
1500 + class_flags: IRCD_FLAGS
1501 + {
1502 +  if (conf_parser_ctx.pass == 1)
1503 +    block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE;
1504 + } '='  class_flags_items ';';
1505 +
1506 + class_flags_items: class_flags_items ',' class_flags_item | class_flags_item;
1507 + class_flags_item: RANDOM_IDLE
1508 + {
1509 +  if (conf_parser_ctx.pass == 1)
1510 +    block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE;
1511 + } | HIDE_IDLE_FROM_OPERS
1512 + {
1513 +  if (conf_parser_ctx.pass == 1)
1514 +    block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS;
1515 + };
1516 +
1517 +
1518   /***************************************************************************
1519   *  section listen
1520   ***************************************************************************/
# Line 1391 | Line 1560 | port_item: NUMBER
1560        if (!ServerInfo.server_ctx)
1561   #endif
1562        {
1563 <        yyerror("SSL not available - port closed");
1563 >        conf_error_report("SSL not available - port closed");
1564          break;
1565        }
1566      add_listener($1, block_state.addr.buf, block_state.flags.value);
# Line 1407 | Line 1576 | port_item: NUMBER
1576        if (!ServerInfo.server_ctx)
1577   #endif
1578        {
1579 <        yyerror("SSL not available - port closed");
1579 >        conf_error_report("SSL not available - port closed");
1580          break;
1581        }
1582  
# Line 1457 | Line 1626 | auth_entry: IRCD_AUTH
1626      split_nuh(&nuh);
1627  
1628      conf        = conf_make(CONF_CLIENT);
1629 <    conf->user  = xstrdup(collapse(block_state.user.buf));
1630 <    conf->host  = xstrdup(collapse(block_state.host.buf));
1629 >    conf->user  = xstrdup(block_state.user.buf);
1630 >    conf->host  = xstrdup(block_state.host.buf);
1631  
1632      if (block_state.rpass.buf[0])
1633        conf->passwd = xstrdup(block_state.rpass.buf);
1634      if (block_state.name.buf[0])
1635 <      conf->passwd = xstrdup(block_state.name.buf);
1635 >      conf->name = xstrdup(block_state.name.buf);
1636  
1637      conf->flags = block_state.flags.value;
1638      conf->port  = block_state.port.value;
# Line 1510 | Line 1679 | auth_encrypted: ENCRYPTED '=' TBOOL ';'
1679   auth_flags: IRCD_FLAGS
1680   {
1681    if (conf_parser_ctx.pass == 2)
1682 <    block_state.flags.value &= CONF_FLAGS_ENCRYPTED;
1682 >    block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP);
1683   } '='  auth_flags_items ';';
1684  
1685   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
# Line 1599 | Line 1768 | resv_entry: RESV
1768  
1769    reset_block_state();
1770    strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf));
1771 < } '{' resv_items '}' ';';
1771 > } '{' resv_items '}' ';'
1772 > {
1773 >  if (conf_parser_ctx.pass != 2)
1774 >    break;
1775 >
1776 >  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1777 > };
1778  
1779   resv_items:     resv_items resv_item | resv_item;
1780 < resv_item:      resv_creason | resv_channel | resv_nick | error ';' ;
1780 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1781  
1782 < resv_creason: REASON '=' QSTRING ';'
1782 > resv_mask: MASK '=' QSTRING ';'
1783   {
1784    if (conf_parser_ctx.pass == 2)
1785 <    strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1785 >    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1786   };
1787  
1788 < resv_channel: CHANNEL '=' QSTRING ';'
1788 > resv_reason: REASON '=' QSTRING ';'
1789   {
1790 <  if (conf_parser_ctx.pass != 2)
1791 <    break;
1617 <
1618 <  if (IsChanPrefix(*yylval.string))
1619 <    create_channel_resv(yylval.string, block_state.rpass.buf, 1);
1790 >  if (conf_parser_ctx.pass == 2)
1791 >    strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1792   };
1793  
1794 < resv_nick: NICK '=' QSTRING ';'
1794 > resv_exempt: EXEMPT '=' QSTRING ';'
1795   {
1796    if (conf_parser_ctx.pass == 2)
1797 <    create_nick_resv(yylval.string, block_state.rpass.buf, 1);
1797 >    dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
1798   };
1799  
1800 +
1801   /***************************************************************************
1802   *  section service
1803   ***************************************************************************/
# Line 1635 | Line 1808 | service_item:      service_name | error;
1808  
1809   service_name: NAME '=' QSTRING ';'
1810   {
1811 <  if (conf_parser_ctx.pass == 2)
1811 >  if (conf_parser_ctx.pass != 2)
1812 >    break;
1813 >
1814 >  if (valid_servname(yylval.string))
1815    {
1816 <    if (valid_servname(yylval.string))
1817 <    {
1642 <      struct MaskItem *conf = conf_make(CONF_SERVICE);
1643 <      conf->name = xstrdup(yylval.string);
1644 <    }
1816 >    struct MaskItem *conf = conf_make(CONF_SERVICE);
1817 >    conf->name = xstrdup(yylval.string);
1818    }
1819   };
1820  
# Line 1670 | Line 1843 | shared_entry: T_SHARED
1843    conf->flags = block_state.flags.value;
1844    conf->name = xstrdup(block_state.name.buf);
1845    conf->user = xstrdup(block_state.user.buf);
1846 <  conf->user = xstrdup(block_state.host.buf);
1846 >  conf->host = xstrdup(block_state.host.buf);
1847   };
1848  
1849   shared_items: shared_items shared_item | shared_item;
# Line 1855 | Line 2028 | connect_entry: CONNECT
2028        !block_state.host.buf[0])
2029      break;
2030  
2031 <  if (!(block_state.rpass.buf[0] ||
2032 <        block_state.spass.buf[0]))
2031 >  if (!block_state.rpass.buf[0] ||
2032 >      !block_state.spass.buf[0])
2033      break;
2034  
2035    if (has_wildcards(block_state.name.buf) ||
# Line 1933 | Line 2106 | connect_send_password: SEND_PASSWORD '='
2106      break;
2107  
2108    if ($3[0] == ':')
2109 <    yyerror("Server passwords cannot begin with a colon");
2109 >    conf_error_report("Server passwords cannot begin with a colon");
2110    else if (strchr($3, ' ') != NULL)
2111 <    yyerror("Server passwords cannot contain spaces");
2111 >    conf_error_report("Server passwords cannot contain spaces");
2112    else
2113      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
2114   };
# Line 1946 | Line 2119 | connect_accept_password: ACCEPT_PASSWORD
2119      break;
2120  
2121    if ($3[0] == ':')
2122 <    yyerror("Server passwords cannot begin with a colon");
2122 >    conf_error_report("Server passwords cannot begin with a colon");
2123    else if (strchr($3, ' ') != NULL)
2124 <    yyerror("Server passwords cannot contain spaces");
2124 >    conf_error_report("Server passwords cannot contain spaces");
2125    else
2126      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2127   };
# Line 2023 | Line 2196 | connect_ssl_cipher_list: T_SSL_CIPHER_LI
2196      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2197   #else
2198    if (conf_parser_ctx.pass == 2)
2199 <    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2199 >    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2200   #endif
2201   };
2202  
# Line 2046 | Line 2219 | kill_entry: KILL
2219        !block_state.host.buf[0])
2220      break;
2221  
2222 +  conf = conf_make(CONF_KLINE);
2223 +  conf->user = xstrdup(block_state.user.buf);
2224 +  conf->host = xstrdup(block_state.host.buf);
2225  
2226 <  if (block_state.port.value == 1)
2227 <  {
2052 < #ifdef HAVE_LIBPCRE
2053 <    void *exp_user = NULL;
2054 <    void *exp_host = NULL;
2055 <    const char *errptr = NULL;
2056 <
2057 <    if (!(exp_user = ircd_pcre_compile(block_state.user.buf, &errptr)) ||
2058 <        !(exp_host = ircd_pcre_compile(block_state.host.buf, &errptr)))
2059 <    {
2060 <      ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2061 <           errptr);
2062 <      break;
2063 <    }
2064 <
2065 <    conf = conf_make(CONF_RKLINE);
2066 <    conf->regexuser = exp_user;
2067 <    conf->regexhost = exp_host;
2068 <
2069 <    conf->user = xstrdup(block_state.user.buf);
2070 <    conf->host = xstrdup(block_state.host.buf);
2071 <
2072 <    if (block_state.rpass.buf[0])
2073 <      conf->reason = xstrdup(block_state.rpass.buf);
2074 <    else
2075 <      conf->reason = xstrdup(CONF_NOREASON);
2076 < #else
2077 <    ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2078 <    break;
2079 < #endif
2080 <  }
2226 >  if (block_state.rpass.buf[0])
2227 >    conf->reason = xstrdup(block_state.rpass.buf);
2228    else
2229 <  {
2230 <    conf = conf_make(CONF_KLINE);
2084 <
2085 <    conf->user = xstrdup(block_state.user.buf);
2086 <    conf->host = xstrdup(block_state.host.buf);
2087 <
2088 <    if (block_state.rpass.buf[0])
2089 <      conf->reason = xstrdup(block_state.rpass.buf);
2090 <    else
2091 <      conf->reason = xstrdup(CONF_NOREASON);
2092 <    add_conf_by_address(CONF_KLINE, conf);
2093 <  }
2229 >    conf->reason = xstrdup(CONF_NOREASON);
2230 >  add_conf_by_address(CONF_KLINE, conf);
2231   };
2232  
2096 kill_type: TYPE
2097 {
2098  if (conf_parser_ctx.pass == 2)
2099    block_state.port.value = 0;
2100 } '='  kill_type_items ';';
2101
2102 kill_type_items: kill_type_items ',' kill_type_item | kill_type_item;
2103 kill_type_item: REGEX_T
2104 {
2105  if (conf_parser_ctx.pass == 2)
2106    block_state.port.value = 1;
2107 };
2108
2233   kill_items:     kill_items kill_item | kill_item;
2234 < kill_item:      kill_user | kill_reason | kill_type | error;
2234 > kill_item:      kill_user | kill_reason | error;
2235  
2236   kill_user: USER '=' QSTRING ';'
2237   {
# Line 2219 | Line 2343 | gecos_entry: GECOS
2343    if (!block_state.name.buf[0])
2344      break;
2345  
2346 <  if (block_state.port.value == 1)
2223 <  {
2224 < #ifdef HAVE_LIBPCRE
2225 <    void *exp_p = NULL;
2226 <    const char *errptr = NULL;
2227 <
2228 <    if (!(exp_p = ircd_pcre_compile(block_state.name.buf, &errptr)))
2229 <    {
2230 <      ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2231 <           errptr);
2232 <      break;
2233 <    }
2234 <
2235 <    conf = conf_make(CONF_RXLINE);
2236 <    conf->regexuser = exp_p;
2237 < #else
2238 <    ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2239 <    break;
2240 < #endif
2241 <  }
2242 <  else
2243 <    conf = conf_make(CONF_XLINE);
2244 <
2346 >  conf = conf_make(CONF_XLINE);
2347    conf->name = xstrdup(block_state.name.buf);
2348  
2349    if (block_state.rpass.buf[0])
# Line 2250 | Line 2352 | gecos_entry: GECOS
2352      conf->reason = xstrdup(CONF_NOREASON);
2353   };
2354  
2253 gecos_flags: TYPE
2254 {
2255  if (conf_parser_ctx.pass == 2)
2256    block_state.port.value = 0;
2257 } '='  gecos_flags_items ';';
2258
2259 gecos_flags_items: gecos_flags_items ',' gecos_flags_item | gecos_flags_item;
2260 gecos_flags_item: REGEX_T
2261 {
2262  if (conf_parser_ctx.pass == 2)
2263    block_state.port.value = 1;
2264 };
2265
2355   gecos_items: gecos_items gecos_item | gecos_item;
2356 < gecos_item:  gecos_name | gecos_reason | gecos_flags | error;
2356 > gecos_item:  gecos_name | gecos_reason | error;
2357  
2358   gecos_name: NAME '=' QSTRING ';'
2359   {
# Line 2298 | Line 2387 | general_item:       general_hide_spoof_i
2387                      general_pace_wait_simple | general_stats_P_oper_only |
2388                      general_short_motd | general_no_oper_flood |
2389                      general_true_no_oper_flood | general_oper_pass_resv |
2301                    general_message_locale |
2390                      general_oper_only_umodes | general_max_targets |
2391                      general_use_egd | general_egdpool_path |
2392                      general_oper_umodes | general_caller_id_wait |
2393                      general_opers_bypass_callerid | general_default_floodcount |
2394                      general_min_nonwildcard | general_min_nonwildcard_simple |
2307                    general_disable_remote_commands |
2395                      general_throttle_time | general_havent_read_conf |
2396                      general_ping_cookie |
2397                      general_disable_auth |
# Line 2370 | Line 2457 | general_ignore_bogus_ts: IGNORE_BOGUS_TS
2457    ConfigFileEntry.ignore_bogus_ts = yylval.number;
2458   };
2459  
2373 general_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2374 {
2375  ConfigFileEntry.disable_remote = yylval.number;
2376 };
2377
2460   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2461   {
2462    ConfigFileEntry.failed_oper_notice = yylval.number;
# Line 2508 | Line 2590 | general_oper_pass_resv: OPER_PASS_RESV '
2590    ConfigFileEntry.oper_pass_resv = yylval.number;
2591   };
2592  
2511 general_message_locale: MESSAGE_LOCALE '=' QSTRING ';'
2512 {
2513  if (conf_parser_ctx.pass == 2)
2514  {
2515    if (strlen(yylval.string) > LOCALE_LENGTH-2)
2516      yylval.string[LOCALE_LENGTH-1] = '\0';
2517
2518    set_locale(yylval.string);
2519  }
2520 };
2521
2593   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2594   {
2595    ConfigFileEntry.dots_in_ident = $3;
# Line 2579 | Line 2650 | umode_oitem:     T_BOTS
2650   } | T_CCONN
2651   {
2652    ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2582 } | T_CCONN_FULL
2583 {
2584  ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
2653   } | T_DEAF
2654   {
2655    ConfigFileEntry.oper_umodes |= UMODE_DEAF;
# Line 2633 | Line 2701 | umode_oitem:     T_BOTS
2701   } | T_LOCOPS
2702   {
2703    ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2704 + } | T_NONONREG
2705 + {
2706 +  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2707 + } | T_FARCONNECT
2708 + {
2709 +  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2710   };
2711  
2712   general_oper_only_umodes: OPER_ONLY_UMODES
# Line 2647 | Line 2721 | umode_item:    T_BOTS
2721   } | T_CCONN
2722   {
2723    ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2650 } | T_CCONN_FULL
2651 {
2652  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
2724   } | T_DEAF
2725   {
2726    ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
# Line 2701 | Line 2772 | umode_item:    T_BOTS
2772   } | T_LOCOPS
2773   {
2774    ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2775 + } | T_NONONREG
2776 + {
2777 +  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2778 + } | T_FARCONNECT
2779 + {
2780 +  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2781   };
2782  
2783   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
# Line 2729 | Line 2806 | channel_items:      channel_items channe
2806   channel_item:       channel_max_bans |
2807                      channel_knock_delay | channel_knock_delay_channel |
2808                      channel_max_chans_per_user | channel_max_chans_per_oper |
2809 <                    channel_quiet_on_ban | channel_default_split_user_count |
2809 >                    channel_default_split_user_count |
2810                      channel_default_split_server_count |
2811 <                    channel_no_create_on_split | channel_restrict_channels |
2811 >                    channel_no_create_on_split |
2812                      channel_no_join_on_split |
2813                      channel_jflood_count | channel_jflood_time |
2814                      channel_disable_fake_channels | error;
# Line 2741 | Line 2818 | channel_disable_fake_channels: DISABLE_F
2818    ConfigChannel.disable_fake_channels = yylval.number;
2819   };
2820  
2744 channel_restrict_channels: RESTRICT_CHANNELS '=' TBOOL ';'
2745 {
2746  ConfigChannel.restrict_channels = yylval.number;
2747 };
2748
2821   channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2822   {
2823    ConfigChannel.knock_delay = $3;
# Line 2766 | Line 2838 | channel_max_chans_per_oper: MAX_CHANS_PE
2838    ConfigChannel.max_chans_per_oper = $3;
2839   };
2840  
2769 channel_quiet_on_ban: QUIET_ON_BAN '=' TBOOL ';'
2770 {
2771  ConfigChannel.quiet_on_ban = yylval.number;
2772 };
2773
2841   channel_max_bans: MAX_BANS '=' NUMBER ';'
2842   {
2843    ConfigChannel.max_bans = $3;
# Line 2813 | Line 2880 | serverhide_entry: SERVERHIDE
2880    '{' serverhide_items '}' ';';
2881  
2882   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2883 < serverhide_item:    serverhide_flatten_links | serverhide_hide_servers |
2883 > serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
2884 >                    serverhide_hide_servers |
2885 >                    serverhide_hide_services |
2886                      serverhide_links_delay |
2887                      serverhide_hidden | serverhide_hidden_name |
2888                      serverhide_hide_server_ips |
# Line 2825 | Line 2894 | serverhide_flatten_links: FLATTEN_LINKS
2894      ConfigServerHide.flatten_links = yylval.number;
2895   };
2896  
2897 + serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2898 + {
2899 +  if (conf_parser_ctx.pass == 2)
2900 +    ConfigServerHide.disable_remote_commands = yylval.number;
2901 + };
2902 +
2903   serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';'
2904   {
2905    if (conf_parser_ctx.pass == 2)
2906      ConfigServerHide.hide_servers = yylval.number;
2907   };
2908  
2909 + serverhide_hide_services: HIDE_SERVICES '=' TBOOL ';'
2910 + {
2911 +  if (conf_parser_ctx.pass == 2)
2912 +    ConfigServerHide.hide_services = yylval.number;
2913 + };
2914 +
2915   serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';'
2916   {
2917    if (conf_parser_ctx.pass == 2)

Diff Legend

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