BackupPC-users

Re: [BackupPC-users] Cannot compress negative numbers in pack at <snip>/Attrib.pm line 295

2010-09-07 09:42:07
Subject: Re: [BackupPC-users] Cannot compress negative numbers in pack at <snip>/Attrib.pm line 295
From: Craig Barratt <cbarratt AT users.sourceforge DOT net>
To: Garith Dugmore <garith AT saao.ac DOT za>
Date: Tue, 7 Sep 2010 06:39:57 -0700
Garith,

Yes, you are seeing a problem in a different part than where 3.2.0
was fixed.

We need to find out why one of the metadata valus is negative, which
causes pack() to fail.  BackupPC expects the type, mode, uid, gid and
size to all be non-negative numbers.  I can't immediately see from the
code how any of them could be negative.

Try changing this code in lib/BackupPC/Attrib.pm around lines 300-302:

        $data .= pack("w a* w$nFldsW N$nFldsN", length($file), $file,
                               @{$a->{files}{$file}}{@FldsUnixW},
                               @{$a->{files}{$file}}{@FldsUnixN},
                    );

to look like this:

        eval {
            $data .= pack("w a* w$nFldsW N$nFldsN", length($file), $file,
                                   @{$a->{files}{$file}}{@FldsUnixW},
                                   @{$a->{files}{$file}}{@FldsUnixN},
                        );
        };
        if ( $@ ) {
            $a->{_errStr} = "Can't pack attr for $file: " . 
Dumper($a->{files}{$file});
        }

You will also have to add:

    use Data::Dumper;

near the top of the file where the other "use" lines are.

Hopefully when the error occurs you should get some output in the
XferLOG file.

Craig

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/