Bug #66445 [Opn->Fbk]: ZipArchive doesn't set external file attributes

From: Date: Fri, 10 Jan 2014 07:42:05 +0000
Subject: Bug #66445 [Opn->Fbk]: ZipArchive doesn't set external file attributes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183685@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66445&edit=1

 ID:                 66445
 Updated by:         ab@php.net
 Reported by:        cmbecker69 at gmx dot de
 Summary:            ZipArchive doesn't set external file attributes
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Zip Related
 Operating System:   Windows
 PHP Version:        5.5.7
 Block user comment: N
 Private report:     N

 New Comment:

libzip is the one responsible for that.

Btw. how do you check that programmatically? Looks impossible, as one would need to reparse the
whole file manually.


Previous Comments:
------------------------------------------------------------------------
[2014-01-08 21:00:37] cmbecker69 at gmx dot de

Description:
------------
The ZipArchive class doesn't set the external file attributes,
what is a particular problem regarding directories which are 
displayed as files in Windows XP's explorer (works fine in Win 7,
though; can't tests other Windows versions).

According to the PKWARE Zip specification[1], section 4.4.15:

| The mapping of the external attributes is
| host-system dependent (see 'version made by').  For
| MS-DOS, the low order byte is the MS-DOS directory
| attribute byte.

The "version made by" field in the created ZIP file is 0, what 
signals MSDOS, but the low order byte of the "external file 
attributes" field is always 0 (should be 0x10 for directories). 

[1] <http://www.pkware.com/documents/casestudies/APPNOTE.TXT>

Test script:
---------------
$zip = new ZipArchive();
$zip->open('foo.zip', ZipArchive::CREATE);
$zip->addEmptyDir('bar');
$zip->close();


Expected result:
----------------
A ZIP file conforming to the PKWARE specification is created.

Actual result:
--------------
The created ZIP file doesn't conform to the PKWARE specification.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66445&edit=1


Thread (7 messages)

« previous php.bugs (#183685) next »