From b12e1922f051e9731a0bb23a018c2484031b365a Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 3 Apr 2008 14:53:43 +0000 Subject: [PATCH] fixed: packages try to restore owner --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Storage.pm | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 77793b1b2..13050c1af 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -21,6 +21,7 @@ - improved behavior of CS mail message filtering - fixed: Thingy: "cancel" -- cannot cancel when adding a thing - fixed: unable to respond to poll multiple times in same session + - fixed: packages try to restore owner 7.5.8 - moved Gallery utility methods to WebGUI::Utility::Gallery diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 61a983bf4..dbfec203b 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -975,14 +975,7 @@ sub tar { chdir $self->getPath or croak 'Unable to chdir to ' . $self->getPath . ": $!"; my @files = (); find(sub { push(@files, $File::Find::name)}, "."); - if ($Archive::Tar::VERSION eq '0.072') { - my $tar = Archive::Tar->new(); - $tar->add_files(@files); - $tar->write($temp->getPath($filename),1); - } - else { - Archive::Tar->create_archive($temp->getPath($filename),1,@files); - } + Archive::Tar->create_archive($temp->getPath($filename),1,@files); chdir $originalDir; return $temp; } @@ -1010,10 +1003,15 @@ sub untar { my $originalDir = cwd; chdir $temp->getPath; - + local $Archive::Tar::CHOWN = 0; Archive::Tar->extract_archive($self->getPath($filename),1); $self->_addError(Archive::Tar->error) if (Archive::Tar->error); - + my @files; + find(sub { + push(@files, $File::Find::name); + }, "."); + $self->_changeOwner(@files); + chdir $originalDir; return $temp; }