]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_newconf.c
Automated merge with ssh://hg.atheme.org//hg/charybdis
[irc/rqf/shadowircd.git] / src / s_newconf.c
index 97cd4751dc4d7a9cbebaa49d1d259b8f25f96319..dc0474d56a5c4f96001297fd058a625e34a45a4a 100644 (file)
@@ -29,7 +29,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id: s_newconf.c 1747 2006-07-25 21:22:45Z jilles $
+ * $Id: s_newconf.c 3508 2007-06-04 16:04:49Z jilles $
  */
 
 #include "stdinc.h"
@@ -504,8 +504,7 @@ set_server_conf_autoconn(struct Client *source_p, char *name, int newval)
                                get_oper_name(source_p), name, newval);
        }
        else
-               sendto_one(source_p, ":%s NOTICE %s :Can't find %s",
-                               me.name, source_p->name, name);
+               sendto_one_notice(source_p, ":Can't find %s", name);
 }
 
 struct ConfItem *
@@ -529,6 +528,23 @@ find_xline(const char *gecos, int counter)
        return NULL;
 }
 
+struct ConfItem *
+find_xline_mask(const char *gecos)
+{
+       struct ConfItem *aconf;
+       dlink_node *ptr;
+
+       DLINK_FOREACH(ptr, xline_conf_list.head)
+       {
+               aconf = ptr->data;
+
+               if(!irccmp(aconf->name, gecos))
+                       return aconf;
+       }
+
+       return NULL;
+}
+
 struct ConfItem *
 find_nick_resv(const char *name)
 {
@@ -549,6 +565,23 @@ find_nick_resv(const char *name)
        return NULL;
 }
 
+struct ConfItem *
+find_nick_resv_mask(const char *name)
+{
+       struct ConfItem *aconf;
+       dlink_node *ptr;
+
+       DLINK_FOREACH(ptr, resv_conf_list.head)
+       {
+               aconf = ptr->data;
+
+               if(!irccmp(aconf->name, name))
+                       return aconf;
+       }
+
+       return NULL;
+}
+
 /* clean_resv_nick()
  *
  * inputs      - nick
@@ -596,6 +629,7 @@ valid_wild_card_simple(const char *data)
        const char *p;
        char tmpch;
        int nonwild = 0;
+       int wild = 0;
 
        /* check the string for minimum number of nonwildcard chars */
        p = data;
@@ -605,9 +639,11 @@ valid_wild_card_simple(const char *data)
                /* found an escape, p points to the char after it, so skip
                 * that and move on.
                 */
-               if(tmpch == '\\')
+               if(tmpch == '\\' && *p)
                {
                        p++;
+                       if(++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
+                               return 1;
                }
                else if(!IsMWildChar(tmpch))
                {
@@ -615,9 +651,12 @@ valid_wild_card_simple(const char *data)
                        if(++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
                                return 1;
                }
+               else
+                       wild++;
        }
 
-       return 0;
+       /* strings without wilds are also ok */
+       return wild == 0;
 }
 
 time_t