From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Javier Olaechea 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 14:02:21 -0500 Message-ID: References: <87v8u2tobr.fsf@posteo.net> <878rnim3cf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000358bfb05e6c4f933" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38164"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 55199@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 21 21:03:11 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 1oPqE2-0009lj-OL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 21:03:10 +0200 Original-Received: from localhost ([::1]:33926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPqE1-0005Sd-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 15:03:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPqDu-0005SU-Nj for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 15:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPqDu-0007AA-8a for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 15:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPqDt-0007oz-Tu for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 15:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Javier Olaechea Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Aug 2022 19:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55199-submit@debbugs.gnu.org id=B55199.166110856130031 (code B ref 55199); Sun, 21 Aug 2022 19:03:01 +0000 Original-Received: (at 55199) by debbugs.gnu.org; 21 Aug 2022 19:02:41 +0000 Original-Received: from localhost ([127.0.0.1]:36806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPqDY-0007oJ-Jo for submit@debbugs.gnu.org; Sun, 21 Aug 2022 15:02:41 -0400 Original-Received: from mail-yw1-f170.google.com ([209.85.128.170]:43663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPqDW-0007o6-5C for 55199@debbugs.gnu.org; Sun, 21 Aug 2022 15:02:38 -0400 Original-Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-333a4a5d495so240764127b3.10 for <55199@debbugs.gnu.org>; Sun, 21 Aug 2022 12:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=vN3mT3+5TxoBi8eemk3jb+SBiwsqavY7Zq940um9ynk=; b=VDHa3QwXMQv0DeY4Wd7EnIKc4DiAOFCjdqRLjRKq+XrHkPie7ts1wBg5CnI28WaxRl BQ6wbef+59YVjOCXuU3jQUTcv3FOcuGUOHMFRVi9+tLSnQb3fzTKQJqXyPMTIbH16lsa YPvQn1oVf94WWCZs3PYUzwm8CvcbR4WfVsmqrGIhTDLAwPUGaQNjiK2o3NVd5jxLUfOr g7d/NlMdkOYwTW6/pMVH7s12b238BYxWZSWpHM04aRvyyc3M7WznzXTqBz2rO9oRXotj 2+OhjPM7lvMwbkr3o9vcGRNqEl8QTeqE5LyqW40i2kUJ715RY5PUtdU0sVsRgM8Ry5au m8uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=vN3mT3+5TxoBi8eemk3jb+SBiwsqavY7Zq940um9ynk=; b=PPrcXmjwdM/nLmCx9MQGTFWF5FxtQEe/lOmPA2/Hyv6W2ySaIoTnRC82wj1W14WPcm XwyU2POelXaVvfC85Tn7OckDu2RHiMTiHyEW/8Xu3sHY7rG0HwDdQCJVpbMlAxovM3Uk YUBBVXQXT7yes0O6Jfdj9wnWnnImk+XfWmxUZXLl/dGKfELGk2MO4J0M4yvvecH/1/U2 OlTobb25ulBGrhJgZ3x2sfMn/UGxbKIt+OS/QOBOmAucLX6GCy2O34Ej+dwsWhklMuXV ZW8cxKz9HhGFCNJuaUycjgDxEiLDiiV58A3IeufCGeyK6rGEWhhx2eOvLj08HWjyfbLi 6RzA== X-Gm-Message-State: ACgBeo09135rTCy64dPgaym/yAFnuYxS4G5jXU7e11DdAbZUZ71JU9A/ DDGMdoANjpBjsgcm44iC+pwHOEL+sHtMMsm+Xio= X-Google-Smtp-Source: AA6agR7rVfHqFA9xHd/GcRtcbvX1mlppPYQ2nN3tfhsyKXuWZ5rNYdgCjLuXyhU9jKtZEweRcT28bKR1pcT/UtBci3A= X-Received: by 2002:a25:bac1:0:b0:683:433d:67ad with SMTP id a1-20020a25bac1000000b00683433d67admr17221222ybk.554.1661108552566; Sun, 21 Aug 2022 12:02:32 -0700 (PDT) In-Reply-To: <878rnim3cf.fsf@gmx.de> 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:240354 Archived-At: --000000000000358bfb05e6c4f933 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michael, I can confirm patch fixes the issue. I don't think we need to change the create function. The issue is that a valid spec, meant for another backend, results in an error when searching the secrets backend. An alternative solution would be for auth-source-secrets-search to return an empty list (no secrets found iirc) when the spec contains a non-string value. On Sun, Aug 21, 2022 at 3:02 AM Michael Albinus wrote: > 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 < > https://specifications.freedesktop.org/secret-service/latest/re03.html>: > > --8<---------------cut here---------------start------------->8--- > READWRITE Dict Attributes ; > --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. > > --=20 "I object to doing things that computers can do." =E2=80=94 Olin Shivers --000000000000358bfb05e6c4f933 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Michael,

I can confirm pa= tch fixes the issue. I don't think we need to change the create functio= n. The issue is that a valid spec, meant for another backend, results in an= error when searching the secrets backend.

An= alternative solution would be for auth-source-secrets-search to return an = empty list (no secrets found iirc) when the spec contains a non-string valu= e.


On Sun, Aug 21, 2022 at 3:02 AM Michael Albin= us <michael.albinus@gmx.de= > wrote:
Javi= er Olaechea <pirat= a@gmail.com> 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")))
>=C2=A0 =C2=A0(auth-source-search :port 6697))

Yep. Fails here as well.

> So the issue is not at all on rcirc, but that secrets backend assumes<= br> > that the search specs should be strings. I haven't researched the<= br> > 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 <https://specif= ications.freedesktop.org/secret-service/latest/re03.html>:

--8<---------------cut here---------------start------------->8---
READWRITE Dict<String,String> Attributes ;
--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= 9;m
also not sure whether we need to change something when creating an item
in auth-source-secrets-create.

Best regrads, Michael.



--
"I object to doing things that computers can do."= =E2=80=94 Olin Shivers
--000000000000358bfb05e6c4f933--