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

[lintian] 01/01: coll/unpacked: Gracefully handle symlink targets with newlines



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 9774dc7cd2d95a2b16b72cce6ceef02a722987aa
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Oct 17 09:52:43 2014 +0200

    coll/unpacked: Gracefully handle symlink targets with newlines
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 collection/unpacked | 10 +++++++---
 debian/changelog    |  4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/collection/unpacked b/collection/unpacked
index e2fcf37..2340549 100755
--- a/collection/unpacked
+++ b/collection/unpacked
@@ -82,13 +82,17 @@ sub collect {
             [
                 'find', '(',  '-type', 'l',
                 # If symlink
-                '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p -> %l\n',
+                '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p -> %l\0',
                 '-true',             # elif dir [needs trailing slash]
                 ')', '-o', '(',  '-type', 'd',
-                '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p/\n', '-true',
+                '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p/\0', '-true',
                 # else (not dir and not symlink)
-                ')', '-o', '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p\n'
+                ')', '-o', '-printf', '%M 0/0 %s %AY-%Am-%Ad %AH:%AM %p\0'
             ],
+            # Link targets can have newlines in them.  A lession learned by
+            # clasp (#765311)
+            '|',
+            ['perl', '-l', '-0', '-pe', 's/\n/\\\n/g'],
             # Sort and compress
             '|',
             ['sort', '-k', '6'],
diff --git a/debian/changelog b/debian/changelog
index 62b04f7..7e5ac1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,10 @@ lintian (2.5.29) UNRELEASED; urgency=medium
       input already available.
   * collection/strings:
     + [NT] Stop creating "elf-index" file as nothing uses it.
+  * collection/unpacked:
+    + [NT] Gracefully handle when symlink targets contains
+      newlines.  Thanks to Faheem Mitha for reporting the bug.
+      (Closes: #765311)
 
   * frontend/lintian:
     + [NT] Aggressively reset the environment a well-defined

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: