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

lintian: r790 - in trunk: checks collection debian



Author: rra
Date: 2006-11-20 05:28:06 +0100 (Mon, 20 Nov 2006)
New Revision: 790

Modified:
   trunk/checks/binaries
   trunk/checks/binaries.desc
   trunk/collection/objdump-info
   trunk/debian/changelog
Log:
* checks/binaries{.desc,}:
  + [RA] Tag unrecognized ELF binaries as apparently corrupted rather
    than failing with a note that binutils-multiarch is required.  Some
    packages have had ELF binaries recognized by file but unreadable.
    Reported by Bill Allombert.  (Closes: #399456)
* collection/objdump-info:
  + [RA] Include unrecognized format errors from objdump in the output
    rather than aborting; some packages contain apparently corrupt ELF
    binaries.

Modified: trunk/checks/binaries
===================================================================
--- trunk/checks/binaries	2006-11-19 20:50:17 UTC (rev 789)
+++ trunk/checks/binaries	2006-11-20 04:28:06 UTC (rev 790)
@@ -83,7 +83,7 @@
 		if ( ($sec =~ /^GLIBC_.*/) and ($sym eq '_mcount') ) {
 		    tag "binary-compiled-with-profiling-enabled", "$file";
 		}
-	    }    
+	    }
 
 	    if ($foo eq '.text' and $sec eq 'Base' and $sym eq 'caml_main') {
 		$OCAML{$file} = 1;
@@ -104,9 +104,9 @@
 	} elsif (m/^DYNAMIC SYMBOL TABLE:/) {
 	    $dynsyms = 1;
 	} elsif (m/^objdump: (.*?): File format not recognized$/) {
-	    fail("file format not recognized for $1\nif you are checking non-i386 binaries, you'll need to install binutils-multiarch\n");
+            tag "apparently-corrupted-elf-binary", "$file";
 	} elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
-	    tag "binary-file-compressed-with-upx", "$1";
+	    tag "binary-file-compressed-with-upx", "$file";
 	} elsif (m/^objdump: \.(.*?): Invalid operation$/) {
 	    tag "binary-with-bad-dynamic-table", "$file" unless $file =~ m%^\./usr/lib/debug/%;
 	} elsif (m/CXXABI/) {

Modified: trunk/checks/binaries.desc
===================================================================
--- trunk/checks/binaries.desc	2006-11-19 20:50:17 UTC (rev 789)
+++ trunk/checks/binaries.desc	2006-11-20 04:28:06 UTC (rev 790)
@@ -158,3 +158,11 @@
 Info: This appears to be an ELF file but objdump -T cannot parse it.
  If it is external debugging symbols for another file, it should be
  installed under /usr/lib/debug.
+
+Tag: apparently-corrupted-elf-binary
+Type: warning
+Info: This appears to be an ELF file but objdump -T doesn't recognize it
+ as valid.  This may be a mistake or a corrupted file, you may need to
+ install binutils-multiarch on the system running lintian so that
+ non-native binaries are handled correctly, or it may be a
+ misidentification of a file as ELF that actually isn't.

Modified: trunk/collection/objdump-info
===================================================================
--- trunk/collection/objdump-info	2006-11-19 20:50:17 UTC (rev 789)
+++ trunk/collection/objdump-info	2006-11-20 04:28:06 UTC (rev 790)
@@ -43,6 +43,7 @@
 # output in the objdump-info file and let the check script deal with
 # it later.
 for bin in `grep ' ELF' <../file-info | cut -d\: -f1`; do
+    echo "Processing $bin" >> /tmp/debug
     echo "-- $bin" >> ../objdump-info
     if head $bin | grep -q 'packed.*with.*UPX'; then
 	echo "objdump: $bin: Packed with UPX" >> ../objdump-info
@@ -54,15 +55,17 @@
 	if objdump --headers --private-headers -T $bin >> ../objdump-info 2>&1 ; then
 	    # everything is ok
 	    :
-	else
+	elif objdump -T $bin 2>&1 | grep -q 'Invalid operation$' ; then
 	    # If the objdump error is "Invalid operation", we handle it later
 	    # in the check script, since this is the expected output (for now)
 	    # on detached debugging information in /usr/lib/debug.
-	    if objdump -T $bin 2>&1 | grep -q 'Invalid operation$' ; then
-		:
-	    else
-		exit 1
-	    fi
+	    :
+	elif objdump -T $bin 2>&1 | grep -q 'File format not recognized$' ; then
+	    # There are some files that file recognizes as ELF but which
+	    # aren't; those too are handled separately in the check script.
+	    :
+	else
+	    exit 1
 	fi
     fi
 done

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-11-19 20:50:17 UTC (rev 789)
+++ trunk/debian/changelog	2006-11-20 04:28:06 UTC (rev 790)
@@ -1,12 +1,22 @@
 lintian (1.23.27) UNRELEASED; urgency=low
 
+  * checks/binaries{.desc,}:
+    + [RA] Tag unrecognized ELF binaries as apparently corrupted rather
+      than failing with a note that binutils-multiarch is required.  Some
+      packages have had ELF binaries recognized by file but unreadable.
+      Reported by Bill Allombert.  (Closes: #399456)
+
   * collection/file-info:
     + [RA] Unescape non-ASCII characters escaped by tar before running
       file on the resulting filename.  Otherwise, file can't find the
       file, exits with an error, and lintian aborts.  Reported by Bill
       Allombert.  (Closes: #399392)
+  * collection/objdump-info:
+    + [RA] Include unrecognized format errors from objdump in the output
+      rather than aborting; some packages contain apparently corrupt ELF
+      binaries.
 
- -- Russ Allbery <rra@debian.org>  Sun, 19 Nov 2006 12:30:28 -0800
+ -- Russ Allbery <rra@debian.org>  Sun, 19 Nov 2006 20:27:49 -0800
 
 lintian (1.23.26) unstable; urgency=low
 



Reply to: