GNU bug report logs - #10162
24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set

Previous Next

Package: emacs;

Reported by: trentbuck <at> gmail.com (Trent W. Buck)

Date: Wed, 30 Nov 2011 00:51:01 UTC

Severity: normal

Tags: fixed

Found in versions 24.3.1, 24.0.91, 24.5.1

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10162 in the body.
You can then email your comments to 10162 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Wed, 30 Nov 2011 00:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to trentbuck <at> gmail.com (Trent W. Buck):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 30 Nov 2011 00:51:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: trentbuck <at> gmail.com (Trent W. Buck)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.91; rcirc autojoin broken (freenode/oftc) when
	rcirc-authenticate-before-join is set
Date: Wed, 30 Nov 2011 11:50:08 +1100
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)
configured using `configure  '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.91/site-lisp:/usr/share/emacs/site-lisp' '--without-compress-info' '--with-crt-dir=/usr/lib/x86_64-linux-gnu/' '--with-x=no' '--without-dbus' '--without-sound' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  xterm-mouse-mode: t
  ido-everywhere: t
  savehist-mode: t
  icomplete-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC x r e p o r t SPC e m a c s SPC b u f DEL g RE
T

Recent messages:
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done
Loading /etc/emacs/site-start.d/50ledger.el (source)...done
Loading /etc/emacs/site-start.d/50magit.el (source)...done
Loading /etc/emacs/site-start.d/50paredit-el.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50puppet-el.el (source)...done
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...done
Loading /etc/emacs/site-start.d/51debian-el.el (source)...done
Loading term/xterm...done
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/home/twb/.emacs.d/lisp/magit/magit-svn hides /usr/share/emacs/24.0.91/site-lisp/magit/magit-svn
/home/twb/.emacs.d/lisp/magit/magit-key-mode hides /usr/share/emacs/24.0.91/site-lisp/magit/magit-key-mode
/home/twb/.emacs.d/lisp/magit/magit hides /usr/share/emacs/24.0.91/site-lisp/magit/magit
/home/twb/.emacs.d/lisp/magit/magit-topgit hides /usr/share/emacs/24.0.91/site-lisp/magit/magit-topgit
/usr/share/emacs/24.0.91/site-lisp/puppet-el/puppet-mode hides /usr/share/emacs/site-lisp/puppet-mode
/usr/share/emacs/24.0.91/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/twb/.emacs.d/lisp/gnus/.dir-locals hides /usr/share/emacs/24.0.91/lisp/gnus/.dir-locals

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml easymenu
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug jka-compr edmacro kmacro xt-mouse ido savehist icomplete
time-date paren delsel saveplace debian-el debian-el-loaddefs w3m-load
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
dpkg-dev-el dpkg-dev-el-loaddefs ediff-hook vc-hooks lisp-float-type
lisp-mode register page menu-bar rfn-eshadow timer select mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Mon, 29 Oct 2012 11:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Ryan Yeske <rcyeske <at> gmail.com>, Deniz Dogan <deniz <at> dogan.se>
Cc: "Trent W. Buck" <trentbuck <at> gmail.com>, 10162 <at> debbugs.gnu.org
Subject: Re: bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when
	rcirc-authenticate-before-join is set
Date: Mon, 29 Oct 2012 19:23:59 +0800
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 <at> 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Tue, 04 Dec 2012 23:34:02 GMT) Full text and rfc822 format available.

Message #11 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: Deniz Dogan <deniz <at> dogan.se>
To: 10162 <at> debbugs.gnu.org, trentbuck <at> gmail.com
Subject: Re: 24.0.91; rcirc autojoin broken (freenode/oftc) when
	rcirc-authenticate-before-join is set
Date: Wed, 05 Dec 2012 00:32:51 +0100
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Wed, 05 Dec 2012 00:34:01 GMT) Full text and rfc822 format available.

Message #14 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: "Trent W. Buck" <trentbuck <at> gmail.com>
To: Deniz Dogan <deniz <at> dogan.se>
Cc: 10162 <at> debbugs.gnu.org
Subject: Re: 24.0.91; rcirc autojoin broken (freenode/oftc) when
	rcirc-authenticate-before-join is set
Date: Wed, 5 Dec 2012 11:33:13 +1100
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 :-)




bug Marked as found in versions 24.3.1. Request was from Trent W. Buck <trentbuck <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 18 Mar 2013 00:17:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 24.5.1. Request was from Trent W. Buck <trentbuck <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 17 Feb 2017 00:58:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Fri, 17 Feb 2017 01:19:01 GMT) Full text and rfc822 format available.

Message #21 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: "Trent W. Buck" <trentbuck <at> gmail.com>
To: deniz <at> dogan.se
Cc: cyd <at> gnu.org, rcyeske <at> gmail.com, 10162 <at> debbugs.gnu.org
Subject: bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when
 rcirc-authenticate-before-join is set
Date: Fri, 17 Feb 2017 12:18:22 +1100
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 :-(




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Mon, 03 Jun 2019 02:12:02 GMT) Full text and rfc822 format available.

Message #24 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Steve Scott <steve <at> stevescott.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#10162: [PATCH] 24.0.91; rcirc autojoin broken (freenode/oftc) when
 rcirc-authenticate-before-join is set
Date: Sun, 02 Jun 2019 21:55:34 -0300
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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Mon, 03 Jun 2019 22:17:02 GMT) Full text and rfc822 format available.

Message #27 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Steve Scott <steve <at> stevescott.ca>
Cc: 10162 <at> debbugs.gnu.org
Subject: Re: bug#10162: [PATCH] 24.0.91;
 rcirc autojoin broken (freenode/oftc) when
 rcirc-authenticate-before-join is set
Date: Mon, 03 Jun 2019 18:16:01 -0400
Steve Scott <steve <at> 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?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Mon, 03 Jun 2019 22:57:01 GMT) Full text and rfc822 format available.

Message #30 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: Steve Scott <steve <at> stevescott.ca>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 10162 <at> debbugs.gnu.org
Subject: Re: bug#10162: [PATCH] 24.0.91;
 rcirc autojoin broken (freenode/oftc) when
 rcirc-authenticate-before-join is set
Date: Mon, 03 Jun 2019 19:54:16 -0300
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 <at> 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?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10162; Package emacs. (Thu, 06 Jun 2019 00:35:01 GMT) Full text and rfc822 format available.

Message #33 received at 10162 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Steve Scott <steve <at> stevescott.ca>
Cc: 10162 <at> debbugs.gnu.org
Subject: Re: bug#10162: [PATCH] 24.0.91;
 rcirc autojoin broken (freenode/oftc) when
 rcirc-authenticate-before-join is set
Date: Wed, 05 Jun 2019 20:34:32 -0400
tags 10162 fixed
close 10162 27.1
quit

Steve Scott <steve <at> 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.





Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 06 Jun 2019 00:35:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 10162 <at> debbugs.gnu.org and trentbuck <at> gmail.com (Trent W. Buck) Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 06 Jun 2019 00:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Jul 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.