X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_zipCreate;h=93bf95b00a4bd92ec4c3e2e8e1708d45b513ae9b;hp=82061aff627eccb288f75ceee494968d48ef067e;hb=ee969a9445a5439cf94a516c7d882e12b1bdf945;hpb=546f9691f118c9ea2d164f377994b4a018a60d02 diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index 82061af..93bf95b 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -52,7 +52,7 @@ # #======================================================================== # -# Version 2.1.0, released 20 Jun 2004. +# Version 3.0.0beta2, released 11 Nov 2006. # # See http://backuppc.sourceforge.net. # @@ -100,7 +100,8 @@ 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); } @@ -141,7 +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.\/$(){}[\]-]+)$/ ) { +if ( $opts{s} =~ m{(^|/)\.\.(/|$)} ) { print(STDERR "$0: bad share name '$opts{s}'\n"); exit(1); } @@ -170,6 +171,7 @@ sub archiveWrite $ErrorCnt++; return; } + $dir = "/" if ( $dir eq "." ); $view->find($Num, $ShareName, $dir, 0, \&ZipWriteFile, $zipfh, $zipPathOverride); }