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

[SCM] Debian package checker branch, master, updated. 2.2.11-14-g119bad6



The following commit has been merged in the master branch:
commit f0f4b5539cbf78fcba2a453d9e6ae0c733966bdd
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Mon Jun 8 15:18:24 2009 -0500

    Check for dbg symbols directly in /usr/lib/debug
    
    The only binaries that should be installed directly in /usr/lib/debug
    are the debugging versions of the normal binaries, and not the dbg symbols.
    Debugging symbols should be installed in a subdirectory.

diff --git a/checks/binaries b/checks/binaries
index 3dd7476..83fb858 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -286,6 +286,14 @@ foreach my $file (sort keys %{$info->file_info}) {
 	}
     }
 
+    # Detached debugging symbols directly in /usr/lib/debug.
+    if ($file =~ m,^\./usr/lib/debug/[^/]+$,) {
+	unless (exists($objdump->{NEEDED})
+	    || $fileinfo =~ m/statically linked/) {
+	    tag "debug-symbols-directly-in-usr-lib-debug", $file;
+	}
+    }
+
     # statically linked?
     if (!exists($objdump->{NEEDED}) || !defined($objdump->{NEEDED})) {
 	if ($fileinfo =~ m/shared object/o) {
diff --git a/checks/binaries.desc b/checks/binaries.desc
index 6af59c0..2360cb1 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -247,3 +247,14 @@ Info: The given ELF object appears to have been statically linked to zlib.
  Doing this is discouraged due to the extra work needed by the security team
  to fix all the extra embedded copies or trigger the package rebuilds, as
  appropriate.
+
+Tag: debug-symbols-directly-in-usr-lib-debug
+Severity: important
+Certainty: certain
+Info: The given debugging symbols-only object is installed directly in
+ <tt>/usr/lib/debug</tt>, although it should be installed in a subdirectory.
+ I.e. debug symbols of a binary in <tt>/usr/bin</tt> should be placed in
+ <tt>/usr/lib/debug/usr/bin</tt>.
+ .
+ gdb, when looking for debugging symbols, prepends <tt>/usr/lib/debug</tt> to
+ the path of the original binary.
diff --git a/t/tests/binaries-general/debian/Makefile b/t/tests/binaries-general/debian/Makefile
index 98ecb6b..307b4c4 100644
--- a/t/tests/binaries-general/debian/Makefile
+++ b/t/tests/binaries-general/debian/Makefile
@@ -5,6 +5,8 @@ all:
 	gcc -o basiclibrpath basic.c -ph -Wl,--rpath,/usr/lib
 	# non-special rpath shipped in the package
 	gcc -o basicshippedrpath basic.c -ph -Wl,--rpath,/usr/share/foo
+	# static version of basic for debugging checks
+	gcc -static -o basic.static basic.c
 
 install:
 	install -d $(DESTDIR)/usr/share/foo/
@@ -15,6 +17,10 @@ install:
 	install -d $(DESTDIR)/usr/lib/foo/
 	install -m 755 -c basiclibrpath $(DESTDIR)/usr/lib/foo/basiclibrpath
 	install -m 755 -c basicshippedrpath $(DESTDIR)/usr/lib/foo/basicshippedrpath
+	objcopy --only-keep-debug basic $(DESTDIR)/usr/lib/debug/basic
+	cp basic.static $(DESTDIR)/usr/lib/debug/
+	# dh_strip attempts to play the smart guy if the ELF obj is executable.
+	cd $(DESTDIR)/usr/lib/debug/ && chmod -x basic basic.static
 
 clean distclean:
 	rm -f basic
diff --git a/t/tests/binaries-general/desc b/t/tests/binaries-general/desc
index ee5751f..f8d6bc9 100644
--- a/t/tests/binaries-general/desc
+++ b/t/tests/binaries-general/desc
@@ -7,4 +7,5 @@ Test-For:
  arch-dependent-file-in-usr-share
  binary-compiled-with-profiling-enabled
  binary-or-shlib-defines-rpath
+ debug-symbols-directly-in-usr-lib-debug
  library-in-debug-or-profile-should-not-be-stripped
diff --git a/t/tests/binaries-general/tags b/t/tests/binaries-general/tags
index a471e53..5347f89 100644
--- a/t/tests/binaries-general/tags
+++ b/t/tests/binaries-general/tags
@@ -1,6 +1,7 @@
 E: binaries-general: arch-dependent-file-in-usr-share ./usr/share/foo/basic
+E: binaries-general: debug-symbols-directly-in-usr-lib-debug ./usr/lib/debug/basic
 E: binaries-general: library-in-debug-or-profile-should-not-be-stripped ./usr/lib/debug/usr/share/foo/basic
 W: binaries-general: binary-compiled-with-profiling-enabled ./usr/share/foo/basic
 W: binaries-general: binary-or-shlib-defines-rpath ./usr/lib/foo/basiclibrpath /usr/lib
 W: binaries-general: binary-or-shlib-defines-rpath ./usr/share/foo/basic /usr/local/lib
-W: binaries-general: debug-package-should-be-named-dbg usr/lib/debug/usr/
+W: binaries-general: debug-package-should-be-named-dbg usr/lib/debug/basic

-- 
Debian package checker


Reply to: