Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZNC sends actual NICK too late to IRC client #1829

Open
coaxial opened this issue Apr 9, 2022 · 3 comments
Open

ZNC sends actual NICK too late to IRC client #1829

coaxial opened this issue Apr 9, 2022 · 3 comments

Comments

@coaxial
Copy link

coaxial commented Apr 9, 2022

When connecting to IRC with irssi via ZNC, the NICK is sent too late. irssi isn't aware of the actual nick and uses the wrong one to set mode +i.

See raw log from irssi, NICK nope is what is configured in irssi, NICK cxl is the actual nick on that IRC server, and irssi sends MODE <nick> +i:

<< CAP LS
<< PASS ***/libera:irssi
<< NICK nope
<< USER nope nope bnc.example.org :nope
>> :irc.znc.in CAP unknown-nick LS :batch cap-notify echo-message multi-prefix server-time userhost-in-names znc.in/batch znc.in/self-message znc.in/server-time-iso
<< CAP REQ :multi-prefix
>> :irc.znc.in CAP nope ACK :multi-prefix
<< CAP END
>> :tantalum.libera.chat 001 nope :Welcome to the Libera.Chat Internet Relay Chat Network cxl
<< MODE nope +i
>> :tantalum.libera.chat 002 nope :Your host is tantalum.libera.chat[93.158.237.2/6697], running version solanum-1.0-dev
>> :tantalum.libera.chat 003 nope :This server was created Mon Nov 22 2021 at 18:12:28 UTC
>> :tantalum.libera.chat 004 nope tantalum.libera.chat solanum-1.0-dev DGQRSZaghilopsuwz CFILMPQSTbcefgijklmnopqrstuvz bkloveqjfI
>> :tantalum.libera.chat 005 nope WHOX MONITOR=100 SAFELIST ELIST=CMNTU ETRACE FNC CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQSTcgimnprstuz :are supported by this server
>> :tantalum.libera.chat 005 nope CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server
>> :tantalum.libera.chat 005 nope TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server
>> :tantalum.libera.chat 251 nope :There are 67 users and 42759 invisible on 28 servers
>> :tantalum.libera.chat 252 nope 41 :IRC Operators online
>> :tantalum.libera.chat 254 nope 21929 :channels formed
>> :tantalum.libera.chat 255 nope :I have 655 clients and 1 servers
>> :tantalum.libera.chat 265 nope 655 4545 :Current local users 655, max 4545
>> :tantalum.libera.chat 266 nope 42826 53550 :Current global users 42826, max 53550
>> :tantalum.libera.chat 250 nope :Highest connection count: 4546 (4545 clients) (368870 connections received)
>> :nope!~hey_its_m@user/cxl NICK :cxl
>> :tantalum.libera.chat 375 cxl :- tantalum.libera.chat Message of the Day -
>> :tantalum.libera.chat 372 cxl :- This server provided by Hyperfilter (https://hyperfilter.com)
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Welcome to Libera Chat, the IRC network for
>> :tantalum.libera.chat 372 cxl :- free & open-source software and peer directed projects.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Use of Libera Chat is governed by our network policies.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- To reduce network abuses we perform open proxy checks
>> :tantalum.libera.chat 372 cxl :- on hosts at connection time.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Please visit us in #libera for questions and support.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Website and documentation:  https://libera.chat
>> :tantalum.libera.chat 372 cxl :- Webchat:                    https://web.libera.chat
>> :tantalum.libera.chat 372 cxl :- Network policies:           https://libera.chat/policies
>> :tantalum.libera.chat 372 cxl :- Email:                      support@libera.chat
>> :tantalum.libera.chat 376 cxl :End of /MOTD command.
>> :cxl!~hey_its_m@user/cxl MODE cxl :+Ziw
@psychon
Copy link
Member

psychon commented Apr 9, 2022

is sent too late.

Uhm... when would be "not too late"?

This is only a guess, but I bet that from ZNC's point of view, it sends the following all at once, even before irssi sends the MODE:

>> :tantalum.libera.chat 001 nope :Welcome to the Libera.Chat Internet Relay Chat Network cxl
>> :tantalum.libera.chat 002 nope :Your host is tantalum.libera.chat[93.158.237.2/6697], running version solanum-1.0-dev
>> :tantalum.libera.chat 003 nope :This server was created Mon Nov 22 2021 at 18:12:28 UTC
>> :tantalum.libera.chat 004 nope tantalum.libera.chat solanum-1.0-dev DGQRSZaghilopsuwz CFILMPQSTbcefgijklmnopqrstuvz bkloveqjfI
>> :tantalum.libera.chat 005 nope WHOX MONITOR=100 SAFELIST ELIST=CMNTU ETRACE FNC CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQSTcgimnprstuz :are supported by this server
>> :tantalum.libera.chat 005 nope CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server
>> :tantalum.libera.chat 005 nope TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server
>> :tantalum.libera.chat 251 nope :There are 67 users and 42759 invisible on 28 servers
>> :tantalum.libera.chat 252 nope 41 :IRC Operators online
>> :tantalum.libera.chat 254 nope 21929 :channels formed
>> :tantalum.libera.chat 255 nope :I have 655 clients and 1 servers
>> :tantalum.libera.chat 265 nope 655 4545 :Current local users 655, max 4545
>> :tantalum.libera.chat 266 nope 42826 53550 :Current global users 42826, max 53550
>> :tantalum.libera.chat 250 nope :Highest connection count: 4546 (4545 clients) (368870 connections received)
>> :nope!~hey_its_m@user/cxl NICK :cxl
>> :tantalum.libera.chat 375 cxl :- tantalum.libera.chat Message of the Day -
>> :tantalum.libera.chat 372 cxl :- This server provided by Hyperfilter (https://hyperfilter.com)
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Welcome to Libera Chat, the IRC network for
>> :tantalum.libera.chat 372 cxl :- free & open-source software and peer directed projects.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Use of Libera Chat is governed by our network policies.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- To reduce network abuses we perform open proxy checks
>> :tantalum.libera.chat 372 cxl :- on hosts at connection time.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Please visit us in #libera for questions and support.
>> :tantalum.libera.chat 372 cxl :-
>> :tantalum.libera.chat 372 cxl :- Website and documentation:  https://libera.chat
>> :tantalum.libera.chat 372 cxl :- Webchat:                    https://web.libera.chat
>> :tantalum.libera.chat 372 cxl :- Network policies:           https://libera.chat/policies
>> :tantalum.libera.chat 372 cxl :- Email:                      support@libera.chat
>> :tantalum.libera.chat 376 cxl :End of /MOTD command.
>> :cxl!~hey_its_m@user/cxl MODE cxl :+Ziw

And only after it sends all of the above does it receive the MODE nope +i from irssi.

You could check this by running ZNC in debug mode (znc --debug). However, that doesn't really help, so... no idea what could be done about this.

@coaxial
Copy link
Author

coaxial commented Apr 10, 2022

Couldn't >> :nope!~hey_its_m@user/cxl NICK :cxl be the first thing ZNC sends, even before >> :tantalum.libera.chat 001 nope :Welcome to the Libera.Chat Internet Relay Chat Network cxl? Just spitballing here, I don't know if that would make any sense.

@dgw
Copy link
Contributor

dgw commented Apr 10, 2022

I'm going to quote from the modern IRC docs' section about connection registration (without taking the time to trace each piece of information back to the RFCs, because the site is a reference for how things are implemented):

The first parameter of the RPL_WELCOME (001) message is the nickname assigned by the network to the client. Since it may differ from the nickname the client requested with the NICK command (due to, e.g. length limits or policy restrictions on nicknames), the client SHOULD use this parameter to determine its actual nickname at the time of connection. Subsequent nickname changes, client-initiated or not, will be communicated by the server sending a NICK message.

To me, it then seems incorrect that ZNC sends nope as the nick in 001 if the network side is connected as cxl. One could say ZNC has an implicit "limit or policy restriction on nicknames", and should inform the client as soon as possible that the NICK it requested was altered. The explicit NICK command sent later can be removed, then. Does that sound reasonable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants