On 5/22/07, Kirill A. Shutemov <[EMAIL PROTECTED]> wrote:
On [Tue, 22.05.2007 02:22], Lauri Leukkunen wrote:
> Attached patch fixes the linux-user path mangling code for use with
> real target root filesystems that have nasty symlinks and lots of
> files. The old code is terribly slow and can easily end up going
> through the entire host system /usr hierarchy in a recursive loop.
>
> Compared to the previous version of this patch, fixes an issue with
> attempting to free() a pointer returned by GNU basename().
My patch to solve same problems attached
The added complexity of my version comes from preventing leaking out
of the "chroot" through symlinks or "../.." elements. If we have
$HOME/buildroot/usr/lib/libfoo.so.1 -> /usr/lib/libfoo.so.1.2 ->
/usr/lib/libfoo.so.1.2.3
and if the buildroot and host system have different versions of the
library, realpath can't be used. It gets a little messy, I agree. I
had to do similar logic in scratchbox2 to maintain the fake chroot.
regards, Lauri