>Synopsis: CRC in CPIO must be 32 bits, not so on 64 bit archs
>Arrival-Date: Mon Nov 07 22:50:01 GMT 2005
>Originator: Peter Philipp
System : OpenBSD 3.8
Machine : amd64
If you got a file large enough the CRC in cpio/pax on 32 bit
architectures will wrap around when the checksum consumed more than 32 bits.
However on 64 bit architectures it doesn't wrap around because the crc was
declared as an unsigned long and on 64 bit architectures that makes this value
32 bits longer. Because of the extra length the checksum does not fit into
the cpio archive field and a cpio will blow up because of this. Here is
# cpio -o -C 16384 < test.list > test.output
cpio: Sv4cpio header field is too small for file triton/usr/src.tgz
# ls -l triton/usr/src.tgz
-rw-r--r-- 1 root wheel 134792489 Nov 4 14:01 triton/usr/src.tgz
The place where this blew up was in file cpio.c, function vcpio_wr() when it
called ul_asc() on line 718.
Now I created a patch for the CRC problem but the problem remains that
other structures are probably also out of wack (due to the unsigned long
declaration) and it could blow up at other times.
With the patch however it may be possible now to create / extract cpio's
between 32 bit and 64 bit architectures and not get CRC problems.