[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ftp client's "ls" is "!ls"



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Mar 25, 2017 at 05:05:43PM -0500, Kent West wrote:
> On Sat, Mar 25, 2017 at 2:02 AM, <tomas@tuxteam.de> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Fri, Mar 24, 2017 at 04:44:17PM -0500, Kent West wrote:
> > > I'm ftp'ing to a Dell/Quest K1000 System Management appliance, from a
> > > Debian 9.0 box, and when I execute the command "ls" or "del" or do a
> > > tab-completion, the commands act on the local directory instead of the
> > > remote, so that "ls" acts like "!ls".
> >
> > This is not how it's supposed to work. At least not ls (dir and ls should
> > both list the remote's system directory contents).
> >
> > Which ftp client are you using?
> >
> 
> 
> westk@westkent:~$ aptitude show ftp
> Package: ftp
> Version: 0.17-34
> 
> I should make a correction to my description of the problem.
> 
> "ls" by itself shows the remote directory files
> 
> "ls <filename> looks to the local directory

(1) I can not confirm this one (see below).

> (as does "ls [tab-completion]" or "del <filename> | [tab-completion]").
> Weird stuff.

(2) Tab completion, OTOH, picks *local* and not remote names for the
   completion list (this was somewhat expected, since it's probably
   readline-based and the authors just went an "easy" path). This is
   definitely confusing.

As to (1), I installed an ftp server (ftpd 0.17-34+b1, but that shouldn't
matter) and gave it a try. (my ftp client is ftp 0.17-31, so not very far
away from yours). Here's an extract from the session, my comments prefixed
with '#'':

  tomas@rasputin:~$ ftp localhost
  Connected to localhost.
  220 rasputin.flughafenstrasse.home FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
  Name (localhost:tomas): 
  331 Password required for tomas.
  Password:
  230- 
  230- The programs included with the Debian GNU/Linux system are free software;
  230- the exact distribution terms for each program are described in the
  230- individual files in /usr/share/doc/*/copyright.
  230- 
  230- Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
  230- permitted by applicable law.
  230 User tomas logged in.
  # Now in my home directory (locally and remotely)
  Remote system type is UNIX.
  Using binary mode to transfer files.
  ftp> ls workbook
  # There is a file workbook in my home
  200 PORT command successful.
  150 Opening ASCII mode data connection for '/bin/ls'.
  -rw-r--r-- 1 tomas tomas 1436472 Mar 25 08:33 workbook
  # ftp can "see" it. Note the 'ls' output format -- a bit like "ls -l"
  226 Transfer complete.
  ftp> cd tmp
  250 CWD command successful.
  # changed (remotely) to ~/tmp (note: NO leading slash, relative)
  ftp> ls workbook
  200 PORT command successful.
  150 Opening ASCII mode data connection for '/bin/ls'.
  /bin/ls: cannot access workbook: No such file or directory
  # No 'workbook' in ~/tmp. This is correct.
  226 Transfer complete.
  ftp> !ls workbook
  workbook
  # ...but locally, it's still there. Note the 'simple' format,
  # as opposed to 'ls'.
  ftp>  

As already said, tab completion's behaviour is, to put it mildly,
confusing. But I'm not seeing what you see wrt. ls vs. !ls.

(now quickly purge the ftp server, before the haxxorz come :)
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAljXi18ACgkQBcgs9XrR2kYoPACfT74hXRuQmDVBk0wSH9sJaFuw
kUgAnjWxaMuu2N2sMF9YJCE2oXOpjQS/
=aU7R
-----END PGP SIGNATURE-----


Reply to: