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

[SCM] Debian package checker branch, master, updated. 2.2.6-27-g0d0b411



The following commit has been merged in the master branch:
commit df52fc74c75ff503fba88d59fe29d5582423433f
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Sun Mar 1 19:00:45 2009 -0600

    Report truncated binaries separate from corrupted binaries
    
    Catch "file truncated" errors from objdump and warn about them.  A version
    of binutils recently (as of the time of writting) uploaded to sid,
    correctly, started to emit this error instead of just saying the binary
    was corrupted.
    
    This affected the binary-from-other-arch test since it only uses the
    header of an ELF object.

diff --git a/checks/binaries b/checks/binaries
index d9baff5..e92e55e 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -104,6 +104,8 @@ foreach my $file (sort keys %{$info->objdump_info}) {
     foreach (@{$objdump->{NOTES}}) {
 	if (m/^File format not recognized$/) {
             tag "apparently-corrupted-elf-binary", "$file";
+	} elsif (m/^File truncated$/) {
+            tag "apparently-truncated-elf-binary", "$file";
 	} elsif (m/^Packed with UPX$/) {
 	    tag "binary-file-compressed-with-upx", "$file";
 	} elsif (m/^Invalid operation$/) {
diff --git a/checks/binaries.desc b/checks/binaries.desc
index a7d82b0..c116b85 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -157,6 +157,13 @@ Info: This appears to be an ELF file but objdump -T doesn't recognize it
  non-native binaries are handled correctly, or it may be a
  misidentification of a file as ELF that actually isn't.
 
+Tag: apparently-truncated-elf-binary
+Severity: normal
+Certainty: possible
+Info: This appears to be an ELF file but objdump believes it is truncated.
+ This may be a mistake or a corrupted file, or it may be a
+ misidentification of a file as ELF that actually isn't.
+
 Tag: missing-dependency-on-libc
 Severity: serious
 Certainty: certain
diff --git a/collection/objdump-info b/collection/objdump-info
index 18ed175..803ca6f 100755
--- a/collection/objdump-info
+++ b/collection/objdump-info
@@ -85,6 +85,8 @@ while (<FILES>) {
 			$failed = 0;
 		    } elsif (m/File format not recognized$/) {
 			$failed = 0;
+		    } elsif (m/File truncated$/) {
+			$failed = 0;
 		    }
 		}
 		close PIPE;
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 3eb82fb..7145545 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -219,6 +219,8 @@ sub objdump_info {
                 $dynsyms = 1;
             } elsif (m/^objdump: (.*?): File format not recognized$/) {
                 push @{$file->{NOTES}}, "File format not recognized";
+            } elsif (m/^objdump: (.*?): File truncated$/) {
+                push @{$file->{NOTES}}, "File truncated";
             } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
                 push @{$file->{NOTES}}, "Packed with UPX";
             } elsif (m/objdump: \.(.*?): Invalid operation$/) {
diff --git a/t/COVERAGE b/t/COVERAGE
index ba27255..f36517f 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,7 +1,8 @@
-Last generated 2009-02-22
+Last generated 2009-03-02
 
 The following tags are not tested by the test suite:
 
+binaries apparently-corrupted-elf-binary
 binaries arch-dependent-file-in-usr-share
 binaries binary-compiled-with-profiling-enabled
 binaries binary-file-compressed-with-upx
diff --git a/t/tests/binaries-from-other-arch/desc b/t/tests/binaries-from-other-arch/desc
index 673a06a..0d0e818 100644
--- a/t/tests/binaries-from-other-arch/desc
+++ b/t/tests/binaries-from-other-arch/desc
@@ -4,5 +4,5 @@ Architecture: any
 Version: 1.0
 Description: Test package with a pseudo binary from a different architecture
 Test-For:
- apparently-corrupted-elf-binary
+ apparently-truncated-elf-binary
  binary-from-other-architecture
diff --git a/t/tests/binaries-from-other-arch/tags b/t/tests/binaries-from-other-arch/tags
index 2821a19..e6749bd 100644
--- a/t/tests/binaries-from-other-arch/tags
+++ b/t/tests/binaries-from-other-arch/tags
@@ -1,4 +1,4 @@
 E: binaries-from-other-arch: binary-from-other-architecture ./usr/bin/elfobject
 E: binaries-from-other-arch: statically-linked-binary ./usr/bin/elfobject
-W: binaries-from-other-arch: apparently-corrupted-elf-binary ./usr/bin/elfobject
+W: binaries-from-other-arch: apparently-truncated-elf-binary ./usr/bin/elfobject
 W: binaries-from-other-arch: binary-without-manpage usr/bin/elfobject

-- 
Debian package checker


Reply to: