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

From: Manuel Giraud <[email-masked]>
Date: Sun, 09 Feb 2025 16:36:48 +0100

Tags: patch

Hi Michael,

I end up having to read the ange-ftp source code to understand this
issue.  So maybe it needs to be documented.  WDYT?

In GNU Emacs 31.0.50 (build 6, x86_64-unknown-openbsd7.6, X toolkit) of
 2025-02-09 built on computer
Repository revision: 35fa7126903a0ac6a28901d194f0753acf60928d
Repository branch: mgi/tramp-ange-docfix
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: OpenBSD computer 7.6 GENERIC.MP#534 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=lucid
 --with-toolkit-scroll-bars=no --without-cairo
 --without-compress-install'

>From b2dcfd3dcbdabb3539b240caf8ef4f6244d89c86 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Sun, 9 Feb 2025 16:27:20 +0100
Subject: [PATCH] Precision on Ange FTP parsing of .authinfo file

* doc/misc/tramp.texi (Password handling): Document discrepancy
in Ange FTP parsing of .authinfo file.
---
 doc/misc/tramp.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 86ffba29744..7bab822a095 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2223,6 +2223,17 @@ Password handling
 (customize-set-variable 'ange-ftp-netrc-filename "~/.authinfo.gpg")
 @end lisp
 
+If you do so, note that Ange FTP does not parse the @option{port} option
+in the @file{.authinfo} file.  So if you need to use different port, you
+should have an entry like this:
+
+@example
+machine @var{host}#@var{port} login @var{user} password secret
+@end example
+
+And then use it to open your remote files with
+@file{@trampfn{ftp,host#port,/path/to/file}}.
+
 In case you do not want to use an authentication file for
 @value{tramp} passwords, use connection-local variables
 @ifinfo
-- 
2.48.1

-- 
Manuel Giraud