Subject: SUMMARY: Problem with DIR command in WU-FTPD 2.4

From: [email-masked] (Raza Rizvi)
Date: Wed, 10 May 1995 13:08:52 +0100

Firstly thank you to all who contributed to this problem.

Summary of Problem:

Fetch 2.1.1 on PPC 7100/66 with System 7.5 connecting to Sun Sparc 4.1.3_U1
with the WU-FTPD 2.4

Works fine for real and anonymous users but Guest Users who are CHROOTed to
a particular directory connect okay but are not presented with a file
listing for their home directory or the (new) root directory.

If the same user logs in from another Unix machine, all is well.

If a UNIX FTP terminal users issue a DIR, which is what FETCH issues, they
get no file listing back. They do if they issue a LS.

Solution:

No one gave the correct answer which was "YOU ARE STUPID. CHECK THAT THE
/BIN DIRECTORY IS HANGING OF THE ROOT DIRECTORY" :-()

I include the edited replies below for your files, my comments are between
the **'s.

Patrick Salsbury        ([email-masked])
I had this problem. Turned out my /usr/lib dir was chmod 111. Doing a
chmod 555 on it fixed the problem. (People could execute the directory, but
couldn't read the libraries out of it, so the dir version of ls didn't work.
Only the built-in version did. I think the libraries need to be readable,
but not executable. The directory needs to be executable (to access it) and
readable (to find out the names of the libraries in it.)

**The /usr/ftp/usr and /usr/ftp/usr/lib directories are chmod 555. The file
/usr/ftp/bin is executable and the file /usr/ftp/bin/ls is
read/execute.**

Ariel Spivakovsky <[email-masked]>
Reading the man page for ftpd on my machine (AIX 3.2.5) helped me with this.
It should tell you what the shared libs. you should need, if any.

**For a Sun running SunOS /usr/ftp/usr/lib contains the libraries I need
(ld.so,libc.so.1.9,libdl.so.1.0) according to the man pages for ftpd, and
they are both readable and executable. They are also readable and
executable in /usr/lib.**

Dave Wolfe ([email-masked])
If you haven't already, try running the same ls command from a chroot
directly. That should display any error messages coming from the system
or ls itself. My bet is on ls flags defined in your wu-ftpd for the long
form that ls doesn't know about, so it just outputs an error message on
stderr, e.g.:

$ ls -lA
UX:ls: ERROR: Illegal option -- A
UX:ls: TO FIX: Usage: ls -1RadCxmnlogrtucpFbqisfL [files]

**When tried from a csh shell login, ls, ls -al, ls -lA, all work okay**

I'm sorry, but your examples just don't convince me you've done what I
suggested.

% strings /usr/local/etc/ftpd | grep /bin/ls
/bin/ls -lA
/bin/ls -lA
/bin/ls %s

These are the commands and options wu-ftpd uses to implement the dir
command.

# chroot /usr/ftp /bin/ls -lA
[ output deleted ]

This simulates what wu-ftpd does in response to a dir command.

**It failed and lead me to realise that I had been unnaturally stupid and
created the root directory one level below where i thought it was**

James Leong ([email-masked])
You need to make the device in dir of [ftp]/dev. The device files are
always necessary, e.g. zero, null.... You can man the ftpd to read what
devices are necessary. To make the devices file, you can't cp them from
/dev. You should use the command--mknod. If you want the detail, try to use
man mknod.

**This had been done but as an aside can give the same symptoms**

Thanks to everyone once again, and I hope this summary helps someone else.

Raza

Raza Rizvi ([email-masked])
RedNet Ltd, High Wycombe, England
Tel - +44 (0)1494 513333  Fax - +44 (0)1494 443374