Subject: Dir and Solaris 2.5.1

From: Vidiot <[email-masked]>
Date: Mon, 3 Mar 1997 16:56:24 -0600 (CST)

I'm still working on the problem (in some spare time) as to why dir doesn't
work under Solaris 2.5.1.  Neil Readwin suggested that I do the following:

	truss chroot ~ftp /bin/ls

I did and got:

ftms.ZROOT <114> truss chroot ~ftp /bin/ls
execve("/usr/sbin/chroot", 0xEFFFF8D8, 0xEFFFF8E8)  argc = 3
open("/dev/zero", O_RDONLY)                     = 3
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xEF7C0000
open("/opt/SUNWspro/SC2.0.1/libc.so.1", O_RDONLY) Err#2 ENOENT
open("/usr/openwin/lib/libc.so.1", O_RDONLY)    Err#2 ENOENT
open("/usr/lib/libc.so.1", O_RDONLY)            = 5
fstat(5, 0xEFFFF58C)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_SHARED, 5, 0) = 0xEF7B0000
mmap(0x00000000, 622592, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) = 0xEF700000
munmap(0xEF780000, 57344)                       = 0
mmap(0xEF78E000, 26688, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 5, 516096) = 0xEF78E000
mmap(0xEF796000, 2696, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xEF796000
close(5)                                        = 0
open("/opt/SUNWspro/SC2.0.1/libdl.so.1", O_RDONLY) Err#2 ENOENT
open("/usr/openwin/lib/libdl.so.1", O_RDONLY)   Err#2 ENOENT
open("/usr/lib/libdl.so.1", O_RDONLY)           = 5
fstat(5, 0xEFFFF58C)                            = 0
mmap(0xEF7B0000, 8192, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_FIXED, 5, 0) = 0xEF7B0000
close(5)                                        = 0
open("/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1", O_RDONLY) = 5
fstat(5, 0xEFFFF3EC)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_SHARED, 5, 0) = 0xEF7A0000
mmap(0x00000000, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) = 0xEF6E0000
munmap(0xEF6E4000, 57344)                       = 0
mmap(0xEF6F2000, 5440, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 5, 8192) = 0xEF6F2000
close(5)                                        = 0
close(3)                                        = 0
munmap(0xEF7A0000, 8192)                        = 0
getuid()                                        = 0 [0]
chroot("/usr/export/ftms_releases/ftp")         = 0
chdir("/")                                      = 0
execve("/bin/ls", 0xEFFFF8E4, 0xEFFFF8EC)  argc = 1
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
open("/dev/zero", O_RDONLY)                     Err#16 EBUSY
........

Then it repeats the last line forever.  Or at least it would have if I didn't
hit ^C :-)

Anyone have any clues, because I sure don't?  From what I can see, it
opens all of the library files just fine, but croaks at doing the ls.

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: Emil Isberg <[email-masked]>
Date: Tue, 4 Mar 1997 00:40:34 +0100 (MET)

> 	truss chroot ~ftp /bin/ls

Hmm .. my suggestion would be
> which truss
/usr/bin/truss
> ldd /usr/bin/truss
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1

> cp /usr/lib/libc.so.1 /usr/lib/libdl.so.1 ~ftp/lib
> cp /usr/bin/truss ~ftp/bin
> chroot ~ftp /bin/truss /bin/ls

(Skillnaden är att i andra fallet kör du truss på ls .. i första fallet
körde du truss på chroot .. hmm .. förresten den körde en execve .. vad
händer med truss då .. den borde följa.. hmm .. ja ja .. testa ..)

Hmm .. 
> uname -a
SunOS bombadill 5.5.1 Generic sun4c sparc SUNW,Sun_4_50
> ls -l ~ftp/dev
total 0
crw-rw-rw-   1 root     root      13,  2 Feb 17 18:25 null
crw-rw-rw-   1 root     root      11, 42 Feb  7 16:31 tcp
crw-rw-rw-   1 root     root     105,  1 Feb  7 16:31 ticotsord
crw-rw-rw-   1 root     root      11, 41 Feb  7 16:31 udp
crw-rw-rw-   1 root     root      13, 12 Feb  7 16:31 zero
> ls -lL /dev/null /dev/tcp /dev/ticotsord /dev/udb /dev/zero
crw-rw-rw-   1 root     sys       13,  2 Mar  3 23:45 /dev/null
crw-rw-rw-   1 root     sys       11, 42 Nov 29 16:12 /dev/tcp
crw-rw-rw-   1 root     sys      105,  1 Nov 29 16:12 /dev/ticotsord
crw-rw-rw-   1 root     sys       11, 41 May  3  1996 /dev/udp
crw-rw-rw-   1 root     sys       13, 12 May  3  1996 /dev/zero

Hmm ..
/Emil
"The last good thing written in C was Franz Schubert's Symphony number 9."