GNU bug report logs - #58807
28.1; Authentication in Gnus using password-store backend of auth-source

Previous Next

Package: emacs;

Reported by: bk <at> asterio.cloud

Date: Thu, 27 Oct 2022 00:11:02 UTC

Severity: normal

Found in version 28.1

Fixed in version 29.1

Done: Robert Pluim <rpluim <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 58807 in the body.
You can then email your comments to 58807 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#58807; Package emacs. (Thu, 27 Oct 2022 00:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to bk <at> asterio.cloud:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Oct 2022 00:11:02 GMT) Full text and rfc822 format available.

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

From: bk <at> asterio.cloud
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1; Authentication in Gnus using password-store backend of
 auth-source
Date: Wed, 26 Oct 2022 21:30:57 +0200
Hi,

As it is written in subject I can't authenticate to my local dovecot 
server when I have enabled pass backend in auth-source. I don't have 
this problem if I use default ~/.authinfo file. If it's not exist it's 
generated by Emacs and contains line as follows:
machine localhost login bk <at> asterio.cloud password pass

My minimal ~/.emacs file
(setq auth-source-debug 'trivia)
(setq auth-sources '(password-store))

(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
      '((nnimap "localhost"
		(nnimap-address "127.0.0.1")
		(nnimap-stream network)
		(nnimap-authenticator login)
		(nnimap-server-port 1143)
		(nnimap-user "bk <at> asterio.cloud"))))

According to documentation [1] I tried numerous of entries of my user 
password in pass:
pass ls
Password Store
├── 127.0.0.1
│   └── bk <at> asterio.cloud
├── bk <at> asterio.cloud <at> 127.0.0.1
├── bk <at> asterio.cloud <at> localhost
└── localhost
    └── bk <at> asterio.cloud

But none of this works and in *Messages* buffer I have always following 
logs:
auth-source-backend-parse: invalid backend spec: password-store
auth-source-search: found 1 backends matching (:max 1 :host ("localhost" 
"127.0.0.1") :port (1143 "imap" "143") :user "bk <at> asterio.cloud" :require 
(:user :secret) :create t)
auth-source-search: found 0 results (max 1) matching (:max 1 :host 
("localhost" "127.0.0.1") :port (1143 "imap" "143") :user 
"bk <at> asterio.cloud" :require (:user :secret) :create t)
auth-source-search: CREATED 0 results (max 1) matching (:max 1 :host 
("localhost" "127.0.0.1") :port (1143 "imap" "143") :user 
"bk <at> asterio.cloud" :require (:user :secret) :create t)
Opening nnimap server on localhost...failed:

I don't try this backend and library in other situations (e.g. TRAMP) so 
I am not sure it's more related to Gnus or Auth-source.

[1] 
https://www.gnu.org/software/emacs/manual/html_node/auth/The-Unix-password-store.html


In GNU Emacs 28.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.34, 
cairo version 1.16.0)
Windowing system distributor 'SUSE LINUX', version 11.0.12201004
System Description: openSUSE MicroOS

Configured using:
 'configure --disable-build-details --without-pop --with-mailutils
 --without-hesiod --with-gameuser=:games --with-kerberos
 --with-kerberos5 --with-file-notification=inotify --with-modules
 --enable-autodepend --prefix=/usr --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --localstatedir=/var
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --with-file-notification=yes --with-native-compilation
 
--enable-locallisppath=/usr/share/emacs/28.1/site-lisp:/usr/share/emacs/site-lisp
 --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
 --with-gif --with-png --with-rsvg --with-dbus --with-xft --without-gpm
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 --x-includes=/usr/include --x-libraries=/usr/lib64 --with-libotf
 --with-m17n-flt --with-cairo --with-xwidgets --build=x86_64-suse-linux
 --with-dumping=pdumper 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE
 -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables
 -fasynchronous-unwind-tables -fstack-clash-protection
 -Werror=return-type -flto=auto -g -D_GNU_SOURCE
 -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label
 -fno-optimize-sibling-calls -fno-PIE -DPDMP_BASE='\''"emacs-gtk"'\'''
 'LDFLAGS=-Wl,-no-pie -Wl,-O2''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_NUMERIC: POSIX
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail comp comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra
help-mode seq byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils delsel lpr
easy-mmode pcase iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 94010 9705)
 (symbols 48 7931 3)
 (strings 32 22898 2026)
 (string-bytes 1 747855)
 (vectors 16 18629)
 (vector-slots 8 336867 21359)
 (floats 8 32 197)
 (intervals 56 606 0)
 (buffers 992 14))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 09:09:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: bk <at> asterio.cloud
Cc: 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 11:08:32 +0200
>>>>> On Wed, 26 Oct 2022 21:30:57 +0200, bk <at> asterio.cloud said:

    bk> Hi,
    bk> As it is written in subject I can't authenticate to my local dovecot
    bk> server when I have enabled pass backend in auth-source. I don't have
    bk> this problem if I use default ~/.authinfo file. If it's not exist it's
    bk> generated by Emacs and contains line as follows:
    bk> machine localhost login bk <at> asterio.cloud password pass

    bk> My minimal ~/.emacs file
    bk> (setq auth-source-debug 'trivia)
    bk> (setq auth-sources '(password-store))

(info "(auth) Help for users") describes how to enable `pass', and
thatʼs not it.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 09:16:02 GMT) Full text and rfc822 format available.

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

From: Bartosz Kaczyński <bk <at> asterio.cloud>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 11:15:37 +0200
Indeed, in Emacs build from master branch the command and manual differs 
from the manual on website [1]

Now my config looks as follows:

(use-package auth-source
  :config
  (auth-source-pass-enable))

and I can authenticate to the server.

Thank you!

[1] 
https://www.gnu.org/software/emacs/manual/html_node/auth/Help-for-users.html

On 10/27/22 11:08, Robert Pluim wrote:
>>>>>> On Wed, 26 Oct 2022 21:30:57 +0200, bk <at> asterio.cloud said:
>      bk> Hi,
>      bk> As it is written in subject I can't authenticate to my local dovecot
>      bk> server when I have enabled pass backend in auth-source. I don't have
>      bk> this problem if I use default ~/.authinfo file. If it's not exist it's
>      bk> generated by Emacs and contains line as follows:
>      bk> machine localhost login bk <at> asterio.cloud password pass
>
>      bk> My minimal ~/.emacs file
>      bk> (setq auth-source-debug 'trivia)
>      bk> (setq auth-sources '(password-store))
>
> (info "(auth) Help for users") describes how to enable `pass', and
> thatʼs not it.
>
> Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 09:47:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Bartosz Kaczyński <bk <at> asterio.cloud>
Cc: 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 11:45:51 +0200
>>>>> On Thu, 27 Oct 2022 11:15:37 +0200, Bartosz Kaczyński <bk <at> asterio.cloud> said:

    Bartosz> Indeed, in Emacs build from master branch the command and manual
    Bartosz> differs from the manual on website [1]

Thatʼs an unfortunate mistake.

I see this was only fixed back in April, and only on master.

Eli, I donʼt think there are going to be any more releases of emacs
28, is it worth cherry-picking 6019ca9dd2 to the emacs-28 branch? (and
then maybe regenerating the HTML manuals?)

    Bartosz> Now my config looks as follows:

    Bartosz> (use-package auth-source
    Bartosz>   :config
    Bartosz>   (auth-source-pass-enable))

    Bartosz> and I can authenticate to the server.

Glad itʼs working.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 13:20:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: bk <at> asterio.cloud, 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1;
 Authentication in Gnus using password-store backend of auth-source
Date: Thu, 27 Oct 2022 16:19:25 +0300
> Cc: 58807 <at> debbugs.gnu.org
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Thu, 27 Oct 2022 11:45:51 +0200
> 
> Eli, I donʼt think there are going to be any more releases of emacs
> 28, is it worth cherry-picking 6019ca9dd2 to the emacs-28 branch? (and
> then maybe regenerating the HTML manuals?)

Doesn't look important enough to me, on both counts.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 14:05:02 GMT) Full text and rfc822 format available.

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

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: bk <at> asterio.cloud
Cc: 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 17:04:18 +0300
Hi,

On 26/10/2022 21:30 +0200, bk <at> asterio.cloud wrote:

[...]

> According to documentation [1] I tried numerous of entries of my user
> password in pass:
> pass ls
> Password Store
> ├── 127.0.0.1
> │   └── bk <at> asterio.cloud
> ├── bk <at> asterio.cloud <at> 127.0.0.1
> ├── bk <at> asterio.cloud <at> localhost
> └── localhost
>     └── bk <at> asterio.cloud
>

Looks like you forgot to gpg-encrypt the files, while the code
explicitly looks for them:

--8<---------------cut here---------------start------------->8---
(defun auth-source-pass-entries ()
  "Return a list of all password store entries."
  (let ((store-dir (expand-file-name auth-source-pass-filename)))
    (mapcar
     (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
     (directory-files-recursively store-dir "\\.gpg\\'"))))
--8<---------------cut here---------------end--------------->8---

I tested using setup similar to yours, but with gpg files -- it worked.

Filipp




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 16:29:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Bartosz Kaczyński <bk <at> asterio.cloud>, .cloud,
 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 18:28:27 +0200
>>>>> On Thu, 27 Oct 2022 17:04:18 +0300, Filipp Gunbin <fgunbin <at> fastmail.fm> said:
    Filipp> (defun auth-source-pass-entries ()
    Filipp>   "Return a list of all password store entries."
    Filipp>   (let ((store-dir (expand-file-name auth-source-pass-filename)))
    Filipp>     (mapcar
    Filipp>      (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
    Filipp>      (directory-files-recursively store-dir "\\.gpg\\'"))))

So `auth-source-pass-filename' is actually a *directory*. <sigh>
Perhaps we need an obsoletion and and alias.

    Filipp> I tested using setup similar to yours, but with gpg files -- it worked.

I saw nothing in Bartoszʼ original bugreport indicating that the files
were not gpg encrypted, nor that they were.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Thu, 27 Oct 2022 17:56:02 GMT) Full text and rfc822 format available.

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

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Bartosz Kaczyński <bk <at> asterio.cloud>, .cloud,
 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Thu, 27 Oct 2022 20:55:25 +0300
On 27/10/2022 18:28 +0200, Robert Pluim wrote:

>>>>>> On Thu, 27 Oct 2022 17:04:18 +0300, Filipp Gunbin <fgunbin <at> fastmail.fm> said:
>     Filipp> (defun auth-source-pass-entries ()
>     Filipp>   "Return a list of all password store entries."
>     Filipp>   (let ((store-dir (expand-file-name auth-source-pass-filename)))
>     Filipp>     (mapcar
>     Filipp>      (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
>     Filipp>      (directory-files-recursively store-dir "\\.gpg\\'"))))
>
> So `auth-source-pass-filename' is actually a *directory*. <sigh>
> Perhaps we need an obsoletion and and alias.
>
>     Filipp> I tested using setup similar to yours, but with gpg files -- it worked.
>
> I saw nothing in Bartoszʼ original bugreport indicating that the files
> were not gpg encrypted, nor that they were.

I thought that these were files/dirs:

> Password Store
> ├── 127.0.0.1
[..]

But now I see that it's the output of "pass" (never used "pass" or
auth-source-pass before).

So probably the files are good, and it was really
auth-source-forget-all-cached that helped (auth-source-pass-enable does
nothing more than modifying auth-sources and calling it).

Filipp




bug marked as fixed in version 29.1, send any further explanations to 58807 <at> debbugs.gnu.org and bk <at> asterio.cloud Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 28 Oct 2022 07:38:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58807; Package emacs. (Fri, 28 Oct 2022 07:39:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Bartosz Kaczyński <bk <at> asterio.cloud>,
 58807 <at> debbugs.gnu.org
Subject: Re: bug#58807: 28.1; Authentication in Gnus using password-store
 backend of auth-source
Date: Fri, 28 Oct 2022 09:38:29 +0200
>>>>> On Thu, 27 Oct 2022 20:55:25 +0300, Filipp Gunbin <fgunbin <at> fastmail.fm> said:

    Filipp> So probably the files are good, and it was really
    Filipp> auth-source-forget-all-cached that helped (auth-source-pass-enable does
    Filipp> nothing more than modifying auth-sources and calling it).

Yep. Iʼm closing this bug.

Robert
-- 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Nov 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 208 days ago.

Previous Next


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