Subject: 29.1; `auth-source-macos-keychain-search' handles :user key incorrectly
From: LdBeth <[email-masked]>
To: [email-masked]
Date: Mon, 31 Jul 2023 10:46:49 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Right after switched from 28.2, my config that uses `auth-source.el'
to retrieve IRC password from macOS keychain stopped working.

Here is the backtrace, apparently there is a function in the chain
forget to handle the :user provided as a list when searching.

Debugger entered--Lisp error: (wrong-type-argument stringp ("ldb"))
  call-process("/usr/bin/security" nil t nil "find-internet-password" "-g" "-s" "irc.libera.chat" "-a" ("ldb") "-r" "\"irc\"")
  apply(call-process "/usr/bin/security" nil t nil ("find-internet-password" "-g" "-s" "irc.libera.chat" "-a" ("ldb") "-r" "\"irc\""))
  auth-source-macos-keychain-search-items("default" macos-keychain-internet 5000 "irc.libera.chat" "\"irc\"" :type macos-keychain-internet :require (:secret) :user ("ldb") :require (:secret))
  apply(auth-source-macos-keychain-search-items "default" macos-keychain-internet 5000 "irc.libera.chat" "\"irc\"" (:type macos-keychain-internet :require (:secret) :user ("ldb") :require (:secret)))
  auth-source-macos-keychain-search(:backend #<auth-source-backend auth-source-backend-1ff6005ea858> :type macos-keychain-internet :max 5000 :require (:secret) :create nil :delete nil :user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret) :max 5000)
  apply(auth-source-macos-keychain-search :backend #<auth-source-backend auth-source-backend-1ff6005ea858> :type macos-keychain-internet :max 5000 :require (:secret) :create nil :delete nil (:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret) :max 5000))
  auth-source-search-backends((#<auth-source-backend auth-source-backend-1ff6005ea858> #<auth-source-backend auth-source-backend-1ff6005ea874>) (:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret) :max 5000) 5000 nil nil (:secret))
  auth-source-search(:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret) :max 5000)
  apply(auth-source-search (:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret) :max 5000))
  erc--auth-source-search(:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret))
  apply(erc--auth-source-search (:user ("ldb") :host ("irc.libera.chat") :port ("irc") :require (:secret)))
  erc-auth-source-search(:user "ldb")
  erc--compute-server-password(nil "ldb")
  erc-determine-parameters("irc.libera.chat" "6697" "ldb" "unknown" "user" nil)
  erc-open("irc.libera.chat" "6697" "ldb" "unknown" t nil nil nil nil nil "user" nil)
  erc-tls(:server "irc.libera.chat" :port "6697")
  #f(compiled-function (&rest _) #<bytecode -0x10737acf4eaa4b33>)((push-button :args nil :value #("Libera Chat" 0 11 (face font-lock-keyword-face)) :help-echo "Start ERC." :action #f(compiled-function (&rest _) #<bytecode -0x10737acf4eaa4b33>) :mouse-face highlight :follow-link "\15" :button-overlay #<overlay from 165 to 178 in *LaunchPad*> :from #<marker (moves after insertion) at 165 in *LaunchPad*> :to #<marker at 178 in *LaunchPad*>) nil)
  widget-apply((push-button :args nil :value #("Libera Chat" 0 11 (face font-lock-keyword-face)) :help-echo "Start ERC." :action #f(compiled-function (&rest _) #<bytecode -0x10737acf4eaa4b33>) :mouse-face highlight :follow-link "\15" :button-overlay #<overlay from 165 to 178 in *LaunchPad*> :from #<marker (moves after insertion) at 165 in *LaunchPad*> :to #<marker at 178 in *LaunchPad*>) :action nil)
  widget-apply-action((push-button :args nil :value #("Libera Chat" 0 11 (face font-lock-keyword-face)) :help-echo "Start ERC." :action #f(compiled-function (&rest _) #<bytecode -0x10737acf4eaa4b33>) :mouse-face highlight :follow-link "\15" :button-overlay #<overlay from 165 to 178 in *LaunchPad*> :from #<marker (moves after insertion) at 165 in *LaunchPad*> :to #<marker at 178 in *LaunchPad*>) nil)
  widget-button-press(165)
  funcall-interactively(widget-button-press 165)
  call-interactively(widget-button-press nil nil)
  command-execute(widget-button-press)

In GNU Emacs 29.1 (build 1, x86_64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6.8 (Build 21G725)) of 2023-07-31 built on
Costume-Party.localWindowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6.8

Configured using:
 'configure --with-small-ja-dic CPPFLAGS=-I/opt/pkg/include
 LDFLAGS=-L/opt/pkg/lib'

Configured features:
ACL GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS ZLIB

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

Major mode: Fundamental

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-networks-mode: t
  recentf-mode: t
  vertico-mode: t
  filladapt-mode: t
  global-page-break-lines-mode: t
  which-key-mode: t
  global-paren-face-mode: t
  override-global-mode: t
  ctrlf-mode: t
  ctrlf-local-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-jump
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-ensure
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-core
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-delight
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-diminish
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-bind-key
/Users/ldbeth/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/bind-key
/Users/ldbeth/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/use-package/use-package-lint
/Users/ldbeth/.emacs.d/elpa/flim-20230205.1423/sasl hides /Users/ldbeth/Downloads/emacs-29.1/nextstep/Emacs.app/Contents/Resources/lisp/net/sasl

Features:
(shadow mel-q-ccl ccl flyspell ispell modb-standard elmo-sendlog
elmo-internal elmo-rss elmo-maildir utf-7 elmo-imap4 time-stamp
mime-diff lsdb wl-fldmgr wl-template wl-demo wl-thread wl-action wl
wl-draft wl-folder elmo-nntp elmo-filter wl-summary wl-refile
wl-message wl-mime mime-play filename wl-e21 wl-highlight elmo-mime
mmelmo-buffer mmelmo-imap mmimap mmbuffer mmgeneric wl-address wl-util
wl-vars wl-version elmo-net elmo-cache elmo-map elmo-dop modb-generic
elmo-flag elmo-localdir elmo elmo-signal elmo-msgdb modb modb-entity
elmo-date elmo-util elmo-vars elmo-version mime-edit mime-image
mime-view mime-conf calist invisible inv-23 mime-setup mail-mime-setup
semi-setup advice semi-def mime-parse mime luna eword-encode
eword-decode mel path-util pces pces-e20 pces-20 mime-def alist
mcs-e20 mcs-20 mcharset std11 pccl pccl-20 broken static apel-ver
product timezone emacsbug message yank-media dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail
shortdoc bug-reference jka-compr mwim help-fns radix-tree cl-print
debug backtrace find-func cus-start cus-load rx orderless
vertico-directory erc-list erc-menu erc-join erc-ring erc-pcomplete
pcomplete comint ansi-osc ansi-color ring erc-track erc-match
erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc format-spec
erc-backend erc-networks erc-common erc-compat erc-loaddefs mail-utils
gnutls network-stream url-http url-gw nsm url-auth textsec uni-scripts
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
idna-mapping uni-confusable textsec-check url-queue url-cache shr
pixel-fill kinsoku url-file puny svg dom newst-plainview newst-ticker
newst-reader newst-backend iso8601 xml time-date recentf tree-widget
vc-git diff-mode vc-dispatcher bookmark text-property-search pp
disp-table wid-edit cl-extra help-mode edmacro kmacro vertico compat
compat-29 filladapt page-break-lines which-key ctrlf thingatpt hl-line
dim-paren tecoline spacemacs-buffer spacemacs-light-theme
spacemacs-dark-theme spacemacs-theme-autoloads core-autoloads bind-key
easy-mmode info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win 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 nadvice seq simple cl-generic
indonesian philippine 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 abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads kqueue
cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 356680 134770)
 (symbols 48 22848 15)
 (strings 32 86294 9713)
 (string-bytes 1 5357679)
 (vectors 16 41941)
 (vector-slots 8 739161 117204)
 (floats 8 406 749)
 (intervals 56 13370 879)
 (buffers 976 32))