From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#55199: 28.1; rcirc auth-source integration doesn't handle port being a number Date: Sun, 21 Aug 2022 10:02:24 +0200 Message-ID: <878rnim3cf.fsf@gmx.de> References: <87v8u2tobr.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Philip Kaludercic , 55199@debbugs.gnu.org To: Javier Olaechea Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 21 10:03:38 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPfvl-00038G-Ah for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 10:03:37 +0200 Original-Received: from localhost ([::1]:48866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPfvk-0004vZ-0t for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 04:03:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPfvC-0004vQ-Io for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 04:03:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPfvC-0002pN-A6 for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 04:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPfvB-0002Ia-S8 for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 04:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Aug 2022 08:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55199 X-GNU-PR-Package: emacs Original-Received: via spool by 55199-submit@debbugs.gnu.org id=B55199.16610689718821 (code B ref 55199); Sun, 21 Aug 2022 08:03:01 +0000 Original-Received: (at 55199) by debbugs.gnu.org; 21 Aug 2022 08:02:51 +0000 Original-Received: from localhost ([127.0.0.1]:33765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPfv1-0002IC-HU for submit@debbugs.gnu.org; Sun, 21 Aug 2022 04:02:51 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:42475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPfuw-0002Hw-5B for 55199@debbugs.gnu.org; Sun, 21 Aug 2022 04:02:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661068946; bh=t4MwmkcTNijkxu6KwFhzA8k1tC5IWoFu5iePAwiRU60=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Ovj78n6OQhT99Z0ys3ZlDe+XBK5x27IGm/5KDGjU5g9uXaLf+tmUaZlkBmj3XjOLl 9SHB3uCdDfAOnio1XTfGeqd6Cr6ceqICNLAOWfPa6o5kuIl7tPgjbSDMe+MwnMT0i7 Jny3WE5VMFRveLmm8fQJ6LeNAIUpkXisi8Eco1ps= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.112.81]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mn2W5-1p8ry90Y8l-00k408; Sun, 21 Aug 2022 10:02:26 +0200 In-Reply-To: (Javier Olaechea's message of "Sun, 21 Aug 2022 01:00:48 -0500") X-Provags-ID: V03:K1:/g/MTS4gdUZho1m82d/u4G98XOLD/eW8KPrUOtejxQj5HTDM+Y5 xb6QJznXvnUHzWjBCbe3cNrldttVFePQbBJVmqqyRp+Rhl0a0tOuu1en++ajiEAtrpLQSUS HATJl4ST4thA7f8smZa4GySJnPO98YmPk5vQxztwmmKY7v7OgRjxb7+fZim/YAtBbUZ7Fwe /khT4DggTnlihwaHDCe/Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:zq+317E/0HM=:1xaKQufMBLcTpG0RStChfk BDQgVHUHHtXlv3dWk2Uo/LrYz45U76kgYZYbxdrkgdMZNGYV/hBFpgn4beAF7LMzAEpd0v/wU Dar6Gj9++Nb2POckwqduSlHOa4VB8VrEzWDft6k3YhjUZaMKmUQ7NswLW3vY1oPBqhxR0/Jhs q5kjvyK+Yw8h7YOho5BQ3N5TT8h7HtXIXS5ROf7VwsThqF6WxG8eklyCgpVQlZC/zdQ/C0DWJ YyxA5lAy0DfDrWCE+Z165DGG6SxWMTLZSgQkT7/7NsPTF8ea1s5WBXWVBsx9UMLBNzz1oj0Ir toIgZrMQrT9lrmgfugmLVUv0CcasRRcvaOzICAYXfanAPQAJfmPUznstN+GXasUARR3wImeEl mem+cvU2ubs2VshqXc03lmt0DJ6AYya43/DzOKbRg4n1oXU0T1uEQINtjmVIk3kFCpXmXtfuW lzN7Tc8SpIMMbDJkVRKfCEf3VqZBzS2oQsIa46J7Aq1omBW5DfPzQMYS+AuCSKhKiaz7e2T4K 45RLeUr1YLjB632GpFlRc7RdLYcUmADBeFh/yU7U1flmEt21KYSSp4MT3rSGV+DluaZT/Om7B Zgw0AZIDmqMmsc11H6wDB4kuySAIuhLGOJHawwru7pfhSOKk5N2sgoVDGj0JBZwTNr5vIYEOD LVJJx1uVpPVPv6ZL60Ki4O/q8UZ1L69tqrGRopC+UPvwSaUEUZzS1aNWVrthpjBGYjioVCHYO tHDKfIXsI3ssDGPkEvJtHucvEsFqqIr1wDvSYLAY6SQoowvSs5WelAcdXZMsJuEh4+/nYxU2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240287 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Javier Olaechea writes: Hi Javier, > I have a simple way to reproduce the issue. Start emacs with emacs -Q. > Then evaluate the following snippet > > (require 'auth-source) > > (let ((auth-sources '("secrets:Login"))) > (auth-source-search :port 6697)) Yep. Fails here as well. > So the issue is not at all on rcirc, but that secrets backend assumes > that the search specs should be strings. I haven't researched the > SecretService API to know if this is a restriction of the underlying > dbus service the secrets backend works with or just a restrictive > assumption of the code in secrets.el. The Secret Service API allows only strings for attribute keys and values, see : =2D-8<---------------cut here---------------start------------->8--- READWRITE Dict Attributes ; =2D-8<---------------cut here---------------end--------------->8--- Looking at auth-source.el. there was a similar problem in auth-source-plstore-search, see commit fcb89237d9ab969bcd29bf8f8fae8d9905644b92 in Emacs git. Applying a similar change to auth-source-secrets-search let the error go away. I've appended the patch, could you pls check in the rcirc context? I'm also not sure whether we need to change something when creating an item in auth-source-secrets-create. Best regrads, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment diff --git a/lisp/auth-source.el b/lisp/auth-source.el index f198362f10..c79e5b81f7 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1618,10 +1618,13 @@ auth-source-secrets-search (search-specs (auth-source-secrets-listify-pattern (apply #'append (mapcar (lambda (k) - (if (or (null (plist-get spec k)) - (eq t (plist-get spec k))) - nil - (list k (plist-get spec k)))) + (let ((v (plist-get spec k))) + (if (or (null v) + (eq t v)) + nil + (list + k + (auth-source-ensure-strings v))))) search-keys)))) ;; needed keys (always including host, login, port, and secret) (returned-keys (delete-dups (append --=-=-=--