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 7282 by michael, Sun Feb 7 18:04:26 2016 UTC vs.
Revision 7304 by michael, Wed Feb 10 10:45:46 2016 UTC

# Line 29 | Line 29
29   #include "ircd_defs.h"
30   #include "conf.h"
31   #include "conf_cluster.h"
32 + #include "conf_gecos.h"
33   #include "conf_pseudo.h"
34   #include "conf_resv.h"
35   #include "conf_service.h"
# Line 72 | Line 73 | struct conf_parser_context conf_parser_c
73   /* general conf items link list root, other than k lines etc. */
74   dlink_list server_items;
75   dlink_list operator_items;
75 dlink_list gecos_items;
76  
77   extern unsigned int lineno;
78   extern char linebuf[];
# Line 134 | Line 134 | map_to_list(enum maskitem_type type)
134   {
135    switch (type)
136    {
137    case CONF_XLINE:
138      return &gecos_items;
139      break;
137      case CONF_OPER:
138        return &operator_items;
139        break;
# Line 544 | Line 541 | find_matching_name_conf(enum maskitem_ty
541  
542    switch (type)
543    {
547  case CONF_XLINE:
548    DLINK_FOREACH(node, list->head)
549    {
550      conf = node->data;
551
552      if (EmptyString(conf->name))
553        continue;
554      if (name && !match(conf->name, name))
555      {
556        if ((user == NULL && (host == NULL)))
557          return conf;
558        if ((conf->modes & flags) != flags)
559          continue;
560        if (EmptyString(conf->user) || EmptyString(conf->host))
561          return conf;
562        if (!match(conf->user, user) && !match(conf->host, host))
563          return conf;
564      }
565    }
566      break;
567
544    case CONF_SERVER:
545      DLINK_FOREACH(node, list->head)
546      {
# Line 602 | Line 578 | find_exact_name_conf(enum maskitem_type
578  
579    switch(type)
580    {
605  case CONF_XLINE:
606    DLINK_FOREACH(node, list->head)
607    {
608      conf = node->data;
609
610      if (EmptyString(conf->name))
611        continue;
612
613      if (irccmp(conf->name, name) == 0)
614      {
615        if ((user == NULL && (host == NULL)))
616          return conf;
617        if (EmptyString(conf->user) || EmptyString(conf->host))
618          return conf;
619        if (!match(conf->user, user) && !match(conf->host, host))
620          return conf;
621      }
622    }
623    break;
624
581    case CONF_OPER:
582      DLINK_FOREACH(node, list->head)
583      {
# Line 930 | Line 886 | conf_connect_allowed(struct irc_ssaddr *
886    return 0;
887   }
888  
933 /* expire_tklines()
934 *
935 * inputs       - tkline list pointer
936 * output       - NONE
937 * side effects - expire tklines
938 */
939 static void
940 expire_tklines(dlink_list *list)
941 {
942  dlink_node *node = NULL, *node_next = NULL;
943
944  DLINK_FOREACH_SAFE(node, node_next, list->head)
945  {
946    struct MaskItem *conf = node->data;
947
948    if (!conf->until || conf->until > CurrentTime)
949      continue;
950
951    if (ConfigGeneral.tkline_expire_notices)
952      sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, "Temporary %s for [%s] expired",
953                           (conf->type == CONF_XLINE) ? "X-line" : "RESV", conf->name);
954    conf_free(conf);
955  }
956 }
957
889   /* cleanup_tklines()
890   *
891   * inputs       - NONE
# Line 966 | Line 897 | void
897   cleanup_tklines(void *unused)
898   {
899    hostmask_expire_temporary();
900 <  expire_tklines(&gecos_items);
900 >  gecos_expire();
901    resv_expire();
902   }
903  
# Line 1083 | Line 1014 | clear_out_old_conf(void)
1014   {
1015    dlink_node *node = NULL, *node_next = NULL;
1016    dlink_list *free_items [] = {
1017 <    &server_items,   &operator_items,
1087 <     &gecos_items, NULL
1017 >    &server_items, &operator_items, NULL
1018    };
1019  
1020    dlink_list ** iterator = free_items; /* C is dumb */
# Line 1100 | Line 1030 | clear_out_old_conf(void)
1030        struct MaskItem *conf = node->data;
1031  
1032        conf->active = 0;
1033 +      dlinkDelete(&conf->node, *iterator);
1034  
1035 <      if (!IsConfDatabase(conf))
1036 <      {
1106 <        dlinkDelete(&conf->node, *iterator);
1107 <
1108 <        if (!conf->ref_count)
1109 <          conf_free(conf);
1110 <      }
1035 >      if (!conf->ref_count)
1036 >        conf_free(conf);
1037      }
1038    }
1039  
# Line 1127 | Line 1053 | clear_out_old_conf(void)
1053  
1054    cluster_clear();  /* Clear cluster {} items */
1055  
1056 +  gecos_clear();  /* Clear gecos {} items */
1057 +
1058    resv_clear();  /* Clear resv {} items */
1059  
1060    service_clear();  /* Clear service {} items */

Diff Legend

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