Bug#955014: slbackup: slbackup.postinst shouldn't create a named block in /etc/slbackup/slbackup.conf
Frans Spiesschaert
Frans.Spiesschaert at yucom.be
Thu Mar 26 19:43:13 GMT 2020
Package: slbackup
Severity: normal
Tags: l10n patch
Dear maintainer,
The slbackup postinst script typically creates the backup
configuration for one host, namely the main server.
When a configuration file has only one block,
Perl module Config::General puts it out as a named block.
This behaviour has been introduced in 2012 in version 2.51
of Config::General to fix Perl Bug #77667
(See https://rt.cpan.org/Public/Bug/Display.html?id=77667).
However named blocks are incompatible with slbackup-php.
slbackup-php expects configuration blocks to be nested blocks.
And according to the Config::General man page this is a proper expectation.
This incompatibility results in slbackup-php menu items config, restore
and maintenance being broken. I added screenshots of those items,
once with the client in /etc/slbackup/slbackup.conf configured
as named block and once as nested block. The difference is obvious,
Config::General offers no configuration option to influence this behaviour.
So we need to work arround this flaw. This is possible by saving the
configuration into a variable as a first step. We then rewrite the content
of that variable so that the named block becomes a nested block, and
finally we save the content of that variable (i.e. the slbackup
configuration) to /etc/slbackup/slbackup.conf.
Please find attached a tested patch to fix this problem.
I also attached a seccond patch. It has the same fix,
but also adds some commented out sample configurations to
compensate for the lack of documentation. Those sample
configurations are mainly copied from conf/slbackup.conf
in the source tree. This doesn't make it into the /usr/share/doc
directory of the binary package.
So you should only apply one out of those 2 patches, depending
on your preference.
--
Kind regards,
Frans Spiesschaert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-named_block.png
Type: image/png
Size: 77446 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-nested_block.png
Type: image/png
Size: 83788 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maintenance-named_block.png
Type: image/png
Size: 37804 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maintenance-nested_block.png
Type: image/png
Size: 38389 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: restore-named_block.png
Type: image/png
Size: 40463 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: restore-nested_block.png
Type: image/png
Size: 41480 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save-nested-block.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save-nested-block+add-examples.patch
Type: text/x-patch
Size: 2763 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-pkg-team/attachments/20200326/7455cd71/attachment-0003.bin>
More information about the Debian-edu-pkg-team
mailing list