Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
The realpath() system call returns the full path outside chroot if a "-o un=
ion"
(NOT unionfs - that works correctly) mount is used, for any path that is not
"unioned" in the upper file system:


# cat > realpathtest.sh <<EOF
#!/bin/sh
# unpack base.txz to /root/base_txz

chroot /root/base_txz /bin/sh -c "realpath /"
chroot /root/base_txz /bin/sh -c "realpath /usr"

mkdir /tmp/upper
touch /tmp/upper/foobar
mount -t nullfs -o union /tmp/upper /root/base_txz

chroot /root/base_txz /bin/sh -c "realpath /"
chroot /root/base_txz /bin/sh -c "realpath /foobar"
# last one is not in the "upper" union fs:
chroot /root/base_txz /bin/sh -c "realpath /usr"
EOF
# /bin/sh realpathtest.sh=20
/
/usr
/
/foobar
/root/base_txz/usr
# uname -a
FreeBSD test 15.0-ALPHA5 FreeBSD 15.0-ALPHA5 GENERIC amd64
#


(This also affects jails.)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>