This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=174a5bd2a080847d0ed901d269a2ba74476eba8b commit 174a5bd2a080847d0ed901d269a2ba74476eba8b Author: Guillem Jover <guil...@debian.org> AuthorDate: Sat Aug 11 03:35:01 2018 +0200 Dpkg::Shlibs: Warn when using LD_LIBRARY_PATH with a descendent of cwd This makes the deprecation explicit, so that we can start noticing what is inappropriately setting this variable for a purpose it was not designed for. --- debian/changelog | 2 ++ scripts/Dpkg/Shlibs.pm | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 90f81981d..a335036fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -152,6 +152,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium Closes: #898010 - Dpkg::Substvars: Reword used/unused warnings to clarify their meaning. Closes: #904258 + - Dpkg::Shlibs: Warn when using LD_LIBRARY_PATH with a private library + directory which is a descendent of the current working directory. * Documentation: - Update gettext minimal version in README. - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph. diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index c8b43ab9d..b5d5bdf64 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -90,8 +90,18 @@ sub setup_library_paths { # XXX: Deprecated. Update library paths with LD_LIBRARY_PATH. if ($ENV{LD_LIBRARY_PATH}) { + require Cwd; + my $cwd = Cwd::getcwd; + foreach my $path (split /:/, $ENV{LD_LIBRARY_PATH}) { $path =~ s{/+$}{}; + + if (Cwd::realpath($path) =~ m/^\Q$cwd\E/) { + warning(g_('deprecated use of LD_LIBRARY_PATH with private ' . + 'library directory which interferes with ' . + 'cross-building, please use -l option instead')); + } + # XXX: This should be added to @custom_librarypaths, but as this # is deprecated we do not care as the code will go away. push @system_librarypaths, $path; -- Dpkg.Org's dpkg