projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release for 3.2.0. Changes since 3.2.0beta1:
[BackupPC.git]
/
bin
/
BackupPC_zipCreate
diff --git
a/bin/BackupPC_zipCreate
b/bin/BackupPC_zipCreate
index
82061af
..
8d9ae27
100755
(executable)
--- a/
bin/BackupPC_zipCreate
+++ b/
bin/BackupPC_zipCreate
@@
-1,4
+1,4
@@
-#!/bin/perl
+#!/
usr/
bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_zipCreate: create a zip archive of an existing dump
#============================================================= -*-perl-*-
#
# BackupPC_zipCreate: create a zip archive of an existing dump
@@
-21,8
+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)
# -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: value of
-# $Conf{ClientCharset} when backup was done)
+# -e charset charset for encoding file names (default: cp1252)
#
# 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
#
# 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
@@
-34,7
+33,7
@@
# Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
# Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2002-200
3
Craig Barratt and Guillaume Filion
+# Copyright (C) 2002-200
9
Craig Barratt and Guillaume Filion
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-52,7
+51,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version
2.1.0, released 20 Jun 2004
.
+# Version
3.2.0, released 31 Jul 2010
.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-94,13
+93,13
@@
usage: $0 [options] files/directories...
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-c level compression level (default is 0, no compression)
-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: value of
- \$Conf{ClientCharset} when backup was done)
+ -e charset charset for encoding file names (default: cp1252)
EOF
exit(1);
}
EOF
exit(1);
}
-if ( $opts{h} !~ /^([\w\.\s-]+)$/ ) {
+if ( $opts{h} !~ /^([\w\.\s-]+)$/
+ || $opts{h} =~ m{(^|/)\.\.(/|$)} ) {
print(STDERR "$0: bad host name '$opts{h}'\n");
exit(1);
}
print(STDERR "$0: bad host name '$opts{h}'\n");
exit(1);
}
@@
-136,12
+135,12
@@
if ( $i >= @Backups ) {
exit(1);
}
exit(1);
}
-my $Charset =
$Backups[$i]{charset}
;
+my $Charset =
"cp1252"
;
$Charset = $opts{e} if ( $opts{e} ne "" );
my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
my $PathAdd = $1 if ( $opts{p} =~ /(.+)/ );
$Charset = $opts{e} if ( $opts{e} ne "" );
my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
my $PathAdd = $1 if ( $opts{p} =~ /(.+)/ );
-if ( $opts{s}
!~ /^([\w\s.\/$(){}[\]-]+)$/
) {
+if ( $opts{s}
=~ m{(^|/)\.\.(/|$)}
) {
print(STDERR "$0: bad share name '$opts{s}'\n");
exit(1);
}
print(STDERR "$0: bad share name '$opts{s}'\n");
exit(1);
}
@@
-170,6
+169,7
@@
sub archiveWrite
$ErrorCnt++;
return;
}
$ErrorCnt++;
return;
}
+ $dir = "/" if ( $dir eq "." );
$view->find($Num, $ShareName, $dir, 0, \&ZipWriteFile,
$zipfh, $zipPathOverride);
}
$view->find($Num, $ShareName, $dir, 0, \&ZipWriteFile,
$zipfh, $zipPathOverride);
}