diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-11-09 21:46:01 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-11-10 08:31:10 +0100 |
commit | d4521fb132266fd6c94796e19d3d1e925847338d (patch) | |
tree | 05422d9bd17a7e7598b2be14f6c0a1605dbaef19 /tools/fakeroot/patches | |
parent | fe302d472a9ace858ccbf0ba2833c9f3469d02f0 (diff) | |
download | upstream-d4521fb132266fd6c94796e19d3d1e925847338d.tar.gz upstream-d4521fb132266fd6c94796e19d3d1e925847338d.tar.bz2 upstream-d4521fb132266fd6c94796e19d3d1e925847338d.zip |
tools: fakeroot: rework relocatable patch to avoid LD_LIBRARY_PATH usage
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>
Diffstat (limited to 'tools/fakeroot/patches')
-rw-r--r-- | tools/fakeroot/patches/000-relocatable.patch | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/fakeroot/patches/000-relocatable.patch b/tools/fakeroot/patches/000-relocatable.patch index 9f6915bfe8..0408acfa25 100644 --- a/tools/fakeroot/patches/000-relocatable.patch +++ b/tools/fakeroot/patches/000-relocatable.patch @@ -1,25 +1,29 @@ --- a/scripts/fakeroot.in +++ b/scripts/fakeroot.in -@@ -30,12 +30,19 @@ fatal () +@@ -30,13 +30,20 @@ fatal () } # strip /bin/fakeroot to find install prefix -FAKEROOT_PREFIX=@prefix@ -FAKEROOT_BINDIR=@bindir@ +if [ -n "$STAGING_DIR_HOST" ]; then -+ FAKEROOT_PREFIX="${STAGING_DIR_HOST}" -+ FAKEROOT_BINDIR="${STAGING_DIR_HOST}/bin" -+ FAKEROOT_LIBDIR="${STAGING_DIR_HOST}/lib" ++ 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@ -+ FAKEROOT_LIBDIR=@libdir@ -+fi - USEABSLIBPATH=@LDPRELOADABS@ - LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-USEABSLIBPATH=@LDPRELOADABS@ +-LIB=lib@fakeroot_transformed@@DLSUFFIX@ -PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot -+PATHS=${FAKEROOT_LIBDIR}:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot - FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ +-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 |