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-8/src/conf.c (file contents):
Revision 1393 by michael, Wed May 2 19:17:37 2012 UTC vs.
Revision 1495 by michael, Sun Aug 5 09:35:42 2012 UTC

# Line 66 | Line 66 | dlink_list rxconf_items  = { NULL, NULL,
66   dlink_list rkconf_items  = { NULL, NULL, 0 };
67   dlink_list nresv_items   = { NULL, NULL, 0 };
68   dlink_list class_items   = { NULL, NULL, 0 };
69 – dlink_list gdeny_items   = { NULL, NULL, 0 };
69  
70   dlink_list temporary_xlines  = { NULL, NULL, 0 };
71   dlink_list temporary_resv = { NULL, NULL, 0 };
# Line 255 | Line 254 | make_conf_item(ConfType type)
254      dlinkAdd(conf, &conf->node, &uconf_items);
255      break;
256  
258 –  case GDENY_TYPE:
259 –    conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem) +
260 –                                       sizeof(struct AccessItem));
261 –    dlinkAdd(conf, &conf->node, &gdeny_items);
262 –    break;
263 –
257    case XLINE_TYPE:
258      conf = (struct ConfItem *)MyMalloc(sizeof(struct ConfItem) +
259                                         sizeof(struct MatchItem));
# Line 364 | Line 357 | delete_conf_item(struct ConfItem *conf)
357      MyFree(aconf->oper_reason);
358      MyFree(aconf->user);
359      MyFree(aconf->host);
367 –    MyFree(aconf->cipher_list);
360   #ifdef HAVE_LIBCRYPTO
361 +    MyFree(aconf->cipher_list);
362 +
363      if (aconf->rsa_public_key)
364        RSA_free(aconf->rsa_public_key);
365      MyFree(aconf->rsa_public_key_file);
# Line 472 | Line 466 | delete_conf_item(struct ConfItem *conf)
466      MyFree(conf);
467      break;
468  
475 –  case GDENY_TYPE:
476 –    aconf = map_to_conf(conf);
477 –    MyFree(aconf->user);
478 –    MyFree(aconf->host);
479 –    dlinkDelete(&conf->node, &gdeny_items);
480 –    MyFree(conf);
481 –    break;
482 –
469    case CLUSTER_TYPE:
470      dlinkDelete(&conf->node, &cluster_items);
471      MyFree(conf);
# Line 548 | Line 534 | report_confitem_types(struct Client *sou
534  
535    switch (type)
536    {
551 –  case GDENY_TYPE:
552 –    DLINK_FOREACH(ptr, gdeny_items.head)
553 –    {
554 –      conf = ptr->data;
555 –      aconf = map_to_conf(conf);
556 –
557 –      p = buf;
558 –
559 –      if (aconf->flags & GDENY_BLOCK)
560 –        *p++ = 'B';
561 –      else
562 –        *p++ = 'b';
563 –
564 –      if (aconf->flags & GDENY_REJECT)
565 –        *p++ = 'R';
566 –      else
567 –        *p++ = 'r';
568 –
569 –      *p = '\0';
570 –
571 –      sendto_one(source_p, ":%s %d %s V %s@%s %s %s",
572 –                 me.name, RPL_STATSDEBUG, source_p->name,
573 –                 aconf->user, aconf->host, conf->name, buf);
574 –    }
575 –    break;
576 –
537    case XLINE_TYPE:
538      DLINK_FOREACH(ptr, xconf_items.head)
539      {
# Line 680 | Line 640 | report_confitem_types(struct Client *sou
640                   classitem->con_freq,
641                   classitem->max_total, classitem->max_sendq,
642                   classitem->curr_user_count,
643 +                 classitem->number_per_cidr, classitem->cidr_bitlen_ipv4,
644 +                 classitem->number_per_cidr, classitem->cidr_bitlen_ipv6,
645                   classitem->active ? "active" : "disabled");
646      }
647      break;
# Line 1325 | Line 1287 | detach_conf(struct Client *client_p, Con
1287   int
1288   attach_conf(struct Client *client_p, struct ConfItem *conf)
1289   {
1290 +  struct AccessItem *aconf = map_to_conf(conf);
1291 +  struct ClassItem *aclass = map_to_conf(aconf->class_ptr);
1292 +
1293    if (dlinkFind(&client_p->localClient->confs, conf) != NULL)
1294      return 1;
1295  
1296 <  if (conf->type == CLIENT_TYPE ||
1297 <      conf->type == SERVER_TYPE ||
1333 <      conf->type == OPER_TYPE)
1334 <  {
1335 <    struct AccessItem *aconf = map_to_conf(conf);
1336 <    struct ClassItem *aclass = map_to_conf(aconf->class_ptr);
1337 <
1338 <    if (IsConfIllegal(aconf))
1339 <      return NOT_AUTHORIZED;
1340 <
1341 <    if (conf->type == CLIENT_TYPE)
1342 <      if (cidr_limit_reached(IsConfExemptLimits(aconf),
1343 <                             &client_p->localClient->ip, aclass))
1344 <        return TOO_MANY;    /* Already at maximum allowed */
1296 >  if (IsConfIllegal(aconf)) /* TBV: can't happen */
1297 >    return NOT_AUTHORIZED;
1298  
1299 <    aclass->curr_user_count++;
1300 <    aconf->clients++;
1301 <  }
1299 >  if (conf->type == CLIENT_TYPE)
1300 >    if (cidr_limit_reached(IsConfExemptLimits(aconf),
1301 >                           &client_p->localClient->ip, aclass))
1302 >      return TOO_MANY;    /* Already at maximum allowed */
1303 >
1304 >  aclass->curr_user_count++;
1305 >  aconf->clients++;
1306  
1307    dlinkAdd(conf, make_dlink_node(), &client_p->localClient->confs);
1308  
# Line 1827 | Line 1784 | set_default_conf(void)
1784  
1785    ConfigChannel.disable_fake_channels = 0;
1786    ConfigChannel.restrict_channels = 0;
1830 –  ConfigChannel.disable_local_channels = 0;
1831 –  ConfigChannel.use_invex = 1;
1832 –  ConfigChannel.use_except = 1;
1833 –  ConfigChannel.use_knock = 1;
1787    ConfigChannel.knock_delay = 300;
1788    ConfigChannel.knock_delay_channel = 60;
1789 <  ConfigChannel.max_chans_per_user = 15;
1789 >  ConfigChannel.max_chans_per_user = 25;
1790 >  ConfigChannel.max_chans_per_oper = 50;
1791    ConfigChannel.quiet_on_ban = 1;
1792    ConfigChannel.max_bans = 25;
1793    ConfigChannel.default_split_user_count = 0;
1794    ConfigChannel.default_split_server_count = 0;
1795    ConfigChannel.no_join_on_split = 0;
1796    ConfigChannel.no_create_on_split = 0;
1843 –  ConfigChannel.burst_topicwho = 1;
1797  
1798    ConfigServerHide.flatten_links = 0;
1799    ConfigServerHide.links_delay = 300;
1800    ConfigServerHide.hidden = 0;
1848 –  ConfigServerHide.disable_hidden = 0;
1801    ConfigServerHide.hide_servers = 0;
1802    DupString(ConfigServerHide.hidden_name, NETWORK_NAME_DEFAULT);
1803    ConfigServerHide.hide_server_ips = 0;
# Line 1853 | Line 1805 | set_default_conf(void)
1805    
1806    DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT);
1807    ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT;
1808 +  ConfigFileEntry.glines = 0;
1809 +  ConfigFileEntry.gline_time = 12 * 3600;
1810 +  ConfigFileEntry.gline_request_time = GLINE_REQUEST_EXPIRE_DEFAULT;
1811    ConfigFileEntry.gline_min_cidr = 16;
1812    ConfigFileEntry.gline_min_cidr6 = 48;
1813    ConfigFileEntry.invisible_on_connect = 1;
# Line 1892 | Line 1847 | set_default_conf(void)
1847    ConfigFileEntry.no_oper_flood = 0;
1848    ConfigFileEntry.true_no_oper_flood = 0;
1849    ConfigFileEntry.oper_pass_resv = 1;
1895 –  ConfigFileEntry.glines = 0;
1896 –  ConfigFileEntry.gline_time = 12 * 3600;
1850    ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
1851    ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
1852    ConfigFileEntry.oper_only_umodes = UMODE_DEBUG;
# Line 1966 | Line 1919 | lookup_confhost(struct ConfItem *conf)
1919  
1920    aconf = map_to_conf(conf);
1921  
1922 <  if (EmptyString(aconf->host) ||
1970 <      EmptyString(aconf->user))
1922 >  if (has_wildcards(aconf->host))
1923    {
1924      ilog(LOG_TYPE_IRCD, "Host/server name error: (%s) (%s)",
1925           aconf->host, conf->name);
1926      return;
1927    }
1928  
1977 –  if (strchr(aconf->host, '*') ||
1978 –      strchr(aconf->host, '?'))
1979 –    return;
1980 –
1929    /* Do name lookup now on hostnames given and store the
1930     * ip numbers in conf structure.
1931     */
# Line 2330 | Line 2278 | read_conf_files(int cold)
2278    fclose(conf_parser_ctx.conf_file);
2279  
2280    add_isupport("NETWORK", ServerInfo.network_name, -1);
2281 <  snprintf(chanmodes, sizeof(chanmodes), "b%s%s:%d",
2282 <           ConfigChannel.use_except ? "e" : "",
2335 <           ConfigChannel.use_invex ? "I" : "", ConfigChannel.max_bans);
2281 >  snprintf(chanmodes, sizeof(chanmodes), "beI:%d",
2282 >           ConfigChannel.max_bans);
2283    add_isupport("MAXLIST", chanmodes, -1);
2284    add_isupport("MAXTARGETS", NULL, ConfigFileEntry.max_targets);
2285  
2286 <  if (ConfigChannel.disable_local_channels)
2340 <    add_isupport("CHANTYPES", "#", -1);
2341 <  else
2342 <    add_isupport("CHANTYPES", "#&", -1);
2286 >  add_isupport("CHANTYPES", "#", -1);
2287  
2288 <  snprintf(chanlimit, sizeof(chanlimit), "%s:%d",
2345 <           ConfigChannel.disable_local_channels ? "#" : "#&",
2288 >  snprintf(chanlimit, sizeof(chanlimit), "#:%d",
2289             ConfigChannel.max_chans_per_user);
2290    add_isupport("CHANLIMIT", chanlimit, -1);
2291 <  snprintf(chanmodes, sizeof(chanmodes), "%s%s%s",
2292 <           ConfigChannel.use_except ? "e" : "",
2350 <           ConfigChannel.use_invex ? "I" : "", "b,k,l,imnprstORS");
2291 >  snprintf(chanmodes, sizeof(chanmodes), "%s",
2292 >           "beI,k,l,imnprstORS");
2293    add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN);
2294  
2295 <  if (ConfigChannel.use_except)
2296 <    add_isupport("EXCEPTS", "e", -1);
2355 <  if (ConfigChannel.use_invex)
2356 <    add_isupport("INVEX", "I", -1);
2295 >  add_isupport("EXCEPTS", "e", -1);
2296 >  add_isupport("INVEX", "I", -1);
2297    add_isupport("CHANMODES", chanmodes, -1);
2298  
2299    /*
# Line 2419 | Line 2359 | clear_out_old_conf(void)
2359    dlink_list *free_items [] = {
2360      &server_items,   &oconf_items,
2361       &uconf_items,   &xconf_items, &rxconf_items, &rkconf_items,
2362 <     &nresv_items, &cluster_items,  &gdeny_items, &service_items, NULL
2362 >     &nresv_items, &cluster_items,  &service_items, NULL
2363    };
2364  
2365    dlink_list ** iterator = free_items; /* C is dumb */

Diff Legend

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