6

So apparently Apple has (stupidly) dropped support for "insecure" Unix commands such as telnet, ftp, etc. in 10.13, or "High Sierra" (see these threads for more info). Unfortunately, I use Dired as an ftp client to lists.gnu.org. So, to compensate for the loss of BSD's ftp, I installed the GNU inetutils from homebrew:

brew install inetutils

However, GNU's ftp seems to behave quite differently. For starters, I now have to explicitly provide a username and "password" and turn on passive mode. For example:

C-x C-f /ftp:ftp@lists.gnu.org:
ftp> open lists.gnu.org
open lists.gnu.org
Connected to lists.gnu.org.
220 Welcome to lists.gnu.org MBOX FTP service.
ftp> ls
ls
530 Please login with USER and PASS.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp> user ftp
user ftp
331 Please specify the password.
Password: my@email.com

230 Login successful.
ftp> ls
ls
500 Illegal PORT command.
500 Unknown command.
ftp> passive
passive
Passive mode on.
ftp> ls
ls
227 Entering Passive Mode (208,118,235,17,81,10).
150 Here comes the directory listing.
drwxr-xr-x    2 500      500          4096 Mar 08  2012 123tkshop-announce
drwxr-xr-x    2 500      500          4096 Jan 08  2007 123tkshop-bugs
drwxr-xr-x    2 500      500          4096 Jan 05  2007 123tkshop-devoloper
...
226 Directory send OK.
ftp> 

Previously, with BSD's ftp, all of this login stuff would automatically happen when I tried to connect.

Yet even though ls now works in the ftp command prompt, I cannot get a Dired buffer for the remote host. Even after I've logged in (as above), when I try to run find-file on /ftp:ftp@lists.gnu.org: I get the following errors in *Messages*:

Getting PWD... [8 times]
tramp-file-name-handler: Unable to obtain CWD

And I see the following in the ftp command prompt:

ftp> pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 

And I get no Dired buffer for the remote host.

So my question is: How can I use Dired to interact with ftp hosts on OS X 10.13?

PS:

I noticed that these issues do not occur in Emacs on Ubuntu. And for good measure, I copied BSD's ftp from another Mac and verified that none of these issues occur when I use that instead of GNU's ftp.

I am using Emacs 25.3 (on both my OS X and Ubuntu systems).

lawlist
  • 18,826
  • 5
  • 37
  • 118
GDP2
  • 1,340
  • 9
  • 25
  • 1
    This sounds like a bug. – Alan Third Oct 01 '17 at 12:16
  • 1
    TRAMP, since it is GNU, should support GNU ftp right? So this is probably a bug in the macOS port of Emacs? Where can I download BSD ftp? – cjohansson Oct 01 '17 at 15:31
  • @AlanThird Do you mean a bug with Dired? Or with `ftp`? – GDP2 Oct 01 '17 at 19:26
  • 1
    @cjohansson Yes, one would think that GNU `ftp` would work great with Emacs. I'll make a post on the `bug-gnu-emacs` mailing list and see if this is a problem with the macOS port of Emacs. Also, [here is FreeBSD's `ftp`,](https://svnweb.freebsd.org/base/release/11.1.0/usr.bin/ftp/) although it may be different from [Apple's `ftp`.](https://opensource.apple.com/tarballs/lukemftp/) – GDP2 Oct 01 '17 at 19:32
  • With Emacs, specifically ange-ftp. I don't see anything in the code that is macOS or BSD specific, so my guess is it should Just Work. – Alan Third Oct 01 '17 at 20:00
  • When I used the Apple `ftp` it worked. Using `(setq ange-ftp-ftp-program-args '("-i" "-g" "-v"))` Emacs is able to login using GNU `ftp` but dired still doesn't work – cjohansson Oct 02 '17 at 07:28
  • @AlanThird Yes, it should Just Work. I suppose it ought to be filed as a bug on `bug-gnu-emacs`; I haven't gotten around to doing that yet, though. – GDP2 Oct 02 '17 at 15:56
  • 1
    @cjohansson I noticed no differences by running `(setq ange-ftp-ftp-program-args '("-i" "-g" "-v"))`. However, yes: Apple `ftp` works totally fine, so there must be something wrong with GNU `ftp`. Or, at least, with the way that Emacs is treating it. – GDP2 Oct 02 '17 at 16:15
  • @AlanThird I [put up a post on `bug-gnu-emacs`](http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-10/msg00074.html) in case this is a problem with the Emacs build for macOS. – GDP2 Oct 02 '17 at 21:14
  • 1
    @cjohansson I [put up a post on `bug-gnu-emacs`](http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-10/msg00074.html) in case this is a problem with the Emacs build for macOS. – GDP2 Oct 02 '17 at 21:14

1 Answers1

1

I have managed to work around this problem by using this solution instead of inetutils.

GDP2
  • 1,340
  • 9
  • 25