anonymous ftp won't 'ls' in Solaris 2.6

anonymous ftp won't 'ls' in Solaris 2.6

Post by Henry Leparska » Thu, 15 Nov 2001 03:50:01



Hi,
    Our anonymous ftp 'ls' has stopped giving a proper directory
listing.
It used to work just fine.  Now it just says 0 bytes!

Just to be sure, I installed the latest Recommended Patches cluster for
2.6.
I then re-installed the anonymous ftp directory using the script that
comes with the man page for 'ftpd'. This didn't change the behavious of
'ls'.

Has anyone else seen this?

Henry Leparskas
UWO Astronomy.

 
 
 

anonymous ftp won't 'ls' in Solaris 2.6

Post by Eric Levinso » Thu, 15 Nov 2001 03:04:52


Sounds like he is behind a firewall and needs a passive client.
The built in FTP doesn't support passive transfers

ericl -at- broderbund.com



> #   Hi,
> #       Our anonymous ftp 'ls' has stopped giving a proper directory
> #   listing.
> #   It used to work just fine.  Now it just says 0 bytes!

> Do you see any error messages running it this way:

>     chroot ~ftp ~ftp/usr/bin/ls -l

> If that still yields the same void,
> run it under 'truss -aef' and see
> if you can spot something.


 
 
 

anonymous ftp won't 'ls' in Solaris 2.6

Post by Brad Lan » Thu, 15 Nov 2001 04:42:55



>    Our anonymous ftp 'ls' has stopped giving a proper directory
>listing.
>It used to work just fine.  Now it just says 0 bytes!

>Just to be sure, I installed the latest Recommended Patches cluster for
>2.6.
>I then re-installed the anonymous ftp directory using the script that
>comes with the man page for 'ftpd'. This didn't change the behavious of
>'ls'.

>Has anyone else seen this?

    It's an ftp client problem.
    ls -l (ls -CF, etc) will show the directories.

    http://www.wu-ftpd.org/wu-ftpd-faq.html

Quote:> 26. ls doesn't show anything except files. It does not show directories
> and links

> Some ftp clients improperly use the NLST and LIST commands.
> NLST was intended to show files only for retrieval using the mget
> command. LIST was intended to show everything in human-readable form.
> Earlier versions of the wu-ftpd did not correctly interpret the RFC which
> defines these commands and many ftp clients were written incorrectly and
> do not use the definitions in the RFC. Starting wu-ftpd 2.6.0, the
> interpretation of NLST versus LIST ftp commands has been changed to what
> is the right interpretation. NLST lists retrievable files for the ftp
> mget command, LIST lists all files for a human reader. Suggested fix: fix
> the client software, or train the users to use ls -l (or dir) in a
> command-line client to get a listing of the files and directories.

    -- Brad

--

 
 
 

anonymous ftp won't 'ls' in Solaris 2.6

Post by Henry Leparska » Sat, 17 Nov 2001 07:19:12


Hmm. I don't think that we are behind any firewalls. Just tcp-wrappers,
which has been there for years.

I'll post a copy of the reply I sent privately:

Hi,
 Thanks for the suggestion. I think that you may have come close to
hitting the nail on the head. From the commands I have run, I still can't
see the forest for the trees, but you might have an idea.

I'll show you the record of my tries, ending with the output of 'truss',
and then a directory listing of /home/ftp.

Sure enough, chroot doesn't want to work, as in:

#
# chroot ~ftp ~ftp/usr/bin/ls -l
chroot: No such file or directory
#
# chroot ~ftp /usr/bin/ls
ld.so.1: /usr/bin/ls: fatal: /dev/zero: open failed: No such device or
address
Killed
#
# cd ~ftp
# pwd
/home/ftp
# ls
total 225952
   2 dr-xr-xr-x   6 root     staff        512 Nov 13 13:18 ./
   4 drwxr-xr-x  65 root     root        1536 Oct 25 09:47 ../
   2 lrwxrwxrwx   1 root     other          7 Nov  9 16:35 bin -> usr/bin/

   2 dr-xr-xr-x   2 root     staff        512 Nov  9 16:35 dev/
   2 dr-xr-xr-x   3 root     staff        512 Oct 30 17:10 etc/
   2 dr-xr-xr-x  17 ftp      staff        512 Oct 24 11:31 pub/
225936 -rw-r--r--   1 root     other    115608576 Oct 30 17:09 pub.tar
   2 dr-xr-xr-x   5 root     staff        512 Feb 26  1996 usr/
#
# cd ~ftp/usr/bin
# ls
total 40
   2 dr-xr-xr-x   2 root     staff        512 Nov 13 12:57 ./
   2 dr-xr-xr-x   5 root     staff        512 Feb 26  1996 ../
  36 ---x--x--x   1 root     other      18120 Nov 13 12:57 ls*
#
#
# ~ftp/usr/bin/ls -l
total 36
---x--x--x   1 root     other      18120 Nov 13 12:57 ls
#
chroot: No such file or directory
chroot: No such file or directory

------------------------------------------

# truss -aef chroot ~ftp ~ftp/usr/bin/ls -l >> chroot.txt
5887:   execve("/usr/sbin/chroot", 0xEFFFF4D4, 0xEFFFF4E8)  argc = 4
5887:    argv: chroot /home/ftp /home/ftp/usr/bin/ls -l
5887:    envp: HOME=/home/hlepar
5887:
PATH=/usr/openwin/bin:/usr/openwin/demo:/sbin:/usr/sbin:/usr/bin:/etc:/usr/ccs/bin:/usr/ccs/lib:/opt/SUNWspro/bin:/usr/ucb:/usr/local/bin:/opt/local/netpbm:/home/hlepar/bin:/opt/local/saord/saord/bin.sun4-sol26:/opt/local/Staroffice/bin:/usr/java1.2/bin:.

5887:     LOGNAME=hlepar HZ=100 TERM=xterm TZ=Canada/Eastern
5887:     SHELL=/bin/tcsh MAIL=/var/mail/hlepar LC_COLLATE=en_CA
5887:     LC_CTYPE=en_CA LC_MESSAGES=C LC_MONETARY=en_CA
5887:     LC_NUMERIC=en_CA LC_TIME=en_CA DISPLAY=jupiter.astro.uwo.ca:0
5887:     PRINTER=tek SHLVL=2 PWD=/home/hlepar USER=hlepar
5887:     HOST=phobos.astro.uwo.ca HOSTTYPE=sun4
5887:     CADCHOME=/usr/local/cadc MOZILLA_HOME=/usr/local/netscape
5887:
HELPPATH=/usr/openwin/lib/help/handbooks:/usr/local/info:/usr/local/lib
5887:     TMPDIR=/tmp GR_PS_PRSTR=lpr -Pps -h
5887:     GR_HOME=/usr/local/lib/xmgr iraf=/iraf/iraf/
5887:     IRAFHOME=/home/hlepar/iraf TAPE=/dev/rmt/0mn
5887:     WWW_HOME=http://phobos.astro.uwo.ca/index.html
5887:     GS_LIB=/usr/local/share/ghostscript/6.0
5887:
GS_FONTPATH=/usr/local/share/ghostscript/fonts:/usr/openwin/lib/X11/fonts/Type1

5887:     TETEXDIR=/usr/local/lib/teTeX PGPLOT_DIR=/opt/local/pgplot
5887:     LESS=-X LPDEST=tek EDITOR=emacs VISUAL=emacs PAGER=less
5887:     OPENWINHOME=/usr/openwin HELPDIR=/usr/openwin/lib/help
5887:
MANPATH=/opt/SUNWspro/man:/usr/openwin/share/man:/home/hlepar/man:/usr/man:/usr/local/man

5887:     PROCDIR=/home/hlepar/proc SWHOME=/opt/SUNWspro/SW3.0
5887:
XFILESEARCHPATH=/usr/local/lib/X11/app-defaults/%N%S:/usr/openwin/lib/%N%S:/usr/lib/X11/app-defaults/%N%S:/usr/tftpboot/usr/lib/X11/ncd/%N%S

5887:     IRAFARCH=ssun ccdctl=/home/hlepar/local/iraf/ccdctl/
5887:     CCDCTL=/home/hlepar/local/iraf/ccdctl
5887:     XAPPHOT=/logan/hlepar/x11iraf/examples/xapphot/
5887:     XEXAMP=/logan/hlepar/x11iraf/examples/
5887:     MOTD=/usr/local/etc/motd
5887:
TERMCAP=x1|xterm|vs100:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:UP=\E[%dA:al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:co#80:cs=\E[%i%d;%dr:ct=\E[3k:dc=\E[P:dl=\E[M:im=\E[4h:ei=\E[4l:mi:ho=\E[H:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:rs=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:km:kn#4:kr=\EOC:ks=\E[?1h\

5887:     PS1=#
5887:
LD_LIBRARY_PATH=/opt/SUNWspro/lib:/usr/openwin/lib:/opt/SUNWspro/SW3.0/lib:/opt/local/lib:/opt/local/lib/X11:/usr/ucblib:/opt/SUNWits/Graphics-sw/xil/lib:/opt/local/midas/98NOV/lib

5887:   stat("/usr/sbin/chroot", 0xEFFFF1D0)            = 0
5887:   open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
5887:   open("/opt/SUNWspro/lib/libc.so.1", O_RDONLY)   Err#2 ENOENT
5887:   open("/usr/openwin/lib/libc.so.1", O_RDONLY)    Err#2 ENOENT
5887:   open("/opt/SUNWspro/SW3.0/lib/libc.so.1", O_RDONLY) Err#2 ENOENT
5887:   open("/opt/local/lib/libc.so.1", O_RDONLY)      Err#2 ENOENT
5887:   open("/opt/local/lib/X11/libc.so.1", O_RDONLY)  Err#2 ENOENT
5887:   open("/usr/ucblib/libc.so.1", O_RDONLY)         Err#2 ENOENT
5887:   open("/opt/SUNWits/Graphics-sw/xil/lib/libc.so.1", O_RDONLY) Err#2
ENOENT
5887:   open("/opt/local/midas/98NOV/lib/libc.so.1", O_RDONLY) Err#2
ENOENT
5887:   open("/usr/lib/libc.so.1", O_RDONLY)            = 3
5887:   fstat(3, 0xEFFFEF6C)                            = 0
5887:   mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xEF7B0000
5887:   mmap(0x00000000, 704512, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xEF700000
5887:   mmap(0xEF7A2000, 28504, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 598016) = 0xEF7A2000
5887:   open("/dev/zero", O_RDONLY)                     = 4
5887:   mmap(0xEF7AA000, 2664, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xEF7AA000
5887:   munmap(0xEF794000, 57344)                       = 0
5887:   memcntl(0xEF700000, 101580, MC_ADVISE, 0x0003, 0, 0) = 0
5887:   close(3)                                        = 0
5887:   open("/opt/SUNWspro/lib/libdl.so.1", O_RDONLY)  Err#2 ENOENT
5887:   open("/usr/openwin/lib/libdl.so.1", O_RDONLY)   Err#2 ENOENT
5887:   open("/opt/SUNWspro/SW3.0/lib/libdl.so.1", O_RDONLY) Err#2 ENOENT
5887:   open("/opt/local/lib/libdl.so.1", O_RDONLY)     Err#2 ENOENT
5887:   open("/opt/local/lib/X11/libdl.so.1", O_RDONLY) Err#2 ENOENT
5887:   open("/usr/ucblib/libdl.so.1", O_RDONLY)        Err#2 ENOENT
5887:   open("/opt/SUNWits/Graphics-sw/xil/lib/libdl.so.1", O_RDONLY)
Err#2 ENOENT
5887:   open("/opt/local/midas/98NOV/lib/libdl.so.1", O_RDONLY) Err#2
ENOENT
5887:   open("/usr/lib/libdl.so.1", O_RDONLY)           = 3
5887:   fstat(3, 0xEFFFEF6C)                            = 0
5887:   mmap(0xEF7B0000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3, 0) = 0xEF7B0000
5887:   close(3)                                        = 0
5887:   open("/usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1", O_RDONLY) = 3

5887:   fstat(3, 0xEFFFEDD4)                            = 0
5887:   mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xEF6F0000
5887:   mmap(0x00000000, 16384, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xEF6E0000
5887:   close(3)                                        = 0
5887:   close(4)                                        = 0
5887:   munmap(0xEF6F0000, 8192)                        = 0
5887:   getuid()                                        = 0 [0]
5887:   chroot("/home/ftp")                             = 0
5887:   chdir("/")                                      = 0
5887:   execve("/home/ftp/usr/bin/ls", 0xEFFFF4E4, 0xEFFFF4F0) Err#2
ENOENT
5887:   ioctl(1, TCGETA, 0xEFFFE554)                    Err#25 ENOTTY
5887:   fstat64(1, 0xEFFFE5C8)                          = 0
5887:   brk(0x00020FA8)                                 = 0
5887:   brk(0x00024FA8)                                 = 0
5887:   llseek(0, 0, SEEK_CUR)                          = 19360
5887:   write(1, " c h r o o t :   N o   s".., 34)      = 34
5887:   _exit(1)

.:
total 225952
dr-xr-xr-x   6 root     staff        512 Nov 13 13:13 .
drwxr-xr-x  65 root     root        1536 Oct 25 09:47 ..
lrwxrwxrwx   1 root     other          7 Nov  9 16:35 bin -> usr/bin
dr-xr-xr-x   2 root     staff        512 Nov  9 16:35 dev
dr-xr-xr-x   3 root     staff        512 Oct 30 17:10 etc
-rw-r--r--   1 root     other          0 Nov 13 13:13 listing.txt
dr-xr-xr-x  17 ftp      staff        512 Oct 24 11:31 pub
-rw-r--r--   1 root     other    115608576 Oct 30 17:09 pub.tar
dr-xr-xr-x   5 root     staff        512 Feb 26  1996 usr

./dev:
total 4
dr-xr-xr-x   2 root     staff        512 Nov  9 16:35 .
dr-xr-xr-x   6 root     staff        512 Nov 13 13:13 ..
crw-rw-rw-   1 root     other     11, 42 Nov  9 16:35 tcp
crw-rw-rw-   1 root     other    105,  2 Nov  9 16:35 ticlts
crw-rw-rw-   1 root     other    105,  1 Nov  9 16:35 ticotsord
crw-rw-rw-   1 root     other     11, 41 Nov  9 16:35 udp
crw-rw-rw-   1 root     other     13, 12 Nov  9 16:35 zero

./etc:
total 28
dr-xr-xr-x   3 root     staff        512 Oct 30 17:10 .
dr-xr-xr-x   6 root     staff        512 Nov 13 13:13 ..
dr-xr-xr-x   2 root     other        512 Oct 30 17:10 default
-r--r--r--   1 root     staff        292 Nov  9 16:35 group
-r--r--r--   1 root     staff       1064 Nov  9 16:35 netconfig
-r--r--r--   1 root     staff       3749 Nov  9 16:35 passwd
-r--r--r--   1 root     other       3749 Oct 30 16:21 passwd~

./etc/default:
total 6
dr-xr-xr-x   2 root     other        512 Oct 30 17:10 .
dr-xr-xr-x   3 root     staff        512 Oct 30 17:10 ..
-r--r--r--   1 root     other        561 Nov  9 16:35 init

./pub:
total 23348
dr-xr-xr-x  17 ftp      staff        512 Oct 24 11:31 .
dr-xr-xr-x   6 root     staff        512 Nov 13 13:13 ..
drwxr-xr-x   2 abrooks  staff        512 Apr 18  2001 abrooks
drwxr-xr-x   2 afwehlau staff        512 Aug 22  1996 afwehlau
drwxr-xr-x   2 asigut   staff        512 Nov  5  1999 asigut
drwxr-xr-x   2 root     staff        512 Oct 22  1996 ccd
drwxr-xr-x   2 1069     staff        512 Dec 11  2000 couchman
drwxr-xr-x   2 curry    staff        512 Jan  9  2001 curry
...

read more »

 
 
 

anonymous ftp won't 'ls' in Solaris 2.6

Post by Dan Fost » Mon, 04 Mar 2002 22:46:50



Quote:>#
># chroot ~ftp /usr/bin/ls
>ld.so.1: /usr/bin/ls: fatal: /dev/zero: open failed: No such device or
>address
>Killed

Try:

# cd ~ftp/dev
# mknod zero c 13 12

I had this problem once in 1996. Sure wasn't obvious until I found it. ;)

-Dan

 
 
 

1. 'ls' fails in anonymous FTP session

I set up anonymous FTP on my Sparc 5, Solaris 2.4,
according to the man pages, but when I ftp in and try to do
'ls', all I get is

200 PORT command successful.
425 Can't create data socket (0.0.0.0,20): No such device or address.

Am I doing something obviously stupid? Thanks, in advance.

Bob
---
Robert Uomini
The Fractal Images Company (http://www.fractals.com)
Voice: 510-528-0258/800-548-0258
Fax:   510-528-0243

2. .htaccess override problem

3. Is 'ls' broken with anonymous ftp in 2.5.1?

4. shutdown and dial by user

5. how to get ftpd 'ls' to work with anonymous ftp

6. Hard Drive size?

7. Is 'ls' broken with anonymous ftp in 2.5.

8. determine memory by bank in 1000

9. Weird 'ls' behavior under Solaris 2.6

10. ls won't work for anonymous ftp !?

11. Solaris 2.6: 'Async safe' implies 'thread safe' ?

12. 64k files in dir - 'ls' slow but 'strace ls' fast?

13. 'ls -e' vs 'ls -l'