Changes for 2.1.0pl1:
authorcbarratt <cbarratt>
Mon, 16 Aug 2004 03:10:41 +0000 (03:10 +0000)
committercbarratt <cbarratt>
Mon, 16 Aug 2004 03:10:41 +0000 (03:10 +0000)
* Added fix to lib/BackupPC/Lang/nl.pm from Lieven Bridts.

* Added patch from Tony Nelson to remove $Info{pid} before BackupPC
  writes the status and shuts down.

* Changed BackupPC_nightly so that it doesn't call find() if the
  directory doesn't exist.  This avoids errors in certain versions
  of perl.  Reported by Bernd Rilling.

* Fixed BackupPC::CGI::Lib to correctly re-load config.pl for mod_perl.
  Reported by Tony Nelson and Jimmy Liang.

* Explicitly untaint $In{host} in BackupPC::CGI::Lib to fix problem
  reported by Thomas TempĂ©.

* Added newline to "...skipping because of user requested delay..."
  log message in BackupPC_dump.  Reported by Wayne Scott.

* Added read file size error checking to BackupPC_tarCreate.
  Reported by Brandon Evans.

* Added check in BackupPC::Xfer::RsyncFileIO to ensure that when
  compression is toggled on/off, a compressed backup doesn't link
  to an uncompressed pool file (and an uncompressed backup doesn't
  link to a compressed pool file).  Reported by Brandon Evans.

* Updated documentation with new dirvish URL and a typo from
  Todd Curry.

* Fix to BackupPC_sendEmail so that it correctly sends admin emails
  for hosts that have failed backups.  Reported by Simon Kuhn.

ChangeLog
bin/BackupPC
bin/BackupPC_dump
bin/BackupPC_nightly
bin/BackupPC_sendEmail
bin/BackupPC_tarCreate
doc-src/BackupPC.pod
lib/BackupPC/CGI/Lib.pm
lib/BackupPC/Lang/nl.pm
lib/BackupPC/Xfer/RsyncFileIO.pm
makeDist

index e9ee938..a296a1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 #------------------------------------------------------------------------
 # Version __VERSION__, __RELEASEDATE__
 #------------------------------------------------------------------------
+* Added fix to lib/BackupPC/Lang/nl.pm from Lieven Bridts.
+
+* Added patch from Tony Nelson to remove $Info{pid} before BackupPC
+  writes the status and shuts down.
+
+* Changed BackupPC_nightly so that it doesn't call find() if the
+  directory doesn't exist.  This avoids errors in certain versions
+  of perl.  Reported by Bernd Rilling.
+
+* Fixed BackupPC::CGI::Lib to correctly re-load config.pl for mod_perl.
+  Reported by Tony Nelson and Jimmy Liang.
+
+* Explicitly untaint $In{host} in BackupPC::CGI::Lib to fix problem
+  reported by Thomas TempĂ©.
+
+* Added newline to "...skipping because of user requested delay..."
+  log message in BackupPC_dump.  Reported by Wayne Scott.
+
+* Added read file size error checking to BackupPC_tarCreate.
+  Reported by Brandon Evans.
+
+* Added check in BackupPC::Xfer::RsyncFileIO to ensure that when
+  compression is toggled on/off, a compressed backup doesn't link
+  to an uncompressed pool file (and an uncompressed backup doesn't
+  link to a compressed pool file).  Reported by Brandon Evans.
+
+* Updated documentation with new dirvish URL and a typo from
+  Todd Curry.
+
+* Fix to BackupPC_sendEmail so that it correctly sends admin emails
+  for hosts that have failed backups.  Reported by Simon Kuhn.
+
+#------------------------------------------------------------------------
+# Version 2.1.0, 20 Jun 2004
+#------------------------------------------------------------------------
 
 * Added Dutch translation from Lieven Bridts, with tweaks from
   Guus Houtzager.
index 50d5500..5304e61 100755 (executable)
@@ -1806,6 +1806,7 @@ sub ServerShutdown
         }
         %Jobs = ();
     }
+    delete($Info{pid});
     StatusWrite();
     unlink("$TopDir/log/BackupPC.pid");
     exit(1);
index 62173e7..c37e239 100755 (executable)
@@ -348,7 +348,7 @@ if ( !$opts{i} && !$opts{f} && $Conf{BlackoutGoodCnt} >= 0
 }
 
 if ( !$opts{i} && !$opts{f} && $StatusHost{backoffTime} > time ) {
-    printf(LOG "%sskipping because of user requested delay (%.1f hours left)",
+    printf(LOG "%sskipping because of user requested delay (%.1f hours left)\n",
                 $bpc->timeStamp, ($StatusHost{backoffTime} - time) / 3600);
     NothingToDo($needLink);
 }
index bca759d..54206c2 100755 (executable)
@@ -148,7 +148,8 @@ for my $pool ( qw(pool cpool) ) {
         $fileLinkMax   = 0;
         $fileCntRename = 0;
         %FixList       = ();
-        find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir");
+        find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir")
+                                           if ( -d "$TopDir/$pool/$dir" );
         my $kb   = $blkCnt / 2;
         my $kbRm = $blkCntRm / 2;
         my $kb2  = $blkCnt2 / 2;
index ff6ddc7..bd9a440 100755 (executable)
@@ -82,7 +82,8 @@ my $mesg = "";
 
 my @badHosts = ();
 foreach my $host ( sort(keys(%Status)) ) {
-    next if ( $Status{$host}{reason} ne "backup failed"
+    next if ( ($Status{$host}{reason} ne "Reason_backup_failed"
+               && $Status{$host}{reason} ne "Reason_restore_failed")
            || $Status{$host}{error} =~ /^lost network connection to host/ );
     push(@badHosts, "$host ($Status{$host}{error})");
 }
index a5fa5eb..dce51dc 100755 (executable)
@@ -423,10 +423,28 @@ sub TarWriteFile
         TarWriteFileInfo($fh, $hdr);
         my($data, $size);
         while ( $f->read(\$data, $BufSize) > 0 ) {
+            if ( $size + length($data) > $hdr->{size} ) {
+                print(STDERR "Error: truncating $hdr->{fullPath} to"
+                           . " $hdr->{size} bytes\n");
+                $data = substr($data, 0, $hdr->{size} - $size);
+                $ErrorCnt++;
+            }
             TarWrite($fh, \$data);
             $size += length($data);
         }
         $f->close;
+        if ( $size != $hdr->{size} ) {
+            print(STDERR "Error: padding $hdr->{fullPath} to $hdr->{size}"
+                       . " bytes from $size bytes\n");
+            $ErrorCnt++;
+            while ( $size < $hdr->{size} ) {
+                my $len = $hdr->{size} - $size;
+                $len = $BufSize if ( $len > $BufSize );
+                $data = "\0" x $len;
+                TarWrite($fh, \$data);
+                $size += $len;
+            }
+        }
         TarWritePad($fh, $size);
        $FileCnt++;
        $ByteCnt += $size;
index a780f9e..3b714e8 100644 (file)
@@ -269,8 +269,7 @@ BackupPC server data to tape.
 
 Various programs and scripts use rsync to provide hardlinked backups.
 See, for example, Mike Rubel's site (L<http://www.mikerubel.org/computers/rsync_snapshots>),
-JW Schultz's dirvish (L<http://www.pegasys.ws/dirvish> (although as of
-June 2004 this link doesn't work)),
+JW Schultz's dirvish (L<http://www.dirvish.org>),
 Ben Escoto's rdiff-backup (L<http://rdiff-backup.stanford.edu>),
 and John Bowman's rlbackup (L<http://www.math.ualberta.ca/imaging/rlbackup>).
 
@@ -1543,7 +1542,7 @@ status files to keep.
 Note that for direct restore to work, the $Conf{XferMethod} must
 be able to write to the client.  For example, that means an SMB
 share for smbclient needs to be writable, and the rsyncd module
-needs "read only" set to "yes".  This creates additional security
+needs "read only" set to "false".  This creates additional security
 risks.  If you only create read-only SMB shares (which is a good
 idea), then the direct restore will fail.  You can disable the
 direct restore option by setting $Conf{SmbClientRestoreCmd},
index 280ff53..9d89b0d 100644 (file)
@@ -102,8 +102,10 @@ sub NewRequest
        $Lang   = $bpc->Lang();
        $ConfigMTime = $bpc->ConfigMTime();
     } elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
-        $bpc->ServerMesg("log Re-read config file because mtime changed");
-        $bpc->ServerMesg("server reload");
+       $bpc->ConfigRead();
+       %Conf   = $bpc->Conf();
+       $Lang   = $bpc->Lang();
+       $ConfigMTime = $bpc->ConfigMTime();
     }
 
     #
@@ -154,6 +156,15 @@ EOF
               {map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) }
        }
     }
+
+    #
+    # Untaint the host name
+    #
+    if ( $In{host} =~ /^([\w.\s-]+)$/ ) {
+       $In{host} = $1;
+    } else {
+       delete($In{host});
+    }
 }
 
 sub timeStamp2
index 2431e53..93f92bb 100644 (file)
@@ -2,7 +2,7 @@
 
 #my %lang;
 #use strict;
-#File:  nl.pm       version 1.3
+#File:  nl.pm       version 1.5
 # --------------------------------
 
 $Lang{Start_Archive} = "Start Archivering";
@@ -79,7 +79,7 @@ $Lang{BackupPC_Server_Status_General_Info}= <<EOF;
             en het maximum van gisteren was \$Info{DUDailyMaxPrev}%.
     </ul>
 </ul>
-eof
+EOF
 
 $Lang{BackupPC_Server_Status} = <<EOF;
 \${h1(qq{$Lang{H_BackupPC_Server_Status}})}
@@ -483,7 +483,7 @@ EOF
 $Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
 Rechtstreeks terugplaatsen is gedeactiveerd voor machine \${EscHTML(\$hostDest)}.
 Gelieve een van de andere herstelopties te kiezen.
-eof
+EOF
 
 # ------------------------------
 $Lang{Option_2__Download_Zip_archive} = <<EOF;
index 3d32dff..26ba1bd 100644 (file)
@@ -711,6 +711,17 @@ sub fileDeltaRxStart
                   . " ($fio->{rxFile}{size} vs $rxSize)")
                         if ( $fio->{logLevel} >= 5 );
     }
+    #
+    # If compression was off and now on, or on and now off, then
+    # don't do an exact match.
+    #
+    if ( defined($fio->{rxLocalAttr})
+           && !$fio->{rxLocalAttr}{compress} != !$fio->{xfer}{compress} ) {
+        $fio->{rxMatchBlk} = undef;     # compression changed, so no file match
+        $fio->log("$fio->{rxFile}{name}: compression changed, so no match"
+              . " ($fio->{rxLocalAttr}{compress} vs $fio->{xfer}{compress})")
+                    if ( $fio->{logLevel} >= 4 );
+    }
     delete($fio->{rxInFd});
     delete($fio->{rxOutFd});
     delete($fio->{rxDigest});
index edc3c43..bd17758 100755 (executable)
--- a/makeDist
+++ b/makeDist
@@ -42,8 +42,8 @@ use Getopt::Std;
 
 umask(0022);
 
-my $Version     = "2.1.0";
-my $ReleaseDate = "20 Jun 2004";
+my $Version     = "2.1.0pl1";
+my $ReleaseDate = "15 Aug 2004";
 my $DistDir     = "dist/BackupPC-$Version";
 
 my @PerlSrc = qw(