Edit report at https://bugs.php.net/bug.php?id=54128&edit=1
ID: 54128
Updated by: cmb@php.net
Reported by: vavra at 602 dot cz
Summary: ZIP_ER_OPEN when ZipArchive::open() on temp file
-Status: Open
+Status: Not a bug
Type: Bug
Package: Zip Related
Operating System: Windows 2003
PHP Version: 5.3.5
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> So I think function _zip_file_exists() in zip/lib/zip_open.c
> should be rewritten.
That file belongs to the bundled libzip (which is unbundled as of
PHP 7.4). If there are still issue, please report these
upstream[1].
[1] <https://libzip.org/>
Previous Comments:
------------------------------------------------------------------------
[2011-03-02 23:33:28] pajoye@php.net
This problem is new to me and again, there are reasons why we use it.
In any case, thanks for the feedback, the problem is identified and has sufficient
info. I will try to figure a portable way to make this special case working.
------------------------------------------------------------------------
[2011-03-02 19:53:19] carsten_sttgt at gmx dot de
hmmm,
> We also have to test if the file exists,
man 2 access
access, eaccess, faccessat -- check accessibility of a file
man 2 stat
stat, lstat, fstat, fstatat -- get file status
I think access is the winner (especially if there is a known problem with stat)
------------------------------------------------------------------------
[2011-03-02 19:37:52] pajoye@php.net
No, stat exists for that.
------------------------------------------------------------------------
[2011-03-02 19:31:39] carsten_sttgt at gmx dot de
> thus stat should normally work in this folder for own files.
Ups, must correct me. stat (crt) is really not working, even "traverse folder/execute
file" is allowed.
But I must agree with vavra. Checking the existence of a file is normally done with (f)open or
access. Someone should report this to the libzip team.
------------------------------------------------------------------------
[2011-03-02 16:56:15] pajoye@php.net
@carsten_sttgt at gmx dot de
Can you please for my own sanity keep separate issues separated? Thanks.
The stat problem here is totally unrelated to realpath_r. There is a reason why
we do it (see my other comment) and I already said that I have to see what else
we can do to work around this problem without adding more platform specific
changes in this implementation.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=54128
--
Edit this bug report at https://bugs.php.net/bug.php?id=54128&edit=1