* Various changes for 3.0.0beta1 v3_0_0beta1
authorcbarratt <cbarratt>
Fri, 4 Aug 2006 06:54:54 +0000 (06:54 +0000)
committercbarratt <cbarratt>
Fri, 4 Aug 2006 06:54:54 +0000 (06:54 +0000)
* Fixed several Xfer charset conversions.

* Added some CGI utf8 conversions from Rodrigo Real and Vincent
  Fleuranceau.

* Host name is forced to lower case, to match 2.x.

* Fixed LOG file naming in BackupPC_restore and BackupPC_archive.

* GFK applied fr.pm corrections from Nicolas Stransky.

* Updated init.d/src scripts for FHS (ie: replaced __TOPDIR__/log
  with __LOGDIR__ and __TOPDIR__/conf with __CONFDIR__).  Patch
  provided by Rodrigo Real.

* Added --log-dir and --conf-dir options to configure.pl.
  Reported by Vincent Fleuranceau.

* Updated File::RsyncP version check in configure.pl, reported
  by Vincent Fleuranceau.  Changed File::RsyncP version to 0.64.

66 files changed:
ChangeLog
README
bin/BackupPC
bin/BackupPC_archive
bin/BackupPC_archiveHost
bin/BackupPC_attribPrint
bin/BackupPC_compressPool
bin/BackupPC_dump
bin/BackupPC_fixupBackupSummary
bin/BackupPC_link
bin/BackupPC_nightly
bin/BackupPC_restore
bin/BackupPC_sendEmail
bin/BackupPC_serverMesg
bin/BackupPC_tarCreate
bin/BackupPC_tarExtract
bin/BackupPC_tarPCCopy
bin/BackupPC_trashClean
bin/BackupPC_zcat
bin/BackupPC_zipCreate
cgi-bin/BackupPC_Admin
conf/config.pl
configure.pl
doc-src/BackupPC.pod
init.d/src/debian-backuppc
init.d/src/gentoo-backuppc.conf
init.d/src/suse-backuppc
lib/BackupPC/Attrib.pm
lib/BackupPC/CGI/AdminOptions.pm
lib/BackupPC/CGI/Archive.pm
lib/BackupPC/CGI/ArchiveInfo.pm
lib/BackupPC/CGI/Browse.pm
lib/BackupPC/CGI/DirHistory.pm
lib/BackupPC/CGI/EditConfig.pm
lib/BackupPC/CGI/EmailSummary.pm
lib/BackupPC/CGI/GeneralInfo.pm
lib/BackupPC/CGI/HostInfo.pm
lib/BackupPC/CGI/LOGlist.pm
lib/BackupPC/CGI/Lib.pm
lib/BackupPC/CGI/Queue.pm
lib/BackupPC/CGI/RSS.pm
lib/BackupPC/CGI/ReloadServer.pm
lib/BackupPC/CGI/Restore.pm
lib/BackupPC/CGI/RestoreFile.pm
lib/BackupPC/CGI/RestoreInfo.pm
lib/BackupPC/CGI/StartServer.pm
lib/BackupPC/CGI/StartStopBackup.pm
lib/BackupPC/CGI/StopServer.pm
lib/BackupPC/CGI/Summary.pm
lib/BackupPC/CGI/View.pm
lib/BackupPC/Config/Meta.pm
lib/BackupPC/FileZIO.pm
lib/BackupPC/Lib.pm
lib/BackupPC/PoolWrite.pm
lib/BackupPC/Storage.pm
lib/BackupPC/Storage/Text.pm
lib/BackupPC/View.pm
lib/BackupPC/Xfer/Archive.pm
lib/BackupPC/Xfer/BackupPCd.pm
lib/BackupPC/Xfer/Rsync.pm
lib/BackupPC/Xfer/RsyncDigest.pm
lib/BackupPC/Xfer/RsyncFileIO.pm
lib/BackupPC/Xfer/Smb.pm
lib/BackupPC/Xfer/Tar.pm
lib/BackupPC/Zip/FileMember.pm
makeDist

index 54d6619..2873269 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 # Version __VERSION__, __RELEASEDATE__
 #------------------------------------------------------------------------
 
+* Fixed several Xfer charset conversions.
+
+* Added some CGI utf8 conversions from Rodrigo Real and Vincent
+  Fleuranceau.
+
+* Host name is forced to lower case, to match 2.x.
+
+* Fixed LOG file naming in BackupPC_restore and BackupPC_archive.
+
+* GFK applied fr.pm corrections from Nicolas Stransky.
+
+* Updated init.d/src scripts for FHS (ie: replaced __TOPDIR__/log
+  with __LOGDIR__ and __TOPDIR__/conf with __CONFDIR__).  Patch
+  provided by Rodrigo Real.
+
+* Added --log-dir and --conf-dir options to configure.pl.
+  Reported by Vincent Fleuranceau.
+
+* Updated File::RsyncP version check in configure.pl, reported
+  by Vincent Fleuranceau.  Changed File::RsyncP version to 0.64.
+
+#------------------------------------------------------------------------
+# Version 3.0.0beta0, 11 Jul 2006
+#------------------------------------------------------------------------
+
 * Added configuration and host CGI editor.
 
 * Added rsync hardlink support.  Requires latest version of
diff --git a/README b/README
index be5bf1e..80e4b3c 100644 (file)
--- a/README
+++ b/README
@@ -5,7 +5,7 @@
 
                             __RELEASEDATE__
 
-         Copyright (C) 2001-2003 Craig Barratt.  All rights reserved.
+         Copyright (C) 2001-2006 Craig Barratt.  All rights reserved.
 
       This program is free software; you can redistribute it and/or
       modify it under the terms of the GNU General Public License.
@@ -33,13 +33,14 @@ To install BackupPC run these commands as root:
     perl configure.pl
 
 This will automatically determine some system information and prompt you
-for install paths.
+for install paths.  Do "perldoc configure.pl" to see the various options
+that configure.pl provides.
 
 INTRODUCTION:
 ------------
 
-BackupPC is a high-performance, enterprise-grade system for
-backing up Linux and WinXX PCs and laptops to a server's disk.
+BackupPC is a high-performance, enterprise-grade system for backing
+up Linux, WinXX, and MacOS PCs and laptops to a server's disk.
 BackupPC is highly configurable and easy to install and maintain.
 
 Given the ever decreasing cost of disks and raid systems, it is now
index d981c18..3e55f7f 100755 (executable)
@@ -47,7 +47,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 9695906..ad10f1f 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -91,9 +91,30 @@ mkpath($Dir, 0, 0777) if ( !-d $Dir );
 if ( !-f "$Dir/LOCK" ) {
     open(LOCK, ">", "$Dir/LOCK") && close(LOCK);
 }
-open(LOG, ">>", "$Dir/LOG");
-select(LOG); $| = 1; select(STDOUT);
 
+my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+my $logPath = sprintf("$Dir/LOG.%02d%04d", $mon + 1, $year + 1900);
+
+if ( !-f $logPath ) {
+    #
+    # Compress and prune old log files
+    #
+    my $lastLog = $Conf{MaxOldPerPCLogFiles} - 1;
+    foreach my $file ( $bpc->sortedPCLogFiles($client) ) {
+        if ( $lastLog <= 0 ) {
+            unlink($file);
+            next;
+        }
+        $lastLog--;
+        next if ( $file =~ /\.z$/ || !$Conf{CompressLevel} );
+        BackupPC::FileZIO->compressCopy($file,
+                                        "$file.z",
+                                        undef,
+                                        $Conf{CompressLevel}, 1);
+    }
+}
+open(LOG, ">>", $logPath);
+select(LOG); $| = 1; select(STDOUT);
 
 #
 # Read the request file
index ff033bf..84dae6a 100755 (executable)
@@ -38,7 +38,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 8a7d58c..72ea295 100755 (executable)
@@ -31,7 +31,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 8d173e1..83867f0 100755 (executable)
@@ -49,7 +49,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 4472b23..f47b6e3 100755 (executable)
@@ -70,7 +70,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -86,6 +86,7 @@ use BackupPC::Xfer::Smb;
 use BackupPC::Xfer::Tar;
 use BackupPC::Xfer::Rsync;
 use BackupPC::Xfer::BackupPCd;
+use Encode;
 use Socket;
 use File::Path;
 use File::Find;
@@ -581,6 +582,10 @@ $NeedPostCmd = 1;
 for my $shareName ( @$ShareNames ) {
     local(*RH, *WH);
 
+    #
+    # Convert $shareName to utf8 octets
+    #
+    $shareName = encode("utf8", $shareName);
     $stat{xferOK} = $stat{hostAbort} = undef;
     $stat{hostError} = $stat{lastOutputLine} = undef;
     if ( -d "$Dir/new/$shareName" ) {
index 86e5e41..70177d5 100755 (executable)
@@ -30,7 +30,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 20825f2..be888d3 100755 (executable)
@@ -39,7 +39,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 9794b67..2639b41 100755 (executable)
@@ -55,7 +55,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 3f58ca6..8af7550 100755 (executable)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -101,9 +101,30 @@ mkpath($Dir, 0, 0777) if ( !-d $Dir );
 if ( !-f "$Dir/LOCK" ) {
     open(LOCK, ">", "$Dir/LOCK") && close(LOCK);
 }
-open(LOG, ">>", "$Dir/LOG");
-select(LOG); $| = 1; select(STDOUT);
 
+my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+my $logPath = sprintf("$Dir/LOG.%02d%04d", $mon + 1, $year + 1900);
+
+if ( !-f $logPath ) {
+    #
+    # Compress and prune old log files
+    #
+    my $lastLog = $Conf{MaxOldPerPCLogFiles} - 1;
+    foreach my $file ( $bpc->sortedPCLogFiles($client) ) {
+        if ( $lastLog <= 0 ) {
+            unlink($file);
+            next;
+        }
+        $lastLog--;
+        next if ( $file =~ /\.z$/ || !$Conf{CompressLevel} );
+        BackupPC::FileZIO->compressCopy($file,
+                                        "$file.z",
+                                        undef,
+                                        $Conf{CompressLevel}, 1);
+    }
+}
+open(LOG, ">>", $logPath);
+select(LOG); $| = 1; select(STDOUT);
 
 #
 # Read the request file
@@ -196,6 +217,7 @@ my $RestoreLOG = BackupPC::FileZIO->open("$Dir/RestoreLOG$fileExt", 1,
                                      $Conf{CompressLevel});
 my $tarCreateFileCnt = 0;
 my $tarCreateByteCnt = 0;
+my $tarCreateDirCnt  = 0;
 my $tarCreateErrCnt  = 1;      # assume not ok until we learn otherwise
 my $tarCreateErr;
 my($logMsg, $xfer);
@@ -329,10 +351,10 @@ if ( $useTar ) {
             @tarPathOpts,
             @{$RestoreReq{fileList}},
     );
-    my $logMsg = "Running: "
+    my $runMsg = "Running: "
               . $bpc->execCmd2ShellCmd("$BinDir/BackupPC_tarCreate", @tarArgs)
               . "\n";
-    $RestoreLOG->write(\$logMsg);
+    $RestoreLOG->write(\$runMsg);
     if ( !defined($tarPid = open(TAR, "-|")) ) {
        close(WH);
        # FIX: need to cleanup xfer
@@ -402,6 +424,7 @@ if ( $useTar ) {
            if ( /^Done: (\d+) files, (\d+) bytes, (\d+) dirs, (\d+) specials, (\d+) errors/ ) {
                $tarCreateFileCnt = $1;
                $tarCreateByteCnt = $2;
+               $tarCreateDirCnt  = $3;
                $tarCreateErrCnt  = $5;
            }
        }
@@ -426,7 +449,7 @@ if ( $useTar ) {
     #
     # otherwise the xfer module does everything for us
     #
-    print(LOG $bpc->timeStamp, "Starting restore\n");
+    print(LOG $bpc->timeStamp, $logMsg . "\n");
     print("started_restore\n");
     ($tarCreateFileCnt, $tarCreateByteCnt,
        $tarCreateErrCnt, $tarCreateErr) = $xfer->run();
@@ -573,7 +596,7 @@ sub RestoreCleanup
        if ( $stat{hostAbort} && $stat{hostError} eq "" ) {
            $stat{hostError} = "lost network connection during restore";
        }
-       $RestoreLOG->write(\"Restore failed: $stat{hostError}\n")
+       $RestoreLOG->write(\"restore failed: $stat{hostError}\n")
                                            if ( defined($RestoreLOG) );
     }
 
@@ -604,10 +627,14 @@ sub RestoreCleanup
     $bpc->RestoreInfoWrite($client, @Restores);
 
     if ( !$stat{xferOK} ) {
-       print(LOG $bpc->timeStamp, "Restore failed ($stat{hostError})\n");
+       print(LOG $bpc->timeStamp, "restore failed ($stat{hostError})\n");
        print("restore failed: $stat{hostError}\n");
        return 1;
     } else {
+        $stat{xferErrCnt} ||= 0;
+       print(LOG $bpc->timeStamp, "restore $lastNum complete"
+                . " ($tarCreateFileCnt files, $tarCreateByteCnt bytes,"
+                . " $tarCreateDirCnt dirs, $stat{xferErrCnt} xferErrs)\n");
        print("restore complete\n");
        return;
     }
index 33824e2..4b8d652 100755 (executable)
@@ -31,7 +31,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 3a9f512..332afc8 100755 (executable)
@@ -43,7 +43,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index d0f4fe7..4eeabfa 100755 (executable)
@@ -53,7 +53,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -131,8 +131,7 @@ $Charset = $opts{e} if ( $opts{e} ne "" );
 
 my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
 my $PathAdd    = $1 if ( $opts{p} =~ /(.+)/ );
-if ( ($opts{s} !~ /^([\w\s.@\/$(){}[\]-]+)$/
-        || $opts{s} =~ m{(^|/)\.\.(/|$)}) && $opts{s} ne "*" ) {
+if ( $opts{s} =~ m{(^|/)\.\.(/|$)} ) {
     print(STDERR "$0: bad share name '$opts{s}'\n");
     exit(1);
 }
index 0ab4b99..2f57fe6 100755 (executable)
@@ -27,7 +27,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -59,11 +59,11 @@ if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) {
     exit(1);
 }
 my $client = $1;
-if ( $ARGV[1] !~ /^([\w\s.\/$(){}[\]-]+)$/ ) {
+if ( $ARGV[1] =~ m{(^|/)\.\.(/|$)} ) {
     print("$0: bad share name '$ARGV[1]'\n");
     exit(1);
 }
-my $ShareNameUM = $1;
+my $ShareNameUM = $1 if ( $ARGV[1] =~ /(.*)/ );
 my $ShareName = $bpc->fileNameEltMangle($ShareNameUM);
 if ( $ARGV[2] !~ /^(\d+)$/ ) {
     print("$0: bad compress level '$ARGV[2]'\n");
index 8c6ff2e..e9477a8 100755 (executable)
@@ -36,7 +36,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index e74792f..d5a58d4 100755 (executable)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index c316f93..59dff2a 100755 (executable)
@@ -32,7 +32,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index adcb709..46731d8 100755 (executable)
@@ -52,7 +52,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -142,8 +142,7 @@ $Charset = $opts{e} if ( $opts{e} ne "" );
 
 my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
 my $PathAdd    = $1 if ( $opts{p} =~ /(.+)/ );
-if ( $opts{s} !~ /^([\w\s.@\/$(){}[\]-]+)$/
-        || $opts{s} =~ m{(^|/)\.\.(/|$)} ) {
+if ( $opts{s} =~ m{(^|/)\.\.(/|$)} ) {
     print(STDERR "$0: bad share name '$opts{s}'\n");
     exit(1);
 }
index 082b91e..e099be4 100755 (executable)
@@ -39,7 +39,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 62c301a..46fd26f 100644 (file)
@@ -843,12 +843,32 @@ $Conf{XferLogLevel} = 1;
 #
 # Filename charset encoding on the client.  BackupPC uses utf8
 # on the server for filename encoding.  If this is empty, then
-# utf8 is assumed and client filenames will not be modified.  If set
-# to a different encoding then filenames will be re-encoded in utf8.
-# A typical WinXX encoding for latin1/western europe is 'cp1252'.
+# utf8 is assumed and client filenames will not be modified.
+# If set to a different encoding then filenames will converted
+# to/from utf8 automatically during backup and restore.
+#
+# If the file names displayed in the browser (eg: accents or special
+# characters) don't look right then it is likely you haven't set
+# $Conf{ClientCharset} correctly.
+#
+# If you are using smbclient on a WinXX machine, smbclient will convert
+# to the "unix charset" setting in smb.conf.  The default is utf8,
+# in which case leave $Conf{ClientCharset} empty since smbclient does
+# the right conversion.
+#
+# If you are using rsync on a WinXX machine then it does no conversion.
+# A typical WinXX encoding for latin1/western europe is 'cp1252',
+# so in this case set $Conf{ClientCharset} to 'cp1252'.
+#
+# On a linux or unix client, run "locale charmap" to see the client's
+# charset.  Set $Conf{ClientCharset} to this value.  A typical value
+# for english/US is 'ISO-8859-1'.
+#
 # Do "perldoc Encode::Supported" to see the list of possible charset
-# values, and also see http://czyborra.com/charsets/iso8859.html.
-#   
+# values.  The FAQ at http://www.cl.cam.ac.uk/~mgk25/unicode.html
+# is excellent, and http://czyborra.com/charsets/iso8859.html
+# provides more information on the iso-8859 charsets.
+#
 $Conf{ClientCharset} = '';
 
 #
index f2a475b..433a016 100755 (executable)
@@ -87,6 +87,7 @@ if ( !GetOptions(
             "cgi-dir=s",
             "compress-level=i",
             "config-path=s",
+            "config-dir=s",
             "data-dir=s",
             "dest-dir=s",
             "fhs!",
@@ -95,6 +96,7 @@ if ( !GetOptions(
             "html-dir=s",
             "html-dir-url=s",
             "install-dir=s",
+            "log-dir=s",
             "man",
             "set-perms!",
             "uid-ignore!",
@@ -105,6 +107,7 @@ pod2usage(1) if ( $opts{help} );
 pod2usage(-exitstatus => 0, -verbose => 2) if $opts{man};
 
 my $DestDir = $opts{"dest-dir"};
+$DestDir = "" if ( $DestDir eq "/" );
 
 if ( !$opts{"uid-ignore"} && $< != 0 ) {
     print <<EOF;
@@ -549,12 +552,12 @@ foreach my $dir ( (
             "$Conf{ConfDir}",
             "$Conf{LogDir}",
         ) ) {
-    mkpath("$DestDir/$dir", 0, 0750) if ( !-d "$DestDir/$dir" );
-    if ( !-d "$DestDir/$dir"
-            || !my_chown($Uid, $Gid, "$DestDir/$dir") ) {
-        die("Failed to create or chown $DestDir/$dir\n");
+    mkpath("$DestDir$dir", 0, 0750) if ( !-d "$DestDir$dir" );
+    if ( !-d "$DestDir$dir"
+            || !my_chown($Uid, $Gid, "$DestDir$dir") ) {
+        die("Failed to create or chown $DestDir$dir\n");
     } else {
-        print("Created $DestDir/$dir\n");
+        print("Created $DestDir$dir\n");
     }
 }
 
@@ -859,9 +862,9 @@ EOF
 }
 
 eval "use File::RsyncP;";
-if ( !$@ && $File::RsyncP::VERSION < 0.52 ) {
+if ( !$@ && $File::RsyncP::VERSION < 0.64 ) {
     print("\nWarning: you need to upgrade File::RsyncP;"
-        . " I found $File::RsyncP::VERSION and BackupPC needs 0.52\n");
+        . " I found $File::RsyncP::VERSION and BackupPC needs 0.64\n");
 }
 
 exit(0);
index ef4b9e4..0200209 100644 (file)
@@ -784,24 +784,19 @@ Here are some brief client setup notes:
 
 =item WinXX
 
-The preferred setup for WinXX clients is to set $Conf{XferMethod} to "smb".
-(Actually, for v2.0.0, rsyncd is the better method for WinXX if you are
-prepared to run rsync/cygwin on your WinXX client.  More information
-about this will be provided via the FAQ.)
+One setup for WinXX clients is to set $Conf{XferMethod} to "smb".
+Actually, rsyncd is the better method for WinXX if you are prepared to
+run rsync/cygwin on your WinXX client.
 
 If you want to use rsyncd for WinXX clients you can find a pre-packaged
 zip file on L<http://backuppc.sourceforge.net>. The package is called
 cygwin-rsync. It contains rsync.exe, template setup files and the
 minimal set of cygwin libraries for everything to run.  The README file
 contains instructions for running rsync as a service, so it starts
-automatically everytime you boot your machine.
-
-If you build your own rsync, for rsync 2.6.2 it is strongly
-recommended you apply the patch in the cygwin-rsync package on
-L<http://backuppc.sourceforge.net>.  This patch adds the --checksum-seed
-option for checksum caching, and also sends all errors to the client,
-which is important so BackupPC can log all file access errors.
-
+automatically everytime you boot your machine.  If you use rsync
+to backup WinXX machines, be sure to set $Conf{ClientCharset}
+correctly (eg: 'cp1252') so that the WinXX file name encoding is
+correctly converted to utf8.
 
 Otherwise, to use SMB, you can either create shares for the data you want
 to backup or your can use the existing C$ share.  To create a new 
@@ -885,23 +880,16 @@ ksmbfs or similar) on your linux/unix server to mount the share,
 and then set $Conf{XferMethod} to "tar" (use tar on the network
 mounted file system).
 
-Also, to make sure that file names with 8-bit characters are correctly
-transferred by smbclient you should add this to samba's smb.conf file
-for samba 2.x:
-
-    [global]
-       # Accept the windows charset
-       client code page = 850
-       character set = ISO8859-1
-
-For samba 3.x this should instead be:
+Also, to make sure that file names with special characters are correctly
+transferred by smbclient you should make sure that the smb.conf file
+has (for samba 3.x):
 
     [global]
-       unix charset = ISO8859-1
+       unix charset = UTF8
 
-This setting should work for western europe.  
-See L<http://www.oreilly.com/catalog/samba/chapter/book/ch08_03.html>
-for more information about settings for other languages.
+UTF8 is the default setting, so if the parameter is missing then it
+is ok.  With this setting $Conf{ClientCharset} should be emtpy,
+since smbclient has already converted the file names to utf8.
 
 =item Linux/Unix
 
@@ -961,6 +949,10 @@ See the rsyncd.conf manual page for more information.
 
 =back
 
+You need to set $Conf{ClientCharset} to the client's charset so that
+file names are correctly converted to utf8.  Use "locale charmap"
+on the client to see its charset.
+
 For linux/unix machines you should not backup "/proc".  This directory
 contains a variety of files that look like regular files but they are
 special files that don't need to be backed up (eg: /proc/kcore is a
index f1274c4..f97eb2c 100755 (executable)
@@ -12,6 +12,7 @@ set -e
 #
 BINDIR=__INSTALLDIR__/bin
 DATADIR=__TOPDIR__
+LOGDIR=__LOGDIR__
 USER=__BACKUPPCUSER__
 #
 NAME=backuppc
@@ -22,27 +23,27 @@ test -x $BINDIR/$DAEMON || exit 0
 case "$1" in
   start)
     echo -n "Starting $NAME: "
-    start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
+    start-stop-daemon --start --pidfile $LOGDIR/BackupPC.pid \
                            -c $USER --exec $BINDIR/$DAEMON -- -d
     echo "ok."
     ;;
   stop)
     echo -n "Stopping $NAME: "
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid -u $USER \
                            --oknodo --retry 30 -x /usr/bin/perl
     echo "ok."
       ;;
   restart)
     echo -n "Restarting $NAME: "
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid -u $USER \
                            --oknodo --retry 30 -x /usr/bin/perl
-    start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
+    start-stop-daemon --start --pidfile $LOGDIR/BackupPC.pid \
                            -c $USER --exec $BINDIR/$DAEMON -- -d
     echo "ok."
     ;;
   reload|force-reload)
     echo "Reloading $NAME configuration files"
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid \
                            --signal 1 -x /usr/bin/perl
     ;;
   *)
index f53890c..2350eb5 100644 (file)
@@ -1,6 +1,5 @@
-CONF_FILE=__TOPDIR__/conf/config.pl
+CONF_FILE=__CONFDIR__/config.pl
 USER=__BACKUPPCUSER__
-PID_FILE=__TOPDIR__/log/BackupPC.pid
+PID_FILE=__LOGDIR__/BackupPC.pid
 EXEC=__INSTALLDIR__/bin/BackupPC
 EXEC_OPTIONS=-d
-
index 00049cc..52a489d 100755 (executable)
@@ -12,6 +12,7 @@ set -e
 #
 BINDIR=__INSTALLDIR__/bin
 DATADIR=__TOPDIR__
+LOGDIR=__LOGDIR__
 USER=__BACKUPPCUSER__
 #
 NAME=backuppc
@@ -22,27 +23,27 @@ test -x $BINDIR/$DAEMON || exit 0
 case "$1" in
   start)
     echo -n "Starting $NAME: "
-    startproc -f  -p $DATADIR/log/BackupPC.pid -u $USER $BINDIR/$DAEMON -d 
+    startproc -f  -p $LOGDIR/BackupPC.pid -u $USER $BINDIR/$DAEMON -d 
     echo "ok."
     ;;
   stop)
     echo -n "Stopping $NAME: "
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid -u $USER \
                            --oknodo 
     echo "ok."
       ;;
   restart)
     echo -n "Stopping $NAME: "
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid -u $USER \
                            --oknodo 
     echo "ok."
     echo -n "Starting $NAME: "
-    startproc -f  -p $DATADIR/log/BackupPC.pid -u $USER $BINDIR/$DAEMON -d 
+    startproc -f  -p $LOGDIR/BackupPC.pid -u $USER $BINDIR/$DAEMON -d 
     echo "ok."
     ;;
   reload|force-reload)
     echo "Reloading $NAME configuration files"
-    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid \
+    start-stop-daemon --stop --pidfile $LOGDIR/BackupPC.pid \
                            --signal 1 -x /usr/bin/perl
     ;;
   *)
index c90f16f..fb904b5 100644 (file)
@@ -30,7 +30,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index f425f56..b7da86a 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 8041617..d11b3f3 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 8538528..dc0675a 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index ab3b13a..e327b05 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -107,6 +107,7 @@ sub action
 
        $attr = $view->dirAttrib($num, $share, $relDir);
         if ( !defined($attr) ) {
+            $relDir = decode_utf8($relDir);
             ErrorExit(eval("qq{$Lang->{Can_t_browse_bad_directory_name2}}"));
         }
 
@@ -254,11 +255,10 @@ EOF
        }
     }
     $share = $currDir;
-    my $dirDisplay = "$share/$dir";
+    my $dirDisplay = decode_utf8("$share/$dir");
     $dirDisplay =~ s{//+}{/}g;
     $dirDisplay =~ s{/+$}{}g;
     $dirDisplay = "/" if ( $dirDisplay eq "" );
-    $dirDisplay = decode_utf8($dirDisplay);
     my $filledBackup;
 
     if ( (my @mergeNums = @{$view->mergeNums}) > 1 ) {
@@ -301,6 +301,7 @@ EOF
         }
         $filledBackup .= eval("qq{$Lang->{Visit_this_directory_in_backup}}");
     }
+    $dir = decode_utf8($dir);
     my $content = eval("qq{$Lang->{Backup_browse_for__host}}");
     Header(eval("qq{$Lang->{Browse_backup__num_for__host}}"), $content);
     Trailer();
index dfcac68..6fb0366 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -40,6 +40,7 @@ use strict;
 use BackupPC::CGI::Lib qw(:all);
 use BackupPC::View;
 use BackupPC::Attrib qw(:all);
+use Encode;
 
 sub action
 {
@@ -85,6 +86,7 @@ sub action
        my %inode2name;
        my $nameCnt = 0;
        (my $fDisp  = "${EscHTML($f)}") =~ s/ /&nbsp;/g;
+        $fDisp      = decode_utf8($fDisp);
        $fileStr   .= "<tr><td align=\"left\"  class=\"histView\">$fDisp</td>";
        my($colSpan, $url, $inode, $type);
        my $tdClass = ' class="histView"';
@@ -162,7 +164,7 @@ EOF
        $fileStr .= "</tr>\n";
     }
 
-    my $dirDisplay = "$share/$dir";
+    my $dirDisplay = decode_utf8("$share/$dir");
     $dirDisplay =~ s{//+}{/}g;
     $dirDisplay =~ s{/+$}{}g;
     $dirDisplay = "/" if ( $dirDisplay eq "" );
index a5740e4..3504bc1 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -1130,7 +1130,7 @@ EOF
         if ( !$type->{noKeyEdit} ) {
             $content .= <<EOF;
 <tr><td class="border" colspan="2">
-$Lang->{CfgEdit_Button_New_Key}: <input type="text" name="addVarKey_$varName" size="20" maxlength="256" value="">
+$Lang->{CfgEdit_Button_New_Key}: <input type="text" class="editTextInput" name="addVarKey_$varName" size="20" maxlength="256" value="">
 <input type="button" name="add_$varName" value="${EscHTML($Lang->{CfgEdit_Button_Add})}" onClick="addSubmit('$varName', 1)">
 </td></tr>
 EOF
index 1b0fcf5..f36c806 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 927b97d..99a3afc 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 583afa0..730d644 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index a728c01..0cd27b2 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 502a83c..c776d3f 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index b516acd..4223d8f 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 61eeee4..b5d9ab1 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 5e5dc2a..e644611 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 1f8a900..9f5cb05 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -112,6 +112,7 @@ EOF
         #
         # Tell the user what options they have
         #
+        $pathHdr = decode_utf8($pathHdr);
        $content .= eval("qq{$Lang->{Restore_Options_for__host2}}");
 
         if ( @hosts == 1 ) {
@@ -271,6 +272,8 @@ EOF
 <tr><td>$host:/$strippedShare$f</td><td>$In{hostDest}:/$strippedShareDest$targetFile</td></tr>
 EOF
         }
+        $In{shareDest} = decode_utf8($In{shareDest});
+        $In{pathHdr}   = decode_utf8($In{pathHdr});
         my $content = eval("qq{$Lang->{Are_you_sure}}");
         Header(eval("qq{$Lang->{Restore_Confirm_on__host}}"), $content);
         Trailer();
index dfce7ef..e0fbe67 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
 package BackupPC::CGI::RestoreFile;
 
 use strict;
+use Encode;
 use BackupPC::CGI::Lib qw(:all);
 use BackupPC::FileZIO;
 use BackupPC::Attrib qw(:all);
 use BackupPC::View;
 
+
 sub action
 {
     restoreFile($In{host}, $In{num}, $In{share}, $In{dir});
@@ -150,7 +152,8 @@ sub restoreFile
     my $view = BackupPC::View->new($bpc, $host, \@Backups);
     my $a = $view->fileAttrib($num, $share, $dir);
     if ( $dir =~ m{(^|/)\.\.(/|$)} || !defined($a) ) {
-        ErrorExit("Can't restore bad file ${EscHTML($dir)} ($num, $share, $dir)");
+        $dir = decode_utf8($dir);
+        ErrorExit("Can't restore bad file ${EscHTML($dir)} ($num, $share)");
     }
     my $f = BackupPC::FileZIO->open($a->{fullPath}, 0, $a->{compress});
     my $data;
index b092563..5b222f0 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 2fe216d..dd643cc 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 80f2df1..07b6456 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index b828c50..1baa907 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index c61538c..bd7f52e 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 4676684..0f5ab98 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 137f957..fb134b9 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index ccf3dc0..016b513 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -248,7 +248,11 @@ sub readLine
         }
     }
     $str = shift(@{$self->{readLineBuf}}) . "\n";
-    $str = decode_utf8($str) if ( $self->{utf8} );
+    if ( $self->{utf8} ) {
+        my $strUtf8 = decode_utf8($str, 0);
+        $strUtf8 = $str if ( length($strUtf8) == 0 );
+        return $strUtf8;
+    }
     return $str;
 }
 
index 960c222..12cb6e1 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -94,7 +94,7 @@ sub new
 
     my $bpc = bless {
        %$paths,
-        Version => '3.0.0beta0',
+        Version => '3.0.0beta1',
     }, $class;
 
     $bpc->{storage} = BackupPC::Storage->new($paths);
index c17cbee..cd6cf0f 100644 (file)
@@ -56,7 +56,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 7c6a0e1..569ba36 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 4f63417..72b2fba 100644 (file)
@@ -30,7 +30,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -451,12 +451,12 @@ sub HostInfoRead
         if ( @hdr ) {
             if ( defined($host) ) {
                 next if ( lc($fld[0]) ne lc($host) );
-                @{$hosts{$fld[0]}}{@hdr} = @fld;
+                @{$hosts{lc($fld[0])}}{@hdr} = @fld;
                close(HOST_INFO);
                 close(LOCK);
                 return \%hosts;
             } else {
-                @{$hosts{$fld[0]}}{@hdr} = @fld;
+                @{$hosts{lc($fld[0])}}{@hdr} = @fld;
             }
         } else {
             @hdr = @fld;
index d879de2..f550b00 100644 (file)
@@ -31,7 +31,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -140,7 +140,7 @@ sub dirCache
            }
        }
         foreach my $file ( @dir ) {
-            $file = $1 if ( $file =~ /(.*)/ );
+            $file = $1 if ( $file =~ /(.*)/s );
             my $fileUM = $file;
             $fileUM = $m->{bpc}->fileNameUnmangle($fileUM) if ( $mangle );
             #print(STDERR "Doing $fileUM\n");
@@ -249,7 +249,7 @@ sub shareList
     my @dir = readdir(DIR);
     closedir(DIR);
     foreach my $file ( @dir ) {
-        $file = $1 if ( $file =~ /(.*)/ );
+        $file = $1 if ( $file =~ /(.*)/s );
         next if ( $file eq "attrib" && $mangle
                || $file eq "."
                || $file eq ".."
@@ -289,7 +289,7 @@ sub fileAttrib
     my($m, $backupNum, $share, $path) = @_;
 
     #print(STDERR "fileAttrib($backupNum, $share, $path)\n");
-    if ( $path =~ s{(.*)/+(.+)}{$1} ) {
+    if ( $path =~ s{(.*)/+(.+)}{$1}s ) {
         my $file = $2;
         $m->dirCache($backupNum, $share, $path);
         return $m->{files}{$file};
@@ -401,7 +401,7 @@ sub dirHistory
            }
        }
         foreach my $file ( @dir ) {
-            $file = $1 if ( $file =~ /(.*)/ );
+            $file = $1 if ( $file =~ /(.*)/s );
             my $fileUM = $file;
             $fileUM = $m->{bpc}->fileNameUnmangle($fileUM) if ( $mangle );
             #print(STDERR "Doing $fileUM\n");
index 9da8e43..cd10031 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 7763ad7..76fa0be 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 20e8b67..074d845 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -40,6 +40,7 @@ package BackupPC::Xfer::Rsync;
 use strict;
 use BackupPC::View;
 use BackupPC::Xfer::RsyncFileIO;
+use Encode qw/from_to encode/;
 
 use vars qw( $RsyncLibOK $RsyncLibErr );
 
@@ -55,10 +56,10 @@ BEGIN {
        #
        # Note: also update configure.pl when this version number is changed!
        #
-        if ( $File::RsyncP::VERSION < 0.62 ) {
+        if ( $File::RsyncP::VERSION < 0.64 ) {
             $RsyncLibOK = 0;
             $RsyncLibErr = "File::RsyncP module version"
-                         . " ($File::RsyncP::VERSION) too old: need 0.62";
+                         . " ($File::RsyncP::VERSION) too old: need 0.64";
         } else {
             $RsyncLibOK = 1;
         }
@@ -130,6 +131,8 @@ sub start
        $rsyncArgs = $conf->{RsyncRestoreArgs};
        my $remoteDir = "$t->{shareName}/$t->{pathHdrDest}";
        $remoteDir    =~ s{//+}{/}g;
+        from_to($remoteDir, "utf8", $conf->{ClientCharset})
+                                    if ( $conf->{ClientCharset} ne "" );
         $argList = ['--server', @$rsyncArgs, '.', $remoteDir];
        $fioArgs = {
            client   => $t->{bkupSrcHost},
@@ -197,9 +200,13 @@ sub start
                 }
             }
             foreach my $file ( @inc ) {
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, "--include=$file");
             }
             foreach my $file ( @exc ) {
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, "--exclude=$file");
             }
         }
@@ -209,6 +216,8 @@ sub start
                 #
                 # just append additional exclude lists onto the end
                 #
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, "--exclude=$file");
             }
         }
@@ -241,8 +250,11 @@ sub start
         $rsyncArgs = [@$rsyncArgs, "--ignore-times"]
                                     if ( $t->{type} eq "full" );
        $rsyncClientCmd = $conf->{RsyncClientCmd};
+        my $shareNameSlash = $t->{shareNameSlash};
+        from_to($shareNameSlash, "utf8", $conf->{ClientCharset})
+                            if ( $conf->{ClientCharset} ne "" );
         $argList = ['--server', '--sender', @$rsyncArgs,
-                              '.', $t->{shareNameSlash}];
+                              '.', $shareNameSlash];
        eval {
            $argList = File::RsyncP->excludeStrip($argList);
        };
@@ -267,6 +279,10 @@ sub start
        sshPath   => $conf->{SshPath},
        argList   => $argList,
     };
+    from_to($args->{shareName}, "utf8", $conf->{ClientCharset})
+                            if ( $conf->{ClientCharset} ne "" );
+    from_to($args->{shareNameSlash}, "utf8", $conf->{ClientCharset})
+                            if ( $conf->{ClientCharset} ne "" );
     $rsyncClientCmd = $bpc->cmdVarSubstitute($rsyncClientCmd, $args);
 
     #
@@ -351,6 +367,11 @@ sub run
        $remoteDir       = $t->{shareNameSlash};
        $remoteDirDaemon = ".";
     }
+    from_to($remoteDir, "utf8", $conf->{ClientCharset})
+                                if ( $conf->{ClientCharset} ne "" );
+    from_to($remoteDirDaemon, "utf8", $conf->{ClientCharset})
+                                if ( $conf->{ClientCharset} ne "" );
+
     if ( $t->{XferMethod} eq "rsync" ) {
        #
        # Run rsync command
@@ -358,6 +379,8 @@ sub run
        my $str = "Running: "
                . $t->{bpc}->execCmd2ShellCmd(@{$t->{rsyncClientCmd}})
                . "\n";
+        from_to($str, $conf->{ClientCharset}, "utf8")
+                                if ( $conf->{ClientCharset} ne "" );
        $t->{XferLOG}->write(\$str);
        $rs->remoteStart($remoteSend, $remoteDir);
     } else {
@@ -378,6 +401,8 @@ sub run
        #
        my $module = $t->{shareName};
        $module = $t->{shareNameSlash} if ( $module =~ /\// );
+        from_to($module, "utf8", $conf->{ClientCharset})
+                                    if ( $conf->{ClientCharset} ne "" );
        if ( defined(my $err = $rs->serverService($module,
                                              $conf->{RsyncdUserName},
                                              $conf->{RsyncdPasswd},
@@ -390,7 +415,10 @@ sub run
        }
        $rs->serverStart($remoteSend, $remoteDirDaemon);
     }
-    my $error = $rs->go($t->{shareNameSlash});
+    my $shareNameSlash = $t->{shareNameSlash};
+    from_to($shareNameSlash, "utf8", $conf->{ClientCharset})
+                                if ( $conf->{ClientCharset} ne "" );
+    my $error = $rs->go($shareNameSlash);
     $rs->serverClose();
 
     #
index 8846340..2a1611c 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index ea72dce..1c89ab9 100644 (file)
@@ -12,7 +12,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -328,7 +328,7 @@ sub attribGetWhere
     $fname = "$fio->{xfer}{pathHdrSrc}/$fname"
                       if ( defined($fio->{xfer}{pathHdrSrc}) );
     $fname =~ s{//+}{/}g;
-    if ( $fname =~ m{(.*)/(.*)} ) {
+    if ( $fname =~ m{(.*)/(.*)}s ) {
        $shareM = $fio->{shareM};
        $dir = $1;
        $fname = $2;
@@ -437,7 +437,7 @@ sub attribSet
     my($fio, $f, $placeHolder) = @_;
     my($dir, $file);
 
-    if ( $f->{name} =~ m{(.*)/(.*)} ) {
+    if ( $f->{name} =~ m{(.*)/(.*)}s ) {
        $file = $2;
        $dir  = "$fio->{shareM}/" . $1;
     } elsif ( $f->{name} eq "." ) {
@@ -517,7 +517,7 @@ sub attribWrite
        my $dir;
        my $share;
 
-       $dir = $1 if ( $d =~ m{.+?/(.*)} );
+       $dir = $1 if ( $d =~ m{.+?/(.*)}s );
        $fio->viewCacheDir(undef, $dir);
        ##print("attribWrite $d,$dir\n");
        ##$Data::Dumper::Indent = 1;
@@ -529,7 +529,7 @@ sub attribWrite
        if ( defined($fio->{viewCache}{$d}) ) {
            foreach my $f ( keys(%{$fio->{viewCache}{$d}}) ) {
                my $name = $f;
-               $name = "$1/$name" if ( $d =~ m{.*?/(.*)} );
+               $name = "$1/$name" if ( $d =~ m{.*?/(.*)}s );
                if ( defined(my $a = $fio->{attrib}{$d}->get($f)) ) {
                    #
                    # delete temporary attributes (skipped files)
@@ -565,7 +565,7 @@ sub attribWrite
        my $dirM = $d;
 
        $dirM = $1 . "/" . $fio->{bpc}->fileNameMangle($2)
-                       if ( $dirM =~ m{(.*?)/(.*)} );
+                       if ( $dirM =~ m{(.*?)/(.*)}s );
         my $fileName = $fio->{attrib}{$d}->fileName("$fio->{outDir}$dirM");
        $fio->log("attribWrite(dir=$d) -> $fileName")
                                if ( $fio->{logLevel} >= 4 );
@@ -615,7 +615,7 @@ sub statsGet
 sub makePath
 {
     my($fio, $f) = @_;
-    my $name = $1 if ( $f->{name} =~ /(.*)/ );
+    my $name = $1 if ( $f->{name} =~ /(.*)/s );
     my $path;
 
     if ( $name eq "." ) {
@@ -625,7 +625,7 @@ sub makePath
     }
     $fio->logFileAction("create", $f) if ( $fio->{logLevel} >= 1 );
     $fio->log("makePath($path, 0777)") if ( $fio->{logLevel} >= 5 );
-    $path = $1 if ( $path =~ /(.*)/ );
+    $path = $1 if ( $path =~ /(.*)/s );
     File::Path::mkpath($path, 0, 0777) if ( !-d $path );
     return $fio->attribSet($f) if ( -d $path );
     $fio->log("Can't create directory $path");
@@ -639,7 +639,7 @@ sub makePath
 sub makeSpecial
 {
     my($fio, $f) = @_;
-    my $name = $1 if ( $f->{name} =~ /(.*)/ );
+    my $name = $1 if ( $f->{name} =~ /(.*)/s );
     my $fNameM = $fio->{bpc}->fileNameMangle($name);
     my $path = $fio->{outDirSh} . $fNameM;
     my $attr = $fio->attribGet($f);
@@ -912,7 +912,7 @@ sub fileDeltaRxNext
         # need to open an output file where we will build the
         # new version.
         #
-        $fio->{rxFile}{name} =~ /(.*)/;
+        $fio->{rxFile}{name} =~ /(.*)/s;
        my $rxOutFileRel = "$fio->{shareM}/" . $fio->{bpc}->fileNameMangle($1);
         my $rxOutFile    = $fio->{outDir} . $rxOutFileRel;
         $fio->{rxOutFd}  = BackupPC::PoolWrite->new($fio->{bpc},
@@ -1079,7 +1079,7 @@ sub fileDeltaRxNext
 sub fileDeltaRxDone
 {
     my($fio, $md4, $phase) = @_;
-    my $name = $1 if ( $fio->{rxFile}{name} =~ /(.*)/ );
+    my $name = $1 if ( $fio->{rxFile}{name} =~ /(.*)/s );
     my $ret;
 
     close($fio->{rxInFd})  if ( defined($fio->{rxInFd}) );
@@ -1358,7 +1358,7 @@ sub fileListEltSend
                             if ( $fio->{clientCharset} ne "" );
     $fList->encode($f);
 
-    $logName = "$fio->{xfer}{pathHdrDest}/$f->{name}";
+    $logName = "$fio->{xfer}{pathHdrDest}/$logName";
     $logName =~ s{//+}{/}g;
     $f->{name} = $logName;
     $fio->logFileAction("restore", $f) if ( $fio->{logLevel} >= 1 );
index c9242f4..03c983c 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -38,6 +38,7 @@
 package BackupPC::Xfer::Smb;
 
 use strict;
+use Encode qw/from_to encode/;
 
 sub new
 {
@@ -111,12 +112,16 @@ sub start
        $t->{fileIncludeHash} = {};
         if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) {
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                push(@fileList, $file);
                $t->{fileIncludeHash}{$file} = 1;
             }
         } elsif ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} )
             {
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                push(@fileList, $file);
             }
            #
@@ -151,6 +156,8 @@ sub start
        X_option      => $X_option,
        timeStampFile => $timeStampFile,
     };
+    from_to($args->{shareName}, "utf8", $conf->{ClientCharset})
+                            if ( $conf->{ClientCharset} ne "" );
     $smbClientCmd = $bpc->cmdVarSubstitute($smbClientCmd, $args);
 
     if ( !defined($t->{xferPid} = open(SMB, "-|")) ) {
@@ -193,6 +200,8 @@ sub start
         return;
     }
     my $str = "Running: " . $bpc->execCmd2ShellCmd(@$smbClientCmd) . "\n";
+    from_to($str, $conf->{ClientCharset}, "utf8")
+                            if ( $conf->{ClientCharset} ne "" );
     $t->{XferLOG}->write(\$str);
     alarm($conf->{ClientTimeout});
     $t->{_errStr} = undef;
@@ -229,6 +238,9 @@ sub readOutput
         #
         alarm($conf->{ClientTimeout}) if ( !$t->{abort} );
         $t->{lastOutputLine} = $_ if ( !/^$/ );
+
+        from_to($_, $conf->{ClientCharset}, "utf8")
+                            if ( $conf->{ClientCharset} ne "" );
         #
         # This section is highly dependent on the version of smbclient.
         # If you upgrade Samba, make sure that these regexp are still valid.
index c78ff53..004808d 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -38,6 +38,7 @@
 package BackupPC::Xfer::Tar;
 
 use strict;
+use Encode qw/from_to encode/;
 
 sub new
 {
@@ -100,13 +101,19 @@ sub start
         if ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} )
             {
-               $file = ".$file" if ( $file =~ /^\// );
+                $file = $2 if ( $file =~ m{^(\./+|/+)(.*)}s );
+               $file = "./$file";
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, "--exclude=$file");
             }
         }
         if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) {
-               $file = ".$file" if ( $file =~ /^\// );
+                $file = $2 if ( $file =~ m{^(\./+|/+)(.*)}s );
+               $file = "./$file";
+                $file = encode($conf->{ClientCharset}, $file)
+                            if ( $conf->{ClientCharset} ne "" );
                 push(@fileList, $file);
             }
         } else {
@@ -143,6 +150,8 @@ sub start
         tarPath   => $conf->{TarClientPath},
         sshPath   => $conf->{SshPath},
     };
+    from_to($args->{shareName}, "utf8", $conf->{ClientCharset})
+                            if ( $conf->{ClientCharset} ne "" );
     $tarClientCmd = $bpc->cmdVarSubstitute($tarClientCmd, $args);
     if ( !defined($t->{xferPid} = open(TAR, "-|")) ) {
         $t->{_errStr} = "Can't fork to run tar";
@@ -184,6 +193,8 @@ sub start
         return;
     }
     my $str = "Running: " . $bpc->execCmd2ShellCmd(@$tarClientCmd) . "\n";
+    from_to($str, $conf->{ClientCharset}, "utf8")
+                            if ( $conf->{ClientCharset} ne "" );
     $t->{XferLOG}->write(\"Running: @$tarClientCmd\n");
     alarm($conf->{ClientTimeout});
     $t->{_errStr} = undef;
@@ -207,9 +218,12 @@ sub readOutput
             $t->{tarOut} .= $mesg;
         }
     }
+    my $logFileThres = $t->{type} eq "restore" ? 1 : 2;
     while ( $t->{tarOut} =~ /(.*?)[\n\r]+(.*)/s ) {
         $_ = $1;
         $t->{tarOut} = $2;
+        from_to($_, $conf->{ClientCharset}, "utf8")
+                            if ( $conf->{ClientCharset} ne "" );
         #
         # refresh our inactivity alarm
         #
@@ -219,7 +233,7 @@ sub readOutput
             $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 );
             $t->{xferOK} = 1;
         } elsif ( /^\./ ) {
-            $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 );
+            $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= $logFileThres );
             $t->{fileCnt}++;
         } else {
             #
index 7be7d6d..ed284fd 100644 (file)
@@ -33,7 +33,7 @@
 #
 #========================================================================
 #
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0beta1, released 30 Jul 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
index 6c081e5..13dd9cf 100755 (executable)
--- a/makeDist
+++ b/makeDist
@@ -53,8 +53,8 @@ die("BackupPC::Lib->new failed\n")
 
 umask(0022);
 
-my $Version     = "3.0.0beta0";
-my $ReleaseDate = "11 Jul 2006";
+my $Version     = "3.0.0beta1";
+my $ReleaseDate = "30 Jul 2006";
 my $DistDir     = "dist/BackupPC-$Version";
 
 my @PerlSrc = qw(