Subject: Re: directory listing problems - PLEASE help

From: [email-masked] (Miquel Cabanas. BBM-UAB)
Date: Tue, 22 Oct 1996 19:17:59 +0200

hi,

> From [email-masked] Tue Oct 22 16:40:26 1996
> 
> yes, I've tried to set up my directories according to what is suggested
> in the man ftpd-page.
> 
> Strange thing is this: The man page tells me to copy the following files 
> (among others) from my /usr/lib directory:
> nss_nis.so*
> nss_nisplus.so*
> nss_dns.so*
> nss_files.so*
> 
> These files do not exist on my system. I found this a little strange,
> so I spoke with my contact at Sun Microsystems, who told me that he
> didn't have those files either.
> 
> Note that I am running Solaris 2.5.
> 

this is the full list of libraries that MUST exists under the /usr/lib
for each one of your chrooting users. Note that some of the libs you're
missing are links to the real library files, i bet you that 'ls -l' is
trying to access the libs through the links, that have no mention of the
library release number and will not change from sys to sys, with upgrades
and OS patches

   -r-xr-xr-x   1 root     other      24576 Mar 22  1996 ld.so
   -r-xr-xr-x   1 root     other      97804 Mar 22  1996 ld.so.1
   lrwxrwxrwx   1 root     other         11 Mar 22  1996 libc.so -> ./libc.so.1
   -r-xr-xr-x   1 root     other     621408 Mar 22  1996 libc.so.1
   lrwxrwxrwx   1 root     other         12 Mar 22  1996 libdl.so -> ./libdl.so.1
   -r-xr-xr-x   1 root     other       3492 Mar 22  1996 libdl.so.1
   lrwxrwxrwx   1 root     other         14 Mar 22  1996 libintl.so -> ./libintl.so.1
   -r-xr-xr-x   1 root     other      13516 Mar 22  1996 libintl.so.1
   lrwxrwxrwx   1 root     other         13 Mar 22  1996 libnsl.so -> ./libnsl.so.1
   -r-xr-xr-x   1 root     other     508896 Mar 22  1996 libnsl.so.1
   lrwxrwxrwx   1 root     other         16 Mar 22  1996 libsocket.so -> ./libsocket.so.1
   -r-xr-xr-x   1 root     other      73048 Mar 22  1996 libsocket.so.1
   lrwxrwxrwx   1 root     other         11 Mar 22  1996 libw.so -> ./libw.so.1
   -r-xr-xr-x   1 root     other      41704 Mar 22  1996 libw.so.1
   drwxr-xr-x   3 bin      bin          512 Mar 22  1996 locale
   lrwxrwxrwx   1 root     other         14 Mar 22  1996 nss_dns.so -> ./nss_dns.so.1
   -r-xr-xr-x   1 root     other      10796 Mar 22  1996 nss_dns.so.1
   lrwxrwxrwx   1 root     other         16 Mar 22  1996 nss_files.so -> ./nss_files.so.1
   -r-xr-xr-x   1 root     other      18496 Mar 22  1996 nss_files.so.1
   lrwxrwxrwx   1 root     other         14 Mar 22  1996 nss_nis.so -> ./nss_nis.so.1
   -r-xr-xr-x   1 root     other      25840 Mar 22  1996 nss_nis.so.1
   lrwxrwxrwx   1 root     other         18 Mar 22  1996 nss_nisplus.so -> ./nss_nisplus.so.1
   -r-xr-xr-x   1 root     other      29376 Mar 22  1996 nss_nisplus.so.1
   lrwxrwxrwx   1 root     other         14 Mar 22  1996 straddr.so -> ./straddr.so.2
   -r-xr-xr-x   1 root     other       9436 Mar 22  1996 straddr.so.2

in Solaris you can check what libraries are called (and how they are called)
by tracing the execution of the program with 'truss' (as someone already
mentioned not too long ago)

   > truss -o ~/ls_l_trace ls -l

and then search for files and libraries opened by the program (in this case, ls -l)
and better that these, find out which ones failed to open!

   > grep 'open' ~/ls_l_trace
   list of files that has tried to open

   > grep 'lstat' ~/ls_l_trace
   list of libraries whose status has tried to check 

hope this helps. Miquel

Miquel E Cabanas ---------------------------------------------------
SeRMN & BBM - Universitat Autonoma de Barcelona, Catalunya - Spain

e-mail: [email-masked]
url:    http://bbm-web.uab.es/biomed-nmr/miquel_angles.html
------------------------------------------o-oo--ooo---ooo--oo-o-----

---

From: [email-masked] (Miquel Cabanas. BBM-UAB)
Date: Tue, 22 Oct 1996 20:25:34 +0200

those are two mail posted early this year on the same issue: static ls

1st mail

> From: Dan Stromberg <[email-masked]>
> Subject: Re: static 'ls' for Solaris 2.5 for wu-ftpd 2.4
> 
> You can compile in stub functions for the dl* routines, to get a static
> executable.  Sun won't support it, but it's worked in practice.
> There've been flame wars over this, and lesser issues...
> 
> EG, for dlopen, compile in:
> 
> void *dlopen(const char *pathname, int mode)
> {
> }
> 
> ...it's safe to do this, because the dl* functions don't _have_ to do
> anything for static executables - the stuff that the dl* routines would
> slurp in, is already present.  It's sufficient to just construct a stub
> from the prototype in the manual page.
> 
> I feel that a minimal compiled-in "ls" would be a Good Thing - not
> because it'd be slightly faster, but because it would simplify writing a
> cross-platform installation script.  Minor apologies if this subject has
> already been beaten to death.
> 
> [email-masked] wrote:
> > 
> > I gave up on this.  (I had the same results.)  Instead, I followed the
> > instructions in the original ftpd man page.  This describes the libraries
> > that should be copied into the ftp root so that ls and others can execute
> > after the chroot.
> > 
> > Garry Williams
> > America Net, Inc.
> > 
> > >Hi - in the wu-ftpd 2.4 docs, there is a discussion about
> > >using a statically-linked version of "ls" in the bin directory for
> > >anonymous ftp.  I am trying to do this for a Solaris 2.5 box.
> > 
> > >I've tried building the 'ls' from the GNU "fileutils" package, using
> > >static linking, but it's unable to link because that 'ls' apparently
> > >needs a routine in "libdl".  The "libdl" man page indicates the
> > >functionality contained therein is ONLY available for DYNAMICally linked
> > >binaries.
> > 
> > >Is there another version of "ls" which can be statically
> > >linked for use on a Solaris 2.5 box?
> > 
> > >Thanks in advance,
> > >Bill
> 

2nd message

> There is no static version of the dl library. Unless you want to
> do it yourself, get a static ls from
> 
> http://www.eng.auburn.edu/users/doug/second.html
> 
> (as a bonus, you'll find there some other very handy utilities)
>
> Luc Desrosiers

miquel