Package: fakechroot
Version: 2.16-1
Severity: important

Hi,

I can actually confirm the following for all fakechroot verions from 2.9
onward.

Following test setup:

sudo debootstrap --variant=minbase sid /tmp/test-chroot
echo foo > /tmp/foo
echo bar > /tmp/test-chroot/tmp/bar
ln -s /tmp/bar /tmp/test-chroot/link1
ln -s /tmp/foo /tmp/test-chroot/link2
ln -s /tmp/test-chroot/tmp/bar /tmp/test-chroot/link3


First test: readlink

$ fakeroot fakechroot chroot /tmp/test-chroot/ readlink /link1
/tmp/bar
$ fakeroot fakechroot chroot /tmp/test-chroot/ readlink /link2
/tmp/foo
$ fakeroot fakechroot chroot /tmp/test-chroot/ readlink /link3
/tmp/bar

The third link should read /tmp/test-chroot/tmp/bar as it was created
like that. To check:

$ sudo chroot /tmp/test-chroot/ readlink /link1
/tmp/bar
$ sudo chroot /tmp/test-chroot/ readlink /link2
/tmp/foo
$ sudo chroot /tmp/test-chroot/ readlink /link3
/tmp/test-chroot/tmp/bar


Second test: cat links

$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /link1
cat: /link1: No such file or directory
$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /link2
foo
$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /link3
bar

/link1 should've been resolved correctly, because /tmp/bar exists in
/tmp/test-chroot. /link2 should not have resolved because /tmp/foo only
exists outside the chroot. /link3 should not have been resolved either
because /tmp/test-chroot/tmp/bar is only visible like that from outside
the chroot. To check:

$ sudo chroot /tmp/test-chroot/ cat /link1
bar
$ sudo chroot /tmp/test-chroot/ cat /link2
cat: /link2: No such file or directory
$ sudo chroot /tmp/test-chroot/ cat /link3
cat: /link3: No such file or directory


Third test: cat files

$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /tmp/bar
bar
$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /tmp/foo
cat: /tmp/foo: No such file or directory
$ fakeroot fakechroot chroot /tmp/test-chroot/ cat /tmp/test-chroot/tmp/bar
cat: /tmp/test-chroot/tmp/bar: No such file or directory

all works as expected

$ sudo chroot /tmp/test-chroot/ cat /tmp/bar
bar
$ sudo chroot /tmp/test-chroot/ cat /tmp/foo
cat: /tmp/foo: No such file or directory
$ sudo chroot /tmp/test-chroot/ cat /tmp/test-chroot/tmp/bar
cat: /tmp/test-chroot/tmp/bar: No such file or directory


As a result I suspect there is something wrong with readlink(2)?

Hope all this helps a bit to fix the issue.

cheers, josch



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to