#661 Backup does not test for failure [patch]

closed-accepted
Havard Sorli
None
5
2012-10-05
2012-10-05
Nick Prater
No

I am using ledgersmb 1.3.22.

The Backup DB and Backup Roles facility, made available through setup.pl, does not test for an error condition when creating the backup files.

Consequently, when sending the backup to the browser, a bad or empty file can be served, without any indication that something is wrong.

I built up a fine collection of zero-length backup files this way.

The proposed patch, which is attached in two parts:

1) Modifies Database.pm so that db_backup() and base_backup() methods check the exit code of pg_dump and pg_dumpall, returning undef if it is non-zero.

2) Modifies setup.pl to raise an error if the return value of Database::db_backup() or Database::base_backup() is false.

Any criticism and feedback always welcome. I hope this proves useful to others.

Nick

Discussion

  • Nick Prater
    Nick Prater
    2012-10-05

    patch for setup.pl

     
  • Havard Sorli
    Havard Sorli
    2012-10-05

    Revision: 5144

     
  • Havard Sorli
    Havard Sorli
    2012-10-05

    • assigned_to: nobody --> hasorli
    • status: open --> closed-accepted