X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FAttrib.pm;h=2b4b36a4d472e4da72b34022ea936ca0c2fe899e;hp=fc245d78ee529c6c666af3fe0498433ef28973bf;hb=ca593f66fd6c35764bd8997c6338b781330f019c;hpb=3d15da9b2c6de8018c02677549678d6d769234b5 diff --git a/lib/BackupPC/Attrib.pm b/lib/BackupPC/Attrib.pm index fc245d7..2b4b36a 100644 --- a/lib/BackupPC/Attrib.pm +++ b/lib/BackupPC/Attrib.pm @@ -12,7 +12,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2007 Craig Barratt +# Copyright (C) 2001-2009 Craig Barratt # # 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 @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.2.0, released 31 Dec 2008. +# Version 3.2.0beta0, released 5 April 2009. # # See http://backuppc.sourceforge.net. # @@ -252,11 +252,18 @@ sub read $fd->read(\$newData, 65536); $data .= $newData; } - ( - @{$a->{files}{$fileName}}{@FldsUnixW}, - @{$a->{files}{$fileName}}{@FldsUnixN}, - $data - ) = unpack("w$nFldsW N$nFldsN a*", $data); + eval { + ( + @{$a->{files}{$fileName}}{@FldsUnixW}, + @{$a->{files}{$fileName}}{@FldsUnixN}, + $data + ) = unpack("w$nFldsW N$nFldsN a*", $data); + }; + if ( $@ ) { + $a->{_errStr} = "unpack: Can't read attributes for $fileName from $file ($@)"; + $fd->close; + return; + } if ( $a->{files}{$fileName}{$FldsUnixN[-1]} eq "" ) { $a->{_errStr} = "Can't read attributes for $fileName" . " from $file";