mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 13:48:06 +00:00
d4521fb132
Due to the use of LD_LIBRARY_PATH, the programs running in the fakeroot
environment may end up loading bundled SDK libraries using the system
ld.so.
Rework the relocatability patch to avoid meddling with LD_LIBRARY_PATH
and construct the paths to faked and libfakeroot.so directly.
Fixes: f93cb5c2c8
("fakeroot: make fakeroot script relocatable")
Reviewed-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
30 lines
917 B
Diff
30 lines
917 B
Diff
--- a/scripts/fakeroot.in
|
|
+++ b/scripts/fakeroot.in
|
|
@@ -30,13 +30,20 @@ fatal ()
|
|
}
|
|
|
|
# strip /bin/fakeroot to find install prefix
|
|
-FAKEROOT_PREFIX=@prefix@
|
|
-FAKEROOT_BINDIR=@bindir@
|
|
+if [ -n "$STAGING_DIR_HOST" ]; then
|
|
+ USEABSLIBPATH=1
|
|
+ LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@
|
|
+ FAKED=${STAGING_DIR_HOST}/bin/faked
|
|
+ PATHS=
|
|
+else
|
|
+ FAKEROOT_PREFIX=@prefix@
|
|
+ FAKEROOT_BINDIR=@bindir@
|
|
|
|
-USEABSLIBPATH=@LDPRELOADABS@
|
|
-LIB=lib@fakeroot_transformed@@DLSUFFIX@
|
|
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
|
|
-FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
|
|
+ USEABSLIBPATH=@LDPRELOADABS@
|
|
+ LIB=lib@fakeroot_transformed@@DLSUFFIX@
|
|
+ PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
|
|
+ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
|
|
+fi
|
|
|
|
FAKED_MODE="unknown-is-root"
|
|
export FAKED_MODE
|