]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/hostmask.c
Fix crash if identify_service/identify_command were not specified in ircd.conf.
[irc/rqf/shadowircd.git] / src / hostmask.c
index a0a193d5c7375f26b39c12c1e913aa1b1c3fdfa6..1058df5ae627a530adb4745f7ba69b937ca4e180 100644 (file)
@@ -62,7 +62,11 @@ parse_netmask(const char *text, struct sockaddr  *naddr, int *nb)
                addr = (struct rb_sockaddr_storage *)&xaddr;
        else
                addr = (struct rb_sockaddr_storage *)naddr;
-       
+
+       if(strpbrk(ip, "*?") != NULL)
+       {
+               return HM_HOST;
+       }
 #ifdef RB_IPV6
        if(strchr(ip, ':'))
        {       
@@ -386,7 +390,7 @@ find_address_conf(const char *host, const char *sockhost, const char *user,
        /* if theres a spoof, check it against klines.. */
        if(IsConfDoSpoofIp(iconf))
        {
-               char *p = strchr(iconf->name, '@');
+               char *p = strchr(iconf->info.name, '@');
 
                /* note, we dont need to pass sockhost here, as its
                 * guaranteed to not match by whats above.. --anfl
@@ -394,11 +398,11 @@ find_address_conf(const char *host, const char *sockhost, const char *user,
                if(p)
                {
                        *p = '\0';
-                       kconf = find_conf_by_address(p+1, NULL, NULL, ip, CONF_KILL, aftype, iconf->name, NULL);
+                       kconf = find_conf_by_address(p+1, NULL, NULL, ip, CONF_KILL, aftype, iconf->info.name, NULL);
                        *p = '@';
                }
                else
-                       kconf = find_conf_by_address(iconf->name, NULL, NULL, ip, CONF_KILL, aftype, vuser, NULL);
+                       kconf = find_conf_by_address(iconf->info.name, NULL, NULL, ip, CONF_KILL, aftype, vuser, NULL);
 
                if(kconf)
                        return kconf;
@@ -446,7 +450,6 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
 
        if(address == NULL)
                address = "/NOMATCH!/";
-       arec = rb_malloc(sizeof(struct AddressRec));
        masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
 #ifdef RB_IPV6
        if(masktype == HM_IPV6)
@@ -704,7 +707,7 @@ show_iline_prefix(struct Client *sptr, struct ConfItem *aconf, char *name)
 void
 report_auth(struct Client *client_p)
 {
-       char *name, *host, *pass = "*", *user, *classname;
+       char *name, *host, *pass, *user, *classname;
        struct AddressRec *arec;
        struct ConfItem *aconf;
        int i, port;