From 00aa1a86493e4160ac98d65b32ff7d0b64ff6e37 Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Mon, 3 Jan 2011 10:01:37 +0100 Subject: Fix multiple security issues with dpkg-source (CVE-2010-1679) - Enhance checks to catch maliciously crafted patches which could modify files outside of the unpacked source package. - Do not consider a top-level symlink like a directory when extracting a tarball. - Exclude .pc while extracting the upstream tarball in 3.0 (quilt) as patch blindly writes in that directory during unpack (and would follow any existing symlink). --- scripts/Dpkg/Source/Archive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/Dpkg/Source/Archive.pm') diff --git a/scripts/Dpkg/Source/Archive.pm b/scripts/Dpkg/Source/Archive.pm index 921c76e6f..5e040cad4 100644 --- a/scripts/Dpkg/Source/Archive.pm +++ b/scripts/Dpkg/Source/Archive.pm @@ -147,7 +147,7 @@ sub extract { closedir(D); my $done = 0; erasedir($dest); - if (scalar(@entries) == 1 && -d "$tmp/$entries[0]") { + if (scalar(@entries) == 1 && ! -l "$tmp/$entries[0]" && -d _) { rename("$tmp/$entries[0]", $dest) || syserr(_g("Unable to rename %s to %s"), "$tmp/$entries[0]", $dest); -- cgit v1.2.3