* bug#67865: [PATCH] ange-ftp fails with tnftp client
@ 2023-12-17 13:56 Christophe Deleuze
2023-12-17 18:45 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Christophe Deleuze @ 2023-12-17 13:56 UTC (permalink / raw)
To: 67865
[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]
* bug description
When used with the tnftp client (https://en.wikipedia.org/wiki/Tnftp),
ange-ftp fails when trying to enable passive mode.
* fix description
Passive mode is enabled by function ange-ftp-passive-mode:
(defun ange-ftp-passive-mode (proc on-or-off)
(if (string-match (concat "Passive mode " on-or-off)
(cdr (ange-ftp-raw-send-cmd
proc (concat "passive " on-or-off)
"Trying passive mode..." nil)))
(ange-ftp-message (concat "Trying passive mode..." on-or-off))
(error "Trying passive mode...failed")))
that expects to get a result string containing the string "Passive
mode on" (when on-or-off is "on"), however tnftp includes a colon in
its answer (extract from the buffer the ftp process is run in):
ftp> passive on
Passive mode: on; fallback to active mode: off.
I suggest slightly changing the regexp used in string-match to allow
for this colon, as shown below:
(defun ange-ftp-passive-mode (proc on-or-off)
(if (string-match (concat "Passive mode:? " on-or-off)
[...]
The attached patch does just that.
For information, in debian bookworm the ftp package has changed from
netkit-ftp to being a dummy transitional package for tnftp.
regards,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 872 bytes --]
From 1f41c0b474b7cc731aa4824902199c13bd15c895 Mon Sep 17 00:00:00 2001
From: Christophe Deleuze <christophe.deleuze@free.fr>
Date: Sun, 17 Dec 2023 14:49:27 +0100
Subject: [PATCH] ange-ftp: fix passive mode result string for tntfp client
---
lisp/net/ange-ftp.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 4e4db34a78d..a1eb57baa20 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -2164,7 +2164,7 @@ ange-ftp-get-process
proc)))
(defun ange-ftp-passive-mode (proc on-or-off)
- (if (string-match (concat "Passive mode " on-or-off)
+ (if (string-match (concat "Passive mode:? " on-or-off)
(cdr (ange-ftp-raw-send-cmd
proc (concat "passive " on-or-off)
"Trying passive mode..." nil)))
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#67865: [PATCH] ange-ftp fails with tnftp client
2023-12-17 13:56 bug#67865: [PATCH] ange-ftp fails with tnftp client Christophe Deleuze
@ 2023-12-17 18:45 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-17 19:23 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-17 18:45 UTC (permalink / raw)
To: Christophe Deleuze; +Cc: 67865
Christophe Deleuze <christophe.deleuze@free.fr> writes:
Hi Cristophe,
> I suggest slightly changing the regexp used in string-match to allow
> for this colon, as shown below:
>
> (defun ange-ftp-passive-mode (proc on-or-off)
> (if (string-match (concat "Passive mode:? " on-or-off)
> [...]
>
> The attached patch does just that.
Looks OK to me.
Eli, do we want this in emacs-29 or master?
> regards,
Best rergards, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#67865: [PATCH] ange-ftp fails with tnftp client
2023-12-17 18:45 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-17 19:23 ` Eli Zaretskii
2023-12-18 10:16 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-12-17 19:23 UTC (permalink / raw)
To: Michael Albinus; +Cc: 67865, christophe.deleuze
> Cc: 67865@debbugs.gnu.org
> Date: Sun, 17 Dec 2023 19:45:18 +0100
> From: Michael Albinus via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Christophe Deleuze <christophe.deleuze@free.fr> writes:
>
> Hi Cristophe,
>
> > I suggest slightly changing the regexp used in string-match to allow
> > for this colon, as shown below:
> >
> > (defun ange-ftp-passive-mode (proc on-or-off)
> > (if (string-match (concat "Passive mode:? " on-or-off)
> > [...]
> >
> > The attached patch does just that.
>
> Looks OK to me.
>
> Eli, do we want this in emacs-29 or master?
It's okay to install this on emacs-29, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#67865: [PATCH] ange-ftp fails with tnftp client
2023-12-17 19:23 ` Eli Zaretskii
@ 2023-12-18 10:16 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-18 10:16 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: christophe.deleuze, 67865-done
Version: 29.2
Eli Zaretskii <eliz@gnu.org> writes:
Hi,
>> > I suggest slightly changing the regexp used in string-match to allow
>> > for this colon, as shown below:
>> >
>> > (defun ange-ftp-passive-mode (proc on-or-off)
>> > (if (string-match (concat "Passive mode:? " on-or-off)
>> > [...]
>> >
>> > The attached patch does just that.
>>
>> Looks OK to me.
>>
>> Eli, do we want this in emacs-29 or master?
>
> It's okay to install this on emacs-29, thanks.
Done, closing the bug.
Best regards, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-18 10:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-17 13:56 bug#67865: [PATCH] ange-ftp fails with tnftp client Christophe Deleuze
2023-12-17 18:45 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-17 19:23 ` Eli Zaretskii
2023-12-18 10:16 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.