http://bugs.debian.org/438155 force structures that are overlaid on files via mmap to be packed so that alignment doesnt screw up the offsets --- cpio-2.9/src/cpiohdr.h +++ cpio-2.9/src/cpiohdr.h @@ -35,7 +35,7 @@ unsigned short c_mtimes[2]; unsigned short c_namesize; unsigned short c_filesizes[2]; -}; +} __attribute__((packed)); struct old_ascii_header { @@ -50,7 +50,7 @@ char c_mtime[11]; char c_namesize[6]; char c_filesize[11]; -}; +} __attribute__((packed)); /* "New" portable format and CRC format: @@ -80,7 +80,7 @@ char c_namesize[8]; /* count includes terminating NUL in pathname */ char c_chksum[8]; /* 0 for "new" portable format; for CRC format the sum of all the bytes in the file */ -}; +} __attribute__((packed)); struct cpio_file_stat /* Internal representation of a CPIO header */ {