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 11:59:20 +0300 Message-ID: <86bk1invo7.fsf@gnu.org> References: <86bk1r661g.fsf@gnu.org> <86ed6n2zld.fsf@gnu.org> <867cce1ke4.fsf@gnu.org> <86ikvyynwg.fsf@gnu.org> <87zfp9q9ym.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="9255"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72526-done@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 11:00:42 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 1shmdV-0002H6-UD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Aug 2024 11:00:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shmdI-00010A-Cy; Sat, 24 Aug 2024 05:00:28 -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 1shmd8-0000xp-5G for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 05:00:22 -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 1shmd3-0002jJ-S3 for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 05:00:17 -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=v80PmlUXl9NBmn0+sDaOz6AqSSadN2t2gBpcktz6C3Y=; b=owOYXO3/eZQPeXN60K2drVgdEb0Idb600zwSiS1/BKiJYEklHf8LqFaFE1eT7LFAmtxui9vl1lpa44W1yqidnzysgBJqyasmdwOws3OqQcPgnZSAfC4WWhRwEkK0UEtjkuYtCSbr7P+iqNRyb2f8X4ONRRymvmksykJO5L0Lkzs4zWXQKP8nM4fOkChX/G6QweG8kZHIp0agc6gIzY9aNyHJXOZACAiA/V5TGb0R1WdmWygXW0Pa5xRdy+QiSHTAofVNHNsIfhBGkjM9nvbry4C7UUjCaFrqKTWrWuG5CW+7KSqeZ99Zj3L6v6j47Mg9vanVh+segCk3bS2jfCXEnA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1shmdp-0007qg-QH for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 05:01:01 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2024 09:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 72526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 72526@debbugs.gnu.org, eliz@gnu.org, bjorn.bidar@thaodan.de Original-Received: via spool by 72526-done@debbugs.gnu.org id=D72526.172449002330100 (code D ref 72526); Sat, 24 Aug 2024 09:01:01 +0000 Original-Received: (at 72526-done) by debbugs.gnu.org; 24 Aug 2024 09:00:23 +0000 Original-Received: from localhost ([127.0.0.1]:40452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shmdC-0007pP-Hj for submit@debbugs.gnu.org; Sat, 24 Aug 2024 05:00:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shmd9-0007p7-MD for 72526-done@debbugs.gnu.org; Sat, 24 Aug 2024 05:00:21 -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 1shmcG-0002GY-SE; Sat, 24 Aug 2024 04:59:24 -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=v80PmlUXl9NBmn0+sDaOz6AqSSadN2t2gBpcktz6C3Y=; b=khkzvFRsQDElKuJ3kexz K6n5vhIHmtgBjLloHUz1KUK4nRnAQ1MhEbuHKHG4WYJGA2S2AZN9kMT9Jk18Vt4WjuFRr+PoAhj9W FMlaEXlia+XxjhBs820YKo2gyKa2CJHpEqfvyDtwGln9zODeUThLjGcstl01GogBIA7y9I8eaFClS wQ4G1jOznrZWvnf5u1BViiNXBxA2WYhfsSh5tLMdk+92cgMWXRWTTt9mv0Q5nJ/5K9JW5bPmv0uFN 3+d/luOfTXlyOTz07VTTL591ADHxW7q12JsDjWo9TnolBh3W5JArA5o+IDM6n3qQysmvIHa4JxRyP /kQDbEd01itKsw==; In-Reply-To: <87zfp9q9ym.fsf@> (message from =?UTF-8?Q?Bj=C3=B6rn?= Bidar on Mon, 19 Aug 2024 09:54:09 +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:290645 Archived-At: > 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.