Some patches for BackupPC 3.2.1:

 - Lib.pm, Text.pm: fix deprecated usage of qw(...) as parentheses
patch-lib-BackupPC-Lib.pm
patch-lib-BackupPC-Storage-Text.pm

Use of qw(...) as parentheses deprecated since perl 5.14
http://perldoc.perl.org/perl5140delta.html#Use-of-qw%28...%29-as-parentheses

Symptoms - error messages:
"Use of qw(...) as parentheses is deprecated at 
/usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302."
"Use of qw(...) as parentheses is deprecated at 
/usr/share/backuppc/lib/BackupPC/Lib.pm line 1413."

http://sourceforge.net/mailarchive/forum.php?thread_name=20432.43867.560494.330449%40consult.pretender&forum_name=backuppc-users


 - config.pl: remove "-N" smbclient option
patch-conf-config.pl

Beginning with version 3.2.3, smbclient has stopped passing the backup user's 
password to authenticate with Window's LAN Manager, causing backups and 
restores to fail when the -N flag is specified.

Symptoms:
Get a "tree connect failed: NT_STATUS_ACCESS_DENIED" error with the -N option.

http://sourceforge.net/mailarchive/forum.php?thread_name=4C9A642E.9070509%40free.fr&forum_name=backuppc-users


 - BackupPC_zipCreate: fix filenames encoding in Zip archives
patch-bin-BackupPC_zipCreate

   Related documentation patches:
patch-doc-BackupPC.html
patch-doc-BackupPC.pod

Details:
http://sourceforge.net/mailarchive/forum.php?thread_name=4DDC94A6.4020901%40mezonplus.ru&forum_name=backuppc-devel


 - CGI: add "Code page" option to restore Zip archive form (English only)
patch-lib-BackupPC-CGI-Restore.pm
patch-lib-BackupPC-Lang-en.pm

--
Alexander
--- bin/BackupPC_zipCreate.orig 2011-04-25 07:31:55.000000000 +0400
+++ bin/BackupPC_zipCreate      2013-02-07 18:09:08.000000000 +0400
@@ -21,7 +21,7 @@
 #       -r pathRemove   path prefix that will be replaced with pathAdd
 #       -p pathAdd      new path prefix
 #       -c level        compression level (default is 0, no compression)
-#       -e charset      charset for encoding file names (default: cp1252)
+#       -e charset      charset for encoding file names (default: utf8)
 #
 #     The -h, -n and -s options specify which dump is used to generate
 #     the zip archive.  The -r and -p options can be used to relocate
@@ -93,7 +93,7 @@
      -r pathRemove   path prefix that will be replaced with pathAdd
      -p pathAdd      new path prefix
      -c level        compression level (default is 0, no compression)
-     -e charset      charset for encoding file names (default: cp1252)
+     -e charset      charset for encoding file names (default: utf8)
 EOF
     exit(1);
 }
@@ -135,7 +135,7 @@
     exit(1);
 }
 
-my $Charset = "cp1252";
+my $Charset = ""; # default: utf8
 $Charset = $opts{e} if ( $opts{e} ne "" );
 
 my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
@@ -311,6 +311,14 @@
     # Specify the compression level for this member
     $zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/);
     
+    if ( $Charset =~ /^(?:utf[-_]?8)?$/i ) {
+        # Set general purpose bit 11 for UTF-8 code page
+        $zipmember->{bitFlag} = $zipmember->{bitFlag} | 0x0800 ;
+    } elsif ( $Charset =~ 
/^cp(?:437|720|737|775|85[02578]|86[069]|874|93[26]|949|950)$/i ) {
+        # Set "version made by" field to 0 (MS-DOS) for OEM code pages
+        $zipmember->fileAttributeFormat('FA_MSDOS');
+    }
+    
     # Finally Zip the member
     $zipfh->addMember($zipmember);
 }
--- conf/config.pl.orig 2013-02-08 15:31:56.000000000 +0400
+++ conf/config.pl      2013-02-08 15:32:32.000000000 +0400
@@ -976,7 +976,7 @@
 # redirection and pipes; put that in a script if you need it.
 #
 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
-           . ' $I_option -U $userName -E -N -d 1'
+           . ' $I_option -U $userName -E -d 1'
             . ' -c tarmode\\ full -Tc$X_option - $fileList';
 
 #
@@ -990,7 +990,7 @@
 # redirection and pipes; put that in a script if you need it.
 #
 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
-           . ' $I_option -U $userName -E -N -d 1'
+           . ' $I_option -U $userName -E -d 1'
            . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
 
 #
@@ -1008,7 +1008,7 @@
 # redirection and pipes; put that in a script if you need it.
 #
 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
-            . ' $I_option -U $userName -E -N -d 1'
+            . ' $I_option -U $userName -E -d 1'
             . ' -c tarmode\\ full -Tx -';
 
 ###########################################################################
--- doc/BackupPC.html.orig 2011-04-25 07:31:55.000000000 +0400 +++ doc/BackupPC.html 2013-02-07 18:09:08.000000000 +0400 @@ -1664,7 +1664,7 @@ -r pathRemove path prefix that will be replaced with pathAdd -p pathAdd new path prefix -c level compression level (default is 0, no compression) - -e charset charset for encoding file names (default: cp1252) + -e charset charset for encoding file names (default: utf8)

The command-line files and directories are relative to the specified shareName. The zip file is written to stdout. The -h, -n and -s options specify which dump is used to generate the zip archive. The

--- doc/BackupPC.pod.orig       2011-04-25 07:31:55.000000000 +0400
+++ doc/BackupPC.pod    2013-02-07 18:09:08.000000000 +0400
@@ -1729,7 +1729,7 @@
        -r pathRemove   path prefix that will be replaced with pathAdd
        -p pathAdd      new path prefix
        -c level        compression level (default is 0, no compression)
-       -e charset      charset for encoding file names (default: cp1252)
+       -e charset      charset for encoding file names (default: utf8)
 
 The command-line files and directories are relative to the specified
 shareName.  The zip file is written to stdout. The -h, -n and -s
--- lib/BackupPC/CGI/Restore.pm.orig    2013-02-08 15:54:10.000000000 +0400
+++ lib/BackupPC/CGI/Restore.pm 2013-02-11 10:49:44.000000000 +0400
@@ -233,6 +233,7 @@
                 "-n", $num,
                 "-c", $In{compressLevel},
                 "-s", $share,
+                "-e", $In{codePage},
                 @pathOpts,
                 @fileList
            ],
--- lib/BackupPC/Lang/en.pm.orig        2013-02-08 15:54:10.000000000 +0400
+++ lib/BackupPC/Lang/en.pm     2013-02-11 11:39:16.000000000 +0400
@@ -530,8 +530,16 @@
 to \${EscHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
 (otherwise archive will contain full paths).
 <br>
-Compression (0=off, 1=fast,...,9=best)
-<input type="text" size="6" value="5" name="compressLevel">
+<table class="tableStnd" border="0">
+<tr>
+    <td>Compression (0=off, 1=fast,...,9=best)</td>
+    <td><input type="text" size="6" value="5" name="compressLevel"></td>
+</tr><tr>
+    <td>Code page (e.g. cp866)</td>
+    <td><input type="text" size="6" value="utf8" name="codePage"></td>
+</tr>
+</table>
+Note: for filenames with non latin characters OEM code page is compatible with 
most of the ZIP archivers.
 <br>
 <input type="submit" value="Download Zip File" name="ignore">
 </form>
--- lib/BackupPC/Lib.pm.orig    2013-02-07 17:44:35.000000000 +0400
+++ lib/BackupPC/Lib.pm 2013-02-07 17:44:59.000000000 +0400
@@ -1409,7 +1409,7 @@
 
     $conf->{$shareName} = [ $conf->{$shareName} ]
                     if ( ref($conf->{$shareName}) ne "ARRAY" );
-    foreach my $param qw(BackupFilesOnly BackupFilesExclude) {
+    foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
         next if ( !defined($conf->{$param}) );
         if ( ref($conf->{$param}) eq "HASH" ) {
             #
--- lib/BackupPC/Storage/Text.pm.orig   2013-02-07 17:45:14.000000000 +0400
+++ lib/BackupPC/Storage/Text.pm        2013-02-07 17:45:43.000000000 +0400
@@ -298,7 +298,7 @@
     #
     # Promote BackupFilesOnly and BackupFilesExclude to hashes
     #
-    foreach my $param qw(BackupFilesOnly BackupFilesExclude) {
+    foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
         next if ( !defined($conf->{$param}) || ref($conf->{$param}) eq "HASH" 
);
         $conf->{$param} = [ $conf->{$param} ]
                                 if ( ref($conf->{$param}) ne "ARRAY" );
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
BackupPC-devel mailing list
[email protected]
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-devel
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to