X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_tarExtract;h=d8f63116ea156f9b18a7fa629d275a6445173011;hp=2ba25bf4e660ee447473de8532a13d094db51987;hb=c6cebe03e53dcc49f889cf15ccda5b0fe3acd235;hpb=1ce7d1541ea1279aaa0a75c16986a3fd40b608ec diff --git a/bin/BackupPC_tarExtract b/bin/BackupPC_tarExtract index 2ba25bf..d8f6311 100755 --- a/bin/BackupPC_tarExtract +++ b/bin/BackupPC_tarExtract @@ -27,14 +27,14 @@ # #======================================================================== # -# Version 1.5.0, released 2 Aug 2002. +# Version 2.0.0beta0, released 23 Feb 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; -use lib "__INSTALLDIR__/lib"; +use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::Attrib qw(:all); use BackupPC::FileZIO; @@ -50,7 +50,7 @@ if ( @ARGV != 3 ) { print("usage: $0 \n"); exit(1); } -if ( $ARGV[0] !~ /^([\w\.-]+)$/ ) { +if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) { print("$0: bad host name '$ARGV[0]'\n"); exit(1); } @@ -76,7 +76,7 @@ my $Compress = $1; # Copyright 1998 Stephen Zander. All rights reserved. # my $tar_unpack_header - = 'A100 A8 A8 A8 A12 A12 A8 A1 A100 A6 A2 A32 A32 A8 A8 A155 x12'; + = 'Z100 A8 A8 A8 A12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12'; my $tar_header_length = 512; my $BufSize = 1048576; # 1MB or 2^20 @@ -372,8 +372,9 @@ sub processClose } mkpath("$OutDir/$ShareName", 0, 0777); -open(NEW_FILES, ">>$TopDir/pc/$host/NewFileList") +open(NEW_FILES, ">>", "$TopDir/pc/$host/NewFileList") || die("can't open $TopDir/pc/$host/NewFileList"); +binmode(STDIN); 1 while ( TarReadFile(*STDIN) ); 1 while ( sysread(STDIN, my $discard, 1024) );