Fix: Pb sécurité avec wrapper. Les chemins recus par le wrapper doivent tous etre obligatoirement relatifs et complétés par le wrapper sous peine d'autoriser le téléchargement de n'importe quel fichier du disque. Je remet le complément du path dans le wrapper et je change au niveau de l'appelant pour passer non pas un chemin complet mais un chemin relatif.

This commit is contained in:
Laurent Destailleur 2005-02-09 19:37:21 +00:00
parent e59708c492
commit e32a48fd73
2 changed files with 3 additions and 3 deletions

View File

@ -114,9 +114,9 @@ if ($_GET["id"])
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>'; print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
$encfile = urlencode(DOL_DATA_ROOT.'/prelevement/bon/'.$bon->ref); $relativepath = 'bon/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.$encfile.'">'.$bon->ref.'</a>'; print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$bon->ref.'</a>';
print '</td></tr>'; print '</td></tr>';

View File

@ -73,7 +73,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
//$original_file=$conf->prelevement->dir_output.'/'.$original_file; $original_file=$conf->prelevement->dir_output.'/'.$original_file;
} }
// Wrapping pour les propales // Wrapping pour les propales