#153 backup.php sometimes needs directory_separator

v_2.3
closed-accepted
nobody
None
5
2009-07-30
2009-07-30
Ryow
No

Hi developers.

I did backup but the content of sql file was php errors, saying, upload_tmp_dir setting is "/var/lib/php/tmp" and backup.php tried to open "/var/lib/php/tmppostfixadmin-20090730-19251.sql", witch is out of open_basedir setting "/var/lib/php/tmp".

ini_get('upload_tmp_dir') doesn't have a last slash in my environment, but backup.php just attaches a file name to the upload_tmp_dir without slash.
I just fixed to work in 57 to 59 like below.

$path = (ini_get('upload_tmp_dir') != '') ? ini_get('upload_tmp_dir') : '/tmp'; // '/tmp/' -> '/tmp'
$filename = "postfixadmin-" . date ("Ymd") . "-" . getmypid() . ".sql";
$backup = $path . DIRECTORY_SEPARATOR . $filename; // added a DIRECTORY_SEPARATOR

I hope this bugfix will be applied in the next release.

Best regards

Discussion

  • GingerDog

    GingerDog - 2009-07-30

    patch merged; thank you. see changeset 697

     
  • GingerDog

    GingerDog - 2009-07-30
    • status: open --> closed-accepted
     
  • GingerDog

    GingerDog - 2009-07-30

    Thanks for the bug report; we believe this has been fixed in subversion.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks