Bug #78400 [Opn->Ver]: Sym-linked files are not accessible
| From: | cmb@php.net | Date: | Sat, 24 Aug 2019 11:05:15 +0000 |
| Subject: | Bug #78400 [Opn->Ver]: Sym-linked files are not accessible | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222389@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78400&edit=1
ID: 78400
Updated by: cmb@php.net
Reported by: armin at v dot ieweg dot de
Summary: Sym-linked files are not accessible
-Status: Open
+Status: Verified
Type: Bug
Package: Built-in web server
Operating System: Windows 10
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The culprit is that we're basically calling stat() on the
symlink[1], and take st_size as being the size of the symlinked
file[2], while it is not.
[1] <https://github.com/php/php-src/blob/php-7.2.21/sapi/cli/php_cli_server.c#L1382>
[2] <https://github.com/php/php-src/blob/php-7.2.21/sapi/cli/php_cli_server.c#L2050>
Previous Comments:
------------------------------------------------------------------------
[2019-08-11 16:41:16] armin at v dot ieweg dot de
Description:
------------
I've already created an issue on Github, regarding their web-server. But it figured out that
the issue also occures, when using the built-in web server nativley.
What I did:
> php -S localhost:8000 -t .
PHP 7.2.19 Development Server started at Sun Aug 11 16:25:34 2019
Listening on http://localhost:8000
Document root is C:\Dev\test
Press Ctrl-C to quit.
[Sun Aug 11 16:25:39 2019] ::1:60634 [200]: /images/test/test.png
I've started the server and requested an image which is a symlink to
"../realfile.png" (which is still located within document root). The server response is
200 but with a content-length of 0. Regular files work normal.
Here you find the original github issue: https://github.com/symfony/symfony/issues/33089
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78400&edit=1