Subject: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file

From: Manuel Giraud <[email-masked]>
Date: Sun, 09 Feb 2025 20:31:15 +0100

Michael Albinus <[email-masked]> writes:

> Manuel Giraud <[email-masked]> writes:
>
>> Hi Michael,
>
> Hi Manuel,
>
>> I end up having to read the ange-ftp source code to understand this
>> issue.  So maybe it needs to be documented.  WDYT?
>
> Thanks for pointing to this problem. However, I believe it is a little
> bit more complex.
>
> 1. Ftp is still ftp. I believe, if you have a ~/.netrc file containing
>
>    machine HOST login USER port PORT password SECRET
>
>
>    it will still work, independent of auth-sources.

I have tested it and it doesn't work for me.  I have left
`ange-ftp-netrc-filename' to its default and add such entry in my .netrc
but TRAMP/Ange-FTP cannot connect to the host (which listens on a non
standard port).

>From what I can gather from "ange-ftp.el", it seems that it could only
parse a different port with the form HOST#PORT.

> 2. Your proposed entry
>
>    machine HOST#PORT login USER password SECRET
>
>
>    is good for every Tramp method, not only for method 'ftp'. Dow we
>    want to have such a wildcard entry?

Yes, you're right this is too large.  Maybe it should be:

     machine HOST#PORT port ftp login USER password SECRET

As I have stated, I don't think that Ange FTP cares about the 'port'
option.  But maybe, this is required to filter out other methods.

> 3. The Tramp manual explains already the port problem with the example
>
>    machine melancholia#4711 port davs login daniel%BIZARRE password geheim
>
> Shouldn't we simply say that this is also applicable for the 'ftp'
> method?

Yes, maybe that could be enough.  I don't really know how to phrase it
though.
-- 
Manuel Giraud