From 8d7768574bb328c669a44c6efbff01e8a7e93d7e Mon Sep 17 00:00:00 2001 From: cbarratt Date: Sun, 15 Jun 2003 02:48:40 +0000 Subject: [PATCH] - 2.0.0 release. Minor tweaks to disable utf8. --- ChangeLog | 14 ++++++++- bin/BackupPC | 3 +- bin/BackupPC_compressPool | 8 ++++- bin/BackupPC_dump | 7 +++-- bin/BackupPC_link | 4 ++- bin/BackupPC_nightly | 3 +- bin/BackupPC_restore | 7 +++-- bin/BackupPC_sendEmail | 4 ++- bin/BackupPC_serverMesg | 3 +- bin/BackupPC_tarCreate | 4 ++- bin/BackupPC_tarExtract | 4 ++- bin/BackupPC_trashClean | 3 +- bin/BackupPC_zcat | 3 +- bin/BackupPC_zipCreate | 4 ++- cgi-bin/BackupPC_Admin | 5 ++- conf/config.pl | 52 +++++++++++++++++++++++++------- configure.pl | 11 +++++-- lib/BackupPC/Attrib.pm | 2 +- lib/BackupPC/FileZIO.pm | 4 ++- lib/BackupPC/Lang/de.pm | 2 +- lib/BackupPC/Lib.pm | 11 +++++-- lib/BackupPC/PoolWrite.pm | 2 +- lib/BackupPC/View.pm | 2 +- lib/BackupPC/Xfer/Rsync.pm | 2 +- lib/BackupPC/Xfer/RsyncFileIO.pm | 4 ++- lib/BackupPC/Xfer/Smb.pm | 2 +- lib/BackupPC/Xfer/Tar.pm | 2 +- lib/BackupPC/Zip/FileMember.pm | 2 +- makeDist | 10 ++++-- 29 files changed, 139 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdfa741..b19a8b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,11 +21,23 @@ # Version __VERSION__, __RELEASEDATE__ #------------------------------------------------------------------------ +* Minor tweaks to disable utf8 on utf8-capable machines (eg: RH8+). + Added "no utf8" to all programs, and added binmode() to relevant + file handles. + +#------------------------------------------------------------------------ +# Version 2.0.0beta3, 1 Jun 2003 +#------------------------------------------------------------------------ + * Several improvements to restore: cancel now reports the correct message and cleans up correctly. * Rsync with whitespace and wildcard excludes fixed by replacing - argList with argList+ in config.pl. + argList with argList+ in config.pl plus a fix to Lib.pm for + shell escaping array arguments. + +* Fixed rsync restore for character and block special devices + (major and minor device numbers weren't correctly restored). * Fixed typo in bin/BackupPC_restore (XferLOG -> RestoreLOG). diff --git a/bin/BackupPC b/bin/BackupPC index e6bc5f1..c95b330 100755 --- a/bin/BackupPC +++ b/bin/BackupPC @@ -47,13 +47,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use vars qw(%Status %Info $Hosts); use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; diff --git a/bin/BackupPC_compressPool b/bin/BackupPC_compressPool index 3796c75..4f22a27 100755 --- a/bin/BackupPC_compressPool +++ b/bin/BackupPC_compressPool @@ -49,13 +49,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use File::Find; use File::Path; @@ -178,6 +179,7 @@ sub doCompress $Errors++; return; } + binmode(FH); while ( sysread(FH, $dataIn, $CompMaxWrite) > 0 ) { $flush = 0; $FileOrigSz += length($dataIn); @@ -202,6 +204,7 @@ sub doCompress close(FH); return; } + binmode(OUT); $copy = 1; } if ( $copy && $dataOut ne "" ) { @@ -244,6 +247,7 @@ sub doCompress unlink("$file.__z"); return; } + binmode(FH); } if ( $copy ) { if ( !sysseek(OUT, 0, 0) ) { @@ -329,6 +333,7 @@ sub checkRead $f->close(); return; } + binmode(FH); #print("comparing $file to $cfile\n"); while ( 1 ) { $n = 1 + int(rand($CompMaxRead) + rand(100)); @@ -363,6 +368,7 @@ sub checkReadLine $f->close(); return; } + binmode(FH); while ( 1 ) { $d0 = ; $d = $f->readLine(); diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index 928dc50..176c93a 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -70,13 +70,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::FileZIO; @@ -476,6 +477,7 @@ for my $shareName ( @$ShareNames ) { close(WH); last; } + binmode(TAR); if ( !$tarPid ) { # # This is the tar child. Close the write end of the pipe, @@ -502,6 +504,7 @@ for my $shareName ( @$ShareNames ) { open(NEW_FILES, ">", "$TopDir/pc/$client/NewFileList") || die("can't open $TopDir/pc/$client/NewFileList"); $newFilesFH = *NEW_FILES; + binmode(NEW_FILES); } # @@ -993,7 +996,7 @@ sub UserCommandRun LOG => *LOG, XferLOG => $XferLOG, stat => \%stat, - xferOK => $stat{xferOK}, + xferOK => $stat{xferOK} || 0, type => $type, }; my $cmd = $bpc->cmdVarSubstitute($Conf{$type}, $vars); diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 7450f28..b70376e 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -39,13 +39,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::Attrib; @@ -106,6 +107,7 @@ while ( 1 ) { $CurrDumpDir = "$Dir/$Backups[$num]{num}"; $Compress = $Backups[$num]{compress}; if ( open(NEW, "<", "$Dir/NewFileList.$Backups[$num]{num}") ) { + binmode(NEW); while ( ) { chomp; next if ( !/(\w+) (\d+) (.*)/ ); diff --git a/bin/BackupPC_nightly b/bin/BackupPC_nightly index e4eb3cc..5ab8fd8 100755 --- a/bin/BackupPC_nightly +++ b/bin/BackupPC_nightly @@ -35,13 +35,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::FileZIO; diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 1186cac..6583b00 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -29,13 +29,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::FileZIO; @@ -320,6 +321,7 @@ if ( $useTar ) { $stat{hostError} = "Can't fork to run tar"; exit(RestoreCleanup($client)); } + binmode(TAR); if ( !$tarPid ) { # # This is the tarCreate child. Clone STDERR to STDOUT, @@ -612,6 +614,7 @@ sub UserCommandRun return if ( !defined($Conf{$type}) ); my $vars = { xfer => $xfer, + client => $client, host => $host, hostIP => $hostIP, share => $RestoreReq{shareDest}, @@ -622,7 +625,7 @@ sub UserCommandRun moreUsers => $Hosts->{$client}{moreUsers}, XferLOG => $RestoreLOG, stat => \%stat, - xferOK => $stat{xferOK}, + xferOK => $stat{xferOK} || 0, type => $type, bkupSrcHost => $RestoreReq{hostSrc}, bkupSrcShare => $RestoreReq{shareSrc}, diff --git a/bin/BackupPC_sendEmail b/bin/BackupPC_sendEmail index 9131081..6f1f95f 100755 --- a/bin/BackupPC_sendEmail +++ b/bin/BackupPC_sendEmail @@ -31,13 +31,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::FileZIO; @@ -282,6 +283,7 @@ if ( !$opts{t} ) { [\%UserEmailInfo], [qw(*UserEmailInfo)]); if ( open(HOST, ">", "$TopDir/log/UserEmailInfo.pl") ) { + binmode(HOST); print(HOST $dumpStr); close(HOST); } diff --git a/bin/BackupPC_serverMesg b/bin/BackupPC_serverMesg index e84cd42..cab0896 100755 --- a/bin/BackupPC_serverMesg +++ b/bin/BackupPC_serverMesg @@ -43,13 +43,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::FileZIO; diff --git a/bin/BackupPC_tarCreate b/bin/BackupPC_tarCreate index 9966469..6fb9c0b 100755 --- a/bin/BackupPC_tarCreate +++ b/bin/BackupPC_tarCreate @@ -48,13 +48,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use File::Path; use Getopt::Std; @@ -135,6 +136,7 @@ my(%HardLinkExtraFiles, @HardLinks); # # Write out all the requested files/directories # +binmode(STDOUT); my $fh = *STDOUT; foreach my $dir ( @ARGV ) { archiveWrite($fh, $dir); diff --git a/bin/BackupPC_tarExtract b/bin/BackupPC_tarExtract index 0508092..6f0251a 100755 --- a/bin/BackupPC_tarExtract +++ b/bin/BackupPC_tarExtract @@ -27,13 +27,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::Attrib qw(:all); @@ -374,6 +375,7 @@ sub processClose mkpath("$OutDir/$ShareName", 0, 0777); open(NEW_FILES, ">>", "$TopDir/pc/$host/NewFileList") || die("can't open $TopDir/pc/$host/NewFileList"); +binmode(NEW_FILES); binmode(STDIN); 1 while ( TarReadFile(*STDIN) ); 1 while ( sysread(STDIN, my $discard, 1024) ); diff --git a/bin/BackupPC_trashClean b/bin/BackupPC_trashClean index 193528f..546bbba 100755 --- a/bin/BackupPC_trashClean +++ b/bin/BackupPC_trashClean @@ -29,13 +29,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; diff --git a/bin/BackupPC_zcat b/bin/BackupPC_zcat index 223b78a..4957bec 100755 --- a/bin/BackupPC_zcat +++ b/bin/BackupPC_zcat @@ -32,13 +32,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use Compress::Zlib; diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index c5fe37c..960743a 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -51,13 +51,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use Archive::Zip qw(:ERROR_CODES); use File::Path; @@ -132,6 +133,7 @@ my $fh = new IO::Handle; $fh->fdopen(fileno(STDOUT),"w"); my $zipfh = Archive::Zip->new(); +binmode(STDOUT); foreach my $dir ( @ARGV ) { archiveWrite($zipfh, $dir); } diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index 906b4bb..5dd2ba9 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -39,13 +39,14 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use CGI; use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; @@ -388,6 +389,7 @@ sub Action_View } elsif ( $type eq "docs" ) { $file = "$BinDir/../doc/BackupPC.html"; if ( open(LOG, $file) ) { + binmode(LOG); Header($Lang->{BackupPC__Documentation}); print while ( ); close(LOG); @@ -1018,6 +1020,7 @@ EOF [qw(*RestoreReq)]); $dump->Indent(1); if ( open(REQ, ">$TopDir/pc/$hostDest/$reqFileName") ) { + binmode(REQ); print(REQ $dump->Dump); close(REQ); } else { diff --git a/conf/config.pl b/conf/config.pl index 8257ac1..4bf78d3 100644 --- a/conf/config.pl +++ b/conf/config.pl @@ -153,7 +153,7 @@ $Conf{MaxOldLogFiles} = 14; $Conf{DfPath} = '/bin/df'; # -# Command to run df. Several variables are substituted at run-time: +# Command to run df. The following variables are substituted at run-time: # # $dfPath path to df ($Conf{DfPath}) # $topDir top-level BackupPC data directory @@ -554,9 +554,6 @@ $Conf{BlackoutWeekDays} = [1, 2, 3, 4, 5]; # - 'tar': backup and restore via tar, tar over ssh, rsh or nfs. # Good choice for linux/unix. # -# A future version should support 'rsync' as a transport method for -# more efficient backup of linux/unix machines (and perhaps WinXX??). -# $Conf{XferMethod} = 'smb'; # @@ -575,7 +572,7 @@ $Conf{SmbClientPath} = '/usr/bin/smbclient'; # Commands to run smbclient for a full dump, incremental dump or a restore. # This setting only matters if $Conf{XferMethod} = 'smb'. # -# Several variables are substituted at run-time: +# The following variables are substituted at run-time: # # $smbClientPath same as $Conf{SmbClientPath} # $host host to backup/restore @@ -618,8 +615,7 @@ $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName' # are sufficient to read all the files you want to backup. Also, you # will probably want to add "/proc" to $Conf{BackupFilesExclude}. # -# Several variables are substituted at run-time. The following variables -# are substituted at run-time: +# The following variables are substituted at run-time: # # $host host name # $hostIP host's IP address @@ -868,7 +864,7 @@ $Conf{NmbLookupPath} = '/usr/bin/nmblookup'; # # NmbLookup command. Given an IP address, does an nmblookup on that -# IP address. Several variables are substituted at run-time: +# IP address. The following variables are substituted at run-time: # # $nmbLookupPath path to nmblookup ($Conf{NmbLookupPath}) # $host IP address @@ -927,7 +923,7 @@ $Conf{FixedIPNetBiosNameCheck} = 0; $Conf{PingPath} = '/bin/ping'; # -# Ping command. Several variables are substituted at run-time: +# Ping command. The following variables are substituted at run-time: # # $pingPath path to ping ($Conf{PingPath}) # $host host name @@ -1018,8 +1014,42 @@ $Conf{MaxOldPerPCLogFiles} = 12; # # $Conf{DumpPreUserCmd} = '$sshPath -l root $host /usr/bin/dumpMysql'; # -# Various variable substitutions are available; see BackupPC_dump -# or BackupPC_restore for the details. +# The following variable substitutions are made at run time for +# $Conf{DumpPreUserCmd} and $Conf{DumpPostUserCmd}: +# +# $type type of dump (incr or full) +# $xferOK 1 if the dump succeeded, 0 if it didn't +# $client client name being backed up +# $host host name (could be different from client name if +# $Conf{ClientNameAlias} is set) +# $hostIP IP address of host +# $user user name from the hosts file +# $moreUsers list of additional users from the hosts file +# $share the first share name +# $shares list of all the share names +# $XferMethod value of $Conf{XferMethod} (eg: tar, rsync, smb) +# $sshPath value of $Conf{SshPath}, +# +# The following variable substitutions are made at run time for +# $Conf{RestorePreUserCmd} and $Conf{RestorePostUserCmd}: +# +# $client client name being backed up +# $xferOK 1 if the restore succeeded, 0 if it didn't +# $host host name (could be different from client name if +# $Conf{ClientNameAlias} is set) +# $hostIP IP address of host +# $user user name from the hosts file +# $moreUsers list of additional users from the hosts file +# $share the first share name +# $XferMethod value of $Conf{XferMethod} (eg: tar, rsync, smb) +# $sshPath value of $Conf{SshPath}, +# $type set to "restore" +# $bkupSrcHost host name of the restore source +# $bkupSrcShare share name of the restore source +# $bkupSrcNum backup number of the restore source +# $pathHdrSrc common starting path of restore source +# $pathHdrDest common starting path of destination +# $fileList list of files being restored # $Conf{DumpPreUserCmd} = undef; $Conf{DumpPostUserCmd} = undef; diff --git a/configure.pl b/configure.pl index b98bccc..1fea712 100755 --- a/configure.pl +++ b/configure.pl @@ -40,6 +40,7 @@ #======================================================================== use strict; +no utf8; use vars qw(%Conf %OrigConf); use lib "./lib"; @@ -544,7 +545,8 @@ if ( -f $dest && !-f $confCopy ) { unless chown($uid, $gid, $confCopy); die("can't chmod $mode $confCopy\n") unless chmod($mode, $confCopy); } -open(OUT, ">$dest") || die("can't open $dest for writing\n"); +open(OUT, ">", $dest) || die("can't open $dest for writing\n"); +binmode(OUT); my $blockComment; foreach my $var ( @$newConf ) { if ( length($blockComment) @@ -636,8 +638,10 @@ sub InstallFile if ( $binary ) { die("can't copy($prog, $dest)\n") unless copy($prog, $dest); } else { - open(PROG, $prog) || die("can't open $prog for reading\n"); - open(OUT, ">$dest") || die("can't open $dest for writing\n"); + open(PROG, $prog) || die("can't open $prog for reading\n"); + open(OUT, ">", $dest) || die("can't open $dest for writing\n"); + binmode(PROG); + binmode(OUT); while ( ) { s/__INSTALLDIR__/$Conf{InstallDir}/g; s/__TOPDIR__/$Conf{TopDir}/g; @@ -681,6 +685,7 @@ sub ConfigParse { my($file) = @_; open(C, $file) || die("can't open $file"); + binmode(C); my($out, @conf, $var); my $comment = 1; my $allVars = {}; diff --git a/lib/BackupPC/Attrib.pm b/lib/BackupPC/Attrib.pm index dda3127..e51dcf9 100644 --- a/lib/BackupPC/Attrib.pm +++ b/lib/BackupPC/Attrib.pm @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/FileZIO.pm b/lib/BackupPC/FileZIO.pm index 56987cd..512bbab 100644 --- a/lib/BackupPC/FileZIO.pm +++ b/lib/BackupPC/FileZIO.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # @@ -99,6 +99,7 @@ sub open } else { open(FH, "<", $fileName) || return; } + binmode(FH); $fh = *FH; } $compLevel = 0 if ( !$CompZlibOK ); @@ -353,6 +354,7 @@ sub compressCopy my $fh = BackupPC::FileZIO->open($destFileZ, 1, $compress); my $data; if ( defined($fh) && open(LOG, "<", $srcFile) ) { + binmode(LOG); while ( sysread(LOG, $data, 65536) > 0 ) { $fh->write(\$data); } diff --git a/lib/BackupPC/Lang/de.pm b/lib/BackupPC/Lang/de.pm index 2d52bb0..9de994e 100644 --- a/lib/BackupPC/Lang/de.pm +++ b/lib/BackupPC/Lang/de.pm @@ -579,7 +579,7 @@ $Lang{Backup_browse_for__host} = < Klicken Sie auf eine Datei um diese per download wiederherzustellen. -\${h2("Contents of \${EscHTML(\$dirDisplay)}")} +\${h2("Inhalt von \${EscHTML(\$dirDisplay)}")}
diff --git a/lib/BackupPC/Lib.pm b/lib/BackupPC/Lib.pm index 43870b8..b0d33df 100644 --- a/lib/BackupPC/Lib.pm +++ b/lib/BackupPC/Lib.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # @@ -58,7 +58,7 @@ sub new TopDir => $topDir || '/data/BackupPC', BinDir => $installDir || '/usr/local/BackupPC', LibDir => $installDir || '/usr/local/BackupPC', - Version => '2.0.0beta3', + Version => '2.0.0', BackupFields => [qw( num type startTime endTime nFiles size nFilesExist sizeExist nFilesNew sizeNew @@ -187,6 +187,7 @@ sub BackupInfoRead flock(LOCK, LOCK_EX) if open(LOCK, "$bpc->{TopDir}/pc/$host/LOCK"); if ( open(BK_INFO, "$bpc->{TopDir}/pc/$host/backups") ) { + binmode(BK_INFO); while ( ) { s/[\n\r]+//; next if ( !/^(\d+\t(incr|full)[\d\t]*$)/ ); @@ -212,6 +213,7 @@ sub BackupInfoWrite "$bpc->{TopDir}/pc/$host/backups.old") if ( -f "$bpc->{TopDir}/pc/$host/backups" ); if ( open(BK_INFO, ">$bpc->{TopDir}/pc/$host/backups") ) { + binmode(BK_INFO); for ( $i = 0 ; $i < @Backups ; $i++ ) { my %b = %{$Backups[$i]}; printf(BK_INFO "%s\n", join("\t", @b{@{$bpc->{BackupFields}}})); @@ -229,6 +231,7 @@ sub RestoreInfoRead flock(LOCK, LOCK_EX) if open(LOCK, "$bpc->{TopDir}/pc/$host/LOCK"); if ( open(RESTORE_INFO, "$bpc->{TopDir}/pc/$host/restores") ) { + binmode(RESTORE_INFO); while ( ) { s/[\n\r]+//; next if ( !/^(\d+.*)/ ); @@ -254,6 +257,7 @@ sub RestoreInfoWrite "$bpc->{TopDir}/pc/$host/restores.old") if ( -f "$bpc->{TopDir}/pc/$host/restores" ); if ( open(RESTORE_INFO, ">$bpc->{TopDir}/pc/$host/restores") ) { + binmode(RESTORE_INFO); for ( $i = 0 ; $i < @Restores ; $i++ ) { my %b = %{$Restores[$i]}; printf(RESTORE_INFO "%s\n", @@ -335,6 +339,7 @@ sub HostInfoRead "Can't open $bpc->{TopDir}/conf/hosts\n"); return {}; } + binmode(HOST_INFO); while ( ) { s/[\n\r]+//; s/#.*//; @@ -606,6 +611,7 @@ sub File2MD5 $name = $1 if ( $name =~ /(.*)/ ); return ("", 0) if ( $fileSize == 0 ); return ("", -1) if ( !open(N, $name) ); + binmode(N); $md5->reset(); $md5->add($fileSize); if ( $fileSize > 262144 ) { @@ -1096,6 +1102,7 @@ sub cmdSystemOrEval return $err if ( !defined($stdoutCB) ); return; } + binmode(CHILD); if ( !$pid ) { # # This is the child diff --git a/lib/BackupPC/PoolWrite.pm b/lib/BackupPC/PoolWrite.pm index d032d3f..4e94ab8 100644 --- a/lib/BackupPC/PoolWrite.pm +++ b/lib/BackupPC/PoolWrite.pm @@ -56,7 +56,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/View.pm b/lib/BackupPC/View.pm index d3ad18f..f008968 100644 --- a/lib/BackupPC/View.pm +++ b/lib/BackupPC/View.pm @@ -31,7 +31,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/Rsync.pm b/lib/BackupPC/Xfer/Rsync.pm index f0350c9..1b43096 100644 --- a/lib/BackupPC/Xfer/Rsync.pm +++ b/lib/BackupPC/Xfer/Rsync.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/RsyncFileIO.pm b/lib/BackupPC/Xfer/RsyncFileIO.pm index d40d51f..4311e7b 100644 --- a/lib/BackupPC/Xfer/RsyncFileIO.pm +++ b/lib/BackupPC/Xfer/RsyncFileIO.pm @@ -12,7 +12,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # @@ -734,6 +734,7 @@ sub fileDeltaRxNext if ( open(F, "+>", "$fio->{outDirSh}RStmp") ) { my $data; my $byteCnt = 0; + binmode(F); while ( $fh->read(\$data, 1024 * 1024) > 0 ) { if ( syswrite(F, $data) != length($data) ) { $fio->log(sprintf("Can't write len=%d to %s", @@ -760,6 +761,7 @@ sub fileDeltaRxNext $fh->close; } else { if ( open(F, "<", $attr->{fullPath}) ) { + binmode(F); $fio->{rxInFd} = *F; $fio->{rxInName} = $attr->{fullPath}; } else { diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index b694785..968df3a 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm index c4f9c6a..d7b6488 100644 --- a/lib/BackupPC/Xfer/Tar.pm +++ b/lib/BackupPC/Xfer/Tar.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Zip/FileMember.pm b/lib/BackupPC/Zip/FileMember.pm index 5e41c58..f4215b5 100644 --- a/lib/BackupPC/Zip/FileMember.pm +++ b/lib/BackupPC/Zip/FileMember.pm @@ -33,7 +33,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.0.0, released 14 Jun 2003. # # See http://backuppc.sourceforge.net. # diff --git a/makeDist b/makeDist index 231ed1b..6079896 100755 --- a/makeDist +++ b/makeDist @@ -41,8 +41,8 @@ use File::Copy; umask(0022); -my $Version = "2.0.0beta3"; -my $ReleaseDate = "1 Jun 2003"; +my $Version = "2.0.0"; +my $ReleaseDate = "14 Jun 2003"; my $DistDir = "dist/BackupPC-$Version"; my @PerlSrc = qw( @@ -162,6 +162,8 @@ sub InstallFile } else { open(FILE, $file) || die("can't open $file for reading\n"); open(OUT, ">$dest") || die("can't open $dest for writing\n"); + binmode(FILE); + binmode(OUT); while ( ) { s/^# *Version \d+\.\d+[\.\w]*, released \d+ \w+ \d{4}\.?/# Version __VERSION__, released __RELEASEDATE__./; s/__VERSION__/$Version/g; @@ -202,6 +204,7 @@ sub InstallFile sub config2pod { open(C, "conf/config.pl") || die("can't open conf/config.pl"); + binmode(C); my($str, $out, $getHdr, @conf); my $first = 1; while ( ) { @@ -261,6 +264,7 @@ sub CheckConfigParams my $errors; open(F, $file) || die("can't open $file\n"); + binmode(F); if ( $check ) { while ( ) { s/\$(self|bpc)->{Conf}{([^}\$]+)}/if ( !defined($vars->{$2}) ) { @@ -304,6 +308,7 @@ sub CheckLangUsage foreach my $file ( qw(cgi-bin/BackupPC_Admin bin/BackupPC_sendEmail) ) { open(F, $file) || die("can't open $file"); + binmode(F); while ( ) { s/\$Lang->{([^}]*)}/$vars->{$1} = 1;/eg; } @@ -312,6 +317,7 @@ sub CheckLangUsage foreach my $f ( ) { my $done = {}; open(F, $f) || die("can't open $f\n"); + binmode(F); while ( ) { s/#.*//g; s/\$Lang{([^}]*)}/ -- 2.20.1