Code:
# truss -rall -wall chown root:sys /etc/shadow
execve("/usr/bin/chown", 0xFFBFFE3C, 0xFFBFFE4C) argc = 3
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
resolvepath("/usr/bin/chown", "/usr/bin/chown", 1023) = 14
stat("/usr/bin/chown", 0xFFBFFC18) = 0
open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT
stat("/lib/libcmdutils.so.1", 0xFFBFF6D0) = 0
resolvepath("/lib/libcmdutils.so.1", "/lib/libcmdutils.so.1", 1023) = 21
open("/lib/libcmdutils.so.1", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF3A0000
mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF380000
mmap(0xFF380000, 1540, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF380000
mmap(0xFF392000, 352, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 8192) = 0xFF392000
munmap(0xFF382000, 65536) = 0
memcntl(0xFF380000, 1092, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
stat("/lib/libc.so.1", 0xFFBFF6D0) = 0
resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/lib/libc.so.1", O_RDONLY) = 4
mmap(0xFF3A0000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF3A0000
mmap(0x00010000, 1294336, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF200000
mmap(0xFF200000, 1237013, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF200000
mmap(0xFF330000, 35645, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 1245184) = 0xFF330000
mmap(0xFF33A000, 1416, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF33A000
memcntl(0xFF200000, 144992, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
stat("/lib/libavl.so.1", 0xFFBFF6D0) = 0
resolvepath("/lib/libavl.so.1", "/lib/libavl.so.1", 1023) = 16
open("/lib/libavl.so.1", O_RDONLY) = 4
mmap(0xFF3A0000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF3A0000
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF3F0000
mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF360000
mmap(0xFF360000, 3260, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF360000
mmap(0xFF372000, 296, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 8192) = 0xFF372000
munmap(0xFF362000, 65536) = 0
memcntl(0xFF360000, 1096, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF350000
munmap(0xFF3A0000, 32768) = 0
getcontext(0xFFBFF908)
getrlimit(RLIMIT_STACK, 0xFFBFF8E8) = 0
getpid() = 6533 [6532]
setustack(0xFF352A88)
brk(0x00022690) = 0
brk(0x00024690) = 0
stat("/platform/SUNW,Netra-240/lib/libc_psr.so.1", 0xFFBFF2B0) = 0
resolvepath("/platform/SUNW,Netra-240/lib/libc_psr.so.1", "/platform/sun4u-us3/lib/libc_psr.so.1", 1023) = 37
open("/platform/SUNW,Netra-240/lib/libc_psr.so.1", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF3A0000
munmap(0xFF3A2000, 24576) = 0
close(4) = 0
stat("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", 0xFFBFEF90) = 0
resolvepath("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", "/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", 1023) = 52
open("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF340000
mmap(0x00010000, 90112, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1E0000
mmap(0xFF1E0000, 19249, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF1E0000
mmap(0xFF1F4000, 5778, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 16384) = 0xFF1F4000
munmap(0xFF1E6000, 57344) = 0
memcntl(0xFF1E0000, 8868, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
munmap(0xFF340000, 32768) = 0
brk(0x00024690) = 0
brk(0x00028690) = 0
getuid() = 0 [0]
getpid() = 6533 [6532]
open("/proc/6533/psinfo", O_RDONLY) = 4
read(4, 0xFFBFF938, 336) = 336
02\0\0\0\0\0\001\0\01985\0\01984\0\01984\0\0\097\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\006 h\0\004 \0\0\0\0\0\0\0\0\003\0\b
]AFD8 :18 e 4DE\0\0\0\0\0 JAE (\0\0\0\0\0\0\0\0 c h o w n\0\0\0
\0\0\0\0\0\0\0\0 c h o w n r o o t : s y s / e t c / s h a d
o w\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\003
FFBFFE <FFBFFE L01\0\0\0\0\0\001\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\019\0\0\0\0\0\0\0\0\0\0\001\0\0\0\0\0\0\0\0\006 O14\003 (\0
\0\0\0 ;\003\0\0 ]AFD8 :\0\0\0\0\0\0\0\0\0 JAE ) T S\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\001FFFFFFFFFFFFFFFF\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
close(4) = 0
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1C0000
getuid() = 0 [0]
getuid() = 0 [0]
open64("/var/run/name_service_door", O_RDONLY) Err#2 ENOENT
open("/etc/nsswitch.conf", O_RDONLY|O_LARGEFILE) = 4
fcntl(4, F_DUPFD, 0x00000100) = 256
close(4) = 0
read(256, 0xFF352400, 1024) = 961
#\n # C o p y r i g h t 2 0 0 6 S u n M i c r o s y s t
e m s , I n c . A l l r i g h t s r e s e r v e d .\n
# U s e i s s u b j e c t t o l i c e n s e t e r m
s .\n #\n # i d e n t\t " @ ( # ) n s s w i t c h . f i l e s
\t 1 . 1 4\t 0 6 / 0 5 / 0 3 S M I "\n\n #\n # / e t c / n s
s w i t c h . f i l e s :\n #\n # A n e x a m p l e f i l
e t h a t c o u l d b e c o p i e d o v e r t o /
e t c / n s s w i t c h . c o n f ; i t\n # d o e s n o t
u s e a n y n a m i n g s e r v i c e .\n #\n # " h o
s t s : " a n d " s e r v i c e s : " i n t h i s f i
l e a r e u s e d o n l y i f t h e\n # / e t c / n
e t c o n f i g f i l e h a s a " - " f o r n a m e
t o a d d r _ l i b s o f " i n e t " t r a n s p o r t s
.\n\n p a s s w d : f i l e \n # p a s s w d _ c o m p a t
:\t f i l e s\n g r o u p : f i l e s\n h o s t s :
f i l e s d n s\n i p n o d e s : f i l e s\n n e t
w o r k s : f i l e s\n p r o t o c o l s : f i l e s
\n r p c : f i l e s\n e t h e r s : f
i l e s\n n e t m a s k s : f i l e s\n b o o t p a r a m
s : f i l e s\n p u b l i c k e y : f i l e s\n # A t
p r e s e n t t h e r e i s n ' t a ' f i l e s ' b a
c k e n d f o r n e t g r o u p ; t h e s y s t e m
w i l l \n # f i g u r e i t o u t p r e t t y q
u i c k l y , a n d w o n ' t u s e n e t g r o u p s
a t a l l .\n n e t g r o u p : f i l e s\n a u t o m o
u n t : f i l e s\n a l i a s e s : f i l e s\n s e
r v i c e s : f i l e s\n p r i n t e r s :\t u s e r f
i l e s\n\n a u t h _ a t t r : f i l e s\n p r o f _ a t t
r : f i l e s\n p r o j e c t : f i l e s\n\n t n r
h t p : f i l e s\n t n r h d b : f i l e s
\n
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1A0000
read(256, 0xFF352400, 1024) = 0
close(256) = 0
stat("/lib/nss_files.so.1", 0xFFBFF558) = 0
resolvepath("/lib/nss_files.so.1", "/lib/nss_files.so.1", 1023) = 19
open("/lib/nss_files.so.1", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF340000
mmap(0x00010000, 106496, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF180000
mmap(0xFF180000, 27106, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF180000
mmap(0xFF198000, 1792, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 32768) = 0xFF198000
munmap(0xFF188000, 65536) = 0
memcntl(0xFF180000, 6392, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
stat("/lib/libsocket.so.1", 0xFFBFF490) = 0
resolvepath("/lib/libsocket.so.1", "/lib/libsocket.so.1", 1023) = 19
open("/lib/libsocket.so.1", O_RDONLY) = 4
mmap(0xFF340000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF340000
mmap(0x00010000, 122880, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF160000
mmap(0xFF160000, 44594, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF160000
mmap(0xFF17C000, 4277, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 49152) = 0xFF17C000
munmap(0xFF16C000, 65536) = 0
memcntl(0xFF160000, 14320, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
stat("/lib/libnsl.so.1", 0xFFBFF490) = 0
resolvepath("/lib/libnsl.so.1", "/lib/libnsl.so.1", 1023) = 16
open("/lib/libnsl.so.1", O_RDONLY) = 4
mmap(0xFF340000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF340000
mmap(0x00010000, 729088, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF080000
mmap(0xFF080000, 595342, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF080000
mmap(0xFF122000, 33761, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 598016) = 0xFF122000
mmap(0xFF12C000, 23248, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF12C000
munmap(0xFF112000, 65536) = 0
memcntl(0xFF080000, 89668, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4) = 0
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF1F0000
munmap(0xFF1F0000, 8192) = 0
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF1F0000
munmap(0xFF1F0000, 8192) = 0
munmap(0xFF340000, 32768) = 0
sigfillset(0xFF3392F0) = 0
brk(0x00028690) = 0
brk(0x0002C690) = 0
open("/etc/group", O_RDONLY|O_LARGEFILE) = 4
fcntl(4, F_DUPFD, 0x00000100) = 256
close(4) = 0
read(256, 0x0002C150, 1024) = 712
r o o t : : 0 :\n o t h e r : : 1 : r o o t\n b i n : : 2 : r o
o t , d a e m o n\n s y s : : 3 : r o o t , b i n , a d m\n a d
m : : 4 : r o o t , d a e m o n\n u u c p : : 5 : r o o t\n m a
i l : : 6 : r o o t\n t t y : : 7 : r o o t , a d m\n l p : : 8
: r o o t , a d m\n n u u c p : : 9 : r o o t\n s t a f f : : 1
0 :\n d a e m o n : : 1 2 : r o o t\n s y s a d m i n : : 1 4 :
\n s m m s p : : 2 5 :\n g d m : : 5 0 :\n w e b s e r v d : : 8
0 :\n p o s t g r e s : : 9 0 :\n n o b o d y : : 6 0 0 0 1 :\n
n o a c c e s s : : 6 0 0 0 2 :\n n o g r o u p : : 6 5 5 3 4 :
\n p r o d a d m : : 1 6 6 6 7 :\n o e u s e r : : 1 6 6 6 6 :\n
p r o d s e : : 5 0 0 0 0 :\n o s i r i s : : 5 0 0 3 1 :\n t d
r a d m : : 1 6 7 0 1 :\n e s p a d m : : 1 6 7 0 2 :\n p d e a
d m : : 1 6 7 0 3 :\n n e n a a d m : : 1 6 7 0 4 :\n p a m a d
m : : 1 6 7 0 5 :\n r o u t a d m : : 1 6 7 0 6 :\n t i m e s t
e n : : 4 0 0 0 2 :\n a l i a d m : : 1 6 7 0 8 :\n x y e x p o
r t : : 1 0 7 :\n o d b c : : 1 7 7 7 6 : t i m e s t e n , p r
o d a d m , t d r a d m , r o u t a d m , e s p a d m , p d e a
d m , x y e x p o r t , a l i a d m , m p c a d m , e s x k a d
m , a l i n k a d m\n o p c g r p : : 1 7 7 :\n e s x k a d m :
: 1 6 7 1 1 :\n m p c a d m : : 1 6 7 0 9 :\n a l i n k a d m :
: 1 6 7 1 2 :\n j o h n s p : : 1 0 0 2 :\n + @ I D S : : : : :
:\n + @ W T A : : : : : :\n + @ N S S : : : : : :\n + @ T I E R
2 : : : : : :\n
close(256) = 0
getuid() = 0 [0]
getuid() = 0 [0]
open64("/var/run/name_service_door", O_RDONLY) Err#2 ENOENT
stat("/lib/nss_file.so.1", 0xFFBFF5B8) Err#2 ENOENT
stat("/usr/lib/nss_file.so.1", 0xFFBFF5B8) Err#2 ENOENT
fstat64(2, 0xFFBFEE00) = 0
chown: unknown user id write(2, 0x00011718, 23) = 23
c h o w n : u n k n o w n u s e r i d
rootwrite(2, " r o o t", 4) = 4
write(2, "\n", 1) = 1
_exit(2)
#