summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-07-15 23:15:54 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-07-15 23:16:02 +0100
commita68894875ce0d11261882f62b2aa28a6e3eed673 (patch)
tree1f8473670bcb9f80fcf6476117330502a6a31644 /dgit
parent643fe03fd85c430ca77c9a3a59a4d9e6f99e9f7c (diff)
dgit import: Defend against broken symlinks in ..
Provide a special error message if lstat succeeds but lstat fails. This is not hypothetical - currently even dgit import ../blah.dsc can generate this situation ! Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit5
1 files changed, 4 insertions, 1 deletions
diff --git a/dgit b/dgit
index 5197596..a68bf19 100755
--- a/dgit
+++ b/dgit
@@ -6349,7 +6349,10 @@ END
foreach my $fi (@dfi) {
my $f = $fi->{Filename};
my $here = "../$f";
- next if lstat $here;
+ if (lstat $here) {
+ next if stat $here;
+ fail "lstat $here works but stat gives $! !";
+ }
fail "stat $here: $!" unless $! == ENOENT;
my $there = $dscfn;
if ($dscfn =~ m#^(?:\./+)?\.\./+#) {