Your message dated Sun, 20 Nov 2016 21:18:35 +0000
with message-id <[email protected]>
and subject line Bug#741965: fixed in fakechroot 2.19-1
has caused the Debian Bug report #741965,
regarding fakechroot : chroot twice -> inconsistent LD_LIBRARY_PATH ?
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
741965: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741965
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: fakechroot
Version: 2.17.2-1
Severity: minor
Tags: patch

Dear Maintainer,

In a fakechroot environment, invoking chroot twice gives some strange results :

1/ absolute paths for newroot cause an error

$ fakechroot fakeroot chroot my_first_chroot
# cd home
# chroot /home/me/my_second_chroot
ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: 
ignored.
ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: 
ignored.
$ echo $LD_LIBRARY_PATH
/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib:/home/me/my_first_chroot/home/me/my_second_chroot/lib

(the path of libfakeroot disappeared)

or 

$ fakechroot fakeroot chroot my_first_chroot
# chroot .
/usr/sbin/chroot: cannot change root directory to : No such file or directory

2/ relative paths for newroot are followed, but :
a/ non existent paths are added to LD_LIBRARY_PATH

$ fakechroot fakeroot chroot my_first_chroot
# chroot home/me/my_second_chroot

The output of
# echo $LD_LIBRARY_PATH
is attached (LD_LIBRARY_PATH.1). Paths
"/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/*"
 
don't exist. 

FAKECHROOT_BASE_ORIG (ie /home/me/my_first_chroot) is added twice to the 
components of LD_LIBRARY_PATH,
and kept after newroot.

b/ paths inside the previous (fake)chroot are kept in
LD_LIBRARY_PATH. They would be forgotten in a real chroot.
What is the correct policy for fakechroot ?

In the previous example, do we have to keep 

/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu/libfakeroot:
/home/me/my_first_chroot/usr/lib64/libfakeroot:
/home/me/my_first_chroot/usr/lib32/libfakeroot:
/home/me/my_first_chroot/usr/local/lib:
/home/me/my_first_chroot/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu

in LD_LIBRARY_PATH ?

Thanks for your comments or corrections !

Regards,
JH Chatenet

*** rustine11.patch
diff -Naur a/scripts/chroot.fakechroot.sh b/scripts/chroot.fakechroot.sh
--- a/scripts/chroot.fakechroot.sh      2014-03-12 15:28:05.000000000 +0100
+++ b/scripts/chroot.fakechroot.sh      2014-03-16 17:50:26.000000000 +0100
@@ -39,6 +39,12 @@
 
 fakechroot_chroot_base="$FAKECHROOT_BASE_ORIG"
 
+# records the content of LD_LIBRARY_PATH at first chroot invocation
+if [ -z "$fakechroot_chroot_base" -a -n "$LD_LIBRARY_PATH" ]; then
+    FAKECHROOT_LDLIBPATH="$LD_LIBRARY_PATH"
+    export FAKECHROOT_LDLIBPATH
+fi
+
 fakechroot_chroot_n=1
 for fakechroot_chroot_opt in "$@"; do
     case "$fakechroot_chroot_opt" in
@@ -46,36 +52,42 @@
             continue
             ;;
         *)
-            fakechroot_chroot_newroot="$fakechroot_chroot_opt"
+            fakechroot_chroot_requested_newroot="$fakechroot_chroot_opt"
             break
             ;;
     esac
     fakechroot_chroot_n=$(($fakechroot_chroot_n + 1))
 done
 
+# absolute paths in fakechroot_chroot_opt are relative to FAKECHROOT_BASE_ORIG
+if [ "${fakechroot_chroot_requested_newroot#/}" != 
"$fakechroot_chroot_requested_newroot" ]; then
+    
fakechroot_chroot_newroot="${fakechroot_chroot_base}${fakechroot_chroot_requested_newroot}"
+else
+    fakechroot_chroot_newroot="$fakechroot_chroot_requested_newroot"
+fi
 
 if [ -d "$fakechroot_chroot_newroot" ]; then
-    fakechroot_chroot_newroot=`cd "$fakechroot_chroot_opt"; pwd -P`
+    fakechroot_chroot_newroot=`cd "$fakechroot_chroot_newroot"; pwd -P`
 
     fakechroot_chroot_paths=
 
     # append newroot to each directory from original LD_LIBRARY_PATH
     fakechroot_chroot_IFS_bak="$IFS" IFS=:
-    for fakechroot_chroot_d in $LD_LIBRARY_PATH; do
-        
fakechroot_chroot_paths="${fakechroot_chroot_paths:+$fakechroot_chroot_paths:}$fakechroot_chroot_base$fakechroot_chroot_newroot/${fakechroot_chroot_d#/}"
+    for fakechroot_chroot_d in $FAKECHROOT_LDLIBPATH; do
+        
fakechroot_chroot_paths="${fakechroot_chroot_paths:+$fakechroot_chroot_paths:}$fakechroot_chroot_newroot/${fakechroot_chroot_d#/}"
     done
     IFS="$fakechroot_chroot_IFS_bak"
 
     # append newroot to each directory from new /etc/ld.so.conf
     fakechroot_chroot_paths_ldsoconf=""
     if [ -f "$fakechroot_chroot_newroot/etc/ld.so.conf" ]; then
-        fakechroot_chroot_paths_ldsoconf=`fakechroot_chroot_load_ldsoconf 
"/etc/ld.so.conf" "$fakechroot_chroot_newroot" | while read 
fakechroot_chroot_line; do printf ":%s%s" "$fakechroot_chroot_base" 
"$fakechroot_chroot_line"; done`
+        fakechroot_chroot_paths_ldsoconf=`fakechroot_chroot_load_ldsoconf 
"/etc/ld.so.conf" "$fakechroot_chroot_newroot" | while read 
fakechroot_chroot_line; do printf ":%s" "$fakechroot_chroot_line"; done`
     elif [ -d "$fakechroot_chroot_newroot/etc/ld.so.conf.d" ]; then
-        fakechroot_chroot_paths_ldsoconf=`fakechroot_chroot_load_ldsoconf 
"/etc/ld.so.conf.d/*" "$fakechroot_chroot_newroot" | while read 
fakechroot_chroot_line; do printf ":%s%s" "$fakechroot_chroot_base" 
"$fakechroot_chroot_line"; done`
+        fakechroot_chroot_paths_ldsoconf=`fakechroot_chroot_load_ldsoconf 
"/etc/ld.so.conf.d/*" "$fakechroot_chroot_newroot" | while read 
fakechroot_chroot_line; do printf ":%s" "$fakechroot_chroot_line"; done`
     fi
     fakechroot_chroot_paths_ldsoconf="${fakechroot_chroot_paths_ldsoconf#:}"
 
-    
fakechroot_chroot_paths="$fakechroot_chroot_paths${fakechroot_chroot_paths_ldsoconf:+:$fakechroot_chroot_paths_ldsoconf}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+    
fakechroot_chroot_paths="$fakechroot_chroot_paths${fakechroot_chroot_paths_ldsoconf:+:$fakechroot_chroot_paths_ldsoconf}${FAKECHROOT_LDLIBPATH:+:$FAKECHROOT_LDLIBPATH}"
     fakechroot_chroot_paths="${fakechroot_chroot_paths#:}"
 fi
 
@@ -83,7 +95,7 @@
 if [ -n "$fakechroot_chroot_newroot" ] && ( test "$1" = "${@:1:$((1+0))}" ) 
2>/dev/null && [ $fakechroot_chroot_n -le $# ]; then
     # shell with arrays and built-in expr
     env -u FAKECHROOT_BASE_ORIG FAKECHROOT_CMD_ORIG= 
LD_LIBRARY_PATH="$fakechroot_chroot_paths" 
FAKECHROOT_BASE="$fakechroot_chroot_base" \
-        "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" 
"${fakechroot_chroot_newroot#$FAKECHROOT_BASE_ORIG}" 
"${@:$(($fakechroot_chroot_n + 1))}"
+        "$fakechroot_chroot_chroot" "${@:1:$(($fakechroot_chroot_n - 1))}" 
"$fakechroot_chroot_requested_newroot" "${@:$(($fakechroot_chroot_n + 1))}"
     exit $?
 else
     # POSIX shell
diff -Naur a/src/libfakechroot.c b/src/libfakechroot.c
--- a/src/libfakechroot.c       2014-03-16 11:12:23.000000000 +0100
+++ b/src/libfakechroot.c       2014-03-16 10:41:48.000000000 +0100
@@ -55,6 +55,7 @@
     "FAKECHROOT_ELFLOADER",
     "FAKECHROOT_ELFLOADER_OPT_ARGV0",
     "FAKECHROOT_EXCLUDE_PATH",
+    "FAKECHROOT_LDLIBPATH",
     "FAKECHROOT_VERSION",
     "FAKEROOTKEY",
     "FAKED_MODE",


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages fakechroot depends on:
ii  libfakechroot  2.17.2-1

fakechroot recommends no packages.

fakechroot suggests no packages.

-- no debconf information

# echo $LD_LIBRARY_PATH
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/lib64/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/lib32/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/local/lib:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib/x86_64-linux-gnu/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib64/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib32/libfakeroot:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/usr/lib:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/home/me/my_first_chroot/lib:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/usr/local/lib:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu/libfakeroot:
/home/me/my_first_chroot/usr/lib64/libfakeroot:
/home/me/my_first_chroot/usr/lib32/libfakeroot:
/home/me/my_first_chroot/usr/local/lib:
/home/me/my_first_chroot/lib/x86_64-linux-gnu:
/home/me/my_first_chroot/usr/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu/libfakeroot:
/usr/lib64/libfakeroot:
/usr/lib32/libfakeroot:
/home/me/my_first_chroot/usr/lib:
/home/me/my_first_chroot/lib:
/home/me/my_first_chroot/home/me/my_second_chroot/usr/lib:
/home/me/my_first_chroot/home/me/my_second_chroot/lib

--- End Message ---
--- Begin Message ---
Source: fakechroot
Source-Version: 2.19-1

We believe that the bug you reported is fixed in the latest version of
fakechroot, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Piotr Roszatycki <[email protected]> (supplier of updated fakechroot package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 20 Nov 2016 18:05:23 +0100
Source: fakechroot
Binary: fakechroot libfakechroot
Architecture: source all amd64
Version: 2.19-1
Distribution: unstable
Urgency: medium
Maintainer: Piotr Roszatycki <[email protected]>
Changed-By: Piotr Roszatycki <[email protected]>
Description:
 fakechroot - gives a fake chroot environment - utilities
 libfakechroot - gives a fake chroot environment - runtime
Closes: 741670 741965 742070 742072 745084 780759 815194 839873 839962 840007 
840008
Changes:
 fakechroot (2.19-1) unstable; urgency=medium
 .
   * New upstream version 2.19:
     - Prevent escaping fake chroot. Closes: #742072.
     - Can do chroot twice. Closes: #741965.
     - Variable FAKECHROOT_EXCLUDE_PATH can contain 100 elements.
       Closes: #745084.
     - Bugfixes for chroot wrapper: Closes: #741670.
     - Bugfixes for debootstrap wrapper. Closes: #742070.
     - Bugfixes for env wrapper. Closes: #815194.
     - Bugfixes for fakechroot command. Closes: #840008.
     - Bugfixes for ldd wrapper. Closes: #780759, #839873, #839962, #840007.
Checksums-Sha1:
 b33321154293d3e6a8d047d7952a9c0ae256d2c3 2021 fakechroot_2.19-1.dsc
 35c2c206dd871331167cd8c139773f1760284b57 492346 fakechroot_2.19.orig.tar.gz
 a7b49ffa414f863d27613b2d22bcc7b11d43539b 8952 fakechroot_2.19-1.debian.tar.xz
 bccc59de06ad59891f992764eea9c99cc09103ec 28934 fakechroot_2.19-1_all.deb
 a9553e65f79f67c73515e69cfd78d30421be13cb 5361 fakechroot_2.19-1_amd64.buildinfo
 8ec3c1c4b429d545779c3205d568a6991e2d341a 120182 
libfakechroot-dbgsym_2.19-1_amd64.deb
 e3c3e8a3aee4637876f87497785fbdc3d54d48ea 43902 libfakechroot_2.19-1_amd64.deb
Checksums-Sha256:
 cea12ed4f3e99e8b6b30411534c8c6063d1d10d344eb19bd6779658b6843a90c 2021 
fakechroot_2.19-1.dsc
 39ffbbbe3a823be7450928b8e3b99ae4cb339c47213b2f1d8ff903e0246f2e15 492346 
fakechroot_2.19.orig.tar.gz
 33bfb005b3cd2f86eed0115da6bebb2b739332ab3076b4d102e38a8f23a4c668 8952 
fakechroot_2.19-1.debian.tar.xz
 d224a1699567f246fa96f6ed7eefaecda67188a180f19f6188ae031cff7dc811 28934 
fakechroot_2.19-1_all.deb
 9d89dfdec592af2c84e57dd1de07142ab56009488c12b31a4f4f6c3291e99849 5361 
fakechroot_2.19-1_amd64.buildinfo
 f8f1f89b34c57183621853038c4c3babea41a05ce8753222c26ccb9b6f7bcb8e 120182 
libfakechroot-dbgsym_2.19-1_amd64.deb
 69700073166150bbae2f4ebe9a6b7c6d1bbcc1905d8c8e176c75b7bb256895d0 43902 
libfakechroot_2.19-1_amd64.deb
Files:
 b94e5bd33e7d29a4ba0aa3e831798cb4 2021 utils optional fakechroot_2.19-1.dsc
 db6378420c769232e69508bb78612c34 492346 utils optional 
fakechroot_2.19.orig.tar.gz
 b8b507da62f5dd5deae53df0298ee285 8952 utils optional 
fakechroot_2.19-1.debian.tar.xz
 215a44a046c84f5f2f7fd96357899956 28934 utils optional fakechroot_2.19-1_all.deb
 9c4175d93905793915d9cb518aabd081 5361 utils optional 
fakechroot_2.19-1_amd64.buildinfo
 7367c670a896cf7a6e8967b441abb873 120182 debug extra 
libfakechroot-dbgsym_2.19-1_amd64.deb
 100f70530476c8163745991823f83b86 43902 libs optional 
libfakechroot_2.19-1_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCAAwFiEEEsz+SLrYKbvWv/49VmIX88Q5XJwFAlgyDXsSHGRleHRlckBk
ZWJpYW4ub3JnAAoJEFZiF/PEOVycvWkP/2As2vqb5Sg3Cb6PIakfgxj27MeV9xsH
7NTQ4ATcBz8BIzsFABZE48G2GAwtZJpr1xAkXW7DpNm489b5Mhk1iseKyljjKEby
QhqpAXkYfS+U5Lj5VdMcvvUa/3wNeidUvEpYmddXlBRSaCl4S5EL+RcY/ikvpXPw
+dxzBERUfbbFOF9fstmjoXqwTrbZHhrJeE2lv8zp/Oh7Yy83K49dNrd/I/SYbwHk
bPX5LbVwOzXDXk2f7mMsp+xbhQ8O1cPTgYVcvh+cZuH0c27V3CgUKPf1FfSuc46a
G1R9q/pAuTEAoUMd+KxNbel2oELsBE2DXQR6jrQkbns533XiHkeZsd4Ze8HDoL8y
7pormpN/wsKY+derS53zPnffuxOMMuwJiOTntohfEIwFi+2PY988HYcE0LjS/oGr
8TlWYxXQogQDDyMIM59HGr5h/FLBZSJvXcRzlV+e2lULxnzFknDMB0TjWIT7ij2i
afSk0jNS0jetQLKHc6gyKDtBbb/GUQQsrYjSK5rNyLz6CQ7HOEvD9RgzfixRzmkt
IZNrLJnkRdK359hL9sF9kh6PYDFaToOsRwy05/rKuwtzP5QHBsGnDF7/lMmoTO28
rlvWfMptrCOjYijhmJ1wmRQUbmGJ4Fi9CR/MnKK7EatEdL6iA6cOq+Q2XIrnxeAX
dv+HlBzE3QxI
=b+D2
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to