]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_server.c
Add chmode +N, which prevents nickchanges.
[irc/rqf/shadowircd.git] / modules / core / m_server.c
index 9007fd8b47003d88507badcd325f4f5105235e88..fc9a453e9371625ae56ab6b28132b4372b580d91 100644 (file)
@@ -75,6 +75,7 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
        const char *name;
        struct Client *target_p;
        int hop;
+       struct Capability *cap;
 
        name = parv[1];
        hop = atoi(parv[2]);
@@ -108,6 +109,23 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
                return 0;
        }
 
+       /* check to ensure any "required" caps are set. --nenolod */
+       for (cap = captab; cap->name; cap++)
+       {
+               if (!cap->required)
+                       continue;
+
+               if (!(client_p->localClient->caps & cap->cap))
+               {
+                       char exitbuf[BUFSIZE];
+
+                       rb_snprintf(exitbuf, BUFSIZE, "Missing required CAPAB [%s]", cap->name);
+                       exit_client(client_p, client_p, client_p, exitbuf);
+
+                       return 0;
+               }
+       }
+
        /* Now we just have to call check_server and everything should be
         * check for us... -A1kmm. */
        switch (check_server(name, client_p))
@@ -642,7 +660,6 @@ set_server_gecos(struct Client *client_p, const char *info)
        {
                char *p;
                char *s;
-               char *t;
 
                s = LOCAL_COPY(info);
 
@@ -651,7 +668,7 @@ set_server_gecos(struct Client *client_p, const char *info)
                        *p = '\0';
 
                /* check for a ] which would symbolise an [IP] */
-               if((t = strchr(s, ']')))
+               if(strchr(s, ']'))
                {
                        /* set s to after the first space */
                        if(p)