Subject: Re: bug#72526: Needs NEWS item and doc change

From: Björn Bidar <[email-masked]>
Date: Thu, 01 May 2025 01:12:15 +0300

Stefan Kangas <[email-masked]> writes:

> Tim Ruffing <[email-masked]> writes:
>
>> I think the first patch (commit a7a22e7) is a good change, but it
>> should get a NEWS item because it breaks existing configurations.
>>
>> If you had this in your netrc file:
>>     machine www.example.com:443 port https login foo password bar
>> Then it needs to be changed to:
>>     machine www.example.com port https login foo password bar
>>
>> See https://github.com/dengste/org-caldav/issues/320 for reports of
>> people running into this. This is true not only for netrc files but
>> also for other authinfo backends. (For example, I've run into this
>> issue with the GNOME keyring / Secret Service API.)
>>
>> Moreover, the docs need to be updated. doc/misc/auth.texi has an
>> example that uses `yourmachine.com:80`. This should be changed to
>> `yourmachine.com`. (Or better, `example.com` or some domain reserved
>> for documentation, see https://www.iana.org/help/example-domains ).
>
> Björn, could you please take a look at this?

Hey sorry I kinda lost track of this.

Here's the patch. What about the yourmachine.com lines? The document
consistently uses YOURMACHINE as in the machine field of netrc.
Does make it sense to use example.com here?

>From 2b27328c73fc201da018d8f55493def3a6714fd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <[email-masked]>
Date: Thu, 1 May 2025 00:56:44 +0300
Subject: [PATCH] Add migration instructions for Bug 72526 and update auth info
 manual

* doc/misc/auth.texi (Help for users):
Remove the port from machine in the netrc example as url-basic-auth no
longer amends the port to machine when calling auth-source.

* etc/NEWS: Document migration instructions
---
 doc/misc/auth.texi |  2 +-
 etc/NEWS           | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index fe920997f1d..5a8195dc355 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -248,7 +248,7 @@ Help for users
 netrc file:
 
 @example
-machine yourmachine.com:80 port http login testuser password testpass
+machine yourmachine.com port http login testuser password testpass
 @end example
 
 This will match any realm and authentication method (basic or digest)
diff --git a/etc/NEWS b/etc/NEWS
index d149a7387e2..7c4e7abe5ef 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -48,6 +48,31 @@ incorrectly in rare cases.
 This allows to specify the directory where the user unit file for
 systemd is installed; default is '${prefix}/usr/lib/systemd/user'.
 
+
+* Incompatible Changes in Emacs 31.1
+
+** url-basic-auth no longer amends ports when search for credentials
+url-basic-auth used to amend the port to the server when searching
+for credentials in auth-source.
+This happened so auth-source would partially emulate the classic netrc
+format where there is no port field, i.e. as in Curl.
+
+The port has to be removed from the server. If the previously
+specified port differs from the one specified in the port field
+then this has to be adjusted too.
+
+So for example:
+machine www.example.com:443 port https login foo password bar
+Becomes:
+machine www.example.com port https login foo password bar
+
+However in this example:
+machine www.example.com:800 port https login foo password bar
+The port has to removed and the https has to replaced with 800:
+machine www.example.com port 800 login foo password bar
+
+(443 is the default port for HTTPS connections.)
+
 
 * Startup Changes in Emacs 31.1
 
-- 
2.45.2