diff --git a/lib/package/archive.php b/lib/package/archive.php index 8579a2c..9b17854 100755 --- a/lib/package/archive.php +++ b/lib/package/archive.php @@ -487,7 +487,8 @@ class tar_file extends archive { $pwd = getcwd(); chdir($this->options['basedir']); - + var_dump($this->options['basedir']); + if($fp = $this->open_archive()) { if($this->options['inmemory'] == 1) @@ -516,6 +517,7 @@ class tar_file extends archive { break; } + $block = substr_replace($block," ",148,8); $checksum = 0; 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'])) { + $this->error[] = "{$file['name']} already exists."; } else if($new = @fopen($file['name'],"wb")) @@ -568,6 +571,7 @@ class tar_file extends archive else { $this->error[] = "Could not open {$file['name']} for writing."; + var_dump("Could not open {$file['stat'][7]} for writing."); } } unset($file); diff --git a/lib/package/backup.php b/lib/package/backup.php index 7402612..0094a0c 100755 --- a/lib/package/backup.php +++ b/lib/package/backup.php @@ -530,7 +530,7 @@ class backup * @param chaine path vers la destination * @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/") ) { diff --git a/lib/package/backup/backupfile.php b/lib/package/backup/backupfile.php index d46af3b..19d6f8b 100755 --- a/lib/package/backup/backupfile.php +++ b/lib/package/backup/backupfile.php @@ -404,13 +404,13 @@ Class backupFile if (file_exists($path.$key) && $this->setFilePerm($path.$key, $chmod)) { $tabresult[$key][0]=$val; - $tabresult[$key][1]=True; + $tabresult[$key][1]=True; } else { $tabresult[$key][1]=False; } - } + } } else { @@ -435,7 +435,7 @@ Class backupFile //Création de l'arbo avec les valeurs contenues dans le fichier .ini foreach ($tab as $key=>$val) { - $tabTmp=split('/',$this->getSystemPath($val[0])); + $tabTmp=mb_split('/',$this->getSystemPath($val[0])); $pathTmp=""; $tabresult[$cpt][0]=$this->getSystemPath($val[0]); $tabresult[$cpt][1]=true; @@ -562,7 +562,7 @@ Class backupFile * @return float version du fichier sinon 0 */ function getSystemPath($pathFile){ - $tabTmp=split('/',$pathFile); + $tabTmp=mb_split('/',$pathFile); if ( (is_null($tabTmp[0])) || ($tabTmp[0]==".") ){ unset($tabTmp[0]); return ($this->getSystemPath(implode("/", $tabTmp))); @@ -602,6 +602,7 @@ Class backupFile $gid = @filegroup('.'); $gid2 = @filegroup($self); $perms = @fileperms($self); +// var_dump(intval(substr(decoct( fileperms($self) ), 2))); // Comparer l'appartenance d'un fichier cree par PHP // avec celle du script et du repertoire courant