Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 888085

Summary: app-backup/backuppc-4.4.0-r1: config.pl is mangled by the CGI interface (upstream patch available)
Product: Gentoo Linux Reporter: Stefan Bruda <bruda>
Component: Current packagesAssignee: Dennis Eisele <kernlpanic>
Status: UNCONFIRMED ---    
Severity: major CC: Nicolai.Beuermann, proxy-maint
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Stefan Bruda 2022-12-23 14:25:24 UTC
The current Gentoo stable version of backuppc (4.4.0-r1) exhibits a nasty bug in that any change in the configuration initiated from the CGI interface mangles the configuration file by replacing many [...] and {...} with (...).  As a result the configuration becomes unusable and so backuppc crashes and/or the CGI interface becomes unusable.

The problem is caused by an incorrect second argument to Data::Dumper in a few places.  An upstream patch to correct the issue is available at https://github.com/backuppc/backuppc/commit/2c9270b9b849b2c86ae6301dd722c97757bc9256


Reproducible: Always

Steps to Reproduce:
1. Launch the backuppc CGI interface https://<host>/BackupPC_Admin
2. Go to any page that edits the configuration, such as
   https://<host>/BackupPC_Admin?action=editConfig&newMenu=hosts
   or
   https://<host>/BackupPC_Admin?action=editConfig
3. Edit something (such as adding a host) and save
Actual Results:  
In /etc/BackupPC/config.pl many [...] and {...} constructs are replaced by (...).  For example

$Conf{WakeupSchedule} = [
  23,
  0,
  1,
  2,
  3,
  4
];

becomes

$Conf{WakeupSchedule} = (
  23,
  0,
  1,
  2,
  3,
  4
);

As a result the backuppc process crashes with errors such as

Can't use string ("4") as an ARRAY ref while "strict refs" in use at /usr/bin/BackupPC line 868.

Expected Results:  
The new configuration is saved correctly and backuppc continues to operate normally.