all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alexey Veretennikov <alexey.veretennikov@gmail.com>
Cc: 22188@debbugs.gnu.org, Lars Magne Ingebrigtsen <larsi@gnus.org>
Subject: bug#22188: 24.5; auth-source-search ignores netrc entries with port set
Date: Thu, 17 Dec 2015 20:36:55 +0200	[thread overview]
Message-ID: <8337v0zzug.fsf@gnu.org> (raw)
In-Reply-To: <m2h9jiazwt.fsf@MacBook-Pro.lan> (message from Alexey Veretennikov on Wed, 16 Dec 2015 21:42:26 +0100)

> From: Alexey Veretennikov <alexey.veretennikov@gmail.com>
> Date: Wed, 16 Dec 2015 21:42:26 +0100
> 
> The auth-source-search function ignores .authinfo entries which contains
> port if port is not specified in the search.
> 
> Steps to reproduce:
> 
> 1) Create a file "~/test.authinfo" with the following contents:
> machine mymachine1 login user1 password pass1
> machine mymachine2 login user2 password pass2 port 100
> machine mymachine3 login user3 password pass3
> machine mymachine4 login user4 password pass4 port 200
> 
> 2) Perform in *scratch* buffer to set this file as a auth source
> (require 'auth-source)
> (auth-source-forget-all-cached)
> (setq auth-sources '("~/test.authinfo"))
> 
> 3) Run the following:
> (dolist (account (auth-source-search))
>   (print (plist-get account :host)))
> 
> Output:
> "mymachine1"
> 
> "mymachine3"
> nil
> 
> 4) Run the following:
> 
> (dolist (account (auth-source-search :port 100))
>   (print (plist-get account :host)))
> 
> 
> Output:
> "mymachine1"
> 
> "mymachine2"
> 
> "mymachine3"
> nil
> 
> 5) Run the following:
> 
> (dolist (account (auth-source-search :port 200))
>   (print (plist-get account :host)))
> 
> "mymachine1"
> 
> "mymachine3"
> 
> "mymachine4"
> nil
> 
> 
> Expected result:
> In step 2 the auth-source-search function should return all 4 machines

Technically, you cannot expect more than 1 result, if you don't
specify :max (it defaults to 1).  But that doesn't mean the bug you
report isn't real: it is.  What happened was that the function that
parsed the netrc entries would reject any entry which had a port
specified.

This is now fixed on the emacs-25 branch, in commit 9384953.

Lars, I hope it's okay to fix something in Gnus in the Emacs
repository?  I assume you will synchronize with your repo.

Thanks.





  reply	other threads:[~2015-12-17 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 20:42 bug#22188: 24.5; auth-source-search ignores netrc entries with port set Alexey Veretennikov
2015-12-17 18:36 ` Eli Zaretskii [this message]
2015-12-23 16:53   ` Ted Zlatanov
2015-12-24 14:22     ` Alexey Veretennikov
2015-12-24 15:09       ` Andreas Schwab
2015-12-24 15:18         ` Ted Zlatanov
2015-12-24 15:25           ` Lars Ingebrigtsen
2015-12-24 21:02             ` Ted Zlatanov
2015-12-25 20:41               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8337v0zzug.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22188@debbugs.gnu.org \
    --cc=alexey.veretennikov@gmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.