Support RPMs containing ghost files.

(Patch by Ben Webb, who would get his patches applied quicker if he actually communicated them to the program's author.)
This commit is contained in:
Joey Hess
2010-05-17 20:54:30 -04:00
parent a320ae144c
commit e7e9f10486
2 changed files with 13 additions and 5 deletions

View File

@@ -274,12 +274,17 @@ sub unpack {
if (defined($owninfo{$file}) && (($mode & 07000) > 0)) {
$modeinfo{$file} = sprintf "%lo", $mode;
}
if ($> == 0) {
$this->do("chown", "$uid:$gid", "$workdir/$file")
|| die "failed chowning $file to $uid\:$gid\: $!";
# Note that ghost files exist in the metadata but not
# in the cpio archive, so check that the file exists
# before trying to access it
if (-e "$workdir/$file") {
if ($> == 0) {
$this->do("chown", "$uid:$gid", "$workdir/$file")
|| die "failed chowning $file to $uid\:$gid\: $!";
}
$this->do("chmod", sprintf("%lo", $mode), "$workdir/$file")
|| die "failed changing mode of $file to $mode\: $!";
}
$this->do("chmod", sprintf("%lo", $mode), "$workdir/$file")
|| die "failed changing mode of $file to $mode\: $!";
}
$this->owninfo(\%owninfo);
$this->modeinfo(\%modeinfo);

3
debian/changelog vendored
View File

@@ -12,6 +12,9 @@ alien (8.81) UNRELEASED; urgency=low
(Patch by Duane Waddle, on a bug tracking system I don't frequent, that
was about the "expire" it 4 days from now. We got lucky Duane, but please
use the Debian BTS next time!)
* Support RPMs containing ghost files.
(Patch by Ben Webb, who would get his patches applied quicker if he
actually communicated them to the program's author.)
-- Joey Hess <joeyh@debian.org> Wed, 28 Apr 2010 11:29:19 -0400