From: Michael Albinus <michael.albinus@gmx.de>
To: LdBeth <andpuke@foxmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 64977@debbugs.gnu.org
Subject: bug#64977: 29.1; `auth-source-macos-keychain-search' handles :user key incorrectly
Date: Sat, 12 Aug 2023 18:02:59 +0200 [thread overview]
Message-ID: <87r0o8z1sc.fsf@gmx.de> (raw)
In-Reply-To: <tencent_961D362BABBF5C37D26E72C7BC1E7B8C2507@qq.com> (LdBeth's message of "Sat, 12 Aug 2023 10:40:36 -0500")
LdBeth <andpuke@foxmail.com> writes:
Hi,
> I think it is possible to use cl-left to redefine
> `auth-source-macos-keychain-search-items' to avoid calling external
> security command and just check the argument passed to
> `call-process'.
>
> Something like:
>
> (cl-letf (((symbol-function 'call-process) (lambda (&rest r) (print r))))
> (auth-source-search :user "ldb" :port "irc"))
>
> ("/usr/bin/security" nil t nil "find-internet-password" "-g" "-a" "ldb" "-r" "irc ")
>
> ("/usr/bin/security" nil t nil "find-generic-password" "-g" "-a" "ldb" "-s" "irc")
Yes, like this. And in the lambda function, you could check the expected
arguments of the "/usr/bin/security" call by `should' and friends.
Would you like to add such test(s)? This would give us more confidence
that nothing is or will be broken, because people using macOS would test
this by default when running "make check", even if they don't care the
macOS keychain.
> ldb
Best regards, Michael.
next prev parent reply other threads:[~2023-08-12 16:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 15:46 bug#64977: 29.1; `auth-source-macos-keychain-search' handles :user key incorrectly LdBeth
2023-08-02 13:22 ` J.P.
2023-08-08 22:20 ` LdBeth
2023-08-12 6:55 ` Eli Zaretskii
2023-08-12 11:39 ` Michael Albinus
2023-08-12 12:55 ` LdBeth
2023-08-12 13:14 ` Michael Albinus
2023-08-12 15:40 ` LdBeth
2023-08-12 16:02 ` Michael Albinus [this message]
2023-08-12 19:02 ` LdBeth
2023-08-13 16:34 ` Michael Albinus
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=87r0o8z1sc.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=64977@debbugs.gnu.org \
--cc=andpuke@foxmail.com \
--cc=eliz@gnu.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.