]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-mode.c
Only allow IRC services to modify user mode "R"
[ngircd-alex.git] / src / ngircd / irc-mode.c
index 80b2949038b7cce6084537f771d21dd398f095a7..ca4cdd0624f6db851d7fdd2e0920612835066a2f 100644 (file)
@@ -256,6 +256,14 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
                                                        ERR_RESTRICTED_MSG,
                                                        Client_ID(Origin));
                        break;
+               case 'R': /* Registered (not [un]settable by clients) */
+                       if (Client_Type(Client) == CLIENT_SERVER)
+                               x[0] = 'R';
+                       else
+                               ok = IRC_WriteStrClient(Origin,
+                                                       ERR_NICKREGISTER_MSG,
+                                                       Client_ID(Origin));
+                       break;
                case 'x': /* Cloak hostname */
                        if (Client_HasMode(Client, 'r'))
                                ok = IRC_WriteStrClient(Origin,
@@ -856,7 +864,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
            const char *Pattern)
 {
        const char *mask;
-       struct list_head *list;
+       struct list_head *list = NULL;
        long int current_count;
 
        assert(Client != NULL);
@@ -923,7 +931,7 @@ Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
              const char *Pattern)
 {
        const char *mask;
-       struct list_head *list;
+       struct list_head *list = NULL;
 
        assert(Client != NULL);
        assert(Channel != NULL);