From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72526: 31.0.50; [PATCH] Fix url-basic-auth secret search when passing username and/or port Date: Sat, 24 Aug 2024 15:51:40 +0300 Message-ID: <86r0aem6cj.fsf@gnu.org> References: <86bk1r661g.fsf@gnu.org> <86ed6n2zld.fsf@gnu.org> <867cce1ke4.fsf@gnu.org> <86ikvyynwg.fsf@gnu.org> <86bk1invo7.fsf@gnu.org> <87y14mb07y.fsf@> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72526@debbugs.gnu.org To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 24 14:52:37 2024 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 1shqFx-0006n9-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Aug 2024 14:52:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shqFb-0007zW-Pb; Sat, 24 Aug 2024 08:52:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shqFa-0007zC-3B for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 08:52:14 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1shqFZ-0004ad-QR for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 08:52:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=z5MoubkGEvEXIGjf5KUKvOFbH14W4jRnoOe+HCvO96U=; b=FJAWW7GZP5+fZONrrNFMiNf6Zb4L+OJoAAznaS0dwzB0XlTd+eFz2SCpJ5LUvWaV/gYRrCycfTev2ZT31gMAsyAaVZ1p2fqc4IzNKmAl1edD+WBSqg3XZqaTD5rGxUUZcpwo/4QZ5ZDULBHY12hZlJJbtbHyJEquvbhZgT3wI9S0PHw9HaOr0LL4pxEfZgzsF5RrKOm64NLva2+fJXAZFCLUU2XJ8PXfujcKEjTNgK11UfZ3Se/hfk10L5vHBaqrVVWK44CrtMI44adOJm+k6epx6j5gBV9Xi+f7LLaP4gviy1r4e1bPwVADnGG+pVxx9X/2lVAVRpn9hvHD2yV5Vg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1shqGM-0005rk-2h for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 08:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2024 12:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72526-submit@debbugs.gnu.org id=B72526.172450396122513 (code B ref 72526); Sat, 24 Aug 2024 12:53:02 +0000 Original-Received: (at 72526) by debbugs.gnu.org; 24 Aug 2024 12:52:41 +0000 Original-Received: from localhost ([127.0.0.1]:40680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shqG1-0005r3-4a for submit@debbugs.gnu.org; Sat, 24 Aug 2024 08:52:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shqFy-0005qm-1T for 72526@debbugs.gnu.org; Sat, 24 Aug 2024 08:52:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shqF5-0004WC-Gv; Sat, 24 Aug 2024 08:51:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=z5MoubkGEvEXIGjf5KUKvOFbH14W4jRnoOe+HCvO96U=; b=rJOVllou7ScwulbSZl5B SgM2kSbTbcDR8c59jwOjynOEvueIC4uTU7PK9iwUeKrA0n4+47GOILjG8SB7Zn2uO/FmzWp2gR44R Sz3l3QKR2faHWJdAA4+RQchhtpIWRcuQlibOJKjuAu2wkepYfI8bmpPhtrpxxEwLBs5DzSZ3AbUYK PhUurDYB+w8leyYPp8lWm4fhHhRLy4CBOFMaUrLE4YfUmWYvzXRylGq83bmh2US0tpQz8Ux0+1uDm YPKaRa72IBmNAqF+UabxyHxZoDPeDRBKR7ijFErkG9ij81G0VRe7axBe7auML5TQfcZdiFZNZmkDd s2ItI/pldHAz9g==; In-Reply-To: <87y14mb07y.fsf@> (message from =?UTF-8?Q?Bj=C3=B6rn?= Bidar on Sat, 24 Aug 2024 14:59:29 +0300) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290666 Archived-At: > From: Björn Bidar > Cc: 72526-done@debbugs.gnu.org > Date: Sat, 24 Aug 2024 14:59:29 +0300 > > Eli Zaretskii writes: > > >> From: Björn Bidar > >> Cc: 72526@debbugs.gnu.org > >> Date: Mon, 19 Aug 2024 09:54:09 +0300 > >> > >> Eli Zaretskii writes: > >> > >> >> From: Björn Bidar > >> >> Cc: 72526@debbugs.gnu.org > >> >> Date: Sun, 18 Aug 2024 15:30:22 +0300 > >> >> > >> >> Eli Zaretskii writes: > >> >> > >> >> 1. url-basic-auth-store uses the 'server' as in the ':' in > >> >> url-basic-auth-storage. I did not want to change the existing format > >> >> as I don't know the implications. > >> > > >> > Can you calculate a separate variable once, and then use 'server' and > >> > that new variable, each one where appropriate? It simply doesn't look > >> > clean to recalculate the same value several times. > >> > > >> >> 2. I tested calling auth-source-search with :user nil and without :user > >> >> in both cases the result was the same, from this I imply that calling > >> >> auth-source-search with :user nil is ok. > >> > > >> > Wouldn't it be cleaner to omit :user if the value is nil? > >> > >> It would, how would one do such thing in lisp except of course > >> having two separate calls one with :user and one without :user. > >> For C it would be normal to just pass NULL if the argument is optional > >> (beginner in lisp). > >> > >> >> Yes if auth-source-search doesn't find a user for the url > >> >> url-basic-auth will prompt the user for a user. > >> >> Why is it a good idea to derive the user by url-basic-auth? > >> >> Because HTTP basic authentication uses the as specific in RFC 3986 > >> >> section 3.2.1. Using it in this function to infer the user from the > >> >> url just follows the standard as already in other programs/Emacs > >> >> packages. > >> >> If the user has specified the username they want to identify with > >> >> at the server asking for it would be redundant and not confirming to > >> >> the standard. > >> > > >> > What does the current code do in that case? Does it completely fail, > >> > or does it prompt for the username? If the latter, it would be a > >> > change in behavior, won't it? > >> > >> Currently it does ask for the user even if the caller sends the user in the > >> url. It would be change of behavior, however it is expected that the user is > >> used in HTTP basic authentication if the the url is 'http://user@host'. > >> I don't think any caller would call the function in such a way without > >> expecting that user is the username used in the call. > > > > Thanks, so I installed the patch on the master branch, and I'm now > > closing this bug. > > Would it make sense to apply it to Emacs 30.1 too? It's too late for behavior changes on the release branch, sorry. > What about the other patch? Should :user only be passed to > auth-source-search if there was a user in the url for the patch to be > ok? Sorry, forgot to push that. Done now.