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

[SCM] Debian package checker branch, master, updated. 2.5.11-171-g90308ca



The following commit has been merged in the master branch:
commit 510bdc6e6e0e2513a2c9b85dcc97c92cfd667037
Author: Guillem Jover <guillem@debian.org>
Date:   Wed Jan 23 02:27:01 2013 +0100

    c/binaries{,.desc}: Handle partially LFS-enabled binaries
    
    If an object which is part of the binary has been correctly built with
    LFS but not another the check should trigger, as it means at least parts
    of the binary will be unable to correctly handle large files. Add a
    regression test for the partially shared library.
    
    [nthykier: remove (now) inaccurate comment]
    
    Signed-off-by: Guillem Jover <guillem@debian.org>
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/binaries b/checks/binaries
index a390298..e2a2bc4 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -128,17 +128,11 @@ foreach my $file (sort keys %{$info->objdump_info}) {
     foreach my $symbol (@{$objdump->{SYMBOLS}}) {
         my ($foo, $sec, $sym) = @{$symbol};
 
-        unless ($has_lfs) {
+        unless (defined $has_lfs) {
             if ($LFS_SYMBOLS->known ($sym)) {
-                # Using a 32bit only interface call, assume it is
-                # built without LFS (for now).  We may disapprove this
-                # later if a 64 variant comes along.
+                # Using a 32bit only interface call, some parts of the
+                # binary are built without LFS.
                 $has_lfs = 0;
-            } elsif ($sym =~ m/^(.+)64$/) {
-                # all LFS symbols appear to be end with 64; exploit
-                # that to check if LFS is enabled.
-                my $base = $1;
-                $has_lfs = 1 if $LFS_SYMBOLS->known ($base);
             }
         }
         if ($arch ne 'hppa') {
diff --git a/checks/binaries.desc b/checks/binaries.desc
index e895ac2..35dd1f1 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -360,9 +360,9 @@ Tag: binary-file-built-without-LFS-support
 Severity: minor
 Certainty: possible
 Experimental: yes
-Info: The listed ELF binary appears to be built without "Large File
- Support" (LFS).  If so, it may not be able to handle large files
- correctly.
+Info: The listed ELF binary appears to be (partially) built without
+ "Large File Support" (LFS).  If so, it may not be able to handle large
+ files correctly.
  .
  To support large files, code review might be needed to make sure that
  those files are not slurped into memory or mmap(2)ed, and that correct
diff --git a/t/tests/binaries-missing-lfs/debian/Makefile b/t/tests/binaries-missing-lfs/debian/Makefile
index 6fc3968..637a9ca 100644
--- a/t/tests/binaries-missing-lfs/debian/Makefile
+++ b/t/tests/binaries-missing-lfs/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 lfs.c basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/binaries-missing-lfs/debian/debian/libbasic2.symbols b/t/tests/binaries-missing-lfs/debian/debian/libbasic2.symbols
index b072f19..c67f613 100644
--- a/t/tests/binaries-missing-lfs/debian/debian/libbasic2.symbols
+++ b/t/tests/binaries-missing-lfs/debian/debian/libbasic2.symbols
@@ -1,3 +1,4 @@
 libbasic.so.2 libbasic2 #MINVER#
  do_open@Base 1.0
  lib_interface@Base 1.0
+ zz_open@Base 1.0
diff --git a/t/tests/binaries-missing-lfs/debian/lfs.c b/t/tests/binaries-missing-lfs/debian/lfs.c
new file mode 100644
index 0000000..04fe113
--- /dev/null
+++ b/t/tests/binaries-missing-lfs/debian/lfs.c
@@ -0,0 +1,10 @@
+#define _FILE_OFFSET_BITS 64
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+int
+zz_open (char *file) {
+  return open (file, O_RDONLY);
+}

-- 
Debian package checker


Reply to: