Package: backuppc
Version: 3.0.0-3
Severity: important
Tags: patch

Since BackupPC 3.0 Xfer/Tar.pm prepends "./" before _all_ file exclusions.
Effectively, this means that it is no longer possible to exclude files by
name only, you would always have to list the full path for each individual
file.
Besides the fact that this makes file exclusions for tar completely
unusable, it is also in contradiction to the documentation [1].

The attached (tested) patch fixes this issue.

Note that the same syntax is also used for "BackupFilesOnly" immediately 
below. I am fairly certain that the same fix needs to be implemented there,
but was not sure enough to include it in the patch.

[1] 
http://backuppc.sourceforge.net/faq/BackupPC.html#item__conf_backupfilesexclude_

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages backuppc depends on:
ii  adduser                    3.102         Add and remove users and groups
ii  apache2                    2.2.3-4       Next generation, scalable, extenda
ii  apache2-mpm-worker [httpd] 2.2.3-4       High speed threaded model for Apac
ii  bzip2                      1.0.3-6       high-quality block-sorting file co
ii  debconf [debconf-2.0]      1.5.11        Debian configuration management sy
ii  dpkg                       1.13.25       package maintenance system for Deb
ii  exim4                      4.63-17       metapackage to ease exim MTA (v4) 
ii  exim4-daemon-light [mail-t 4.63-17       lightweight exim MTA (v4) daemon
ii  libarchive-zip-perl        1.16-1        Module for manipulation of ZIP arc
ii  libcompress-zlib-perl      1.42-2        Perl module for creation and manip
ii  perl [libdigest-md5-perl]  5.8.8-7       Larry Wall's Practical Extraction 
ii  perl-suid                  5.8.8-7       Runs setuid Perl scripts
ii  samba-common               3.0.24-6etch4 Samba common files used by both th
ii  smbclient                  3.0.24-6etch4 a LanManager-like simple client fo
ii  tar                        1.16-2        GNU tar
ii  wwwconfig-common           0.0.48        Debian web auto configuration

backuppc recommends no packages.

-- debconf information excluded

diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm
index c34b019..06d6832 100644
--- a/lib/BackupPC/Xfer/Tar.pm
+++ b/lib/BackupPC/Xfer/Tar.pm
@@ -101,8 +101,7 @@ sub start
         if ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} )
             {
-                $file = $2 if ( $file =~ m{^(\./+|/+)(.*)}s );
-		$file = "./$file";
+                $file = "./$2" if ( $file =~ m{^(\./+|/+)(.*)}s );
                 $file = encode($conf->{ClientCharset}, $file)
                             if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, "--exclude=$file");

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to