ZNC adds unnecessary restrictions to usernames #587

Open
opened 2026-10-05 04:31:35 +02:00 by adam · 0 comments
Owner

ZNC requires that usernames must start with a letter, [az-AZ]. This rules out having usernames such as __0x277F or even 0x277F.

I can't find any RFC which states that usernames must start with a letter, and indeed these usernames are both valid on InspIRCd at least.

Curiously RFC 1459 says that usernames can start with any non whitespace char, but nicks must start with a letter.

   <nick>       ::= <letter> { <letter> | <number> | <special> }
   <user>       ::= <nonwhite> { <nonwhite> }
   <letter>     ::= 'a' ... 'z' | 'A' ... 'Z'
   <number>     ::= '0' ... '9'
   <special>    ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'
   <nonwhite>   ::= <any 8bit code except SPACE (0x20), NUL (0x0), CR
                     (0xd), and LF (0xa)>

I guess most correct behaviour would be for ZNC to accept any valid username, but when autogenerated the default nick, munge them to be valid (start with a letter).

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ZNC requires that usernames must start with a letter, [az-AZ]. This rules out having usernames such as __0x277F or even 0x277F. I can't find any RFC which states that usernames must start with a letter, and indeed these usernames are both valid on InspIRCd at least. Curiously RFC 1459 says that usernames can start with any non whitespace char, but nicks must start with a letter. ``` <nick> ::= <letter> { <letter> | <number> | <special> } <user> ::= <nonwhite> { <nonwhite> } <letter> ::= 'a' ... 'z' | 'A' ... 'Z' <number> ::= '0' ... '9' <special> ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}' <nonwhite> ::= <any 8bit code except SPACE (0x20), NUL (0x0), CR (0xd), and LF (0xa)> ``` I guess most correct behaviour would be for ZNC to accept any valid username, but when autogenerated the default nick, munge them to be valid (start with a letter). ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26799057-znc-adds-unnecessary-restrictions-to-usernames?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:107319693 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#587