[debsums] 01/01: fail faster in case of symlink loop

dod at debian.org dod at debian.org
Thu Oct 27 11:36:31 UTC 2016


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

dod pushed a commit to branch master
in repository debsums.

commit e8518bb4ba8b2ac45a1f37809b9bcefe7393af0c
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Oct 27 13:35:42 2016 +0200

    fail faster in case of symlink loop
---
 debsums     | 3 +--
 t/debsums.t | 7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/debsums b/debsums
index 25eac9c..b32b3ba 100755
--- a/debsums
+++ b/debsums
@@ -438,9 +438,8 @@ sub resolve_path {
         }
         my $fp = $root . '/' . join('/', @parts) . '/' . $token;
         if ($seen{$fp}) {
-            warn "$self: Error: symlink loop detected in path '$path'. ",
+            die "$self: Error: symlink loop detected in path '$path'. ",
                 "Please file a bug again $package.\n";
-            return $path; # give up
         }
         $seen{$fp} = 1;
         if (-l $fp) {
diff --git a/t/debsums.t b/t/debsums.t
index a72c30b..d2448c5 100644
--- a/t/debsums.t
+++ b/t/debsums.t
@@ -176,16 +176,15 @@ foreach my $option (qw(-c -s)) {
 # Checks symlinks with loops           #
 ########################################
 
-# Expect a warning
+# Expect a death
 $chroot = "t/fakechroots/link-with-loop";
 @command = ($command, "--root=$chroot");
 foreach my $option (qw(-c -s)) {
     run(@command, $option);
     is(stderr,
-       "debsums: Error: symlink loop detected in path 'usr/share/doc/fakepkg/loop.1'. Please file a bug again fakepkg.
-debsums: can't open fakepkg file t/fakechroots/link-with-loop/usr/share/doc/fakepkg/loop.1 (Too many levels of symbolic links)\n",
+       "debsums: Error: symlink loop detected in path 'usr/share/doc/fakepkg/loop.1'. Please file a bug again fakepkg.\n",
        'Warning on STDERR');
-    expected_rc(2);
+    expected_rc(255);
 }
 
 #######################

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/debsums.git



More information about the Pkg-perl-cvs-commits mailing list