mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Fix a longstanding bug I was only recently told about: When converting
from rpm, ignore the icky file owners and perms from the cpio archive,
and query rpm for the real set that it overrides in the control data
structure. Closes: #151546
This commit is contained in:
@@ -176,6 +176,30 @@ sub unpack {
|
|||||||
or die "error moving unpacked files into the default prefix directory: $!";
|
or die "error moving unpacked files into the default prefix directory: $!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($> == 0) {
|
||||||
|
# rpm files have two sets of permissions; the set in the cpio
|
||||||
|
# archive, and the set in the control data; which override them.
|
||||||
|
# The set in the control data are more correct, so let's use those.
|
||||||
|
open (GETPERMS, 'rpm --queryformat \'[%{FILEMODES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]\' -qp '.$this->filename.' |');
|
||||||
|
while (<GETPERMS>) {
|
||||||
|
chomp;
|
||||||
|
my ($mode, $owner, $group, $file) = split(/ /, $_, 4);
|
||||||
|
$mode = $mode & 07777; # remove filetype
|
||||||
|
my $uid = getpwnam($owner);
|
||||||
|
if (! defined $uid) {
|
||||||
|
print STDERR "WARNING: $file is owned by a user ($owner) not on this system; using root instead";
|
||||||
|
$uid=0;
|
||||||
|
}
|
||||||
|
my $gid = getgrnam($group);
|
||||||
|
if (! defined $gid) {
|
||||||
|
print STDERR "WARNING: $file is owned by a group ($group) not on this system; using group root instead";
|
||||||
|
$gid=0;
|
||||||
|
}
|
||||||
|
chown($uid, $gid, $file) || die "failed chowning $file to $uid\:$gid\: $!";
|
||||||
|
chmod($mode, $file) || die "failed changing mode of $file to $mode\: $!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# When cpio extracts the file, any child directories that are
|
# When cpio extracts the file, any child directories that are
|
||||||
# present, but whose parent directories are not, end up mode 700.
|
# present, but whose parent directories are not, end up mode 700.
|
||||||
# This next block corrects that to 755, which is more reasonable.
|
# This next block corrects that to 755, which is more reasonable.
|
||||||
|
|||||||
2
alien.pl
2
alien.pl
@@ -364,7 +364,7 @@ unless (@ARGV) {
|
|||||||
if (! -w '.') {
|
if (! -w '.') {
|
||||||
die("Cannot write to current directory. Try moving to /tmp and re-running alien.\n");
|
die("Cannot write to current directory. Try moving to /tmp and re-running alien.\n");
|
||||||
}
|
}
|
||||||
if ($> ne 0) {
|
if ($> != 0) {
|
||||||
if ($destformats{deb} && ! $generate && ! $single) {
|
if ($destformats{deb} && ! $generate && ! $single) {
|
||||||
die "Must run as root to convert to deb format (or you may use fakeroot).\n";
|
die "Must run as root to convert to deb format (or you may use fakeroot).\n";
|
||||||
}
|
}
|
||||||
|
|||||||
9
debian/changelog
vendored
9
debian/changelog
vendored
@@ -1,3 +1,12 @@
|
|||||||
|
alien (8.15) unstable; urgency=low
|
||||||
|
|
||||||
|
* Fix a longstanding bug I was only recently told about: When converting
|
||||||
|
from rpm, ignore the icky file owners and perms from the cpio archive,
|
||||||
|
and query rpm for the real set that it overrides in the control data
|
||||||
|
structure. Closes: #151546
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Mon, 8 Jul 2002 20:52:48 -0400
|
||||||
|
|
||||||
alien (8.14) unstable; urgency=low
|
alien (8.14) unstable; urgency=low
|
||||||
|
|
||||||
* Enabled Getopt::Long Bundling, see comment in alien.pl. Closes: #152148
|
* Enabled Getopt::Long Bundling, see comment in alien.pl. Closes: #152148
|
||||||
|
|||||||
Reference in New Issue
Block a user