Subject: Redhat Linux 6.0 Problem

From: "Lisa L Berdeja" <[email-masked]>
Date: Fri, 7 May 1999 07:29:37 -0700

I just install Redhat 6.0, wu-ftp seems to have a globbing problem.  ls
works great unless you trie to use an * then you get nothing at all.
Thank You.

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 7 May 1999 10:56:45 -0400 (EDT)

On Fri, 7 May 1999, Lisa L Berdeja wrote:

> I just install Redhat 6.0, wu-ftp seems to have a globbing problem.  
> ls works great unless you trie to use an * then you get nothing at
> all.

A bit more description of the problem would be good.  Where are you trying
to use a *?

The location of the latest versions of wu-ftpd can be found in the 
directory
 
      ftp://ftp.vr.net/pub/wu-ftpd/
 
wu-ftpd Resource Center:  http://www.landfield.com/wu-ftpd/
wu-ftpd FAQ:              http://www.cetis.hvu.nl/~koos/wu-ftpd-faq.html
wu-ftpd list archive:     http://www.landfield.com/wu-ftpd/mail-archive/

-- 

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

---

From: [email-masked]
Date: Fri, 7 May 1999 10:14:37 -0400 (EDT)

> A bit more description of the problem would be good.  Where are you trying

I hadn't noticed this, but just reproduced it on a Red Hat 6.0 upgraded box.

Connecting to localhost...
xxx.xxx.xxx FTP server (Version wu-2.4.2-VR17(1) Mon Apr 19 09:21:53 EDT
1999) ready.
Logging in...                                                                   
Guest login ok, access restrictions apply.
Logged in to xxx.                                                               
ncftp / > dir
drwxr-xr-x   6 root     root         1024   Mar 21 16:49   .
drwxr-xr-x   6 root     root         1024   Mar 21 16:49   ..
d--x--x--x   2 root     root         1024   May  2 20:13   bin
d--x--x--x   2 root     root         1024   May  2 20:13   etc
drwxr-xr-x   2 root     root         1024   May  2 20:13   lib
drwxr-sr-x   2 root     ftp          1024   Mar 21 16:49   pub
ncftp / > ls -l
drwxr-xr-x   6 root     root         1024   Mar 21 16:49   .
drwxr-xr-x   6 root     root         1024   Mar 21 16:49   ..
d--x--x--x   2 root     root         1024   May  2 20:13   bin
d--x--x--x   2 root     root         1024   May  2 20:13   etc
drwxr-xr-x   2 root     root         1024   May  2 20:13   lib
drwxr-sr-x   2 root     ftp          1024   Mar 21 16:49   pub
ncftp / > ls -l *
ncftp / > ls -l *.*
ncftp / > dir *
ncftp / >

Name        : wu-ftpd                      Relocations: (not relocateable)
Version     : 2.4.2vr17                         Vendor: Red Hat Software
Release     : 3                             Build Date: Mon Apr 19 09:22:03 1999
Install date: Sun May  2 16:41:13 1999      Build Host: porky.devel.redhat.com
Group       : System Environment/Daemons    Source RPM: wu-ftpd-2.4.2vr17-3.src.rpm
Size        : 403980                           License: BSD
Packager    : Red Hat Software <http://developer.redhat.com/bugzilla>
Summary     : An FTP daemon provided by Washington University.

----don't waste your cpu, crack rc5...www.distributed.net team enzo---
 Jon Lewis [email-masked]*|  Spammers will be winnuked or 
 System Administrator        |  nestea'd...whatever it takes
 Atlantic Net                |  to get the job done.
_________http://www.lewis.org/~jlewis/pgp for PGP public key__________

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 7 May 1999 11:28:02 -0400 (EDT)

> Summary     : An FTP daemon provided by Washington University.

This _is_ a FAQ.

You are missing bin/ls, a library (in lib) and, most definitely missing
devices (dev/null is required on all installs, in all chroot areas).

Read the Guest HOWTO and follow the instructions.

 

--

---

From: [email-masked]
Date: Fri, 7 May 1999 10:45:39 -0400 (EDT)

> devices (dev/null is required on all installs, in all chroot areas).

No...I'm not missing any of the bins or libs.  I've never had/missed /dev
in a chrooting wu-ftp install on Linux.

[root@xxx ftp]# pwd
/home/ftp
[root@xxx ftp]# ls -laR
.:
total 6
drwxr-xr-x   6 root     root         1024 Mar 21 11:49 .
drwxr-xr-x  12 root     root         1024 Feb  6  1996 ..
d--x--x--x   2 root     root         1024 May  7 11:37 bin
d--x--x--x   2 root     root         1024 May  2 16:13 etc
drwxr-xr-x   2 root     root         1024 May  2 16:13 lib
drwxr-sr-x   2 root     ftp          1024 Mar 21 11:49 pub

bin:
total 388
d--x--x--x   2 root     root         1024 May  7 11:37 .
drwxr-xr-x   6 root     root         1024 Mar 21 11:49 ..
-rwxr-xr-x   1 root     root        63132 May  7 11:37 ash
---x--x--x   1 root     root        15204 Mar 21 11:49 compress
---x--x--x   1 root     root        52388 Mar 21 11:49 cpio
---x--x--x   1 root     root        50384 Mar 21 11:49 gzip
---x--x--x   1 root     root        29308 Mar 21 11:49 ls
---x--x--x   1 root     root        62660 Mar 21 11:49 sh
---x--x--x   1 root     root       110668 Mar 21 11:49 tar
lrwxrwxrwx   1 root     root            4 Dec  1 11:15 zcat -> gzip

etc:
total 37
d--x--x--x   2 root     root         1024 May  2 16:13 .
drwxr-xr-x   6 root     root         1024 Mar 21 11:49 ..
-r--r--r--   1 root     root           53 Mar 21 11:49 group
-rw-r--r--   1 root     root        31940 Mar 21 11:49 ld.so.cache
-r--r--r--   1 root     root           79 Mar 21 11:49 passwd

lib:
total 1203
drwxr-xr-x   2 root     root         1024 May  2 16:13 .
drwxr-xr-x   6 root     root         1024 Mar 21 11:49 ..
-rwxr-xr-x   1 root     root        77968 Mar 21 11:49 ld-2.1.1.so
lrwxrwxrwx   1 root     root           11 May  2 16:13 ld-linux.so.2 ->
ld-2.1.1
.so
-rwxr-xr-x   1 root     root      1031004 Mar 21 11:49 libc-2.1.1.so
lrwxrwxrwx   1 root     root           13 May  2 16:13 libc.so.6 ->
libc-2.1.1.s
o
-rwxr-xr-x   1 root     root        77196 Mar 21 11:49 libnsl-2.1.1.so
lrwxrwxrwx   1 root     root           15 May  2 16:13 libnsl.so.1 ->
libnsl-2.1
.1.so
-rwxr-xr-x   1 root     root        33596 Mar 21 11:49
libnss_files-2.1.1.so
lrwxrwxrwx   1 root     root           21 May  2 16:13 libnss_files.so.2
-> libn
ss_files-2.1.1.so
pub:
total 2
drwxr-sr-x   2 root     ftp          1024 Mar 21 11:49 .
drwxr-xr-x   6 root     root         1024 Mar 21 11:49 ..
[root@xxx ftp]#

ash is in bin only because I just put it there so I could 
/usr/sbin/chroot /home/ftp /bin/ash 
and then play around in the chroot area making sure the bins there
do work...and they do.  Red Hat 5.2 has the same dir structure/permissions
(just older bins and libs) and works fine.  I strongly suspect whoever
packaged wu-ftpd-2.4.2vr17-3 at Red Hat botched something in the config.

> Read the Guest HOWTO and follow the instructions.

I'm not using guestgroup.  This is just a totally stock Red Hat
installed wu-ftpd using regular anonymous FTP.

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 7 May 1999 12:12:08 -0400 (EDT)

> in a chrooting wu-ftp install on Linux.

Never missed is the right wording.  trust me, you need /dev/null for
everything to work properly (well, better, I'm still tracking down one
thing I don't like with the way on-the-fly tar+gzip is working).

>From what you're saying, I suppose Redhat 6.0 has a new library, and
you're missing it in the guest-user chroot area.

It's a simple test:

Does 'ls' work from the command line for a non-root user?  If so, then
you're missing something (on Redhat, probably a library) in the chroot
area.

The Guest HOWTO has a test command su runs to test the installation of
'ls' in the chroot area.  Does it work?

No, use ldd to see what libraries are directly referenced.  Are they all
there?

Is so, then you need to take a look at other libraries which may be on-
the-fly loaded.  PAM and some of the BIND/Resovler libraries, for
instance, are not found using ldd, but are required by some programs all
the same.  Which ones might Redhat 6.0's ls command be using?  Beats me.

Oh, and are you using symlinks?  If so, there's your problem.  Symlinks
won't work if they point outside the chroot'd area.  Use hardlinks,
loopback mounts, or copies.

If all else fails, scrog the lot (ls/tar/gzip/compress/md5sum/cksum, and
all libraries), build statically-linked versions of them, and use them
instead.

An example of a minimal system (which _does_ work on Linux), using
statically linked helpers in ~ftp/bin, is laid out at
ftp://ftp.vr.net/pub/wu-ftpd/examples

Statically linked helpers for Linux are at
ftp://ftp.vr.net/pub/wu-ftpd/binaries/intel/linux/ftp.bin.linux.i386.tar.gz

--

---

From: [email-masked]
Date: Fri, 7 May 1999 11:54:13 -0400 (EDT)

> you're missing something (on Redhat, probably a library) in the chroot

Yes.  If I suid the ash to my uid, I can chroot myself in /home/ftp and
run ls as myself (not root) and it works.

> 'ls' in the chroot area.  Does it work?

Haven't looked at the Guest HOWTO recently.  After my own tests, I'm
relatively convinced /home/ftp/bin/ls works properly for non-root users
when chrooted in /home/ftp/.

> the same.  Which ones might Redhat 6.0's ls command be using?  Beats me.

# ldd ./ls
        /lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x40014000)
        libc.so.6 => /lib/libc.so.6 (0x4001c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

I've never heard of libNoVersion.  All the /home/ftp/bin stuff in 6.0 uses
it...but it doesn't exist.  Perhaps that's got something to do with
it...but its odd that the programs work when I chroot there and run them.

> Oh, and are you using symlinks?  If so, there's your problem.  Symlinks

No symlinks except for zcat -> gzip.  This is a standard Red Hat
installation.  It looks like they just screwed up the wu-ftpd package and
will probably issue an update sometime soon.  For me, this isn't a huge
issue.  I'm not using RH 6.0 on production servers yet.  I like to wait a
few weeks after new releases and see how much stuff they broke and then
either wait for the updates or use the source.

---

From: [email-masked]
Date: Fri, 7 May 1999 12:01:50 -0400 (EDT)

> either wait for the updates or use the source.

I just noticed another really wierd thing.  For some reason the anonftp
package on Red Hat (at least 5.2 and 6.0) that includes the libs and bins
needed for wu-ftpd to work for anonymous FTP includes what seems to be a
copy of /bin/ash as /home/ftp/bin/sh.  Why the heck would they include a
bourne shell in the anon bin directory?

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 7 May 1999 13:37:17 -0400 (EDT)

On Fri, 7 May 1999 [email-masked] wrote:

> I've never heard of libNoVersion.  All the /home/ftp/bin stuff in 6.0
> uses it...but it doesn't exist.  Perhaps that's got something to do
> with it...but its odd that the programs work when I chroot there and
> run them.

Maybe.  Never heard of it either.

I've seen something like what you're seeing before when my library
in-memorg cache got out-of-sync.  I don't put the lib cache stuff in my
chroot areas and everybody's happy.  Maybe it's not a missing lib, but a
bad lib version or linkage caused by crossing chroot boundaries with
cached information.

--

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 7 May 1999 13:38:30 -0400 (EDT)

On Fri, 7 May 1999 [email-masked] wrote:

> I just noticed another really wierd thing.  For some reason the
> anonftp package on Red Hat (at least 5.2 and 6.0) that includes the
> libs and bins needed for wu-ftpd to work for anonymous FTP includes
> what seems to be a copy of /bin/ash as /home/ftp/bin/sh.  Why the heck
> would they include a bourne shell in the anon bin directory?

Never played with anonftp but on first blush I say "Uh, yeah .. that's a
Really Bad Idea (tm)"

--