I noticed that if I have a Filesystem.System object and I chroot(), calling get_dir() with an absolute path will break out of the chroot. This doesn't happen with get_stat(), and it seems like it might be a bug.
For example:
Filesystem.System("/etc")->chroot("/etc")->get_dir("/")
returns a list of items in the system root (/). If I do the same thing but replace the get_dir with get_stat(), I get a list of stat objects for /etc. The latter (get_stat) behavior seems correct to me.
Can anyone confirm that the current behavior is actually correct? If not, I'll look into fixing it.
Best,
Bill
On a related note, please see bfe46ef9244935d4d959dfdc641167d758487c5b.
Once we have gotten to the bottom if this, maybe we should include the fixes in 7.8, too.
This commit is wrong. Even if the system is UNIX, the member "filesystem" does not necessarily hold a Filesystem.System object. Any system dependency needs to go into Filesystem.System, not Filesystem.Stat.
pike-devel@lists.lysator.liu.se