unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10162: 24.0.91; rcirc autojoin broken (freenode/oftc) when rcirc-authenticate-before-join is set
@ 2011-11-30  0:50 Trent W. Buck
  2012-10-29 11:23 ` Chong Yidong
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Trent W. Buck @ 2011-11-30  0:50 UTC (permalink / raw)
  To: 10162

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)





^ 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
                   ` (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

end of thread, other threads:[~2019-06-06  0:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-06-03 22:16   ` Noam Postavsky
2019-06-03 22:54     ` Steve Scott
2019-06-06  0:34       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).