Subject: Re: "ls" works but "dir" does not from a ftp client

From: "ANM Mlist 01" <[email-masked]>
Date: 16 Nov 1998 17:46:28 -0000

At 10:18 AM 11/16/98 -0500, Gregory A Lundberg wrote:
>
>A few comments about this:
>
> - There's no ~ftp/dev directory so, depending on your flavor of Unix,
>   that's probably the problem.  This is covered in the FAQ.
>

For the record I am running Linux with a 2.1.127 Kernel. The FAQ does
not mention /dev for Linux. Nether does the install instructions, if
memory serves. Comments for Linux user welcome......

>
> - The /bin you've listed here looks to be the root /bin .. what are the
>   contents of ~ftp/bin?
>

Here is a non-chrooted ls:
benny:ftp# /bin/ls -l ~ftp/. ~ftp/bin; 
/home/ftp/.:
total 5
d--x--x--x   2 root     root         1024 Sep 20 23:30 bin
dr-xr-xr-x   2 root     root         1024 Nov 15 12:19 etc
drwx-wx-wt   2 root     daemon       1024 Nov 15 11:28 incoming
dr-xr-xr-x   2 root     root         1024 Nov 15 11:49 lib
drwxr-xr-x   2 root     root         1024 Nov 15 11:29 pub

/home/ftp/bin:
total 189
---x--x--x   1 root     root       116244 Sep 20 23:03 gtar
---x--x--x   1 root     root        45309 Sep 20 23:03 gzip
---x--x--x   1 root     root        27212 Sep 18 18:06 ls
lrwxrwxrwx   1 root     root            4 Sep 20 23:30 tar -> gtar

The following test shows that we are talking about the same
directories:

benny:ftp# (cd ~ftp; chroot . /bin/ls  --directory --inode . /bin)
  49153 .       53249 /bin
benny:ftp# /bin/ls --directory --inode ~ftp/. ~ftp/bin; 
  49153 /home/ftp/.      53249 /home/ftp/bin

So the /bin I listed in my earlier chroot test is one and the same as
~ftp/bin.

> - chroot tells you *root* can run the program, with all the special
>   privileges, it doesn't say it's all there for a normal user like ftp.
>

That is true. If anyone has a suggestion as to how I can chroot and su
to ftp to perform a test without placing su into ~ftp/bin I would
like to know, since this would clear things up a bit. In fact I am now
curious how wuftp does it? Note that:

benny:ftp# su - ftp -c '~/bin/ls -l . ~/bin'
.:
total 5
d--x--x--x   2 root     root         1024 Sep 20 23:30 bin
dr-xr-xr-x   2 root     root         1024 Nov 15 12:19 etc
drwx-wx-wt   2 root     daemon       1024 Nov 15 11:28 incoming
dr-xr-xr-x   2 root     root         1024 Nov 15 11:49 lib
drwxr-xr-x   2 root     root         1024 Nov 15 11:29 pub

/home/ftp/bin/ls: /home/ftp/bin: Permission denied

Performs as expected. The user ftp is able to run the ~ftp/bin/ls
program but is unable to list ~ftp/bin. So if the user ftp can 
"ls -l" the root directory ~ftp/. correctly, you would expect that a
NLST client command would work under wuftp...... No such luck yet!

> - ISTM you're running a Sun system, in which case you did NOT read the
>   FAQ.  Try reading it instead of scanning quickly over it.
>

I have read the entire FAQ more than once and there is no answer
there! I have scanned the mail-archive and noted that this problem
has been mentioned before, but it would appear that it affects Solaris
sites mostly. I am yet to see a Linux based discussion.

>> >The location of the latest version of wu-ftpd can be found in the 
>> >directory
>> > 
>> >      ftp://ftp.academ.com/pub/wu-ftpd/private/
>> 
>> I checked the URL got following response: 
>> 
>> ftp> open ftp.academ.com
>> Connected to ANNOUNCER.ACADEM.COM.
>> Connection closed by remote host.
>> 
>> So thats not very helpful.
>
>Sure it is.  You're just impatient.  Machines go down for any number of
>reasons.  It's up and working fine today.
>

That is interesting.... I just checked.... and..... nope. It's not
accessible.

Any other new ideas?

Thanks

Anthony

---

From: Gregory A Lundberg <[email-masked]>
Date: Mon, 16 Nov 1998 13:09:02 -0500 (EST)

> memory serves. Comments for Linux user welcome......

My example site shows exactly what's needed, ownerships and permissions,
for a Linux site.

  ftp://ftp.vr.net/pub/wu-ftpd/examples/

If you're still having troubles, just grab the binaries from my site and
set things up as you see them there.  I develop on Linux and run my site
on it.

-- 

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195