Subject: Re: dir command dumps core

From: [email-masked] (William E. Diego)
Date: Tue, 4 Mar 1997 09:16:47 -0500

I posted a problem last Thursday concerning 'dir' not listing anything
and dumping core under Solaris 2.5.  I was using the vanilla 2.4 version
of wu-ftpd.

Thanks especially to Jim Davis for leading me on the right track.  You
definitely want the academic version (which I think now is 13; Version
12 was the latest when I went to get it at:

ftp://ftp.academ.com/pub/wu-ftpd/private/wu-ftpd-2.4.2-beta-13.tar.Z

*HOWEVER* it turns out that *ORIGINAL* Sun in.ftpd manual page is the
one that really counts when setting things up.  You are told explicitly
what files you need where (especially all the libraries required to
make dynamically linked ls work; some are extra in case you are running
NIS - put them in there anyway, even if you aren't).  The wu-ftpd
in.ftpd man page is much more generic in it's approach (understandibly
so).

My suggestion, if I may be so bold, is to change the Makefile so that
when the wu-ftpd version of the page is installed it does not overwrite
the old one AND do it so that it is installed in section 8 instead of
1M - this way you can use the -s flag in the man command to find
whichever page you need.

I would think that this will solve most 2.5.1 problems as well, though
I have yet to try...

Thanks again for all the help.  This is a **GREAT** listserver.

Cheers,
-bd
_______________________________________________________________________
William E. Diego                         | 
Science and Technology Corporation       | Tel: (703) 428-6827
U.S. Army Topographic Engineering Center |      (703) 428-6840 x2597
7701 Telegraph Road, Building 2592       | Fax: (703) 428-8176     
ATTN: CETEC-TD-TR (DIEGO)                | Internet: [email-masked]
Alexandria, VA  22315-3864               |
_________________________________________|_____________________________

---

From: Vidiot <[email-masked]>
Date: Tue, 4 Mar 1997 10:13:56 -0600 (CST)

William E. Diego posted:

<*HOWEVER* it turns out that *ORIGINAL* Sun in.ftpd manual page is the
<one that really counts when setting things up.  You are told explicitly
<what files you need where (especially all the libraries required to
<make dynamically linked ls work; some are extra in case you are running
<NIS - put them in there anyway, even if you aren't).  The wu-ftpd
<in.ftpd man page is much more generic in it's approach (understandibly
<so).
<
<I would think that this will solve most 2.5.1 problems as well, though
<I have yet to try...

I have all of the library files listed in the man page there, but dir still
doesn't work.  Many of the library pieces are symbolic links.  I'm assuming
those should work, though the man page says to copy, which would destroy
the links:

dir ~ftp/usr/lib:

total 3284
dr-xr-xr-x   2 root     other       1024 Mar  3 18:17 .
dr-xr-xr-x   4 root     other        512 Mar  4 10:05 ..
-r-xr-xr-x   1 root     other      24576 Feb 14 11:26 ld.so
-rwxr-xr-x   1 bin      bin       137160 Feb 14 11:26 ld.so.1
lrwxrwxrwx   1 root     other         11 Feb 14 11:26 libc.so -> ./libc.so.1
-r-xr-xr-x   1 root     other     662764 Feb 14 11:26 libc.so.1
lrwxrwxrwx   1 root     other         12 Feb 14 11:26 libdl.so -> ./libdl.so.1
-r-xr-xr-x   1 root     other       2564 Feb 14 11:26 libdl.so.1
lrwxrwxrwx   1 root     other         14 Feb 14 11:26 libintl.so -> ./libintl.so.1
-rwxr-xr-x   1 root     other      15720 Feb 14 11:26 libintl.so.1
lrwxrwxrwx   1 root     other         12 Feb 14 11:26 libmp.so -> ./libmp.so.1
-rwxr-xr-x   1 root     other      15720 Feb 14 11:26 libmp.so.1
lrwxrwxrwx   1 root     other         13 Feb 14 11:26 libnsl.so -> ./libnsl.so.1
-rwxr-xr-x   1 root     other     566700 Feb 14 11:26 libnsl.so.1
lrwxrwxrwx   1 root     other         16 Feb 14 11:26 libsocket.so -> ./libsocket.so.1
-rwxr-xr-x   1 root     other      68780 Feb 14 11:26 libsocket.so.1
lrwxrwxrwx   1 root     other         11 Feb 14 11:26 libw.so -> ./libw.so.1
-rwxr-xr-x   1 root     other      39932 Feb 14 11:26 libw.so.1
lrwxrwxrwx   1 root     other         14 Feb 14 11:26 nss_dns.so -> ./nss_dns.so.1
-rwxr-xr-x   1 root     other       9332 Feb 14 11:26 nss_dns.so.1
lrwxrwxrwx   1 root     other         16 Feb 14 11:26 nss_files.so -> ./nss_files.so.1
-rwxr-xr-x   1 root     other      21144 Feb 14 11:26 nss_files.so.1
lrwxrwxrwx   1 root     other         14 Feb 14 11:26 nss_nis.so -> ./nss_nis.so.1
-rwxr-xr-x   1 root     other      24404 Feb 14 11:26 nss_nis.so.1
lrwxrwxrwx   1 root     other         18 Feb 14 11:26 nss_nisplus.so -> ./nss_nisplus.so.1
-rwxr-xr-x   1 root     other      28844 Feb 14 11:26 nss_nisplus.so.1
lrwxrwxrwx   1 root     other         14 Feb 14 11:26 straddr.so -> ./straddr.so.2
-rwxr-xr-x   1 root     other       9312 Feb 14 11:26 straddr.so.2

This is getting real frustrating.

MB
-- 
System Administrator - Finnigan FT/MS - Madison WI. <URL:http://www.ftms.com/>
e-mail: [email-masked]
phone: (608) 273-8262 ext: 612  fax: (608) 273-8719
Visit - <URL:http://www.cdsnet.net/vidiot/>  (Your link to Star Trek and UPN)

---

From: Mike Farace <[email-masked]>
Date: Tue, 04 Mar 1997 08:51:00 -0800

> This is getting real frustrating.

It sounded like you tried to manually copy the files.  I would make sure
you are using the Solaris Script in the man page.  I have attached it
here for your reference.  Give it a whirl...  (define your anonymous ftp
user in /etc/passwd first!).

Mike Farace
[email-masked]

=================
     #!/bin/sh
     # script to setup anonymous ftp area
     #
     # handle the optional command line argument
     case $# in

        # the default location for the anon ftp comes from the passwd
file
        0) ftphome="`grep '^ftp:' /etc/passwd | cut -d: -f6`"
           ;;

        1) if [ "$1" = "start" ]; then
              ftphome="`grep '^ftp:' /etc/passwd | cut -d: -f6`"
           else
              ftphome=$1
           fi
           ;;

        *) echo "Usage: $0 [anon-ftp-root]"
           exit 1
           ;;
     esac

     if [ -z "${ftphome}" ]; then
        echo "$0: ftphome must be non-null"
        exit 2
     fi

     # This script assumes that ftphome is neither / nor /usr so ...
     if [ "${ftphome}" = "/" -o "${ftphome}" = "/usr" ]; then
        echo "$0: ftphome must not be / or /usr"
        exit 2
     fi

     # If ftphome does not exist but parent does, create ftphome
     if [ ! -d ${ftphome} ]; then
         # lack of -p below is intentional
         mkdir ${ftphome}
     fi
     echo Setting up anonymous ftp area ${ftphome}

     # Ensure that the /usr/bin directory exists
     if [ ! -d ${ftphome}/usr/bin ]; then
         mkdir -p ${ftphome}/usr/bin
     fi

     cp /usr/bin/ls ${ftphome}/usr/bin
     chmod 111 ${ftphome}/usr/bin/ls

     # Now set the ownership and modes to match the man page
     chown root ${ftphome}/usr/bin
     chmod 555 ${ftphome}/usr/bin

     # this may not be the right thing to do
     # but we need the bin -> usr/bin link
     if [ -r ${ftphome}/bin ]; then
         mv -f ${ftphome}/bin ${ftphome}/Obin
     fi
     ln -s usr/bin ${ftphome}

     # Ensure that the /usr/lib and /etc directories exist
     if [ ! -d ${ftphome}/usr/lib ]; then
         mkdir -p ${ftphome}/usr/lib
     fi
     if [ ! -d ${ftphome}/etc ]; then
         mkdir -p ${ftphome}/etc
     fi

     #Most of the following are needed for basic operation, except
     #for libnsl.so, nss_nis.so, libsocket.so, and straddr.so which are
     #needed to resolve NIS names.

     cp /usr/lib/ld.so /usr/lib/ld.so.1 ${ftphome}/usr/lib

     for lib in libc libdl libintl libw libnsl libsocket \
        nss_nis nss_nisplus nss_dns nss_files
     do
        cp /usr/lib/${lib}.so.1 ${ftphome}/usr/lib
        rm -f ${ftphome}/usr/lib/${lib}.so
        ln -s ./${lib}.so.1 ${ftphome}/usr/lib/${lib}.so
     done

     cp /usr/lib/straddr.so.2 ${ftphome}/usr/lib
     rm -f ${ftphome}/usr/lib/straddr.so
     ln -s ./straddr.so.2 ${ftphome}/usr/lib/straddr.so

     cp /etc/passwd /etc/group /etc/netconfig ${ftphome}/etc

     # Copy timezone database
     mkdir -p ${ftphome}/usr/share/lib/zoneinfo
     (cd ${ftphome}/usr/share/lib/zoneinfo
       (cd /usr/share/lib/zoneinfo; find . -print | cpio -o) | cpio
-imdu
       find . -print | xargs chmod 555
       find . -print | xargs chown root
     )

     chmod 555 ${ftphome}/usr/lib/*
     chmod 444 ${ftphome}/etc/*

     # Now set the ownership and modes
     chown root ${ftphome}/usr/lib ${ftphome}/etc
     chmod 555 ${ftphome}/usr/lib ${ftphome}/etc

     # Ensure that the /dev directory exists
     if [ ! -d ${ftphome}/dev ]; then
         mkdir -p ${ftphome}/dev
     fi

     # make device nodes. ticotsord and udp are necessary for
     # 'ls' to resolve NIS names.

     for device in zero tcp udp ticotsord
     do
        line=`ls -lL /dev/${device} | sed -e 's/,//'`
        major=`echo $line | awk '{print $5}'`
        minor=`echo $line | awk '{print $6}'`
        rm -f ${ftphome}/dev/${device}
        mknod ${ftphome}/dev/${device} c ${major} ${minor}
     done

     chmod 666 ${ftphome}/dev/*

     ## Now set the ownership and modes
     chown root ${ftphome}/dev
     chmod 555 ${ftphome}/dev

     if [ ! -d ${ftphome}/pub ]; then
        mkdir -p ${ftphome}/pub
     fi
     chown ftp ${ftphome}/pub
     chmod 777 ${ftphome}/pub

---

From: [email-masked] (Dan Bellis)
Date: Tue, 4 Mar 1997 12:09:08 -0500 (EST)

> This is getting real frustrating.

The library files that I am using for my 2.5.1 installation are actual 2.5
libs.  I upgraded the OS put left the same ~ftp directory.  This is the list
of the libraries I am using:

		Size		    File name

		106768 Feb 18 00:47 ld.so.1
		192328 Feb 17 21:53 libc.a
		664048 Feb 17 22:19 libc.so.1
		  2568 Feb 17 22:19 libdl.so.1
		 15304 Feb 17 22:19 libintl.so.1
		 39340 Feb 17 22:19 libw.so.1

The ls binary is also a 2.5 version.  I hope this helps with your problem...
-- 

                                Dan Bellis
                                Unix System Administrator
                                email: [email-masked]
                                phone: (716) 631-4132
~

---

From: Vidiot <[email-masked]>
Date: Tue, 4 Mar 1997 11:58:13 -0600 (CST)

Mike Farace posted:

<It sounded like you tried to manually copy the files.  I would make sure
<you are using the Solaris Script in the man page.  I have attached it
<here for your reference.  Give it a whirl...  (define your anonymous ftp
<user in /etc/passwd first!).

I used a script that basically did the same thing as the script, but there
are some differences in some files that were installed (other than in the
usr/lib area).

As pointed out by another person, the in.ftpd man page is overwritten by
the wu-ftp install.  That is a no-no.  If anything, the man page should
be installed in /usr/local/man/man8 or /usr/share/man/man8, but not in
/usr/share/man/man1m.  So I never saw the script.

Also, the script you included was not from Solaris 2.5.1 and it failed at
the cpio command.  The one that comes with Solaris 2.5.1 worked.  But, it
led me in the right direction.  BTW, the script copies over /etc/passwd and
/etc/group and it really shouldn't.  Once the copy of passwd and group have
been done, hand edit the files and just leave the entry for root.

To find out what the differences are between the other install script that
I used and this one, I'd have to compare them and frankly it isn't worth it.

Thanks to all, the problem is now solved.

Maybe this script should be added to the wu-ftpd distribution.

MB

---

From: Vidiot <[email-masked]>
Date: Tue, 4 Mar 1997 12:02:15 -0600 (CST)

Mike Farace posted:

The Solaris install script:

<     #!/bin/sh

<        # the default location for the anon ftp comes from the passwd
<file

Line wrap problem.  The above two lines should be a single line.

<       (cd /usr/share/lib/zoneinfo; find . -print | cpio -o) | cpio
<-imdu

Line wrap problem.  The above two lines should be a single line.  That is
why the cpio command failed, as mentioned in my previous message.  Gotta
watch out for those line wrapping scripts that parse e-mail :-)

MB

---

From: Mike Farace <[email-masked]>
Date: Tue, 04 Mar 1997 11:35:12 -0800

I have found how to fix some things in Solaris 2.5.1 and wu-ftpd, but I
still cannot get the following to work with wu-ftpd (beta 11, 12 or 13):

1) messages and banners commands in ftpaccess file
2) guestgroup members are not chroot'ed to their directories
3) ftpwho, ftpcount - always show 0 users, not matter what
4) ftpshut - does absolutely nothing

I have compiled with cc, not gcc (because I couldn't get it installed
correctly - not a programmer, and cc was already installed on one
system) - is this a problem?

If anyone can send me their compiled copy of wu-ftpd (any version) so I
can see if it behaves differently..  I would be extremely grateful!

Thanks,
Mike Farace
[email-masked]

---

From: Vidiot <[email-masked]>
Date: Tue, 4 Mar 1997 13:59:19 -0600 (CST)

Mike Farace posted:

<I have found how to fix some things in Solaris 2.5.1 and wu-ftpd, but I
<still cannot get the following to work with wu-ftpd (beta 11, 12 or 13):

I am running beta 12 under Solaris 2.5.1.

<1) messages and banners commands in ftpaccess file

That works for me.  I have a .welcome.msg file in ~ftp and the following lines
in ftpaccess:

	message .welcome.msg            login
	message .message                cwd=*

The .welcome.msg is displayed when the anonymous user logs in.

<2) guestgroup members are not chroot'ed to their directories

Interesting, I have one guest member and it kinda works.  Here are the lines
that I have in the listed files:

/etc/group:

guest::5000:ftmsftp

/etc/passwd:

ftmsftp:x:5001:5000:Guest FTP account:/usr/export/ftms_releases/ftp/./ftms:/bin/false

ftpaccess:

class   local    real,guest  *
class   remote   anonymous  *
guestgroup guest

Here is the interesting part.  If I log in as ftmsftp, I get to where I am
supposed to go, and that is ~ftp/ftms.  BUT, I am allowed to move up a
directory into the parent of ~ftp/ftms.  Is this right?  I cannot cd out of
the ~ftp area, but I can certainly leave ~ftp/ftms.

<3) ftpwho, ftpcount - always show 0 users, not matter what

Haven't used either, so I don't know.

<4) ftpshut - does absolutely nothing

Haven't used this one either.

<I have compiled with cc, not gcc (because I couldn't get it installed
<correctly - not a programmer, and cc was already installed on one
<system) - is this a problem?

GCC does take a little patience, but it does compile.  It takes three times
for the first time builder of GCC.  Once using cc, then once using the just
built GCC and then once more with the newest built GCC.  From that point
on, each revision of GCC only requires one pass of the compiler (using GCC).

<If anyone can send me their compiled copy of wu-ftpd (any version) so I
<can see if it behaves differently..  I would be extremely grateful!

My copy is available as:

	ftp://ftms.com/pub/misc/in.ftpd.gz

The ftp files it is looking for go in /etc/ftpd

MB