From c8ca044d28d47848c1bf7ab27e1993b879ccecd8 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Mon, 8 Oct 2018 16:06:46 -0700 Subject: [PATCH] libapparmor: Finish removing LD_RUN_PATH from Makefile.perl commit 94dfe15b28dc56f60c7c368f2bf7353fe2e0906d attempted to remove LD_RUN_PATH unfortunately But all it actually does is cause the Makefile.perl to embed the rpath "" instead. Which is still an rpath, only I guess an even worse one. -- Eli Schwartz Arch Linux Bug Wrangler and Trusted User This is because it cleared the setting of the variable LD_RUN_PATH which was expanded in the command $(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) $(RM_F) $@ LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \ $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \ $(INST_DYNAMIC_FIX) $(CHMOD) $(PERM_RWX) $@ resulting in LD_RUN_PATH="" being passed to the command. Finish removing LD_RUN_PATH from Makefile.perl by removing it from the command invocation if it is present. Note: we use \x24 instead of $ in the regex as there seems to be a bug and no level of escaping $ would allow it to be used. PR: https://gitlab.com/apparmor/apparmor/merge_requests/207 Signed-off-by: John Johansen Acked-by: Christian Boltz (cherry picked from commit 958cc288769360aaec23971efaf4318f4c6817bc) --- libraries/libapparmor/swig/perl/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/libapparmor/swig/perl/Makefile.am b/libraries/libapparmor/swig/perl/Makefile.am index 901fc62cf..6ae4e30cf 100644 --- a/libraries/libapparmor/swig/perl/Makefile.am +++ b/libraries/libapparmor/swig/perl/Makefile.am @@ -12,6 +12,7 @@ LibAppArmor.pm: libapparmor_wrap.c Makefile.perl: Makefile.PL LibAppArmor.pm $(PERL) $< PREFIX=$(prefix) MAKEFILE=$@ + sed -ie 's/LD_RUN_PATH="\x24(LD_RUN_PATH)"//g' Makefile.perl sed -ie 's/^LD_RUN_PATH.*//g' Makefile.perl LibAppArmor.so: libapparmor_wrap.c Makefile.perl