X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-login.c;h=99cd26f45818a1fa3a42bb36c67f58a4c7ac86b2;hp=9e1abdd59e8b0349b535b9b1299989f994a3827c;hb=005340c83f3f481bdcdc6a03ae9b9b2973248ceb;hpb=bcefdef1eaed14d3156b7fb5b9ad6d3b7078efcf diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 9e1abdd5..99cd26f4 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -18,6 +18,7 @@ #include "imp.h" #include +#include #include #include #include @@ -418,12 +419,13 @@ IRC_USER(CLIENT * Client, REQUEST * Req) Client_ID(Client), Req->command); - /* User name: only alphanumeric characters are allowed! */ + /* User name: only alphanumeric characters and limited + punctuation is allowed.*/ ptr = Req->argv[0]; while (*ptr) { - if ((*ptr < '0' || *ptr > '9') && - (*ptr < 'A' || *ptr > 'Z') && - (*ptr < 'a' || *ptr > 'z')) { + if (!isalnum(*ptr) && + *ptr != '+' && *ptr != '-' && + *ptr != '.' && *ptr != '_') { Conn_Close(Client_Conn(Client), NULL, "Invalid user name", true); return DISCONNECTED;