Bug #54128 [NEW]: ZIP_ER_OPEN when ZipArchive::open() on temp file

From: Date: Tue, 01 Mar 2011 14:28:58 +0000
Subject: Bug #54128 [NEW]: ZIP_ER_OPEN when ZipArchive::open() on temp file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159126@lists.php.net to get a copy of this message
From:             
Operating system: Windows 2003
PHP version:      5.2.17
Package:          Zip Related
Bug Type:         Bug
Bug description:ZIP_ER_OPEN when ZipArchive::open() on temp file

Description:
------------
On Windows 2003, IIS we use php as CGI. The php process runs as a IUSR_XXXX
user. When we want to unzip a file, we get error 11 (ZIP_ER_OPEN).

I tracked this by Process Monitor and I saw that ZipArchive::open() tries
to list a directory. We use temp directory. On Windows 2003 it is
C:\Windows\Temp.
After listing this directory ZipArchive::open() returns 11. And doesn't
continue at work.

When I add right "List Folder" for user IUSR_XXXX the open() call
succeeds.
I think it should be a kind of bug of c-runtime. I searched for ZIP_ER_OPEN
in php source and this is returned nearly after calls of fopen() and
stat(). It's odd that fopen() and stat() makes directory listing....



Test script:
---------------
//without result testing:

$zipfile = tempnam(sys_get_temp_dir(),'zip');
file_put_contents($zipfile, $a_zip_file_content);
$zip = new ZipArchive();

$a_zip_file_content_reread = file_get_contents($zipfile,
$a_zip_file_conent);
//$a_zip_file_conent_reread has bean successfully read and has the same
content as $a_zip_file_content


$res=$zip->open($zipfile);
if ($res!==true)
 echo "Failed open a file: ".$res;



-- 
Edit bug report at http://bugs.php.net/bug.php?id=54128&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54128&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54128&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54128&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54128&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54128&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54128&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54128&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54128&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54128&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54128&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54128&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54128&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54128&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54128&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54128&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54128&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54128&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54128&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54128&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54128&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54128&r=mysqlcfg



Thread (16 messages)

« previous php.bugs (#159126) next »