bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64977: 29.1; `auth-source-macos-keychain-search' handles :user key i


From: LdBeth
Subject: bug#64977: 29.1; `auth-source-macos-keychain-search' handles :user key incorrectly
Date: Sat, 12 Aug 2023 10:40:36 -0500
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (x86_64-apple-darwin20.6.0) MULE/6.0 (HANACHIRUSATO)

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

ldb

>>>>> In <87wmy0z9lp.fsf@gmx.de> 
>>>>>   Michael Albinus <michael.albinus@gmx.de> wrote:
> LdBeth <andpuke@foxmail.com> writes:

> Hi,

>> To test this function, first add password using:
>>
>> $ security add-internet-password -s irc.libera.chat -a ldb -r 'irc ' -w 
>> 'passwd'
>>
>> In emacs, use something like
>>
>> (auth-source-search :user "ldb" :port "irc")
>>
>> should about to retrieve the password.

> Thanbks.

> Do you believe it is possible to add corresponding tests to
> auth-source-tests.el, like we have for the netrc and secrets backends?

>> ldb

> Best regards, Michael.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]