Bug 518874 - BackupPC_tarPCCopy fails when __TOPDIR__ and path argument end with one slash
Summary: BackupPC_tarPCCopy fails when __TOPDIR__ and path argument end with one slash
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: BackupPC
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Johan Cwiklinski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-23 18:06 UTC by Joel Uckelman
Modified: 2010-12-05 06:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-05 06:34:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joel Uckelman 2009-08-23 18:06:47 UTC
Description of problem:

__TOPDIR__ is set to '/var/lib/BackupPC/' in /etc/BackupPC/config.pl. When
invoking BackupPC_tarPCCopy, you're supposed to give as an argument an
absolute path starting with __TOPDIR__. If you want an archive containing
everything backed up by this instance of BackupPC, the most obvious things to
give as an argument are:

/var/lib/BackupPC/pc
/var/lib/BackupPC/pc/

Both of these fail, and the error message (copied here, from the second one) is utterly unhelpful:

Argument /var/lib/BackupPC/pc/ must be an absolute path starting with /var/lib/BackupPC/

The code in BackupPC_tarPCCopy which produces the error message is this:

  if ( $path !~ m{^\Q$TopDir/\E} ) {
    print STDERR "Argument $path must be an absolute path starting with $TopDir\n";
    exit(1);
  }

The problem is that the regex has an extra slash in it---so, if you gave

/var/lib/BackupPC/pc//

as the argument, the script wouldn't bail here, but it's not at all obvious why
that should be the case until you look at the code.

Something needs changing here. One possible solution is to make sure that
$TopDir ends with exactly one slash:

  $TopDir .= '/' if ($TopDir !~ m{/$});
  if ( $path !~ m{^\Q$TopDir\E} ) {
    ...
  }

Another would be to not end the names of directories in config.pl with
slashes, though I don't know what effect that would have on other parts of
BackupPC. (Hopefully none?) That might be a better way to go.


Version-Release number of selected component (if applicable):

BackupPC-3.1.0-5.fc11.noarch

How reproducible:

Always.

Steps to Reproduce:
1. su backuppc
2. /usr/share/BackupPC/bin/BackupPC_tarPCCopy /var/lib/BackupPC/pc/ >foo
  
Actual results:

Argument /var/lib/BackupPC/pc/ must be an absolute path starting with /var/lib/BackupPC/


Expected results:

The pool should start to be copied.

Comment 1 Bug Zapper 2010-04-28 09:55:45 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bug Zapper 2010-11-04 10:25:10 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Joel Uckelman 2010-11-05 22:15:15 UTC
This seems fixed in F14.

Comment 4 Bug Zapper 2010-12-05 06:34:23 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.