problem with busybox tar
Denis Vlasenko
vda.linux at googlemail.com
Sat Mar 3 20:01:53 UTC 2007
On Saturday 03 March 2007 20:40, Denis Vlasenko wrote:
> Hmm wait a second... GNU tar seems to use SIGNED bytes for checksumming!
>
> The fix: archival/libunarchive/get_header_tar.c:
>
> sum = ' ' * sizeof(tar.chksum);
> for (i = 0; i < 148 ; i++) {
> sum += ((signed char*)&tar)[i]; // <- 'signed' added
> }
> for (i = 156; i < 512 ; i++) {
> sum += ((signed char*)&tar)[i]; // <- 'signed' added
> }
>
> Works for me, will fix in svn now.
More digging in GNU tar revealed that tar file's header checksum
is _supposed to be_ done over unsigned bytes, but Sun and HP-UX
fucked it up. Nice...
Please try attached...
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.patch
Type: text/x-diff
Size: 1911 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070303/13f4143a/attachment-0002.bin
More information about the busybox
mailing list