]> jfr.im git - solanum.git/blobdiff - src/s_newconf.c
Merge pull request #53 from ShadowNinja/clarify_U+R
[solanum.git] / src / s_newconf.c
index b26be9de6b677fd1c0358d0d086356c801380456..7ca43ad67ef82880525e7af239ba3dbf5ac7c2cc 100644 (file)
@@ -44,6 +44,8 @@
 #include "newconf.h"
 #include "hash.h"
 #include "irc_dictionary.h"
+#include "s_assert.h"
+#include "logger.h"
 
 rb_dlink_list shared_conf_list;
 rb_dlink_list cluster_conf_list;
@@ -173,7 +175,7 @@ free_remote_conf(struct remote_conf *remote_p)
 }
 
 int
-find_shared_conf(const char *username, const char *host, 
+find_shared_conf(const char *username, const char *host,
                const char *server, int flags)
 {
        struct remote_conf *shared_p;
@@ -215,7 +217,7 @@ propagate_generic(struct Client *source_p, const char *command,
                        "ENCAP %s %s %s",
                        target, command, buffer);
 }
-                       
+
 void
 cluster_generic(struct Client *source_p, const char *command,
                int cltype, int cap, const char *format, ...)
@@ -262,6 +264,7 @@ free_oper_conf(struct oper_conf *oper_p)
        rb_free(oper_p->username);
        rb_free(oper_p->host);
        rb_free(oper_p->name);
+       rb_free(oper_p->certfp);
 
        if(oper_p->passwd)
        {
@@ -486,7 +489,7 @@ find_xline(const char *gecos, int counter)
        {
                aconf = ptr->data;
 
-               if(match_esc(aconf->name, gecos))
+               if(match_esc(aconf->host, gecos))
                {
                        if(counter)
                                aconf->port++;
@@ -507,7 +510,7 @@ find_xline_mask(const char *gecos)
        {
                aconf = ptr->data;
 
-               if(!irccmp(aconf->name, gecos))
+               if(!irccmp(aconf->host, gecos))
                        return aconf;
        }
 
@@ -524,7 +527,7 @@ find_nick_resv(const char *name)
        {
                aconf = ptr->data;
 
-               if(match_esc(aconf->name, name))
+               if(match_esc(aconf->host, name))
                {
                        aconf->port++;
                        return aconf;
@@ -544,7 +547,7 @@ find_nick_resv_mask(const char *name)
        {
                aconf = ptr->data;
 
-               if(!irccmp(aconf->name, name))
+               if(!irccmp(aconf->host, name))
                        return aconf;
        }
 
@@ -651,6 +654,7 @@ valid_temp_time(const char *p)
        return(result * 60);
 }
 
+/* Propagated bans are expired elsewhere. */
 static void
 expire_temp_rxlines(void *unused)
 {
@@ -663,12 +667,14 @@ expire_temp_rxlines(void *unused)
        {
                aconf = ptr->data;
 
+               if(aconf->lifetime != 0)
+                       continue;
                if(aconf->hold && aconf->hold <= rb_current_time())
                {
                        if(ConfigFileEntry.tkline_expire_notices)
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                                "Temporary RESV for [%s] expired",
-                                               aconf->name);
+                                               aconf->host);
 
                        free_conf(aconf);
                        rb_dlinkDestroy(ptr, &resvTable[i]);
@@ -680,12 +686,14 @@ expire_temp_rxlines(void *unused)
        {
                aconf = ptr->data;
 
+               if(aconf->lifetime != 0)
+                       continue;
                if(aconf->hold && aconf->hold <= rb_current_time())
                {
                        if(ConfigFileEntry.tkline_expire_notices)
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                                "Temporary RESV for [%s] expired",
-                                               aconf->name);
+                                               aconf->host);
                        free_conf(aconf);
                        rb_dlinkDestroy(ptr, &resv_conf_list);
                }
@@ -695,12 +703,14 @@ expire_temp_rxlines(void *unused)
        {
                aconf = ptr->data;
 
+               if(aconf->lifetime != 0)
+                       continue;
                if(aconf->hold && aconf->hold <= rb_current_time())
                {
                        if(ConfigFileEntry.tkline_expire_notices)
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                                "Temporary X-line for [%s] expired",
-                                               aconf->name);
+                                               aconf->host);
                        free_conf(aconf);
                        rb_dlinkDestroy(ptr, &xline_conf_list);
                }
@@ -722,7 +732,7 @@ add_nd_entry(const char *name)
                return;
 
        nd = rb_bh_alloc(nd_heap);
-       
+
        rb_strlcpy(nd->name, name, sizeof(nd->name));
        nd->expire = rb_current_time() + ConfigFileEntry.nick_delay;