Subject: Help! Anonymous "dir" stopped working.

From: Karl Kopper <[email-masked]>
Date: Fri, 1 Mar 1996 11:12:45 -0800

We've been making NIS server changes and the location
of the anonymous ftp home directory, and suddenly
anonymous ftp can no longer do the "dir" command,
but "ls" still works!? (Running a freshly re-installed
Version wu-2.4(1)) on Sun OS 4.1.3_U1).

Here's what it looks like:

---------
230 Guest login ok, access restrictions apply.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.                                    <<<<< NO OUTPUT
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
bin							  <<<<< WORKS!
etc
pub
usr
incoming
lib
welcome.msg
226 Transfer complete.
48 bytes received in 0.0013 seconds (36 Kbytes/s)
ftp> 
--------

It's driving me crazy.. What's the difference?? A trace of wu-ftpd shows:

write (1, "150 Opening ASCII mode data conn".., 53) = 53
sigblock (0) = 0
sigstack (0, 0xf7fff04c) = 0
ioctl (9, 0x40125401, 0xf7ffef44) = -1 EOPNOTSUPP (Operation not supported on socket)
- SIGCHLD (20)
fstat (9, 0xf7ffefb8) = 0
read (9, "", 4096) = 0
write (1, "226 Transfer complete.\r\n", 24) = 24

So why is it not supported? What did I break? This causes all of the
applications hard coded to retrieve file lists with dir to fail.

--Karl

---

From: "Scott T. Miller" <[email-masked]>
Date: Sat, 2 Mar 1996 07:43:45 -0500 (EST)

On Fri, 1 Mar 1996, Karl Kopper wrote:

> It's driving me crazy.. What's the difference?? 

Karl,

I was also having a problem with the anonynmous ls command under wu-ftpd 
2.4 and Linux 1.3.67.  Then I rebuilt the ls command with the -static 
flag and it worked fine.  You have to specify -static in the CFLAGS and the 
LDFLAGS in the Makefile (why both I don't know).  You can get the source
from the fileutil's gz file, probably on the same ftp site from which you
downloaded wu-ftpd.  If you can't find it, send another msg. and I'll dig 
up the URL for you.

According to the deeply-buried documentation, the anonymous ftp user can't
execute a dynamically linked ls if it can't find all the proper .so files.
You could track down all the shared object libraries which ld uses, using 
the ldd and trace commands.  Then you can copy the correct libs into
~ftp/lib.  Or you can just rebuild ls statically.  Rebuilding was easier for
me.  I hacked around with the .so files for a while, then gave up and went
with the rebuild.

--Scott T. Miller
[email-masked]