BUG 11423 Errors when restoring a ws with the Enterprise plugin enabled. SOLVED
Was added some validations to make the backup and the restore functions work fine when it is enabled the Enterprise plugin.
This commit is contained in:
14
gulliver/thirdparty/pear/Archive/Tar.php
vendored
14
gulliver/thirdparty/pear/Archive/Tar.php
vendored
@@ -917,6 +917,12 @@ class Archive_Tar extends PEAR
|
||||
if ($v_filename == '')
|
||||
continue;
|
||||
|
||||
if($v_filename == $p_remove_dir.'/plugin.singleton')
|
||||
continue;
|
||||
|
||||
if($v_filename == $p_remove_dir.'/ee')
|
||||
continue;
|
||||
|
||||
// ----- ignore files and directories matching the ignore regular expression
|
||||
if ($this->_ignore_regexp && preg_match($this->_ignore_regexp, '/'.$v_filename)) {
|
||||
$this->_warning("File '$v_filename' ignored");
|
||||
@@ -1090,12 +1096,12 @@ class Archive_Tar extends PEAR
|
||||
$v_magic = 'ustar ';
|
||||
|
||||
$v_version = ' ';
|
||||
|
||||
|
||||
if (function_exists('posix_getpwuid'))
|
||||
{
|
||||
$userinfo = posix_getpwuid($v_info[4]);
|
||||
$groupinfo = posix_getgrgid($v_info[5]);
|
||||
|
||||
|
||||
$v_uname = $userinfo['name'];
|
||||
$v_gname = $groupinfo['name'];
|
||||
}
|
||||
@@ -1179,7 +1185,7 @@ class Archive_Tar extends PEAR
|
||||
{
|
||||
$userinfo = posix_getpwuid($p_uid);
|
||||
$groupinfo = posix_getgrgid($p_gid);
|
||||
|
||||
|
||||
$v_uname = $userinfo['name'];
|
||||
$v_gname = $groupinfo['name'];
|
||||
}
|
||||
@@ -1188,7 +1194,7 @@ class Archive_Tar extends PEAR
|
||||
$v_uname = '';
|
||||
$v_gname = '';
|
||||
}
|
||||
|
||||
|
||||
$v_devmajor = '';
|
||||
|
||||
$v_devminor = '';
|
||||
|
||||
@@ -1099,6 +1099,12 @@ class workspaceTools
|
||||
foreach ($metadata->directories as $dir) {
|
||||
CLI::logging("+> Restoring directory '$dir'\n");
|
||||
|
||||
if(file_exists("$tempDirectory/$dir" . "/ee")) {
|
||||
G::rm_dir("$tempDirectory/$dir" . "/ee");
|
||||
}
|
||||
if(file_exists("$tempDirectory/$dir" . "/plugin.singleton")) {
|
||||
G::rm_dir("$tempDirectory/$dir" . "/plugin.singleton");
|
||||
}
|
||||
if (!rename("$tempDirectory/$dir", $workspace->path)) {
|
||||
throw new Exception("There was an error copying the backup files ($tempDirectory/$dir) to the workspace directory {$workspace->path}.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user