* bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2011-11-30 0:50 bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set Trent W. Buck
@ 2012-10-29 11:23 ` Chong Yidong
2012-12-04 23:32 ` Deniz Dogan
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Chong Yidong @ 2012-10-29 11:23 UTC (permalink / raw)
To: Ryan Yeske, Deniz Dogan; +Cc: Trent W. Buck, 10162
Hi Ryan, Deniz,
Could either of you please take a look at this bug? This appears to be
a regression, so it would be good to fix it for Emacs 24.3. Thanks.
trentbuck@gmail.com (Trent W. Buck) writes:
> When doing emacs -f irc or M-x irc, Emacs would connect to all three
> servers, but not autojoin channels in Freenode with this setting:
>
> (setq rcirc-server-alist
> `(("irc.freenode.net" :channels ("##workingset"
> "#collectd"
> "#emacs"
> "#lxcontainers"
> "#netfilter"
> "#paredit"
> "#screen"
> "#ubuntu-hardened"
> "#ubuntu-server"))
> ("irc.oftc.net" :channels ("#debian-au"
> "#debian-derivatives"
> "#debian-eeepc"
> "#debian-haskell"
> "#debian-mentors"
> "#debian-next"))
> ("irc.cyber.com.au" :channels ("#cyber"))))
>
> I tried moving freenode to be the last of the three; the result was that
> only #cyber was joined.
>
> As a random guess, I tried (setq rcirc-authenticate-before-join nil) --
> this fixed the problem.
>
> I speculate there is an issue with this new feature when >1 server is in
> the server alist. I could reproduce this behaviour reliably with a
> dozen or so attempts under emacs-snapshot; I never had this behaviour
> under 23 (which predates authenticate-before-join).
>
> I also had this problem several months ago with the emacs-snapshot that
> was current then; I didn't bother to investigate at the time -- it was
> easier to just switch back to 23.
>
> irc.cyber.com.au is an internal (private) office IRC server; running
> ircd-irc2 2.11.2p1+dfsg-2 on Ubuntu 10.04 (Lucid).
>
> A complete (but slightly older) copy of my emacs configuration can be
> found at http://cyber.com.au/~twb/.emacs and
> http://cyber.com.au/~twb/.rcirc.el.
>
> In GNU Emacs 24.0.91.1 (x86_64-pc-linux-gnu)
> of 2011-11-04 on zelenka, modified by Debian
> (emacs-snapshot package, version 1:20111104-1)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2011-11-30 0:50 bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set Trent W. Buck
2012-10-29 11:23 ` Chong Yidong
@ 2012-12-04 23:32 ` Deniz Dogan
2012-12-05 0:33 ` Trent W. Buck
2017-02-17 1:18 ` Trent W. Buck
2019-06-03 0:55 ` bug#10162: [PATCH] " Steve Scott
3 siblings, 1 reply; 9+ messages in thread
From: Deniz Dogan @ 2012-12-04 23:32 UTC (permalink / raw)
To: 10162, trentbuck
Hi,
I'm actually unable to reproduce this problem using the latest version
from Bazaar. Could you provide a minimal recipe to reproduce this?
Cheers,
Deniz
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2012-12-04 23:32 ` Deniz Dogan
@ 2012-12-05 0:33 ` Trent W. Buck
0 siblings, 0 replies; 9+ messages in thread
From: Trent W. Buck @ 2012-12-05 0:33 UTC (permalink / raw)
To: Deniz Dogan; +Cc: 10162
Deniz Dogan wrote:
> I'm actually unable to reproduce this problem using the latest
> version from Bazaar. Could you provide a minimal recipe to
> reproduce this?
I discussed this with damd (Deniz) on IRC and he can now reproduce the
symptoms. I leave it to him to finish debugging the issue :-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2011-11-30 0:50 bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set Trent W. Buck
2012-10-29 11:23 ` Chong Yidong
2012-12-04 23:32 ` Deniz Dogan
@ 2017-02-17 1:18 ` Trent W. Buck
2019-06-03 0:55 ` bug#10162: [PATCH] " Steve Scott
3 siblings, 0 replies; 9+ messages in thread
From: Trent W. Buck @ 2017-02-17 1:18 UTC (permalink / raw)
To: deniz; +Cc: cyd, rcyeske, 10162
This bug still affected 24.3 in 2013, and 24.5 today.
Due to me misunderstanding how GNU's debbugs instance is configured,
I don't think anyone was CC'd when I told debbug,
so here's today's comment again:
The #emacs IRC channel recently got +r mode (registered accounts only) to mitigate persistent Judenhass trolling,
which means that M-x irc opens an #emacs buffer,
but it just says something like "only registered users can join #emacs".
If I then type /join #emacs, I get in, because by then *irc.freenode.net* has "-NickServ- You are now identified for trentbuck.".
I tried setting rcirc-authenticate-before-join back to t to fix that, and the symptoms of this bug (#10162) reappeared.
I am using emacs24-nox=24.5+1-6~bpo8+1 package from Debian 8 Jessie.
According to the bug history, damd can reproduce the issue --- any luck fixing it?
PS: I don't have a record of the recipe I gave damd to reproduce the bug :-(
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: [PATCH] 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2011-11-30 0:50 bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set Trent W. Buck
` (2 preceding siblings ...)
2017-02-17 1:18 ` Trent W. Buck
@ 2019-06-03 0:55 ` Steve Scott
2019-06-03 22:16 ` Noam Postavsky
3 siblings, 1 reply; 9+ messages in thread
From: Steve Scott @ 2019-06-03 0:55 UTC (permalink / raw)
To: 10162
Since the hostname returned by irc.freenode.net can be something other
than irc.freenode.net, e.g. niven.freenode.net, the entries for
rcirc-authinfo and rcirc-server-alist will not match.
Hence checking rcirc-server-name (the hostname returned) instead of
rcirc-server (the hostname connected to) will cause the auth-required
condition to fail because of the mismatch. The hostname in
rcirc-authinfo won't be found and the authentication hook will be skipped.
The authenticate and join functions still get called in the ELSE in this
case but there is no waiting for the authentication to be successful
before joining the channels.
Moreover, if rcirc-auto-authenticate-flag is set, there should indeed be
a check for the corresponding rcirc-authinfo, regardless of whether the
rcirc-authenticate-before-join must happen. Otherwise, there's no point
in calling authenticate.
My proposed patch enclosed.
Thanks,
Steve Scott
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 9c3828caf5..0f1904ea0e 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2545,16 +2545,15 @@ rcirc-handler-001
(setq rcirc-server-name sender)
(setq rcirc-nick (car args))
(rcirc-update-prompt)
- (if rcirc-auto-authenticate-flag
- (if (and rcirc-authenticate-before-join
- ;; We have to ensure that there's an authentication
- ;; entry for that server. Else,
- ;; rcirc-authenticated-hook won't be triggered, and
- ;; autojoin won't happen at all.
- (let (auth-required)
- (dolist (s rcirc-authinfo auth-required)
- (when (string-match (car s) rcirc-server-name)
- (setq auth-required t)))))
+ (if (and rcirc-auto-authenticate-flag
+ ;; We have to ensure that there's an authentication
+ ;; entry for that server. Otherwise,
+ ;; there's no point in calling authenticate.
+ (let (auth-required)
+ (dolist (s rcirc-authinfo auth-required)
+ (when (string-match (car s) rcirc-server)
+ (setq auth-required t)))))
+ (if rcirc-authenticate-before-join
(progn
(add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t)
(rcirc-authenticate))
^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#10162: [PATCH] 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2019-06-03 0:55 ` bug#10162: [PATCH] " Steve Scott
@ 2019-06-03 22:16 ` Noam Postavsky
2019-06-03 22:54 ` Steve Scott
0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2019-06-03 22:16 UTC (permalink / raw)
To: Steve Scott; +Cc: 10162
Steve Scott <steve@stevescott.ca> writes:
> Since the hostname returned by irc.freenode.net can be something other
> than irc.freenode.net, e.g. niven.freenode.net, the entries for
> rcirc-authinfo and rcirc-server-alist will not match.
Thanks, I was hitting this, and based on your explanation, I changed my
rcirc-authinfo entry to "[.]freenode[.]net\\'" instead of
"irc.freenode.net" and autojoin started working.
> + (if (and rcirc-auto-authenticate-flag
> + ;; We have to ensure that there's an authentication
> + ;; entry for that server. Otherwise,
> + ;; there's no point in calling authenticate.
> + (let (auth-required)
> + (dolist (s rcirc-authinfo auth-required)
> + (when (string-match (car s) rcirc-server)
> + (setq auth-required t)))))
> + (if rcirc-authenticate-before-join
But it looks like we're still calling authenticate, even in the
"otherwise" case, even though you say there's no point?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: [PATCH] 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2019-06-03 22:16 ` Noam Postavsky
@ 2019-06-03 22:54 ` Steve Scott
2019-06-06 0:34 ` Noam Postavsky
0 siblings, 1 reply; 9+ messages in thread
From: Steve Scott @ 2019-06-03 22:54 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 10162
There are three cases, and authenticate needs to be called for two of them:
1) auto-authenticate + authenticate-before-join
Use the hook to ensure authentication completes before joining.
2) auto-authenticate but not "before join"
In this case, authenticate must still be called but the hook is not
required because the order is not important.
3) no auto-authenticate
Just join the channels without authenticating.
The "Otherwise" comment refers to the 3rd case:
if auto-authenticate is set but no authinfo is specified we just join
the channels.
I'm not sure authenticate-before-join is even necessary. I would
recommend authenticating before joining be the way it works but that's
probably a separate discussion.
Noam Postavsky writes:
> Steve Scott <steve@stevescott.ca> writes:
>
>> Since the hostname returned by irc.freenode.net can be something other
>> than irc.freenode.net, e.g. niven.freenode.net, the entries for
>> rcirc-authinfo and rcirc-server-alist will not match.
>
> Thanks, I was hitting this, and based on your explanation, I changed my
> rcirc-authinfo entry to "[.]freenode[.]net\\'" instead of
> "irc.freenode.net" and autojoin started working.
>
>> + (if (and rcirc-auto-authenticate-flag
>> + ;; We have to ensure that there's an authentication
>> + ;; entry for that server. Otherwise,
>> + ;; there's no point in calling authenticate.
>> + (let (auth-required)
>> + (dolist (s rcirc-authinfo auth-required)
>> + (when (string-match (car s) rcirc-server)
>> + (setq auth-required t)))))
>> + (if rcirc-authenticate-before-join
>
> But it looks like we're still calling authenticate, even in the
> "otherwise" case, even though you say there's no point?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10162: [PATCH] 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
2019-06-03 22:54 ` Steve Scott
@ 2019-06-06 0:34 ` Noam Postavsky
0 siblings, 0 replies; 9+ messages in thread
From: Noam Postavsky @ 2019-06-06 0:34 UTC (permalink / raw)
To: Steve Scott; +Cc: 10162
tags 10162 fixed
close 10162 27.1
quit
Steve Scott <steve@stevescott.ca> writes:
> The "Otherwise" comment refers to the 3rd case:
> if auto-authenticate is set but no authinfo is specified we just join
> the channels.
Ah right, I was misreading the nested conditionals. Anyway, I think
this all makes sense so I pushed to master.
cd3221ab0f 2019-06-05T20:30:23-04:00 "Check rcirc-server for auto authentication (Bug#10162)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=cd3221ab0f8dbde584a76c2648cc9029e63bd8d1
> I'm not sure authenticate-before-join is even necessary. I would
> recommend authenticating before joining be the way it works but that's
> probably a separate discussion.
Yeah, I kind of agree, but removing options is always a tough sell.
^ permalink raw reply [flat|nested] 9+ messages in thread