]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - extensions/ip_cloaking.c
libratbox: Clean up uses of strcpy().
[irc/rqf/shadowircd.git] / extensions / ip_cloaking.c
index 035913e9b3f068c317fb0c54e85ff228c3341dfd..1f807ad41d69851cee3f9fffbe6a62a3eff1aaae 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: ip_cloaking.c 3526 2007-07-06 07:56:14Z nenolod $ */
 
 #include "stdinc.h"
 #include "modules.h"
@@ -19,7 +18,7 @@ static int
 _modinit(void)
 {
        /* add the usermode to the available slot */
-       user_modes['h'] = find_umode_slot();
+       user_modes['x'] = find_umode_slot();
        construct_umodebuf();
 
        return 0;
@@ -29,7 +28,7 @@ static void
 _moddeinit(void)
 {
        /* disable the umode and remove it from the available list */
-       user_modes['h'] = 0;
+       user_modes['x'] = 0;
        construct_umodebuf();
 }
 
@@ -165,14 +164,14 @@ check_umode_change(void *vdata)
                return;
 
        /* didn't change +h umode, we don't need to do anything */
-       if (!((data->oldumodes ^ source_p->umodes) & user_modes['h']))
+       if (!((data->oldumodes ^ source_p->umodes) & user_modes['x']))
                return;
 
-       if (source_p->umodes & user_modes['h'])
+       if (source_p->umodes & user_modes['x'])
        {
                if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
                {
-                       source_p->umodes &= ~user_modes['h'];
+                       source_p->umodes &= ~user_modes['x'];
                        return;
                }
                if (strcmp(source_p->host, source_p->localClient->mangledhost))
@@ -184,7 +183,7 @@ check_umode_change(void *vdata)
                        sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
                                source_p->host);
        }
-       else if (!(source_p->umodes & user_modes['h']))
+       else if (!(source_p->umodes & user_modes['x']))
        {
                if (source_p->localClient->mangledhost != NULL &&
                                !strcmp(source_p->host, source_p->localClient->mangledhost))
@@ -202,7 +201,7 @@ check_new_user(void *vdata)
 
        if (IsIPSpoof(source_p))
        {
-               source_p->umodes &= ~user_modes['h'];
+               source_p->umodes &= ~user_modes['x'];
                return;
        }
        source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1);
@@ -211,8 +210,8 @@ check_new_user(void *vdata)
        else
                do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
        if (IsDynSpoof(source_p))
-               source_p->umodes &= ~user_modes['h'];
-       if (source_p->umodes & user_modes['h'])
+               source_p->umodes &= ~user_modes['x'];
+       if (source_p->umodes & user_modes['x'])
        {
                rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
                if (irccmp(source_p->host, source_p->orighost))