Subject: problem with dir and ls -l

From: Ed_Donley <[email-masked]>
Date: Thu, 18 May 1995 21:55:50 -0500 (EST)

I just installed wu-ftpd version 2.4 on a DECstation 5000/200 running Ultrix
4.4.  It works fine for real users, but "ls -l" and "dir" will not list
directory contents for anonymous users.  Strangely enough, "ls" does work for
anonymous users.  I've enclosed a log of the problem below.  The server is at
ftp.ma.iup.edu.  Has anyone experienced a similar problem or know what my
problem is?

Thanks,
Ed Donley
Mathematics Department
Indiana University of Pennsylvania
Indiana, PA  15705
U.S.A.

[email-masked]
http://www.ma.iup.edu/MathDept/Professors/HDonley.html

==============================================================================

ftp> ls -l
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
remote: -l
0 bytes received in 0.35 seconds (0 Kbytes/s)
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
0 bytes received in 0.32 seconds (0 Kbytes/s)
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
lost+found
bin
etc
pub
www
font
.welcome
226 Transfer complete.
48 bytes received in 0.0039 seconds (12 Kbytes/s)

---

From: Robert Denault <[email-masked]>
Date: Fri, 19 May 1995 07:21:24 -0400

> From: Ed_Donley <[email-masked]> 

I had a similar problem on Sun Solaris 2.4
I'm not familiar with Ultrix so...

Check to make sure your chroot environment contain all the shared libraries the software in the bin directory will need. You can use ldd to list the shared libraries, and if all thoses are there run truss on ls and ls -l and see if there are any extra libraries the extra options need.

Also make sure the permissions are right on your libraries so that the program
can access and load them.

Hope this helps..

Robert Denault

Telematique Immedia
1155, boul Rene-Levesque ouest, bureau 2250
Montreal, (Quebec)
H3B 4T3
Canada

Voice:	(514) 397-9747 ext 242
FAX:	(514) 398-0764

---

From: [email-masked]
Date: Fri, 19 May 95 09:33:32 PDT

On Thu, 18 May 1995 21:55:50 -0500 (EST)  Ed_Donley wrote:
>I just installed wu-ftpd version 2.4 on a DECstation 5000/200 running 
>Ultrix 4.4.  It works fine for real users, but "ls -l" and "dir" will 
>not list directory contents for anonymous users.  Strangely enough, 
>"ls" does work for anonymous users.  I've enclosed a log of the problem 
>below.  The server is at ftp.ma.iup.edu.  Has anyone experienced a 
>similar >problem or know what my problem is?

The 'ls' command by itself is run from within ftpd; all other variants 
such as ls -l and dir are run using the /bin/ls program *under the ftp 
root directory*.  If your ftp root is /home/ftp, there must exist 
/home/ftp/bin/ls.  Depending on the OS, you need more or less support 
stuff around it, such as /home/ftp/dev/*stuff*, etc.  anonymous ftp runs 
in a chroot'ed environment; that is, the root directory for ftpd becomes 
/home/ftp, and it cannot see above that.  That is why all this stuff 
must be under the tree.

The docs do a pretty good job on this, but enough people have trouble 
with this that they may deficient in some way.  Do the best you can with 
them, and when you get stuck someone on this list can help.

Hope this helps...
---------------
Michael Brennen                    Intecom, Inc.
[email-masked]               5057 Keller Springs
(214) 447-8074                     Dallas,  TX  75248

---

From: [email-masked] (Nic Wolff)
Date: Sat, 20 May 1995 13:30:11 -0500

I'm sure you'll get deluged with answers; everyone (including me!) gets
this wrong the first time. The problem is that 'ls' is dynamically linked,
and the anonymous user has the root of the file system changed to ~ftp, so
the copy of 'ls' you put in ~ftp/bin can't find its libraries. There are
two solutions: either duplicate the library directory hierarchy under ~ftp,
or (the easy way) recompile 'ls' with the -static flag -- get the gnu
fileutils package (try csvax.cs.caltech.edu:/gnu/fileutils-3.6.tar.gz) and
follow the instructions.

The reason "ls" works is that wu-ftpd actually catches it and returns a
file list itself, rather than executing 'ls'. Sending "ls -l" (or "ls" with
any flags) causes 'ls' to be run and to fail to find its libraries. And
"dir" is aliased to "ls -l", so it won't work either. Confusing, ain't it?

Have fun.