[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#727683: patch



Control: tag -1 patch

Attached is a patch that fixes the problem, by splitting the RPATH into
components before doing any checks on it. The patch includes a test case
too.

I would appreciate if this could be applied soonish, as I need to add an
override to syslog-ng until this is in backports, as
binary-or-shlib-defines-rpath is on the ftp-master (soft) autoreject list.

-- 
|8]

>From 34fe711c42cf21d9f2d3fe86322a8e40b71594b2 Mon Sep 17 00:00:00 2001
From: Gergely Nagy <algernon@balabit.hu>
Date: Fri, 25 Oct 2013 13:00:06 +0200
Subject: [PATCH] c/binaries.pm: Add support for multi-component RPATHs

The RPATH setting works similar to PATH, and supports multiple
components, separated by a colon. As such, Lintian should be able to
handle those, and split the RPATH into components before making any
checks on those.

This patch does just that, and adds a test case to trigger the original
issue too.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
---
 checks/binaries.pm                       | 2 +-
 debian/changelog                         | 2 ++
 t/tests/binaries-general/debian/Makefile | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/checks/binaries.pm b/checks/binaries.pm
index c57e431..122657d 100644
--- a/checks/binaries.pm
+++ b/checks/binaries.pm
@@ -359,7 +359,7 @@ sub run {
         if (exists $objdump->{RPATH}) {
             foreach my $rpath (
                 map {File::Spec->canonpath($_)}
-                keys %{$objdump->{RPATH}}
+                map {split(/:/, $_)} keys %{$objdump->{RPATH}}
               ) {
                 next
                   if $rpath
diff --git a/debian/changelog b/debian/changelog
index d58061a..176d908 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ lintian (2.5.20) UNRELEASED; urgency=low
   * checks/cruft.{desc,pm}:
     + [BR] Check files for under a non-distributable Nvidia
       license.  (Closes: #724930)
+  * checks/binaries.pm:
+    + [GN] Add support for multi-component RPATHs. (Closes: #727683)
 
   * data/binary/embedded-libs:
     + [RG] Detect embedded copies of poppler/xpdf.  (Closes: #724733)
diff --git a/t/tests/binaries-general/debian/Makefile b/t/tests/binaries-general/debian/Makefile
index ac5bd0f..5f0f442 100644
--- a/t/tests/binaries-general/debian/Makefile
+++ b/t/tests/binaries-general/debian/Makefile
@@ -10,6 +10,8 @@ all:
 	$(COMPILE) -o basiclibrpath basic.c -Wl,--rpath,/usr/lib
 	# non-special rpath shipped in the package
 	$(COMPILE) -o basicshippedrpath basic.c -Wl,--rpath,/usr/share/foo
+	# special rpath shipped in the package, multiple paths
+	$(COMPILE) -o basicshippedrpathmore basic.c -Wl,--rpath,/usr/lib/binaries-general:/usr/lib/binaries-general/bar
 	# static version of basic for debugging checks
 	$(COMPILE) -static -o basic.static basic.c
 	# version with debug
@@ -27,6 +29,7 @@ install:
 	strip -s $(DESTDIR)/usr/lib/debug/usr/share/foo/basic
 	install -m 755 -c basiclibrpath $(DESTDIR)/usr/lib/foo/basiclibrpath
 	install -m 755 -c basicshippedrpath $(DESTDIR)/usr/lib/foo/basicshippedrpath
+	install -m 744 -c basicshippedrpathmore $(DESTDIR)/usr/lib/foo/basicshippedrpathmore
 	objcopy --only-keep-debug basic $(DESTDIR)/usr/lib/debug/basic
 	install -d "$(DESTDIR)/usr/lib/debug/.build-id/"`$(GETBUILDID) -s basicdebug`
 	install -m 755 -c basicdebug $(DESTDIR)/usr/share/foo/basicdebug
-- 
1.8.4.rc3


Reply to: