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

Comparing:
ircd-hybrid-7.2/src/s_conf.c (file contents), Revision 896 by michael, Sat Nov 3 08:54:09 2007 UTC vs.
ircd-hybrid-8/src/s_conf.c (file contents), Revision 1306 by michael, Sat Mar 24 07:43:04 2012 UTC

# Line 23 | Line 23
23   */
24  
25   #include "stdinc.h"
26 + #include "list.h"
27   #include "ircd_defs.h"
28 < #include "tools.h"
28 > #include "balloc.h"
29   #include "s_conf.h"
30   #include "s_serv.h"
31   #include "resv.h"
32   #include "channel.h"
33   #include "client.h"
33 #include "common.h"
34   #include "event.h"
35   #include "hash.h"
36   #include "hook.h"
37   #include "irc_string.h"
38   #include "sprintf_irc.h"
39   #include "s_bsd.h"
40 #include "irc_getaddrinfo.h"
40   #include "ircd.h"
42 #include "list.h"
41   #include "listener.h"
42   #include "hostmask.h"
43   #include "modules.h"
# Line 54 | Line 52
52   #include "userhost.h"
53   #include "s_user.h"
54   #include "channel_mode.h"
55 + #include "parse.h"
56 + #include "s_misc.h"
57  
58   struct Callback *client_check_cb = NULL;
59   struct config_server_hide ConfigServerHide;
60  
61   /* general conf items link list root, other than k lines etc. */
62 + dlink_list service_items = { NULL, NULL, 0 };
63   dlink_list server_items  = { NULL, NULL, 0 };
64   dlink_list cluster_items = { NULL, NULL, 0 };
65   dlink_list hub_items     = { NULL, NULL, 0 };
# Line 85 | Line 86 | extern char linebuf[];
86   extern char conffilebuf[IRCD_BUFSIZE];
87   extern char yytext[];
88   extern int yyparse(); /* defined in y.tab.c */
89 < int ypass = 1; /* used by yyparse()      */
89 >
90 > struct conf_parser_context conf_parser_ctx = { 0, 0, NULL };
91  
92   /* internally defined functions */
93   static void lookup_confhost(struct ConfItem *);
# Line 114 | Line 116 | static void destroy_cidr_class(struct Cl
116  
117   static void flags_to_ascii(unsigned int, const unsigned int[], char *, int);
118  
117 FBFILE *conf_fbfile_in = NULL;
118
119   /* address of default class conf */
120   static struct ConfItem *class_default;
121  
# Line 138 | Line 138 | static BlockHeap *ip_entry_heap = NULL;
138   static int ip_entries_count = 0;
139  
140  
141 < inline void *
141 > void *
142   map_to_conf(struct ConfItem *aconf)
143   {
144    void *conf;
145 <  conf = (void *)((unsigned long)aconf +
146 <                  (unsigned long)sizeof(struct ConfItem));
145 >  conf = (void *)((uintptr_t)aconf +
146 >                  (uintptr_t)sizeof(struct ConfItem));
147    return(conf);
148   }
149  
150 < inline struct ConfItem *
150 > struct ConfItem *
151   unmap_conf_item(void *aconf)
152   {
153    struct ConfItem *conf;
154  
155 <  conf = (struct ConfItem *)((unsigned long)aconf -
156 <                             (unsigned long)sizeof(struct ConfItem));
155 >  conf = (struct ConfItem *)((uintptr_t)aconf -
156 >                             (uintptr_t)sizeof(struct ConfItem));
157    return(conf);
158   }
159  
# Line 168 | Line 168 | unmap_conf_item(void *aconf)
168   * if successful save hp in the conf item it was called with
169   */
170   static void
171 < conf_dns_callback(void *vptr, struct DNSReply *reply)
171 > conf_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name)
172   {
173 <  struct AccessItem *aconf = (struct AccessItem *)vptr;
174 <  struct ConfItem *conf;
173 >  struct AccessItem *aconf = vptr;
174  
175 <  MyFree(aconf->dns_query);
177 <  aconf->dns_query = NULL;
175 >  aconf->dns_pending = 0;
176  
177 <  if (reply != NULL)
178 <    memcpy(&aconf->ipnum, &reply->addr, sizeof(reply->addr));
179 <  else {
180 <    ilog(L_NOTICE, "Host not found: %s, ignoring connect{} block",
183 <         aconf->host);
184 <    conf = unmap_conf_item(aconf);
185 <    sendto_realops_flags(UMODE_ALL, L_ALL,
186 <                         "Ignoring connect{} block for %s - host not found",
187 <                         conf->name);
188 <    delete_conf_item(conf);
189 <  }
177 >  if (addr != NULL)
178 >    memcpy(&aconf->ipnum, addr, sizeof(aconf->ipnum));
179 >  else
180 >    aconf->dns_failed = 1;
181   }
182  
183   /* conf_dns_lookup()
# Line 198 | Line 189 | conf_dns_callback(void *vptr, struct DNS
189   static void
190   conf_dns_lookup(struct AccessItem *aconf)
191   {
192 <  if (aconf->dns_query == NULL)
192 >  if (!aconf->dns_pending)
193    {
194 <    aconf->dns_query = MyMalloc(sizeof(struct DNSQuery));
195 <    aconf->dns_query->ptr = aconf;
205 <    aconf->dns_query->callback = conf_dns_callback;
206 <    gethost_byname(aconf->host, aconf->dns_query);
194 >    aconf->dns_pending = 1;
195 >    gethost_byname(conf_dns_callback, aconf, aconf->host);
196    }
197   }
198  
# Line 303 | Line 292 | make_conf_item(ConfType type)
292                                         sizeof(struct MatchItem));
293      dlinkAdd(conf, &conf->node, &xconf_items);
294      break;
295 <
295 > #ifdef HAVE_LIBPCRE
296    case RXLINE_TYPE:
297      conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem) +
298                                         sizeof(struct MatchItem));
# Line 317 | Line 306 | make_conf_item(ConfType type)
306      aconf->status = CONF_KLINE;
307      dlinkAdd(conf, &conf->node, &rkconf_items);
308      break;
309 <
309 > #endif
310    case CLUSTER_TYPE:
311      conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem));
312      dlinkAdd(conf, &conf->node, &cluster_items);
# Line 334 | Line 323 | make_conf_item(ConfType type)
323      dlinkAdd(conf, &conf->node, &nresv_items);
324      break;
325  
326 +  case SERVICE_TYPE:
327 +    status = CONF_SERVICE;
328 +    conf = MyMalloc(sizeof(struct ConfItem));
329 +    dlinkAdd(conf, &conf->node, &service_items);
330 +    break;
331 +
332    case CLASS_TYPE:
333      conf = MyMalloc(sizeof(struct ConfItem) +
334                             sizeof(struct ClassItem));
# Line 381 | Line 376 | delete_conf_item(struct ConfItem *conf)
376    case SERVER_TYPE:
377      aconf = map_to_conf(conf);
378  
379 <    if (aconf->dns_query != NULL)
380 <    {
386 <      delete_resolver_queries(aconf->dns_query);
387 <      MyFree(aconf->dns_query);
388 <    }
379 >    if (aconf->dns_pending)
380 >      delete_resolver_queries(aconf);
381      if (aconf->passwd != NULL)
382        memset(aconf->passwd, 0, strlen(aconf->passwd));
383      if (aconf->spasswd != NULL)
# Line 398 | Line 390 | delete_conf_item(struct ConfItem *conf)
390      MyFree(aconf->oper_reason);
391      MyFree(aconf->user);
392      MyFree(aconf->host);
393 <    MyFree(aconf->fakename);
393 >    MyFree(aconf->cipher_list);
394   #ifdef HAVE_LIBCRYPTO
395      if (aconf->rsa_public_key)
396        RSA_free(aconf->rsa_public_key);
# Line 478 | Line 470 | delete_conf_item(struct ConfItem *conf)
470      dlinkDelete(&conf->node, &xconf_items);
471      MyFree(conf);
472      break;
473 <
473 > #ifdef HAVE_LIBPCRE
474    case RKLINE_TYPE:
475      aconf = map_to_conf(conf);
476      MyFree(aconf->regexuser);
# Line 501 | Line 493 | delete_conf_item(struct ConfItem *conf)
493      dlinkDelete(&conf->node, &rxconf_items);
494      MyFree(conf);
495      break;
496 <
496 > #endif
497    case NRESV_TYPE:
498      match_item = map_to_conf(conf);
499      MyFree(match_item->user);
# Line 543 | Line 535 | delete_conf_item(struct ConfItem *conf)
535      MyFree(conf);
536      break;
537  
538 +  case SERVICE_TYPE:
539 +    dlinkDelete(&conf->node, &service_items);
540 +    MyFree(conf);
541 +    break;
542 +
543    default:
544      break;
545    }
# Line 628 | Line 625 | report_confitem_types(struct Client *sou
625      }
626      break;
627  
628 + #ifdef HAVE_LIBPCRE
629    case RXLINE_TYPE:
630      DLINK_FOREACH(ptr, rxconf_items.head)
631      {
# Line 656 | Line 654 | report_confitem_types(struct Client *sou
654                   aconf->reason, aconf->oper_reason ? aconf->oper_reason : "");
655      }
656      break;
657 + #endif
658  
659    case ULINE_TYPE:
660      DLINK_FOREACH(ptr, uconf_items.head)
# Line 700 | Line 699 | report_confitem_types(struct Client *sou
699        aconf = map_to_conf(conf);
700  
701        /* Don't allow non opers to see oper privs */
702 <      if (IsOper(source_p))
702 >      if (HasUMode(source_p, UMODE_OPER))
703          sendto_one(source_p, form_str(RPL_STATSOLINE),
704                     me.name, source_p->name, 'O', aconf->user, aconf->host,
705                     conf->name, oper_privs_as_string(aconf->port),
# Line 732 | Line 731 | report_confitem_types(struct Client *sou
731    case CLIENT_TYPE:
732      break;
733  
734 +  case SERVICE_TYPE:
735 +    DLINK_FOREACH(ptr, service_items.head)
736 +    {
737 +      conf = ptr->data;
738 +      sendto_one(source_p, form_str(RPL_STATSSERVICE),
739 +                 me.name, source_p->name, 'S', "*", conf->name, 0, 0);
740 +    }
741 +    break;
742 +
743    case SERVER_TYPE:
744      DLINK_FOREACH(ptr, server_items.head)
745      {
# Line 744 | Line 752 | report_confitem_types(struct Client *sou
752  
753        if (IsConfAllowAutoConn(aconf))
754          *p++ = 'A';
755 <      if (IsConfCryptLink(aconf))
756 <        *p++ = 'C';
749 <      if (aconf->fakename)
750 <        *p++ = 'M';
755 >      if (IsConfSSL(aconf))
756 >        *p++ = 'S';
757        if (IsConfTopicBurst(aconf))
758          *p++ = 'T';
753      if (IsConfCompressed(aconf))
754        *p++ = 'Z';
759        if (buf[0] == '\0')
760          *p++ = '*';
761  
# Line 760 | Line 764 | report_confitem_types(struct Client *sou
764        /*
765         * Allow admins to see actual ips unless hide_server_ips is enabled
766         */
767 <      if (!ConfigServerHide.hide_server_ips && IsAdmin(source_p))
767 >      if (!ConfigServerHide.hide_server_ips && HasUMode(source_p, UMODE_ADMIN))
768          sendto_one(source_p, form_str(RPL_STATSCLINE),
769                     me.name, source_p->name, 'C', aconf->host,
770                     buf, conf->name, aconf->port,
# Line 800 | Line 804 | report_confitem_types(struct Client *sou
804    case CRESV_TYPE:
805    case NRESV_TYPE:
806    case CLUSTER_TYPE:
807 +  default:
808      break;
809    }
810   }
# Line 826 | Line 831 | check_client(va_list args)
831  
832    /* I'm already in big trouble if source_p->localClient is NULL -db */
833    if ((i = verify_access(source_p, username)))
834 <    ilog(L_INFO, "Access denied: %s[%s]",
834 >    ilog(LOG_TYPE_IRCD, "Access denied: %s[%s]",
835           source_p->name, source_p->sockhost);
836  
837    switch (i)
# Line 836 | Line 841 | check_client(va_list args)
841                             "Too many on IP for %s (%s).",
842                             get_client_name(source_p, SHOW_IP),
843                             source_p->sockhost);
844 <      ilog(L_INFO,"Too many connections on IP from %s.",
844 >      ilog(LOG_TYPE_IRCD, "Too many connections on IP from %s.",
845             get_client_name(source_p, SHOW_IP));
846        ++ServerStats.is_ref;
847        exit_client(source_p, &me, "No more connections allowed on that IP");
# Line 847 | Line 852 | check_client(va_list args)
852                             "I-line is full for %s (%s).",
853                             get_client_name(source_p, SHOW_IP),
854                             source_p->sockhost);
855 <      ilog(L_INFO,"Too many connections from %s.",
855 >      ilog(LOG_TYPE_IRCD, "Too many connections from %s.",
856             get_client_name(source_p, SHOW_IP));
857        ++ServerStats.is_ref;
858        exit_client(source_p, &me,
# Line 864 | Line 869 | check_client(va_list args)
869                             source_p->sockhost,
870                             source_p->localClient->listener->name,
871                             source_p->localClient->listener->port);
872 <      ilog(L_INFO,
872 >      ilog(LOG_TYPE_IRCD,
873            "Unauthorized client connection from %s on [%s/%u].",
874            get_client_name(source_p, SHOW_IP),
875            source_p->localClient->listener->name,
# Line 1191 | Line 1196 | hash_ip(struct irc_ssaddr *addr)
1196    {
1197      struct sockaddr_in *v4 = (struct sockaddr_in *)addr;
1198      int hash;
1199 <    u_int32_t ip;
1199 >    uint32_t ip;
1200  
1201      ip   = ntohl(v4->sin_addr.s_addr);
1202      hash = ((ip >> 12) + ip) & (IP_HASH_SIZE-1);
# Line 1202 | Line 1207 | hash_ip(struct irc_ssaddr *addr)
1207    {
1208      int hash;
1209      struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr;
1210 <    u_int32_t *ip = (u_int32_t *)&v6->sin6_addr.s6_addr;
1210 >    uint32_t *ip = (uint32_t *)&v6->sin6_addr.s6_addr;
1211  
1212      hash  = ip[0] ^ ip[3];
1213      hash ^= hash >> 16;  
# Line 1226 | Line 1231 | hash_ip(struct irc_ssaddr *addr)
1231   * used in the hash.
1232   */
1233   void
1234 < count_ip_hash(int *number_ips_stored, unsigned long *mem_ips_stored)
1234 > count_ip_hash(unsigned int *number_ips_stored, uint64_t *mem_ips_stored)
1235   {
1236    struct ip_entry *ptr;
1237    int i;
# Line 1552 | Line 1557 | map_to_list(ConfType type)
1557    case SERVER_TYPE:
1558      return(&server_items);
1559      break;
1560 +  case SERVICE_TYPE:
1561 +    return(&service_items);
1562 +    break;
1563    case CLUSTER_TYPE:
1564      return(&cluster_items);
1565      break;
# Line 1587 | Line 1595 | find_matching_name_conf(ConfType type, c
1595  
1596    switch (type)
1597    {
1598 <    case RXLINE_TYPE:
1598 > #ifdef HAVE_LIBPCRE
1599 >  case RXLINE_TYPE:
1600        DLINK_FOREACH(ptr, list_p->head)
1601        {
1602          conf = ptr->data;
# Line 1597 | Line 1606 | find_matching_name_conf(ConfType type, c
1606            return conf;
1607        }
1608        break;
1609 + #endif
1610 +  case SERVICE_TYPE:
1611 +    DLINK_FOREACH(ptr, list_p->head)
1612 +    {
1613 +      conf = ptr->data;
1614 +
1615 +      if (EmptyString(conf->name))
1616 +        continue;
1617 +      if ((name != NULL) && !irccmp(name, conf->name))
1618 +        return conf;
1619 +    }
1620 +    break;
1621  
1622    case XLINE_TYPE:
1623    case ULINE_TYPE:
# Line 1651 | Line 1672 | find_matching_name_conf(ConfType type, c
1672   * side effects - looks for an exact match on name field
1673   */
1674   struct ConfItem *
1675 < find_exact_name_conf(ConfType type, const char *name,
1675 > find_exact_name_conf(ConfType type, const struct Client *who, const char *name,
1676                       const char *user, const char *host)
1677   {
1678    dlink_node *ptr = NULL;
# Line 1692 | Line 1713 | find_exact_name_conf(ConfType type, cons
1713      DLINK_FOREACH(ptr, list_p->head)
1714      {
1715        conf = ptr->data;
1716 <      aconf = (struct AccessItem *)map_to_conf(conf);
1716 >      aconf = map_to_conf(conf);
1717 >
1718        if (EmptyString(conf->name))
1719 <        continue;
1720 <    
1721 <      if (irccmp(conf->name, name) == 0)
1719 >        continue;
1720 >
1721 >      if (!irccmp(conf->name, name))
1722        {
1723 <        if ((user == NULL && (host == NULL)))
1724 <          return (conf);
1725 <        if (EmptyString(aconf->user) || EmptyString(aconf->host))
1726 <          return (conf);
1727 <        if (match(aconf->user, user) && match(aconf->host, host))
1728 <          return (conf);
1723 >        if (!who)
1724 >          return conf;
1725 >        if (EmptyString(aconf->user) || EmptyString(aconf->host))
1726 >          return conf;
1727 >        if (match(aconf->user, who->username))
1728 >        {
1729 >          switch (aconf->type)
1730 >          {
1731 >            case HM_HOST:
1732 >              if (match(aconf->host, who->host) || match(aconf->host, who->sockhost))
1733 >                return conf;
1734 >              break;
1735 >            case HM_IPV4:
1736 >              if (who->localClient->aftype == AF_INET)
1737 >                if (match_ipv4(&who->localClient->ip, &aconf->ipnum, aconf->bits))
1738 >                  return conf;
1739 >              break;
1740 > #ifdef IPV6
1741 >            case HM_IPV6:
1742 >              if (who->localClient->aftype == AF_INET6)
1743 >                if (match_ipv6(&who->localClient->ip, &aconf->ipnum, aconf->bits))
1744 >                  return conf;
1745 >              break;
1746 > #endif
1747 >            default:
1748 >              assert(0);
1749 >          }
1750 >        }
1751        }
1752      }
1753 +
1754      break;
1755  
1756    case SERVER_TYPE:
# Line 1761 | Line 1806 | rehash(int sig)
1806      sendto_realops_flags(UMODE_ALL, L_ALL,
1807                           "Got signal SIGHUP, reloading ircd.conf file");
1808  
1764 #ifndef _WIN32
1809    restart_resolver();
1810 < #endif
1810 >
1811    /* don't close listeners until we know we can go ahead with the rehash */
1812  
1813    /* Check to see if we magically got(or lost) IPv6 support */
# Line 1774 | Line 1818 | rehash(int sig)
1818    if (ServerInfo.description != NULL)
1819      strlcpy(me.info, ServerInfo.description, sizeof(me.info));
1820  
1777 #ifndef STATIC_MODULES
1821    load_conf_modules();
1779 #endif
1822  
1823    flush_deleted_I_P();
1824  
1825    rehashed_klines = 1;
1826 <
1826 > /* XXX */
1827    if (ConfigLoggingEntry.use_logging)
1828 <    reopen_log(logFileName);
1828 >    log_close_all();
1829  
1830    return(0);
1831   }
# Line 1822 | Line 1864 | set_default_conf(void)
1864    ServerInfo.specific_ipv6_vhost = 0;
1865  
1866    ServerInfo.max_clients = MAXCLIENTS_MAX;
1867 <  /* Don't reset hub, as that will break lazylinks */
1868 <  /* ServerInfo.hub = NO; */
1867 >
1868 >  ServerInfo.hub = 0;
1869    ServerInfo.dns_host.sin_addr.s_addr = 0;
1870    ServerInfo.dns_host.sin_port = 0;
1871    AdminInfo.name = NULL;
1872    AdminInfo.email = NULL;
1873    AdminInfo.description = NULL;
1874  
1875 <  set_log_level(L_NOTICE);
1875 >  log_close_all();
1876 >
1877    ConfigLoggingEntry.use_logging = 1;
1878 <  ConfigLoggingEntry.operlog[0] = '\0';
1879 <  ConfigLoggingEntry.userlog[0] = '\0';
1880 <  ConfigLoggingEntry.klinelog[0] = '\0';
1881 <  ConfigLoggingEntry.glinelog[0] = '\0';
1882 <  ConfigLoggingEntry.killlog[0] = '\0';
1883 <  ConfigLoggingEntry.operspylog[0] = '\0';
1884 <  ConfigLoggingEntry.ioerrlog[0] = '\0';
1885 <  ConfigLoggingEntry.failed_operlog[0] = '\0';
1843 <
1844 <  ConfigChannel.disable_fake_channels = NO;
1845 <  ConfigChannel.restrict_channels = NO;
1846 <  ConfigChannel.disable_local_channels = NO;
1847 <  ConfigChannel.use_invex = YES;
1848 <  ConfigChannel.use_except = YES;
1849 <  ConfigChannel.use_knock = YES;
1878 >  ConfigLoggingEntry.timestamp = 1;
1879 >
1880 >  ConfigChannel.disable_fake_channels = 0;
1881 >  ConfigChannel.restrict_channels = 0;
1882 >  ConfigChannel.disable_local_channels = 0;
1883 >  ConfigChannel.use_invex = 1;
1884 >  ConfigChannel.use_except = 1;
1885 >  ConfigChannel.use_knock = 1;
1886    ConfigChannel.knock_delay = 300;
1887    ConfigChannel.knock_delay_channel = 60;
1888    ConfigChannel.max_chans_per_user = 15;
1889 <  ConfigChannel.quiet_on_ban = YES;
1889 >  ConfigChannel.quiet_on_ban = 1;
1890    ConfigChannel.max_bans = 25;
1891    ConfigChannel.default_split_user_count = 0;
1892    ConfigChannel.default_split_server_count = 0;
1893 <  ConfigChannel.no_join_on_split = NO;
1894 <  ConfigChannel.no_create_on_split = NO;
1895 <  ConfigChannel.burst_topicwho = YES;
1893 >  ConfigChannel.no_join_on_split = 0;
1894 >  ConfigChannel.no_create_on_split = 0;
1895 >  ConfigChannel.burst_topicwho = 1;
1896  
1897 <  ConfigServerHide.flatten_links = NO;
1897 >  ConfigServerHide.flatten_links = 0;
1898    ConfigServerHide.links_delay = 300;
1899 <  ConfigServerHide.hidden = NO;
1900 <  ConfigServerHide.disable_hidden = NO;
1901 <  ConfigServerHide.hide_servers = NO;
1899 >  ConfigServerHide.hidden = 0;
1900 >  ConfigServerHide.disable_hidden = 0;
1901 >  ConfigServerHide.hide_servers = 0;
1902    DupString(ConfigServerHide.hidden_name, NETWORK_NAME_DEFAULT);
1903 <  ConfigServerHide.hide_server_ips = NO;
1903 >  ConfigServerHide.hide_server_ips = 0;
1904  
1905    
1906 +  DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT);
1907    ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT;
1908    ConfigFileEntry.gline_min_cidr = 16;
1909    ConfigFileEntry.gline_min_cidr6 = 48;
1910 <  ConfigFileEntry.invisible_on_connect = YES;
1911 <  ConfigFileEntry.burst_away = NO;
1912 <  ConfigFileEntry.use_whois_actually = YES;
1913 <  ConfigFileEntry.tkline_expire_notices = YES;
1914 <  ConfigFileEntry.hide_spoof_ips = YES;
1915 <  ConfigFileEntry.ignore_bogus_ts = NO;
1916 <  ConfigFileEntry.disable_auth = NO;
1917 <  ConfigFileEntry.disable_remote = NO;
1910 >  ConfigFileEntry.invisible_on_connect = 1;
1911 >  ConfigFileEntry.burst_away = 0;
1912 >  ConfigFileEntry.use_whois_actually = 1;
1913 >  ConfigFileEntry.tkline_expire_notices = 1;
1914 >  ConfigFileEntry.hide_spoof_ips = 1;
1915 >  ConfigFileEntry.ignore_bogus_ts = 0;
1916 >  ConfigFileEntry.disable_auth = 0;
1917 >  ConfigFileEntry.disable_remote = 0;
1918    ConfigFileEntry.kill_chase_time_limit = 90;
1919 <  ConfigFileEntry.default_floodcount = 8; /* XXX */
1920 <  ConfigFileEntry.failed_oper_notice = YES;
1921 <  ConfigFileEntry.dots_in_ident = 0;      /* XXX */
1885 <  ConfigFileEntry.dot_in_ip6_addr = YES;
1919 >  ConfigFileEntry.default_floodcount = 8;
1920 >  ConfigFileEntry.failed_oper_notice = 1;
1921 >  ConfigFileEntry.dots_in_ident = 0;
1922    ConfigFileEntry.min_nonwildcard = 4;
1923    ConfigFileEntry.min_nonwildcard_simple = 3;
1924    ConfigFileEntry.max_accept = 20;
1925 <  ConfigFileEntry.anti_nick_flood = NO;   /* XXX */
1925 >  ConfigFileEntry.anti_nick_flood = 0;
1926    ConfigFileEntry.max_nick_time = 20;
1927    ConfigFileEntry.max_nick_changes = 5;
1928 <  ConfigFileEntry.anti_spam_exit_message_time = 0;  /* XXX */
1928 >  ConfigFileEntry.anti_spam_exit_message_time = 0;
1929    ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT;
1930 <  ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;  /* XXX */
1931 <  ConfigFileEntry.kline_with_reason = YES;
1930 >  ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
1931 >  ConfigFileEntry.kline_with_reason = 1;
1932    ConfigFileEntry.kline_reason = NULL;
1933 <  ConfigFileEntry.warn_no_nline = YES;
1934 <  ConfigFileEntry.stats_o_oper_only = NO; /* XXX */
1933 >  ConfigFileEntry.warn_no_nline = 1;
1934 >  ConfigFileEntry.stats_o_oper_only = 0;
1935    ConfigFileEntry.stats_k_oper_only = 1;  /* masked */
1936    ConfigFileEntry.stats_i_oper_only = 1;  /* masked */
1937 <  ConfigFileEntry.stats_P_oper_only = NO;
1937 >  ConfigFileEntry.stats_P_oper_only = 0;
1938    ConfigFileEntry.caller_id_wait = 60;
1939 <  ConfigFileEntry.opers_bypass_callerid = NO;
1939 >  ConfigFileEntry.opers_bypass_callerid = 0;
1940    ConfigFileEntry.pace_wait = 10;
1941    ConfigFileEntry.pace_wait_simple = 1;
1942 <  ConfigFileEntry.short_motd = NO;
1943 <  ConfigFileEntry.ping_cookie = NO;
1944 <  ConfigFileEntry.no_oper_flood = NO;     /* XXX */
1945 <  ConfigFileEntry.true_no_oper_flood = NO;  /* XXX */
1946 <  ConfigFileEntry.oper_pass_resv = YES;
1947 <  ConfigFileEntry.glines = NO;            /* XXX */
1948 <  ConfigFileEntry.gline_time = 12 * 3600; /* XXX */
1913 <  ConfigFileEntry.idletime = 0;
1942 >  ConfigFileEntry.short_motd = 0;
1943 >  ConfigFileEntry.ping_cookie = 0;
1944 >  ConfigFileEntry.no_oper_flood = 0;
1945 >  ConfigFileEntry.true_no_oper_flood = 0;
1946 >  ConfigFileEntry.oper_pass_resv = 1;
1947 >  ConfigFileEntry.glines = 0;
1948 >  ConfigFileEntry.gline_time = 12 * 3600;
1949    ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
1950    ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
1951 <  ConfigFileEntry.oper_only_umodes = UMODE_DEBUG;  /* XXX */
1951 >  ConfigFileEntry.oper_only_umodes = UMODE_DEBUG;
1952    ConfigFileEntry.oper_umodes = UMODE_BOTS | UMODE_LOCOPS | UMODE_SERVNOTICE |
1953 <    UMODE_OPERWALL | UMODE_WALLOP;        /* XXX */
1954 <  DupString(ConfigFileEntry.servlink_path, SLPATH);
1920 < #ifdef HAVE_LIBCRYPTO
1921 <  /* jdc -- This is our default value for a cipher.  According to the
1922 <   *        CRYPTLINK document (doc/cryptlink.txt), BF/128 must be supported
1923 <   *        under all circumstances if cryptlinks are enabled.  So,
1924 <   *        this will be our default.
1925 <   *
1926 <   *        NOTE: I apologise for the hard-coded value of "1" (BF/128).
1927 <   *              This should be moved into a find_cipher() routine.
1928 <   */
1929 <  ConfigFileEntry.default_cipher_preference = &CipherTable[1];
1930 < #endif
1931 <  ConfigFileEntry.use_egd = NO;
1953 >    UMODE_OPERWALL | UMODE_WALLOP;
1954 >  ConfigFileEntry.use_egd = 0;
1955    ConfigFileEntry.egdpool_path = NULL;
1933 #ifdef HAVE_LIBZ
1934  ConfigFileEntry.compression_level = 0;
1935 #endif
1956    ConfigFileEntry.throttle_time = 10;
1957   }
1958  
# Line 1948 | Line 1968 | read_conf(FBFILE *file)
1968    lineno = 0;
1969  
1970    set_default_conf(); /* Set default values prior to conf parsing */
1971 <  ypass = 1;
1971 >  conf_parser_ctx.pass = 1;
1972    yyparse();          /* pick up the classes first */
1973  
1974    fbrewind(file);
1975  
1976 <  ypass = 2;
1976 >  conf_parser_ctx.pass = 2;
1977    yyparse();          /* Load the values from the conf */
1978    validate_conf();    /* Check to make sure some values are still okay. */
1979                        /* Some global values are also loaded here. */
# Line 1969 | Line 1989 | validate_conf(void)
1989    if (ConfigFileEntry.ts_max_delta < TS_MAX_DELTA_MIN)
1990      ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
1991  
1972  if (ConfigFileEntry.servlink_path == NULL)
1973    DupString(ConfigFileEntry.servlink_path, SLPATH);
1974
1992    if (ServerInfo.network_name == NULL)
1993      DupString(ServerInfo.network_name,NETWORK_NAME_DEFAULT);
1994  
1995    if (ServerInfo.network_desc == NULL)
1996      DupString(ServerInfo.network_desc,NETWORK_DESC_DEFAULT);
1997  
1998 +  if (ConfigFileEntry.service_name == NULL)
1999 +    DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT);
2000 +
2001    if ((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
2002        (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
2003      ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX;
# Line 2001 | Line 2021 | lookup_confhost(struct ConfItem *conf)
2021    if (EmptyString(aconf->host) ||
2022        EmptyString(aconf->user))
2023    {
2024 <    ilog(L_ERROR, "Host/server name error: (%s) (%s)",
2024 >    ilog(LOG_TYPE_IRCD, "Host/server name error: (%s) (%s)",
2025           aconf->host, conf->name);
2026      return;
2027    }
# Line 2021 | Line 2041 | lookup_confhost(struct ConfItem *conf)
2041    /* Get us ready for a bind() and don't bother doing dns lookup */
2042    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
2043  
2044 <  if (irc_getaddrinfo(aconf->host, NULL, &hints, &res))
2044 >  if (getaddrinfo(aconf->host, NULL, &hints, &res))
2045    {
2046      conf_dns_lookup(aconf);
2047      return;
# Line 2032 | Line 2052 | lookup_confhost(struct ConfItem *conf)
2052    memcpy(&aconf->ipnum, res->ai_addr, res->ai_addrlen);
2053    aconf->ipnum.ss_len = res->ai_addrlen;
2054    aconf->ipnum.ss.ss_family = res->ai_family;
2055 <  irc_freeaddrinfo(res);
2055 >  freeaddrinfo(res);
2056   }
2057  
2058   /* conf_connect_allowed()
# Line 2071 | Line 2091 | conf_connect_allowed(struct irc_ssaddr *
2091   static struct AccessItem *
2092   find_regexp_kline(const char *uhi[])
2093   {
2094 + #ifdef HAVE_LIBPCRE
2095    const dlink_node *ptr = NULL;
2096  
2097    DLINK_FOREACH(ptr, rkconf_items.head)
# Line 2085 | Line 2106 | find_regexp_kline(const char *uhi[])
2106           !ircd_pcre_exec(aptr->regexhost, uhi[2])))
2107        return aptr;
2108    }
2109 <
2109 > #endif
2110    return NULL;
2111   }
2112  
# Line 2329 | Line 2350 | expire_tklines(dlink_list *tklist)
2350   static const struct oper_privs
2351   {
2352    const unsigned int oprivs;
2332  const unsigned int hidden;
2353    const unsigned char c;
2354   } flag_list[] = {
2355 <  { OPER_FLAG_ADMIN,       OPER_FLAG_HIDDEN_ADMIN,  'A' },
2356 <  { OPER_FLAG_REMOTEBAN,   0,                       'B' },
2357 <  { OPER_FLAG_DIE,         0,                       'D' },
2358 <  { OPER_FLAG_GLINE,       0,                       'G' },
2359 <  { OPER_FLAG_REHASH,      0,                       'H' },
2360 <  { OPER_FLAG_K,           0,                       'K' },
2361 <  { OPER_FLAG_OPERWALL,    0,                       'L' },
2362 <  { OPER_FLAG_N,           0,                       'N' },
2363 <  { OPER_FLAG_GLOBAL_KILL, 0,                       'O' },
2364 <  { OPER_FLAG_REMOTE,      0,                       'R' },
2365 <  { OPER_FLAG_OPER_SPY,    0,                       'S' },
2366 <  { OPER_FLAG_UNKLINE,     0,                       'U' },
2367 <  { OPER_FLAG_X,           0,                       'X' },
2368 <  { 0, 0, '\0' }
2355 >  { OPER_FLAG_ADMIN,       'A' },
2356 >  { OPER_FLAG_REMOTEBAN,   'B' },
2357 >  { OPER_FLAG_DIE,         'D' },
2358 >  { OPER_FLAG_GLINE,       'G' },
2359 >  { OPER_FLAG_REHASH,      'H' },
2360 >  { OPER_FLAG_K,           'K' },
2361 >  { OPER_FLAG_OPERWALL,    'L' },
2362 >  { OPER_FLAG_N,           'N' },
2363 >  { OPER_FLAG_GLOBAL_KILL, 'O' },
2364 >  { OPER_FLAG_REMOTE,      'R' },
2365 >  { OPER_FLAG_OPER_SPY,    'S' },
2366 >  { OPER_FLAG_UNKLINE,     'U' },
2367 >  { OPER_FLAG_X,           'X' },
2368 >  { 0, '\0' }
2369   };
2370  
2371   char *
# Line 2357 | Line 2377 | oper_privs_as_string(const unsigned int
2377  
2378    for (; flag_list[i].oprivs; ++i)
2379    {
2380 <    if ((port & flag_list[i].oprivs) &&
2361 <        (port & flag_list[i].hidden) == 0)
2380 >    if (port & flag_list[i].oprivs)
2381        *privs_ptr++ = flag_list[i].c;
2382      else
2383        *privs_ptr++ = ToLowerTab[flag_list[i].c];
# Line 2383 | Line 2402 | get_oper_name(const struct Client *clien
2402    struct AccessItem *aconf;
2403  
2404    /* +5 for !,@,{,} and null */
2405 <  static char buffer[NICKLEN+USERLEN+HOSTLEN+HOSTLEN+5];
2405 >  static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5];
2406  
2407    if (MyConnect(client_p))
2408    {
# Line 2394 | Line 2413 | get_oper_name(const struct Client *clien
2413  
2414        if (IsConfOperator(aconf))
2415        {
2416 <        ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name,
2417 <                   client_p->username, client_p->host,
2399 <                   conf->name);
2416 >        snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name,
2417 >                 client_p->username, client_p->host, conf->name);
2418          return buffer;
2419        }
2420      }
# Line 2407 | Line 2425 | get_oper_name(const struct Client *clien
2425      assert(0); /* Oper without oper conf! */
2426    }
2427  
2428 <  ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name,
2429 <             client_p->username, client_p->host, client_p->servptr->name);
2428 >  snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name,
2429 >           client_p->username, client_p->host, client_p->servptr->name);
2430    return buffer;
2431   }
2432  
# Line 2425 | Line 2443 | read_conf_files(int cold)
2443    char chanmodes[32];
2444    char chanlimit[32];
2445  
2446 +  conf_parser_ctx.boot = cold;
2447    filename = get_conf_name(CONF_TYPE);
2448  
2449    /* We need to know the initial filename for the yyerror() to report
# Line 2435 | Line 2454 | read_conf_files(int cold)
2454    */
2455    strlcpy(conffilebuf, filename, sizeof(conffilebuf));
2456  
2457 <  if ((conf_fbfile_in = fbopen(filename, "r")) == NULL)
2457 >  if ((conf_parser_ctx.conf_file = fbopen(filename, "r")) == NULL)
2458    {
2459      if (cold)
2460      {
2461 <      ilog(L_CRIT, "Unable to read configuration file '%s': %s",
2461 >      ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s",
2462             filename, strerror(errno));
2463        exit(-1);
2464      }
# Line 2455 | Line 2474 | read_conf_files(int cold)
2474    if (!cold)
2475      clear_out_old_conf();
2476  
2477 <  read_conf(conf_fbfile_in);
2478 <  fbclose(conf_fbfile_in);
2477 >  read_conf(conf_parser_ctx.conf_file);
2478 >  fbclose(conf_parser_ctx.conf_file);
2479  
2480    add_isupport("NETWORK", ServerInfo.network_name, -1);
2481 <  ircsprintf(chanmodes, "b%s%s:%d", ConfigChannel.use_except ? "e" : "",
2482 <             ConfigChannel.use_invex ? "I" : "", ConfigChannel.max_bans);
2481 >  snprintf(chanmodes, sizeof(chanmodes), "b%s%s:%d",
2482 >           ConfigChannel.use_except ? "e" : "",
2483 >           ConfigChannel.use_invex ? "I" : "", ConfigChannel.max_bans);
2484    add_isupport("MAXLIST", chanmodes, -1);
2485    add_isupport("MAXTARGETS", NULL, ConfigFileEntry.max_targets);
2486 +
2487    if (ConfigChannel.disable_local_channels)
2488      add_isupport("CHANTYPES", "#", -1);
2489    else
2490      add_isupport("CHANTYPES", "#&", -1);
2491 <  ircsprintf(chanlimit, "%s:%d", ConfigChannel.disable_local_channels ? "#" : "#&",
2492 <             ConfigChannel.max_chans_per_user);
2491 >
2492 >  snprintf(chanlimit, sizeof(chanlimit), "%s:%d",
2493 >           ConfigChannel.disable_local_channels ? "#" : "#&",
2494 >           ConfigChannel.max_chans_per_user);
2495    add_isupport("CHANLIMIT", chanlimit, -1);
2496 <  ircsprintf(chanmodes, "%s%s%s", ConfigChannel.use_except ? "e" : "",
2497 <             ConfigChannel.use_invex ? "I" : "", "b,k,l,imnpst");
2496 >  snprintf(chanmodes, sizeof(chanmodes), "%s%s%s",
2497 >           ConfigChannel.use_except ? "e" : "",
2498 >           ConfigChannel.use_invex ? "I" : "", "b,k,l,imnprstORS");
2499    add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN);
2500 +
2501    if (ConfigChannel.use_except)
2502      add_isupport("EXCEPTS", "e", -1);
2503    if (ConfigChannel.use_invex)
# Line 2485 | Line 2510 | read_conf_files(int cold)
2510     */
2511    rebuild_isupport_message_line();
2512  
2513 <  parse_conf_file(KLINE_TYPE, cold);
2513 > #ifdef HAVE_LIBPCRE
2514    parse_conf_file(RKLINE_TYPE, cold);
2515 +  parse_conf_file(RXLINE_TYPE, cold);
2516 + #endif
2517 +  parse_conf_file(KLINE_TYPE, cold);
2518    parse_conf_file(DLINE_TYPE, cold);
2519    parse_conf_file(XLINE_TYPE, cold);
2492  parse_conf_file(RXLINE_TYPE, cold);
2520    parse_conf_file(NRESV_TYPE, cold);
2521    parse_conf_file(CRESV_TYPE, cold);
2522   }
# Line 2509 | Line 2536 | parse_conf_file(int type, int cold)
2536    if ((file = fbopen(filename, "r")) == NULL)
2537    {
2538      if (cold)
2539 <      ilog(L_ERROR, "Unable to read configuration file '%s': %s",
2539 >      ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s",
2540             filename, strerror(errno));
2541      else
2542        sendto_realops_flags(UMODE_ALL, L_ALL,
# Line 2540 | Line 2567 | clear_out_old_conf(void)
2567    dlink_list *free_items [] = {
2568      &server_items,   &oconf_items,    &hub_items, &leaf_items,
2569       &uconf_items,   &xconf_items, &rxconf_items, &rkconf_items,
2570 <     &nresv_items, &cluster_items,  &gdeny_items, NULL
2570 >     &nresv_items, &cluster_items,  &gdeny_items, &service_items, NULL
2571    };
2572  
2573    dlink_list ** iterator = free_items; /* C is dumb */
# Line 2641 | Line 2668 | clear_out_old_conf(void)
2668    clear_out_address_conf();
2669  
2670    /* clean out module paths */
2644 #ifndef STATIC_MODULES
2671    mod_clear_paths();
2646 #endif
2672  
2673    /* clean out ServerInfo */
2674    MyFree(ServerInfo.description);
# Line 2685 | Line 2710 | clear_out_old_conf(void)
2710     */
2711  
2712    /* clean out general */
2713 <  MyFree(ConfigFileEntry.servlink_path);
2714 <  ConfigFileEntry.servlink_path = NULL;
2715 < #ifdef HAVE_LIBCRYPTO
2691 <  ConfigFileEntry.default_cipher_preference = NULL;
2692 < #endif /* HAVE_LIBCRYPTO */
2713 >  MyFree(ConfigFileEntry.service_name);
2714 >  ConfigFileEntry.service_name = NULL;
2715 >
2716    delete_isupport("INVEX");
2717    delete_isupport("EXCEPTS");
2718   }
# Line 2884 | Line 2907 | find_class(const char *classname)
2907   {
2908    struct ConfItem *conf;
2909  
2910 <  if ((conf = find_exact_name_conf(CLASS_TYPE, classname, NULL, NULL)) != NULL)
2910 >  if ((conf = find_exact_name_conf(CLASS_TYPE, NULL, classname, NULL, NULL)) != NULL)
2911      return conf;
2912  
2913    return class_default;
# Line 2943 | Line 2966 | init_class(void)
2966   * output       - sendq for this client as found from its class
2967   * side effects - NONE
2968   */
2969 < unsigned long
2969 > unsigned int
2970   get_sendq(struct Client *client_p)
2971   {
2972 <  unsigned long sendq = DEFAULT_SENDQ;
2972 >  unsigned int sendq = DEFAULT_SENDQ;
2973    dlink_node *ptr;
2974    struct ConfItem *conf;
2975    struct ConfItem *class_conf;
# Line 3044 | Line 3067 | conf_add_server(struct ConfItem *conf, c
3067    if (!aconf->host || !conf->name)
3068    {
3069      sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block");
3070 <    ilog(L_WARN, "Bad connect block");
3070 >    ilog(LOG_TYPE_IRCD, "Bad connect block");
3071      return -1;
3072    }
3073  
3074 <  if (EmptyString(aconf->passwd) && !IsConfCryptLink(aconf))
3074 >  if (EmptyString(aconf->passwd))
3075    {
3076      sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block, name %s",
3077                           conf->name);
3078 <    ilog(L_WARN, "Bad connect block, host %s", conf->name);
3078 >    ilog(LOG_TYPE_IRCD, "Bad connect block, host %s", conf->name);
3079      return -1;
3080    }
3081  
# Line 3079 | Line 3102 | conf_add_server(struct ConfItem *conf, c
3102    return 0;
3103   }
3104  
3082 /* conf_add_d_conf()
3083 *
3084 * inputs       - pointer to config item
3085 * output       - NONE
3086 * side effects - Add a d/D line
3087 */
3088 void
3089 conf_add_d_conf(struct AccessItem *aconf)
3090 {
3091  if (aconf->host == NULL)
3092    return;
3093
3094  aconf->user = NULL;
3095
3096  /* XXX - Should 'd' ever be in the old conf? For new conf we don't
3097   *       need this anyway, so I will disable it for now... -A1kmm
3098   */
3099  if (parse_netmask(aconf->host, NULL, NULL) == HM_HOST)
3100  {
3101    ilog(L_WARN, "Invalid Dline %s ignored", aconf->host);
3102    free_access_item(aconf);
3103  }
3104  else
3105  {
3106    /* XXX ensure user is NULL */
3107    MyFree(aconf->user);
3108    aconf->user = NULL;
3109    add_conf_by_address(CONF_DLINE, aconf);
3110  }
3111 }
3112
3105   /* yyerror()
3106   *
3107   * inputs       - message from parser
# Line 3121 | Line 3113 | yyerror(const char *msg)
3113   {
3114    char newlinebuf[IRCD_BUFSIZE];
3115  
3116 <  if (ypass != 1)
3116 >  if (conf_parser_ctx.pass != 1)
3117      return;
3118  
3119    strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
3120    sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %u: %s: %s",
3121                         conffilebuf, lineno + 1, msg, newlinebuf);
3122 <  ilog(L_WARN, "\"%s\", line %u: %s: %s",
3122 >  ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
3123         conffilebuf, lineno + 1, msg, newlinebuf);
3124   }
3125  
# Line 3157 | Line 3149 | conf_yy_fatal_error(const char *msg)
3149   * Originally written by Dianora (Diane, db@db.net)
3150   */
3151   time_t
3152 < valid_tkline(char *p, int minutes)
3152 > valid_tkline(const char *p, int minutes)
3153   {
3154    time_t result = 0;
3155  
3156 <  while (*p)
3156 >  for (; *p; ++p)
3157    {
3158 <    if (IsDigit(*p))
3167 <    {
3168 <      result *= 10;
3169 <      result += ((*p) & 0xF);
3170 <      p++;
3171 <    }
3172 <    else
3158 >    if (!IsDigit(*p))
3159        return 0;
3160 +
3161 +    result *= 10;
3162 +    result += ((*p) & 0xF);
3163    }
3164  
3165 <  /* in the degenerate case where oper does a /quote kline 0 user@host :reason
3165 >  /*
3166 >   * In the degenerate case where oper does a /quote kline 0 user@host :reason
3167     * i.e. they specifically use 0, I am going to return 1 instead
3168     * as a return value of non-zero is used to flag it as a temporary kline
3169     */
3180
3170    if (result == 0)
3171      result = 1;
3172  
# Line 3278 | Line 3267 | valid_wild_card(struct Client *source_p,
3267   *                if target_server is NULL and an "ON" is found error
3268   *                is reported.
3269   *                if reason pointer is NULL ignore pointer,
3270 < *                this allows usee of parse_a_line in unkline etc.
3270 > *                this allows use of parse_a_line in unkline etc.
3271   *
3272   * - Dianora
3273   */
# Line 3348 | Line 3337 | parse_aline(const char *cmd, struct Clie
3337          return -1;
3338        }
3339  
3340 <      if (!IsOperRemoteBan(source_p))
3340 >      if (!HasOFlag(source_p, OPER_FLAG_REMOTEBAN))
3341        {
3342          sendto_one(source_p, form_str(ERR_NOPRIVS),
3343                     me.name, source_p->name, "remoteban");
# Line 3385 | Line 3374 | parse_aline(const char *cmd, struct Clie
3374        return -1;
3375      }
3376  
3377 <    if ((parse_flags & AWILD) && !valid_wild_card(source_p, YES, 2, *up_p, *h_p))
3377 >    if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 2, *up_p, *h_p))
3378        return -1;
3379    }
3380    else
3381 <    if ((parse_flags & AWILD) && !valid_wild_card(source_p, YES, 1, *up_p))
3381 >    if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 1, *up_p))
3382        return -1;
3383  
3384    if (reason != NULL)
# Line 3397 | Line 3386 | parse_aline(const char *cmd, struct Clie
3386      if (parc != 0 && !EmptyString(*parv))
3387      {
3388        *reason = *parv;
3389 <      if (!valid_comment(source_p, *reason, YES))
3389 >      if (!valid_comment(source_p, *reason, 1))
3390          return -1;
3391      }
3392      else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines