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 1459 by michael, Fri Jul 6 14:23:09 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 1833 | Line 1790 | set_default_conf(void)
1790    ConfigChannel.use_knock = 1;
1791    ConfigChannel.knock_delay = 300;
1792    ConfigChannel.knock_delay_channel = 60;
1793 <  ConfigChannel.max_chans_per_user = 15;
1793 >  ConfigChannel.max_chans_per_user = 25;
1794 >  ConfigChannel.max_chans_per_oper = 50;
1795    ConfigChannel.quiet_on_ban = 1;
1796    ConfigChannel.max_bans = 25;
1797    ConfigChannel.default_split_user_count = 0;
1798    ConfigChannel.default_split_server_count = 0;
1799    ConfigChannel.no_join_on_split = 0;
1800    ConfigChannel.no_create_on_split = 0;
1843 –  ConfigChannel.burst_topicwho = 1;
1801  
1802    ConfigServerHide.flatten_links = 0;
1803    ConfigServerHide.links_delay = 300;
# Line 1853 | Line 1810 | set_default_conf(void)
1810    
1811    DupString(ConfigFileEntry.service_name, SERVICE_NAME_DEFAULT);
1812    ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT;
1813 +  ConfigFileEntry.glines = 0;
1814 +  ConfigFileEntry.gline_time = 12 * 3600;
1815 +  ConfigFileEntry.gline_request_time = GLINE_REQUEST_EXPIRE_DEFAULT;
1816    ConfigFileEntry.gline_min_cidr = 16;
1817    ConfigFileEntry.gline_min_cidr6 = 48;
1818    ConfigFileEntry.invisible_on_connect = 1;
# Line 1892 | Line 1852 | set_default_conf(void)
1852    ConfigFileEntry.no_oper_flood = 0;
1853    ConfigFileEntry.true_no_oper_flood = 0;
1854    ConfigFileEntry.oper_pass_resv = 1;
1895 –  ConfigFileEntry.glines = 0;
1896 –  ConfigFileEntry.gline_time = 12 * 3600;
1855    ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
1856    ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
1857    ConfigFileEntry.oper_only_umodes = UMODE_DEBUG;
# Line 1966 | Line 1924 | lookup_confhost(struct ConfItem *conf)
1924  
1925    aconf = map_to_conf(conf);
1926  
1927 <  if (EmptyString(aconf->host) ||
1970 <      EmptyString(aconf->user))
1927 >  if (has_wildcards(aconf->host))
1928    {
1929      ilog(LOG_TYPE_IRCD, "Host/server name error: (%s) (%s)",
1930           aconf->host, conf->name);
1931      return;
1932    }
1933  
1977 –  if (strchr(aconf->host, '*') ||
1978 –      strchr(aconf->host, '?'))
1979 –    return;
1980 –
1934    /* Do name lookup now on hostnames given and store the
1935     * ip numbers in conf structure.
1936     */
# Line 2419 | Line 2372 | clear_out_old_conf(void)
2372    dlink_list *free_items [] = {
2373      &server_items,   &oconf_items,
2374       &uconf_items,   &xconf_items, &rxconf_items, &rkconf_items,
2375 <     &nresv_items, &cluster_items,  &gdeny_items, &service_items, NULL
2375 >     &nresv_items, &cluster_items,  &service_items, NULL
2376    };
2377  
2378    dlink_list ** iterator = free_items; /* C is dumb */

Diff Legend

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