Bug #69473 [Asn->Opn]: bug in symlink() prevents relative symlinks on Windows
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 07:37:45 +0000 |
| Subject: | Bug #69473 [Asn->Opn]: bug in symlink() prevents relative symlinks on Windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212126@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69473&edit=1
ID: 69473
Updated by: kalle@php.net
Reported by: email at spikx dot net
Summary: bug in symlink() prevents relative symlinks on
Windows
-Status: Assigned
+Status: Open
Type: Bug
Package: Filesystem function related
Operating System: Windows 7
PHP Version: 5.6.8
-Assigned To: pajoye
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-04-20 07:50:54] ab@php.net
see also bug #68167
------------------------------------------------------------------------
[2015-04-20 07:45:48] ab@php.net
The main concern I'd like to express about this is the thread safety. A robust solution should
include CWD magic when relative paths are used. Otherwise it might make sense to rework this for CLI
or NTS only.
What @spikx means about chdir in PHP looks like confused with _chdir in CRT. Two completely
unrelated things, so chdir() in PHP can't affect anything in the symlink behavior.
Thanks.
------------------------------------------------------------------------
[2015-04-18 14:44:12] cmb@php.net
I've submitted the PR <https://github.com/php/php-src/pull/1243>.
Pierre, can you please have a look at it.
------------------------------------------------------------------------
[2015-04-18 12:44:46] cmb@php.net
> it's just the $target check
Apparently, dest_p has to be checked there instead of topath.
I'm working on a respective PR.
------------------------------------------------------------------------
[2015-04-18 11:53:26] email at spikx dot net
cmb@php.net: exactly - it's just the $target check [1] right before the pCreateSymbolicLinkA
call that prevents using relative symlinks, since the GetFileAttributes expects the path to be
either absolute or relative to the CWD, not relative to the parent directories of that in which the
link to the target resides.
[1] <https://github.com/php/php-src/blob/master/ext/standard/link_win32.c#L169>
------------------------------------------------------------------------
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=69473
--
Edit this bug report at https://bugs.php.net/bug.php?id=69473&edit=1