Fixed ticket #43

This commit is contained in:
Rooty 2020-12-25 06:11:17 +01:00
parent 39dc9722f1
commit e5b6f56887
3 changed files with 11 additions and 6 deletions

View File

@ -487,6 +487,7 @@ class tar_file extends archive
{ {
$pwd = getcwd(); $pwd = getcwd();
chdir($this->options['basedir']); chdir($this->options['basedir']);
var_dump($this->options['basedir']);
if($fp = $this->open_archive()) if($fp = $this->open_archive())
{ {
@ -516,6 +517,7 @@ class tar_file extends archive
{ {
break; break;
} }
$block = substr_replace($block," ",148,8); $block = substr_replace($block," ",148,8);
$checksum = 0; $checksum = 0;
for($i = 0; $i < 512; $i++) for($i = 0; $i < 512; $i++)
@ -554,6 +556,7 @@ class tar_file extends archive
} }
else if($this->options['overwrite'] == 0 && file_exists($file['name'])) else if($this->options['overwrite'] == 0 && file_exists($file['name']))
{ {
$this->error[] = "{$file['name']} already exists."; $this->error[] = "{$file['name']} already exists.";
} }
else if($new = @fopen($file['name'],"wb")) else if($new = @fopen($file['name'],"wb"))
@ -568,6 +571,7 @@ class tar_file extends archive
else else
{ {
$this->error[] = "Could not open {$file['name']} for writing."; $this->error[] = "Could not open {$file['name']} for writing.";
var_dump("Could not open {$file['stat'][7]} for writing.");
} }
} }
unset($file); unset($file);

View File

@ -530,7 +530,7 @@ class backup
* @param chaine path vers la destination * @param chaine path vers la destination
* @return booleen * @return booleen
*/ */
function checkFileVersion($src,$dest) function checkFileVersion($src, $dest)
{ {
if (strstr($dest, $GLOBALS["CONF_DATA_PATH"]."data/") || strstr($dest, $GLOBALS["CONF_LOG_PATH"]."log/") ) if (strstr($dest, $GLOBALS["CONF_DATA_PATH"]."data/") || strstr($dest, $GLOBALS["CONF_LOG_PATH"]."log/") )
{ {

View File

@ -435,7 +435,7 @@ Class backupFile
//Création de l'arbo avec les valeurs contenues dans le fichier .ini //Création de l'arbo avec les valeurs contenues dans le fichier .ini
foreach ($tab as $key=>$val) foreach ($tab as $key=>$val)
{ {
$tabTmp=split('/',$this->getSystemPath($val[0])); $tabTmp=mb_split('/',$this->getSystemPath($val[0]));
$pathTmp=""; $pathTmp="";
$tabresult[$cpt][0]=$this->getSystemPath($val[0]); $tabresult[$cpt][0]=$this->getSystemPath($val[0]);
$tabresult[$cpt][1]=true; $tabresult[$cpt][1]=true;
@ -562,7 +562,7 @@ Class backupFile
* @return float version du fichier sinon 0 * @return float version du fichier sinon 0
*/ */
function getSystemPath($pathFile){ function getSystemPath($pathFile){
$tabTmp=split('/',$pathFile); $tabTmp=mb_split('/',$pathFile);
if ( (is_null($tabTmp[0])) || ($tabTmp[0]==".") ){ if ( (is_null($tabTmp[0])) || ($tabTmp[0]==".") ){
unset($tabTmp[0]); unset($tabTmp[0]);
return ($this->getSystemPath(implode("/", $tabTmp))); return ($this->getSystemPath(implode("/", $tabTmp)));
@ -602,6 +602,7 @@ Class backupFile
$gid = @filegroup('.'); $gid = @filegroup('.');
$gid2 = @filegroup($self); $gid2 = @filegroup($self);
$perms = @fileperms($self); $perms = @fileperms($self);
// var_dump(intval(substr(decoct( fileperms($self) ), 2)));
// Comparer l'appartenance d'un fichier cree par PHP // Comparer l'appartenance d'un fichier cree par PHP
// avec celle du script et du repertoire courant // avec celle du script et du repertoire courant