[Bug 1045] unzip unix attributes

bugzilla at busybox.net bugzilla at busybox.net
Mon May 24 01:45:26 UTC 2010


--- Comment #4 from Denys Vlasenko <vda.linux at googlemail.com>  ---
Looked at the code closer.


First, you did not bother unifying cds reading done for streaming archives,
which is just above your addition. This makes us read cds header twice.


cds_header_t cds_attr_header;
cds_attr_offset = read_next_cds(0, cds_attr_offset, &cds_attr_header);
if (cds_attr_header.formatted.version_made_by & 0x0003) { // for unix archives

"& 3" test is wring : it tests wrong byte, it tests "unix" wrongly - should
check "= 3", it doesn't bother to swap bytes on big endian machine. *3 BUGS* in
one line!

        unix_file_attrs = (cds_attr_header.formatted.external_file_attributes
>> 16);

no byte swap here too.

} else {
        unix_file_attrs = 0777;

Very bad...

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list