mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* When reloating files from a rpm, run the mv command directly,
not in a subshell; this is safer especially if odd filenames are
involved.
* When converting from rpm, only chmod each directory once, it was doing
it many times for some directories before.
* Fixed chmodding to use the correct path to the directory. This fixes
file permissions in rpm's converted to other formats, a bug introduced
at 7.0.
* Fixed some undefined value warnings (which pointed out real but rare
bugs).
* Fixed a rare, but bad little bug. If you ran alien in a directory that
had the suid/sgid bit set (as my home directory does), and generated
debs and probably other formats, it generated packages with the root
directory suid/sgid.
This commit is contained in:
@@ -237,6 +237,10 @@ sub unpack {
|
||||
my $workdir = $this->name."-".$this->version;
|
||||
mkdir $workdir, 0755 ||
|
||||
die "unable to mkdir $workdir: $!";
|
||||
# If the parent directory is suid/sgid, mkdir will make the root
|
||||
# directory of the package inherit those bits. That is a bad thing,
|
||||
# so explicitly force perms to 755.
|
||||
chmod 0755, $workdir;
|
||||
$this->unpacked_tree($workdir);
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ sub getpatch {
|
||||
|
||||
my @patches;
|
||||
foreach my $dir (@_) {
|
||||
push @patches,glob("$dir/".$this->name."_".$this->version."-".$this->revision."*.diff.gz");
|
||||
push @patches, glob("$dir/".$this->name."_".$this->version."-".$this->release."*.diff.gz");
|
||||
}
|
||||
unless (@patches) {
|
||||
# Try not matching the revision, see if that helps.
|
||||
|
||||
@@ -84,7 +84,8 @@ sub scan {
|
||||
foreach my $field (keys(%fieldtrans)) {
|
||||
$_=`LANG=C rpm -qp $file --queryformat \%{$field}`;
|
||||
$field=$fieldtrans{$field};
|
||||
$this->$field($_) if $_ ne '(none)';
|
||||
$_='' if $_ eq '(none)';
|
||||
$this->$field($_);
|
||||
}
|
||||
|
||||
# Get the conffiles list.
|
||||
@@ -153,18 +154,18 @@ sub unpack {
|
||||
# Test to see if the package contains the prefix directory already.
|
||||
if (defined $this->prefixes && ! -e "$workdir/".$this->prefixes) {
|
||||
# Get the files to move.
|
||||
my $filelist=join ' ',glob("$workdir/*");
|
||||
my @filelist=glob("$workdir/*");
|
||||
|
||||
# Now, make the destination directory.
|
||||
my $collect=$workdir;
|
||||
foreach (split m:/:, $this->prefixes) {
|
||||
if ($_ ne undef) { # this keeps us from using anything but relative paths.
|
||||
if ($_ ne '') { # this keeps us from using anything but relative paths.
|
||||
$collect.="$_/";
|
||||
mkdir $collect,0755 || die "unable to mkdir $collect: $!";
|
||||
}
|
||||
}
|
||||
# Now move all files in the package to the directory we made.
|
||||
system "mv $filelist $workdir/".$this->prefixes &&
|
||||
system "mv", @filelist, "$workdir/".$this->prefixes &&
|
||||
die "error moving unpacked files into the default prefix directory: $!";
|
||||
}
|
||||
|
||||
@@ -175,9 +176,10 @@ sub unpack {
|
||||
# Of course, this whole thing assumes we get the filelist in sorted
|
||||
# order.
|
||||
my $lastdir='';
|
||||
my %tochmod;
|
||||
foreach my $file (@{$this->filelist}) {
|
||||
$file=~s/^\///;
|
||||
if (($lastdir && $file=~m:^\Q$lastdir\E/[^/]*$: eq undef) || !$lastdir) {
|
||||
if (($lastdir && $file !~ m:^\Q$lastdir\E/[^/]*$:) || !$lastdir) {
|
||||
# We've found one of the nasty directories. Fix it
|
||||
# up.
|
||||
#
|
||||
@@ -191,11 +193,13 @@ sub unpack {
|
||||
my $dircollect='';
|
||||
foreach my $dir (split(/\//,$file)) {
|
||||
$dircollect.="$dir/";
|
||||
chmod 0755,$dircollect; # TADA!
|
||||
# Use a hash to prevent duplicate chmods.
|
||||
$tochmod{"$workdir/$dircollect"}=1;
|
||||
}
|
||||
}
|
||||
$lastdir=$file if -d "./$file";
|
||||
}
|
||||
chmod 0755, keys %tochmod if %tochmod;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
19
debian/changelog
vendored
19
debian/changelog
vendored
@@ -1,3 +1,22 @@
|
||||
alien (7.2) unstable; urgency=low
|
||||
|
||||
* When reloating files from a rpm, run the mv command directly,
|
||||
not in a subshell; this is safer especially if odd filenames are
|
||||
involved.
|
||||
* When converting from rpm, only chmod each directory once, it was doing
|
||||
it many times for some directories before.
|
||||
* Fixed chmodding to use the correct path to the directory. This fixes
|
||||
file permissions in rpm's converted to other formats, a bug introduced
|
||||
at 7.0.
|
||||
* Fixed some undefined value warnings (which pointed out real but rare
|
||||
bugs).
|
||||
* Fixed a rare, but bad little bug. If you ran alien in a directory that
|
||||
had the suid/sgid bit set (as my home directory does), and generated
|
||||
debs and probably other formats, it generated packages with the root
|
||||
directory suid/sgid.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Tue, 9 May 2000 14:13:15 -0700
|
||||
|
||||
alien (7.1) unstable; urgency=low
|
||||
|
||||
* Corrected checking of system() in Deb::prep. Closes: #63396
|
||||
|
||||
Reference in New Issue
Block a user