unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
@ 2022-10-26 19:30 bk
  2022-10-27  9:08 ` Robert Pluim
  2022-10-27 14:04 ` Filipp Gunbin
  0 siblings, 2 replies; 9+ messages in thread
From: bk @ 2022-10-26 19:30 UTC (permalink / raw)
  To: 58807

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@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@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@asterio.cloud
├── bk@asterio.cloud@127.0.0.1
├── bk@asterio.cloud@localhost
└── localhost
     └── bk@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@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@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@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))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-26 19:30 bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source bk
@ 2022-10-27  9:08 ` Robert Pluim
  2022-10-27  9:15   ` Bartosz Kaczyński
  2022-10-27 14:04 ` Filipp Gunbin
  1 sibling, 1 reply; 9+ messages in thread
From: Robert Pluim @ 2022-10-27  9:08 UTC (permalink / raw)
  To: bk; +Cc: 58807

>>>>> On Wed, 26 Oct 2022 21:30:57 +0200, bk@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@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
-- 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27  9:08 ` Robert Pluim
@ 2022-10-27  9:15   ` Bartosz Kaczyński
  2022-10-27  9:45     ` Robert Pluim
  0 siblings, 1 reply; 9+ messages in thread
From: Bartosz Kaczyński @ 2022-10-27  9:15 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 58807

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@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@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27  9:15   ` Bartosz Kaczyński
@ 2022-10-27  9:45     ` Robert Pluim
  2022-10-27 13:19       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Pluim @ 2022-10-27  9:45 UTC (permalink / raw)
  To: Bartosz Kaczyński; +Cc: 58807

>>>>> On Thu, 27 Oct 2022 11:15:37 +0200, Bartosz Kaczyński <bk@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
-- 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27  9:45     ` Robert Pluim
@ 2022-10-27 13:19       ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-10-27 13:19 UTC (permalink / raw)
  To: Robert Pluim; +Cc: bk, 58807

> Cc: 58807@debbugs.gnu.org
> From: Robert Pluim <rpluim@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-26 19:30 bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source bk
  2022-10-27  9:08 ` Robert Pluim
@ 2022-10-27 14:04 ` Filipp Gunbin
  2022-10-27 16:28   ` Robert Pluim
  1 sibling, 1 reply; 9+ messages in thread
From: Filipp Gunbin @ 2022-10-27 14:04 UTC (permalink / raw)
  To: bk; +Cc: 58807

Hi,

On 26/10/2022 21:30 +0200, bk@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@asterio.cloud
> ├── bk@asterio.cloud@127.0.0.1
> ├── bk@asterio.cloud@localhost
> └── localhost
>     └── bk@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27 14:04 ` Filipp Gunbin
@ 2022-10-27 16:28   ` Robert Pluim
  2022-10-27 17:55     ` Filipp Gunbin
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Pluim @ 2022-10-27 16:28 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: Bartosz Kaczyński

>>>>> On Thu, 27 Oct 2022 17:04:18 +0300, Filipp Gunbin <fgunbin@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
-- 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27 16:28   ` Robert Pluim
@ 2022-10-27 17:55     ` Filipp Gunbin
  2022-10-28  7:38       ` Robert Pluim
  0 siblings, 1 reply; 9+ messages in thread
From: Filipp Gunbin @ 2022-10-27 17:55 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Bartosz Kaczyński

On 27/10/2022 18:28 +0200, Robert Pluim wrote:

>>>>>> On Thu, 27 Oct 2022 17:04:18 +0300, Filipp Gunbin <fgunbin@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source
  2022-10-27 17:55     ` Filipp Gunbin
@ 2022-10-28  7:38       ` Robert Pluim
  0 siblings, 0 replies; 9+ messages in thread
From: Robert Pluim @ 2022-10-28  7:38 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: Bartosz Kaczyński, 58807

>>>>> On Thu, 27 Oct 2022 20:55:25 +0300, Filipp Gunbin <fgunbin@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
-- 





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-28  7:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26 19:30 bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source bk
2022-10-27  9:08 ` Robert Pluim
2022-10-27  9:15   ` Bartosz Kaczyński
2022-10-27  9:45     ` Robert Pluim
2022-10-27 13:19       ` Eli Zaretskii
2022-10-27 14:04 ` Filipp Gunbin
2022-10-27 16:28   ` Robert Pluim
2022-10-27 17:55     ` Filipp Gunbin
2022-10-28  7:38       ` Robert Pluim

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).