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

Add option to stop connection if SASL authentication fails (irc.server.*.sasl_disconnect_on_fail). #265

Merged
merged 2 commits into from Nov 23, 2014

Conversation

Projects
None yet
3 participants
@maxteufel
Copy link
Contributor

commented Nov 22, 2014

See https://savannah.nongnu.org/task/?12204.

This also adds support for the 902 numeric (ERR_NICKLOCKED), which is used if SASL authentication fails because an account is frozen, locked or held.

@@ -76,7 +76,7 @@ char *irc_server_option_string[IRC_SERVER_NUM_OPTIONS] =
"ssl", "ssl_cert", "ssl_priorities", "ssl_dhkey_size", "ssl_fingerprint",
"ssl_verify",
"password", "capabilities",
"sasl_mechanism", "sasl_username", "sasl_password", "sasl_timeout",
"sasl_mechanism", "sasl_username", "sasl_password", "sasl_timeout", "sasl_disconnect_on_fail",

This comment has been minimized.

Copy link
@flashcode

flashcode Nov 22, 2014

Member

You forgot to update the default values for options (another array below this one).
Please update it as well (otherwise there will be a shift of default values for server options).

This comment has been minimized.

Copy link
@maxteufel

maxteufel Nov 22, 2014

Author Contributor

Updated second array too. Didn't notice this in my tests because the next value is "off" too.

@flashcode

This comment has been minimized.

Copy link
Member

commented Nov 22, 2014

And I'm investigating why the Travis build fails.
The automatic tests fail, but these tests are on core functions, so this seems not related to your changes.

@maxteufel maxteufel force-pushed the maxteufel:feature/sasl_disconnect_on_fail branch from 5f42c36 to c010671 Nov 22, 2014

@flashcode

This comment has been minimized.

Copy link
Member

commented Nov 22, 2014

The tests failed because of the shift in default server options values: the connection to default irc server freenode was enabled, and the tests expect to have only core buffer opened.
So this is fixed by your last changes.

@Mikaela

This comment has been minimized.

Copy link
Contributor

commented Nov 22, 2014

I don't understand the code, but I hope this defaults to off. As you know, SASL doesn't protect the IP and to do that you need Tor.

There are also people who care more on missing lines/being disconnected than having their host showing at IRC and I believe this includes the majority of users if they know anything on vhosts.

@maxteufel

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2014

It defaults to off, yes. I could also change the code to make it reconnect and try again.

@flashcode

This comment has been minimized.

Copy link
Member

commented Nov 22, 2014

Yes I think reconnection would be better, because if ever SASL failes one time and that you don't notice that, you could be disconnected for a long time (until you reconnect to your screen/tmux for example).

@maxteufel maxteufel force-pushed the maxteufel:feature/sasl_disconnect_on_fail branch from c010671 to cea0a5b Nov 22, 2014

@maxteufel

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2014

Updated to reconnect (uses irc_server_disconnect with reconnect enabled, which means that WeeChat will only reconnect when autoreconnect is on).

@maxteufel maxteufel force-pushed the maxteufel:feature/sasl_disconnect_on_fail branch from cea0a5b to 7823495 Nov 22, 2014

@maxteufel

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2014

It is also possible to enable server address switching, at least if SASL times out. Timeouts are usually a sign of a netsplit (not valid for some ircds, see zohlai/neephi@91b0cedd4fd35ab2ab9ef871d157bf315b76c60e and zohlai/neephi@782fb0a7b8a8aeb872e97c6e529767fa4ac3ce26).

@flashcode flashcode merged commit 7823495 into weechat:master Nov 23, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

flashcode added a commit that referenced this pull request Nov 23, 2014

@flashcode flashcode added this to the 1.1 milestone Nov 23, 2014

@flashcode flashcode self-assigned this Nov 23, 2014

@maxteufel maxteufel deleted the maxteufel:feature/sasl_disconnect_on_fail branch Jan 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.