Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 888085 - app-backup/backuppc-4.4.0-r1: config.pl is mangled by the CGI interface (upstream patch available)
Summary: app-backup/backuppc-4.4.0-r1: config.pl is mangled by the CGI interface (upst...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Dennis Eisele
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-12-23 14:25 UTC by Stefan Bruda
Modified: 2023-01-23 18:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.