X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_zipCreate;h=7c859d2e8155c73737b11ba93b787756a93d6101;hp=978c449f5e028811bbd532d73af9ea2f154543fd;hb=17dcbbebb871212f90b81bb97f8d1feb528bdc43;hpb=329e870f56fb6572fa697998d33676588034c149 diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index 978c449..7c859d2 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_zipCreate: create a zip archive of an existing dump @@ -51,7 +51,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0, released 20 Jun 2004. # # See http://backuppc.sourceforge.net. # @@ -120,7 +120,7 @@ if ( $i >= @Backups ) { my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ ); my $PathAdd = $1 if ( $opts{p} =~ /(.+)/ ); -if ( $opts{s} !~ /^([\w\s\.\/\$-]+)$/ ) { +if ( $opts{s} !~ /^([\w\s.\/$(){}[\]-]+)$/ ) { print(STDERR "$0: bad share name '$opts{s}'\n"); exit(1); } @@ -271,8 +271,14 @@ sub ZipWriteFile } return if ( !$zipmember ); - # Set the attributes and permissions - $zipmember->setLastModFileDateTimeFromUnix($hdr->{mtime}); + # + # Set the attributes and permissions. The standard zip file + # header cannot handle dates prior to 1/1/1980, or 315561600 + # unix seconds, so we round up the mtime. + # + my $mtime = $hdr->{mtime}; + $mtime = 315561600 if ( $mtime < 315561600 ); + $zipmember->setLastModFileDateTimeFromUnix($mtime); $zipmember->unixFileAttributes($hdr->{mode}); # Zip files don't accept uid and gid, so we put them in the comment field. $zipmember->fileComment("uid=".$hdr->{uid}." gid=".$hdr->{gid})