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

Comparing ircd-hybrid/trunk/src/conf.c (file contents):
Revision 7335 by michael, Sat Feb 20 17:50:51 2016 UTC vs.
Revision 8500 by michael, Thu Apr 5 13:00:49 2018 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 1997-2016 ircd-hybrid development team
4 > *  Copyright (c) 1997-2018 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 27 | Line 27
27   #include "stdinc.h"
28   #include "list.h"
29   #include "ircd_defs.h"
30 + #include "parse.h"
31   #include "conf.h"
32   #include "conf_cluster.h"
33   #include "conf_gecos.h"
# Line 50 | Line 51
51   #include "send.h"
52   #include "memory.h"
53   #include "res.h"
53 #include "userhost.h"
54   #include "user.h"
55   #include "channel_mode.h"
56 #include "parse.h"
56   #include "misc.h"
57   #include "conf_db.h"
58   #include "conf_class.h"
59   #include "motd.h"
60   #include "ipcache.h"
61   #include "isupport.h"
62 + #include "whowas.h"
63  
64  
65   struct config_channel_entry ConfigChannel;
# Line 71 | Line 71 | struct config_admin_entry ConfigAdminInf
71   struct conf_parser_context conf_parser_ctx;
72  
73   /* general conf items link list root, other than k lines etc. */
74 < dlink_list server_items;
74 > dlink_list connect_items;
75   dlink_list operator_items;
76  
77   extern unsigned int lineno;
# Line 138 | Line 138 | map_to_list(enum maskitem_type type)
138        return &operator_items;
139        break;
140      case CONF_SERVER:
141 <      return &server_items;
141 >      return &connect_items;
142        break;
143      default:
144        return NULL;
# Line 217 | Line 217 | static int
217   attach_iline(struct Client *client_p, struct MaskItem *conf)
218   {
219    const struct ClassItem *const class = conf->class;
220  struct ip_entry *ip_found;
220    int a_limit_reached = 0;
222  unsigned int local = 0, global = 0, ident = 0;
221  
222 <  ip_found = ipcache_find_or_add_address(&client_p->connection->ip);
223 <  ip_found->count++;
222 >  struct ip_entry *ipcache = ipcache_find_or_add_address(&client_p->ip);
223 >  ++ipcache->count_local;
224    AddFlag(client_p, FLAGS_IPHASH);
225  
228  userhost_count(client_p->username, client_p->host,
229                 &global, &local, &ident);
230
231  /* XXX blah. go down checking the various silly limits
232   * setting a_limit_reached if any limit is reached.
233   * - Dianora
234   */
226    if (class->max_total && class->ref_count >= class->max_total)
227      a_limit_reached = 1;
228 <  else if (class->max_perip && ip_found->count > class->max_perip)
238 <    a_limit_reached = 1;
239 <  else if (class->max_local && local >= class->max_local)
228 >  else if (class->max_perip_local && ipcache->count_local > class->max_perip_local)
229      a_limit_reached = 1;
230 <  else if (class->max_global && global >= class->max_global)
231 <    a_limit_reached = 1;
243 <  else if (class->max_ident && ident >= class->max_ident &&
244 <           client_p->username[0] != '~')
230 >  else if (class->max_perip_global &&
231 >           (ipcache->count_local + ipcache->count_remote) > class->max_perip_global)
232      a_limit_reached = 1;
233  
234    if (a_limit_reached)
# Line 253 | Line 240 | attach_iline(struct Client *client_p, st
240                        "but you have exceed_limit = yes;");
241    }
242  
243 <  return attach_conf(client_p, conf);
243 >  return conf_attach(client_p, conf);
244   }
245  
246   /* verify_access()
# Line 270 | Line 257 | verify_access(struct Client *client_p)
257    if (HasFlag(client_p, FLAGS_GOTID))
258    {
259      conf = find_address_conf(client_p->host, client_p->username,
260 <                             &client_p->connection->ip,
261 <                             client_p->connection->aftype,
260 >                             &client_p->ip,
261 >                             client_p->ip.ss.ss_family,
262                               client_p->connection->password);
263    }
264    else
# Line 280 | Line 267 | verify_access(struct Client *client_p)
267  
268      strlcpy(non_ident + 1, client_p->username, sizeof(non_ident) - 1);
269      conf = find_address_conf(client_p->host, non_ident,
270 <                             &client_p->connection->ip,
271 <                             client_p->connection->aftype,
270 >                             &client_p->ip,
271 >                             client_p->ip.ss.ss_family,
272                               client_p->connection->password);
273    }
274  
# Line 343 | Line 330 | check_client(struct Client *source_p)
330      case TOO_MANY:
331        sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
332                             "Too many on IP for %s (%s).",
333 <                           get_client_name(source_p, SHOW_IP),
333 >                           client_get_name(source_p, SHOW_IP),
334                             source_p->sockhost);
335        ilog(LOG_TYPE_IRCD, "Too many connections on IP from %s.",
336 <           get_client_name(source_p, SHOW_IP));
336 >           client_get_name(source_p, SHOW_IP));
337        ++ServerStats.is_ref;
338        exit_client(source_p, "No more connections allowed on that IP");
339        break;
# Line 354 | Line 341 | check_client(struct Client *source_p)
341      case I_LINE_FULL:
342        sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
343                             "auth {} block is full for %s (%s).",
344 <                           get_client_name(source_p, SHOW_IP),
344 >                           client_get_name(source_p, SHOW_IP),
345                             source_p->sockhost);
346        ilog(LOG_TYPE_IRCD, "Too many connections from %s.",
347 <           get_client_name(source_p, SHOW_IP));
347 >           client_get_name(source_p, SHOW_IP));
348        ++ServerStats.is_ref;
349        exit_client(source_p, "No more connections allowed in your connection class");
350        break;
# Line 366 | Line 353 | check_client(struct Client *source_p)
353        /* jdc - lists server name & port connections are on */
354        /*       a purely cosmetical change */
355        sendto_realops_flags(UMODE_UNAUTH, L_ALL, SEND_NOTICE,
356 <                           "Unauthorized client connection from %s [%s] on [%s/%u].",
357 <                           get_client_name(source_p, SHOW_IP),
371 <                           source_p->sockhost,
356 >                           "Unauthorized client connection from %s on [%s/%u].",
357 >                           client_get_name(source_p, SHOW_IP),
358                             source_p->connection->listener->name,
359                             source_p->connection->listener->port);
360        ilog(LOG_TYPE_IRCD, "Unauthorized client connection from %s on [%s/%u].",
361 <           get_client_name(source_p, SHOW_IP),
361 >           client_get_name(source_p, SHOW_IP),
362             source_p->connection->listener->name,
363             source_p->connection->listener->port);
364  
# Line 393 | Line 379 | check_client(struct Client *source_p)
379    return !(i < 0);
380   }
381  
382 < /* detach_conf()
383 < *
384 < * inputs       - pointer to client to detach
385 < *              - type of conf to detach
400 < * output       - 0 for success, -1 for failure
401 < * side effects - Disassociate configuration from the client.
402 < *                Also removes a class from the list if marked for deleting.
382 > /*! \brief Disassociate configuration from the client. Also removes a class
383 > *         from the list if marked for deleting.
384 > * \param client_p Client to operate on
385 > * \param type     Type of conf to detach
386   */
387   void
388 < detach_conf(struct Client *client_p, enum maskitem_type type)
388 > conf_detach(struct Client *client_p, enum maskitem_type type)
389   {
390 <  dlink_node *node = NULL, *node_next = NULL;
390 >  dlink_node *node, *node_next;
391  
392    DLINK_FOREACH_SAFE(node, node_next, client_p->connection->confs.head)
393    {
# Line 421 | Line 404 | detach_conf(struct Client *client_p, enu
404      free_dlink_node(node);
405  
406      if (conf->type == CONF_CLIENT)
407 <      remove_from_cidr_check(&client_p->connection->ip, conf->class);
407 >      remove_from_cidr_check(&client_p->ip, conf->class);
408  
409      if (--conf->class->ref_count == 0 && conf->class->active == 0)
410      {
# Line 434 | Line 417 | detach_conf(struct Client *client_p, enu
417    }
418   }
419  
420 < /* attach_conf()
421 < *
422 < * inputs       - client pointer
423 < *              - conf pointer
424 < * output       -
442 < * side effects - Associate a specific configuration entry to a *local*
443 < *                client (this is the one which used in accepting the
444 < *                connection). Note, that this automatically changes the
445 < *                attachment if there was an old one...
420 > /*! \brief Associate a specific configuration entry to a *local* client (this
421 > *         is the one which used in accepting the connection). Note, that this
422 > *         automatically changes the attachment if there was an old one.
423 > * \param client_p Client to attach the conf to
424 > * \param conf Configuration record to attach
425   */
426   int
427 < attach_conf(struct Client *client_p, struct MaskItem *conf)
427 > conf_attach(struct Client *client_p, struct MaskItem *conf)
428   {
429    if (dlinkFind(&client_p->connection->confs, conf))
430      return 1;
431  
432    if (conf->type == CONF_CLIENT)
433      if (cidr_limit_reached(IsConfExemptLimits(conf),
434 <                           &client_p->connection->ip, conf->class))
434 >                           &client_p->ip, conf->class))
435        return TOO_MANY;    /* Already at maximum allowed */
436  
437    conf->class->ref_count++;
# Line 463 | Line 442 | attach_conf(struct Client *client_p, str
442    return 0;
443   }
444  
466 /* attach_connect_block()
467 *
468 * inputs       - pointer to server to attach
469 *              - name of server
470 *              - hostname of server
471 * output       - true (1) if both are found, otherwise return false (0)
472 * side effects - find connect block and attach them to connecting client
473 */
474 int
475 attach_connect_block(struct Client *client_p, const char *name,
476                     const char *host)
477 {
478  dlink_node *node = NULL;
479
480  assert(host);
481
482  DLINK_FOREACH(node, server_items.head)
483  {
484    struct MaskItem *conf = node->data;
485
486    if (match(conf->name, name) || match(conf->host, host))
487      continue;
488
489    attach_conf(client_p, conf);
490    return 1;
491  }
492
493  return 0;
494 }
495
445   /* find_conf_name()
446   *
447   * inputs       - pointer to conf link list to search
# Line 521 | Line 470 | find_conf_name(dlink_list *list, const c
470    return NULL;
471   }
472  
473 < /* find_matching_name_conf()
474 < *
475 < * inputs       - type of link list to look in
527 < *              - pointer to name string to find
528 < *              - pointer to user
529 < *              - pointer to host
530 < *              - optional flags to match on as well
531 < * output       - NULL or pointer to found struct MaskItem
532 < * side effects - looks for a match on name field
473 > /*! \brief Find a connect {} conf that has a name that matches \a name.
474 > * \param name Name to match
475 > * \param compare Pointer to function to be used for string matching
476   */
477   struct MaskItem *
478 < find_matching_name_conf(enum maskitem_type type, const char *name, const char *user,
536 <                        const char *host, unsigned int flags)
478 > connect_find(const char *name, int (*compare)(const char *, const char *))
479   {
480 <  dlink_node *node = NULL;
539 <  dlink_list *list = map_to_list(type);
540 <  struct MaskItem *conf = NULL;
480 >  dlink_node *node;
481  
482 <  switch (type)
482 >  DLINK_FOREACH(node, connect_items.head)
483    {
484 <  case CONF_SERVER:
545 <    DLINK_FOREACH(node, list->head)
546 <    {
547 <      conf = node->data;
548 <
549 <      if (name && !match(name, conf->name))
550 <        return conf;
551 <      if (host && !match(host, conf->host))
552 <        return conf;
553 <    }
554 <    break;
484 >    struct MaskItem *conf = node->data;
485  
486 <  default:
487 <    break;
486 >    if (!compare(name, conf->name))
487 >      return conf;
488    }
489 +
490    return NULL;
491   }
492  
# Line 569 | Line 500 | find_matching_name_conf(enum maskitem_ty
500   * side effects - looks for an exact match on name field
501   */
502   struct MaskItem *
503 < find_exact_name_conf(enum maskitem_type type, const struct Client *who, const char *name,
573 <                     const char *user, const char *host)
503 > operator_find(const struct Client *who, const char *name)
504   {
505    dlink_node *node = NULL;
576  dlink_list *list = map_to_list(type);
577  struct MaskItem *conf = NULL;
506  
507 <  switch(type)
507 >  DLINK_FOREACH(node, operator_items.head)
508    {
509 <  case CONF_OPER:
582 <    DLINK_FOREACH(node, list->head)
583 <    {
584 <      conf = node->data;
509 >    struct MaskItem *conf = node->data;
510  
511 <      if (EmptyString(conf->name))
512 <        continue;
511 >    if (!irccmp(conf->name, name))
512 >    {
513 >      if (!who)
514 >        return conf;
515  
516 <      if (!irccmp(conf->name, name))
516 >      if (!match(conf->user, who->username))
517        {
518 <        if (!who)
592 <          return conf;
593 <        if (EmptyString(conf->user) || EmptyString(conf->host))
594 <          return NULL;
595 <        if (!match(conf->user, who->username))
518 >        switch (conf->htype)
519          {
520 <          switch (conf->htype)
521 <          {
522 <            case HM_HOST:
523 <              if (!match(conf->host, who->host) || !match(conf->host, who->sockhost))
520 >          case HM_HOST:
521 >            if (!match(conf->host, who->host) || !match(conf->host, who->sockhost))
522 >              if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total)
523 >                return conf;
524 >            break;
525 >          case HM_IPV4:
526 >            if (who->ip.ss.ss_family == AF_INET)
527 >              if (match_ipv4(&who->ip, &conf->addr, conf->bits))
528 >                if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total)
529 >                  return conf;
530 >            break;
531 >          case HM_IPV6:
532 >            if (who->ip.ss.ss_family == AF_INET6)
533 >              if (match_ipv6(&who->ip, &conf->addr, conf->bits))
534                  if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total)
535                    return conf;
536 <              break;
537 <            case HM_IPV4:
538 <              if (who->connection->aftype == AF_INET)
606 <                if (match_ipv4(&who->connection->ip, &conf->addr, conf->bits))
607 <                  if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total)
608 <                    return conf;
609 <              break;
610 <            case HM_IPV6:
611 <              if (who->connection->aftype == AF_INET6)
612 <                if (match_ipv6(&who->connection->ip, &conf->addr, conf->bits))
613 <                  if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total)
614 <                    return conf;
615 <              break;
616 <            default:
617 <              assert(0);
618 <          }
536 >            break;
537 >          default:
538 >            assert(0);
539          }
540        }
541      }
622
623    break;
624
625  case CONF_SERVER:
626    DLINK_FOREACH(node, list->head)
627    {
628      conf = node->data;
629
630      if (EmptyString(conf->name))
631        continue;
632
633      if (name == NULL)
634      {
635        if (EmptyString(conf->host))
636          continue;
637        if (irccmp(conf->host, host) == 0)
638          return conf;
639      }
640      else if (irccmp(conf->name, name) == 0)
641        return conf;
642    }
643
644    break;
645
646  default:
647    break;
542    }
543  
544    return NULL;
# Line 679 | Line 573 | set_default_conf(void)
573    ConfigServerInfo.max_nick_length = 9;
574    ConfigServerInfo.max_topic_length = 80;
575    ConfigServerInfo.hub = 0;
682  ConfigServerInfo.libgeoip_database_options = 0;
576  
577    log_del_all();
578  
# Line 689 | Line 582 | set_default_conf(void)
582    ConfigChannel.invite_client_count = 10;
583    ConfigChannel.invite_client_time = 300;
584    ConfigChannel.invite_delay_channel = 5;
585 +  ConfigChannel.invite_expire_time = 1800;
586    ConfigChannel.knock_client_count = 1;
587    ConfigChannel.knock_client_time = 300;
588    ConfigChannel.knock_delay_channel = 60;
589    ConfigChannel.max_channels = 25;
590 <  ConfigChannel.max_bans = 25;
590 >  ConfigChannel.max_invites = 20;
591 >  ConfigChannel.max_bans = 100;
592 >  ConfigChannel.max_bans_large = 500;
593    ConfigChannel.default_join_flood_count = 18;
594    ConfigChannel.default_join_flood_time = 6;
595  
# Line 709 | Line 605 | set_default_conf(void)
605    ConfigGeneral.away_count = 2;
606    ConfigGeneral.away_time = 10;
607    ConfigGeneral.max_watch = 50;
608 +  ConfigGeneral.whowas_history_length = 15000;
609    ConfigGeneral.cycle_on_host_change = 1;
610    ConfigGeneral.dline_min_cidr = 16;
611    ConfigGeneral.dline_min_cidr6 = 48;
# Line 720 | Line 617 | set_default_conf(void)
617    ConfigGeneral.disable_auth = 0;
618    ConfigGeneral.kill_chase_time_limit = 90;
619    ConfigGeneral.default_floodcount = 8;
620 +  ConfigGeneral.default_floodtime = 1;
621    ConfigGeneral.failed_oper_notice = 1;
622    ConfigGeneral.dots_in_ident = 0;
623    ConfigGeneral.min_nonwildcard = 4;
# Line 740 | Line 638 | set_default_conf(void)
638    ConfigGeneral.stats_P_oper_only = 0;
639    ConfigGeneral.stats_u_oper_only = 0;
640    ConfigGeneral.caller_id_wait = 60;
641 <  ConfigGeneral.opers_bypass_callerid = 0;
641 >  ConfigGeneral.opers_bypass_callerid = 1;
642    ConfigGeneral.pace_wait = 10;
643    ConfigGeneral.pace_wait_simple = 1;
644    ConfigGeneral.short_motd = 0;
# Line 774 | Line 672 | validate_conf(void)
672   static void
673   read_conf(FILE *file)
674   {
675 <  lineno = 0;
675 >  lineno = 1;
676  
677    set_default_conf();  /* Set default values prior to conf parsing */
678    conf_parser_ctx.pass = 1;
# Line 786 | Line 684 | read_conf(FILE *file)
684    yyparse();  /* Load the values from the conf */
685    validate_conf();  /* Check to make sure some values are still okay. */
686                      /* Some global values are also loaded here. */
687 +  whowas_trim();  /* Attempt to trim whowas list if necessary */
688    class_delete_marked();  /* Delete unused classes that are marked for deletion */
689   }
690  
# Line 799 | Line 698 | void
698   conf_rehash(int sig)
699   {
700    if (sig)
701 +  {
702      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
703                           "Got signal SIGHUP, reloading configuration file(s)");
704 +    ilog(LOG_TYPE_IRCD, "Got signal SIGHUP, reloading configuration file(s)");
705 +  }
706  
707    restart_resolver();
708  
# Line 946 | Line 848 | static const struct oper_flags
848   const char *
849   oper_privs_as_string(const unsigned int flags)
850   {
851 <  static char buf[sizeof(flag_table) / sizeof(struct oper_flags)];
851 >  static char buf[sizeof(flag_table) / sizeof(flag_table[0])];
852    char *p = buf;
853  
854    for (const struct oper_flags *tab = flag_table; tab->flag; ++tab)
# Line 1014 | Line 916 | clear_out_old_conf(void)
916   {
917    dlink_node *node = NULL, *node_next = NULL;
918    dlink_list *free_items [] = {
919 <    &server_items, &operator_items, NULL
919 >    &connect_items, &operator_items, NULL
920    };
921  
922    dlink_list ** iterator = free_items; /* C is dumb */
# Line 1061 | Line 963 | clear_out_old_conf(void)
963  
964    pseudo_clear();  /* Clear pseudo {} items */
965  
1064 #ifdef HAVE_LIBGEOIP
1065  GeoIP_delete(GeoIPv4_ctx);
1066  GeoIPv4_ctx = NULL;
1067  GeoIP_delete(GeoIPv6_ctx);
1068  GeoIPv6_ctx = NULL;
1069 #endif
1070
966    /* Clean out ConfigServerInfo */
967    xfree(ConfigServerInfo.description);
968    ConfigServerInfo.description = NULL;
# Line 1075 | Line 970 | clear_out_old_conf(void)
970    ConfigServerInfo.network_name = NULL;
971    xfree(ConfigServerInfo.network_desc);
972    ConfigServerInfo.network_desc = NULL;
1078  xfree(ConfigServerInfo.libgeoip_ipv6_database_file);
1079  ConfigServerInfo.libgeoip_ipv6_database_file = NULL;
1080  xfree(ConfigServerInfo.libgeoip_ipv4_database_file);
1081  ConfigServerInfo.libgeoip_ipv4_database_file = NULL;
973    xfree(ConfigServerInfo.rsa_private_key_file);
974    ConfigServerInfo.rsa_private_key_file = NULL;
975    xfree(ConfigServerInfo.ssl_certificate_file);
# Line 1100 | Line 991 | clear_out_old_conf(void)
991    xfree(ConfigAdminInfo.description);
992    ConfigAdminInfo.description = NULL;
993  
994 +  /* Clean out ConfigServerHide */
995    xfree(ConfigServerHide.flatten_links_file);
996    ConfigServerHide.flatten_links_file = NULL;
997 +  xfree(ConfigServerHide.hidden_name);
998 +  ConfigServerHide.hidden_name = NULL;
999  
1000    /* Clean out listeners */
1001    listener_close_marked();
# Line 1187 | Line 1081 | read_conf_files(int cold)
1081    snprintf(chanlimit, sizeof(chanlimit), "#:%u",
1082             ConfigChannel.max_channels);
1083    isupport_add("CHANLIMIT", chanlimit, -1);
1084 <  snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,cimnprstCMORST");
1084 >  snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,cimnprstuCLMNORST");
1085    isupport_add("CHANNELLEN", NULL, CHANNELLEN);
1086    isupport_add("TOPICLEN", NULL, ConfigServerInfo.max_topic_length);
1087    isupport_add("CHANMODES", chanmodes, -1);
1194
1195  /*
1196   * message_locale may have changed.  rebuild isupport since it relies
1197   * on strlen(form_str(RPL_ISUPPORT))
1198   */
1199  isupport_rebuild();
1088   }
1089  
1090   /* conf_add_class_to_conf()
# Line 1232 | Line 1120 | conf_add_class_to_conf(struct MaskItem *
1120   void
1121   yyerror(const char *msg)
1122   {
1235  char newlinebuf[IRCD_BUFSIZE];
1236
1123    if (conf_parser_ctx.pass != 1)
1124      return;
1125  
1126 <  strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
1126 >  const char *p = stripws(linebuf);
1127    sendto_realops_flags(UMODE_SERVNOTICE, L_ADMIN, SEND_NOTICE,
1128                         "\"%s\", line %u: %s: %s",
1129 <                       conffilebuf, lineno + 1, msg, newlinebuf);
1129 >                       conffilebuf, lineno, msg, p);
1130    ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
1131 <       conffilebuf, lineno + 1, msg, newlinebuf);
1131 >       conffilebuf, lineno, msg, p);
1132   }
1133  
1134   void
1135   conf_error_report(const char *msg)
1136   {
1137 <  char newlinebuf[IRCD_BUFSIZE];
1252 <
1253 <  strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
1137 >  const char *p = stripws(linebuf);
1138    sendto_realops_flags(UMODE_SERVNOTICE, L_ADMIN, SEND_NOTICE,
1139                         "\"%s\", line %u: %s: %s",
1140 <                       conffilebuf, lineno + 1, msg, newlinebuf);
1140 >                       conffilebuf, lineno, msg, p);
1141    ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
1142 <       conffilebuf, lineno + 1, msg, newlinebuf);
1142 >       conffilebuf, lineno, msg, p);
1143   }
1144  
1145   /*
# Line 1349 | Line 1233 | valid_wild_card_simple(const char *data)
1233   * side effects - NOTICE is given to source_p if warn is 1
1234   */
1235   int
1236 < valid_wild_card(struct Client *source_p, int count, ...)
1236 > valid_wild_card(int count, ...)
1237   {
1238    unsigned char tmpch = '\0';
1239    unsigned int nonwild = 0;
# Line 1392 | Line 1276 | valid_wild_card(struct Client *source_p,
1276      }
1277    }
1278  
1395  if (IsClient(source_p))
1396    sendto_one_notice(source_p, &me,
1397                      ":Please include at least %u non-wildcard characters with the mask",
1398                      ConfigGeneral.min_nonwildcard);
1279    va_end(args);
1280    return 0;
1281   }
# Line 1512 | Line 1392 | find_user_host(struct Client *source_p,
1392   int
1393   parse_aline(const char *cmd, struct Client *source_p,
1394              int parc, char **parv,
1395 <            int parse_flags, char **up_p, char **h_p, uintmax_t *tkline_time,
1395 >            char **up_p, char **h_p, uintmax_t *tkline_time,
1396              char **target_server, char **reason)
1397   {
1398 <  int found_tkline_time=0;
1398 >  uintmax_t found_tkline_time=0;
1399    static char default_reason[] = CONF_NOREASON;
1400    static char user[USERLEN*4+1];
1401    static char host[HOSTLEN*4+1];
# Line 1592 | Line 1472 | parse_aline(const char *cmd, struct Clie
1472      }
1473    }
1474  
1595  if (h_p)
1596  {
1597    if (strchr(user, '!'))
1598    {
1599      sendto_one_notice(source_p, &me, ":Invalid character '!' in kline");
1600      return 0;
1601    }
1602
1603    if ((parse_flags & AWILD) && !valid_wild_card(source_p, 2, *up_p, *h_p))
1604      return 0;
1605  }
1606  else
1607    if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, *up_p))
1608      return 0;
1609
1475    if (reason)
1476    {
1477      if (parc && !EmptyString(*parv))

Comparing ircd-hybrid/trunk/src/conf.c (property svn:keywords):
Revision 7335 by michael, Sat Feb 20 17:50:51 2016 UTC vs.
Revision 8500 by michael, Thu Apr 5 13:00:49 2018 UTC

# Line 1 | Line 1
1 < Id Revision
1 > Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines