Package: fakechroot
Version: 2.14-1
Severity: normal
While I can confirm the reported behaviour, I ran into a very similar
issue when using fakechroot with a foreign armhf build. Using strace I
found that fakechroot put a double chroot path when access and
subsequently fstat was called.
Strangely that issue is not existant on other platforms. This problem
does for example not occur with armel and amd64 rootfs.
So while the mknod problem persists on all three architectures (didnt
test others), the fstat problem is only on armhf.
I do not know where the error comes from but I attached a patch that
solved both issues for me. It just adds a check to expand_chroot_path
whether the path really has to be expanded or (for a reason unknown to
me) already comes with the fakechroot_path prepended.
I hope the patch doesnt break anything else and can be applied by you?
If the patch is bad, how else would one fix the issue?
cheers, josch
diff --git a/src/libfakechroot.h b/src/libfakechroot.h
index 161469e..1dcc85f 100644
--- a/src/libfakechroot.h
+++ b/src/libfakechroot.h
@@ -98,7 +98,7 @@
if (!fakechroot_localdir(path)) { \
if ((path) != NULL && *((char *)(path)) == '/') { \
fakechroot_path = getenv("FAKECHROOT_BASE"); \
- if (fakechroot_path != NULL) { \
+ if (fakechroot_path != NULL && strncmp((path), fakechroot_path, strlen(fakechroot_path)) != 0) { \
strcpy(fakechroot_buf, fakechroot_path); \
strcat(fakechroot_buf, (path)); \
(path) = fakechroot_buf; \