Bug #66445 [NEW]: ZipArchive doesn't set external file attributes

From: Date: Wed, 08 Jan 2014 21:00:38 +0000
Subject: Bug #66445 [NEW]: ZipArchive doesn't set external file attributes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183652@lists.php.net to get a copy of this message
From:             cmbecker69 at gmx dot de
Operating system: Windows
PHP version:      5.5.7
Package:          Zip Related
Bug Type:         Bug
Bug description:ZipArchive doesn't set external file attributes

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 bug report at https://bugs.php.net/bug.php?id=66445&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66445&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66445&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66445&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66445&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66445&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66445&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66445&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66445&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66445&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66445&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66445&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66445&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66445&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66445&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66445&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66445&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66445&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66445&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66445&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66445&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#183652) next »