/[svn]/ircd-hybrid/branches/8.2.x/src/conf.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.2.x/src/conf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7281 by michael, Sun Feb 7 18:02:24 2016 UTC revision 7303 by michael, Wed Feb 10 10:34:25 2016 UTC
# Line 29  Line 29 
29  #include "ircd_defs.h"  #include "ircd_defs.h"
30  #include "conf.h"  #include "conf.h"
31  #include "conf_cluster.h"  #include "conf_cluster.h"
32    #include "conf_gecos.h"
33  #include "conf_pseudo.h"  #include "conf_pseudo.h"
34  #include "conf_resv.h"  #include "conf_resv.h"
35  #include "conf_service.h"  #include "conf_service.h"
# Line 72  struct conf_parser_context conf_parser_c Line 73  struct conf_parser_context conf_parser_c
73  /* general conf items link list root, other than k lines etc. */  /* general conf items link list root, other than k lines etc. */
74  dlink_list server_items;  dlink_list server_items;
75  dlink_list operator_items;  dlink_list operator_items;
 dlink_list gecos_items;  
76    
77  extern unsigned int lineno;  extern unsigned int lineno;
78  extern char linebuf[];  extern char linebuf[];
# Line 134  map_to_list(enum maskitem_type type) Line 134  map_to_list(enum maskitem_type type)
134  {  {
135    switch (type)    switch (type)
136    {    {
     case CONF_XLINE:  
       return &gecos_items;  
       break;  
137      case CONF_OPER:      case CONF_OPER:
138        return &operator_items;        return &operator_items;
139        break;        break;
# Line 544  find_matching_name_conf(enum maskitem_ty Line 541  find_matching_name_conf(enum maskitem_ty
541    
542    switch (type)    switch (type)
543    {    {
   case CONF_XLINE:  
     DLINK_FOREACH(node, list->head)  
     {  
       conf = node->data;  
   
       if (EmptyString(conf->name))  
         continue;  
       if (name && !match(conf->name, name))  
       {  
         if ((user == NULL && (host == NULL)))  
           return conf;  
         if ((conf->modes & flags) != flags)  
           continue;  
         if (EmptyString(conf->user) || EmptyString(conf->host))  
           return conf;  
         if (!match(conf->user, user) && !match(conf->host, host))  
           return conf;  
       }  
     }  
       break;  
   
544    case CONF_SERVER:    case CONF_SERVER:
545      DLINK_FOREACH(node, list->head)      DLINK_FOREACH(node, list->head)
546      {      {
# Line 602  find_exact_name_conf(enum maskitem_type Line 578  find_exact_name_conf(enum maskitem_type
578    
579    switch(type)    switch(type)
580    {    {
   case CONF_XLINE:  
     DLINK_FOREACH(node, list->head)  
     {  
       conf = node->data;  
   
       if (EmptyString(conf->name))  
         continue;  
   
       if (irccmp(conf->name, name) == 0)  
       {  
         if ((user == NULL && (host == NULL)))  
           return conf;  
         if (EmptyString(conf->user) || EmptyString(conf->host))  
           return conf;  
         if (!match(conf->user, user) && !match(conf->host, host))  
           return conf;  
       }  
     }  
     break;  
   
581    case CONF_OPER:    case CONF_OPER:
582      DLINK_FOREACH(node, list->head)      DLINK_FOREACH(node, list->head)
583      {      {
# Line 930  conf_connect_allowed(struct irc_ssaddr * Line 886  conf_connect_allowed(struct irc_ssaddr *
886    return 0;    return 0;
887  }  }
888    
 /* expire_tklines()  
  *  
  * inputs       - tkline list pointer  
  * output       - NONE  
  * side effects - expire tklines  
  */  
 static void  
 expire_tklines(dlink_list *list)  
 {  
   dlink_node *node = NULL, *node_next = NULL;  
   
   DLINK_FOREACH_SAFE(node, node_next, list->head)  
   {  
     struct MaskItem *conf = node->data;  
   
     if (!conf->until || conf->until > CurrentTime)  
       continue;  
   
     if (ConfigGeneral.tkline_expire_notices)  
       sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, "Temporary %s for [%s] expired",  
                            (conf->type == CONF_XLINE) ? "X-line" : "RESV", conf->name);  
     conf_free(conf);  
   }  
 }  
   
889  /* cleanup_tklines()  /* cleanup_tklines()
890   *   *
891   * inputs       - NONE   * inputs       - NONE
# Line 966  void Line 897  void
897  cleanup_tklines(void *unused)  cleanup_tklines(void *unused)
898  {  {
899    hostmask_expire_temporary();    hostmask_expire_temporary();
900    expire_tklines(&gecos_items);    gecos_expire();
901    resv_expire();    resv_expire();
902  }  }
903    
# Line 1083  clear_out_old_conf(void) Line 1014  clear_out_old_conf(void)
1014  {  {
1015    dlink_node *node = NULL, *node_next = NULL;    dlink_node *node = NULL, *node_next = NULL;
1016    dlink_list *free_items [] = {    dlink_list *free_items [] = {
1017      &server_items,   &operator_items,      &server_items, &operator_items, NULL
      &gecos_items, NULL  
1018    };    };
1019    
1020    dlink_list ** iterator = free_items; /* C is dumb */    dlink_list ** iterator = free_items; /* C is dumb */
# Line 1100  clear_out_old_conf(void) Line 1030  clear_out_old_conf(void)
1030        struct MaskItem *conf = node->data;        struct MaskItem *conf = node->data;
1031    
1032        conf->active = 0;        conf->active = 0;
1033          dlinkDelete(&conf->node, *iterator);
1034    
1035        if (!IsConfDatabase(conf))        if (!conf->ref_count)
1036        {          conf_free(conf);
         dlinkDelete(&conf->node, *iterator);  
   
         if (!conf->ref_count)  
           conf_free(conf);  
       }  
1037      }      }
1038    }    }
1039    
# Line 1127  clear_out_old_conf(void) Line 1053  clear_out_old_conf(void)
1053    
1054    cluster_clear();  /* Clear cluster {} items */    cluster_clear();  /* Clear cluster {} items */
1055    
1056      gecos_clear();  /* Clear gecos {} items */
1057    
1058    resv_clear();  /* Clear resv {} items */    resv_clear();  /* Clear resv {} items */
1059    
1060    service_clear();  /* Clear service {} items */    service_clear();  /* Clear service {} items */

Legend:
Removed from v.7281  
changed lines
  Added in v.7303

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.30