about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrett Smith <brett@w3.org>2012-09-14 11:56:38 -0400
committerBrett Smith <brett@w3.org>2012-09-14 11:56:38 -0400
commit85abfd84beee0a5fc6725624b0bd0260c7b2d856 (patch)
tree1349146f1a021ad9395f69f0be74c61e1228073d /src
parenta072180c9262f8a1c6bba6b8f0613bccc2863f48 (diff)
downloadngircd-85abfd84beee0a5fc6725624b0bd0260c7b2d856.tar.gz
ngircd-85abfd84beee0a5fc6725624b0bd0260c7b2d856.zip
Allow limited punctuation in usernames, for better PAM integration.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-login.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c
index 9e1abdd5..74d8b9d1 100644
--- a/src/ngircd/irc-login.c
+++ b/src/ngircd/irc-login.c
@@ -418,12 +418,15 @@ 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')) {
+			    (*ptr < 'a' || *ptr > 'z') &&
+			    (*ptr != '+') && (*ptr != '-') &&
+			    (*ptr != '.') && (*ptr != '_')) {
 				Conn_Close(Client_Conn(Client), NULL,
 					   "Invalid user name", true);
 				return DISCONNECTED;