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:[email protected]:
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: [email protected]

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:[email protected]: 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).

10
  • 1
    This sounds like a bug.
    – Alan Third
    Commented Oct 1, 2017 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
    Commented Oct 1, 2017 at 15:31
  • 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, although it may be different from Apple's ftp.
    – GDP2
    Commented Oct 1, 2017 at 19:32
  • 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
    Commented Oct 2, 2017 at 16:15
  • 1
    @cjohansson I put up a post on bug-gnu-emacs in case this is a problem with the Emacs build for macOS.
    – GDP2
    Commented Oct 2, 2017 at 21:14

1 Answer 1

1

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

2
  • I've got that installed, no change in behavior. Commented Dec 11, 2019 at 13:46
  • @BretWeinraub Sorry, not sure how to help you there. It solved the issue when I did it.
    – GDP2
    Commented Dec 11, 2019 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.