GNU bug report logs - #76159
[PATCH] Precision on Ange FTP parsing of .authinfo file

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Sun, 9 Feb 2025 15:38:01 UTC

Severity: normal

Tags: notabug, patch

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76159 in the body.
You can then email your comments to 76159 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76159; Package emacs. (Sun, 09 Feb 2025 15:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 09 Feb 2025 15:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: bug-gnu-emacs <at> gnu.org
Cc: Michael Albinus <michael.albinus <at> gmx.de>
Subject: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Sun, 09 Feb 2025 16:36:48 +0100
[Message part 1 (text/plain, inline)]
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'

[0001-Precision-on-Ange-FTP-parsing-of-.authinfo-file.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76159; Package emacs. (Sun, 09 Feb 2025 17:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 76159 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 76159 <at> debbugs.gnu.org
Subject: Re: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Sun, 09 Feb 2025 17:59:47 +0100
Manuel Giraud <manuel <at> ledu-giraud.fr> 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

--8<---------------cut here---------------start------------->8---
   machine HOST login USER port PORT password SECRET
--8<---------------cut here---------------end--------------->8---

   it will still work, independent of auth-sources.

2. Your proposed entry

--8<---------------cut here---------------start------------->8---
   machine HOST#PORT login USER password SECRET
--8<---------------cut here---------------end--------------->8---

   is good for every Tramp method, not only for method 'ftp'. Dow we
   want to have such a wildcard entry?

3. The Tramp manual explains already the port problem with the example

--8<---------------cut here---------------start------------->8---
   machine melancholia#4711 port davs login daniel%BIZARRE password geheim
--8<---------------cut here---------------end--------------->8---

Shouldn't we simply say that this is also applicable for the 'ftp' method?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76159; Package emacs. (Sun, 09 Feb 2025 19:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 76159 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 76159 <at> debbugs.gnu.org
Subject: Re: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Sun, 09 Feb 2025 20:31:15 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Manuel Giraud <manuel <at> ledu-giraud.fr> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76159; Package emacs. (Mon, 10 Feb 2025 11:45:02 GMT) Full text and rfc822 format available.

Message #14 received at 76159 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 76159 <at> debbugs.gnu.org
Subject: Re: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Mon, 10 Feb 2025 12:43:46 +0100
[Message part 1 (text/plain, inline)]
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:

Hi Manuel,

>> 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.

How about this:

[Message part 2 (text/x-patch, inline)]
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 86ffba29744..3f6d25e3fab 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2187,6 +2187,13 @@ Password handling
 machine melancholia#4711 port davs login daniel%BIZARRE password geheim
 @end example

+@noindent
+This must also be applied for the @option{ftp} method, like in
+
+@example
+machine @var{host}#@var{port} port ftp login @var{user} password secret
+@end example
+
 For the methods @option{doas}, @option{sudo}, @option{sudoedit} and
 @option{nspawn} the password of the user requesting the connection is
 needed, and not the password of the target user <at> footnote{On the local
[Message part 3 (text/plain, inline)]
Best regards, Michael.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76159; Package emacs. (Mon, 10 Feb 2025 15:32:01 GMT) Full text and rfc822 format available.

Message #17 received at 76159 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 76159 <at> debbugs.gnu.org
Subject: Re: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Mon, 10 Feb 2025 16:31:47 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
>
> Hi Manuel,
>
>>> 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.
>
> How about this:

Well sorry but I think there was some misunderstanding on my part.  The
manual says:

--8<---------------cut here---------------start------------->8---
   The port can take any TRAMP method (*note Inline methods::, *note
External methods::).  Omitting port values matches all TRAMP methods.
Domain and ports, as used in TRAMP file name syntax, must be appended to
the machine and login items:
--8<---------------cut here---------------end--------------->8---

I thought that the 'port' option was used to declare a non standard port
for a given server but it seems that this option is used to match
against TRAMP *method*.

This misunderstanding leads me to read how Ange FTP parses netrc (or
authinfo) entries.  But I'm not sure there is a need for a documentation
fix then.
-- 
Manuel Giraud




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Mon, 10 Feb 2025 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
bug acknowledged by developer. (Mon, 10 Feb 2025 15:45:02 GMT) Full text and rfc822 format available.

Message #22 received at 76159-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 76159-done <at> debbugs.gnu.org
Subject: Re: bug#76159: [PATCH] Precision on Ange FTP parsing of .authinfo file
Date: Mon, 10 Feb 2025 16:44:20 +0100
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:

Hi Manuel,

> This misunderstanding leads me to read how Ange FTP parses netrc (or
> authinfo) entries.  But I'm not sure there is a need for a documentation
> fix then.

OK, let's be it as it is. I'm closing this bug.

Best regards, Michael.




Added tag(s) notabug. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Mon, 10 Feb 2025 15:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Mar 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.