Hi,

wan_jm wrote:
> the problem is the follow command gives the error message . but the command 
> works well in solaris9. Is it a bug ?
> bash-3.00# chroot /secroot /usr/sbin/df -b /
> df: cannot statvfs /secroot: No such file or directory
> 
> what should I do.
> 
> part result of "truss chroot /secroot /usr/sbin/df -b /" is following:
> resolvepath("/", "/", 1024)                     = 1
> statvfs64("/secroot", 0xFFBFFCF8)               Err#2 ENOENT
> fstat64(2, 0xFFBFE958)                          = 0
> df: cannot statvfs /secroot: No such file or directorywrite(2, " d f :   c a 
> n n o t   s".., 54)        = 54
> 
> write(2, "\n", 1)                               = 1

I suspect this will work if you loopback mount etc/mnttab within your chroot
environment, along the lines of mount -F lofs /etc/mnttab /secroot/etc/mnttab;
I used to look after a number of chroot build environments in which we
performed that trick so that df etc would report correctly.
Unfortunately this makes the chroot area less secure an insular
as it exposes external knowledge within the chroot;  it
also upsets some utilities which attempt to canonicalize a pathname
since they can now see the true path to their root directory,
and they land up prepending /secroot or whatever to some
paths.

Cheers

Gavin
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to