Bug #80993 [Opn->Wfx]: readlink() works no correctly

From: Date: Tue, 27 Apr 2021 13:08:17 +0000
Subject: Bug #80993 [Opn->Wfx]: readlink() works no correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233588@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80993&edit=1

 ID:                 80993
 Updated by:         cmb@php.net
 Reported by:        romanmartinuk at gmail dot com
 Summary:            readlink() works no correctly
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows 10.0.19042
 PHP Version:        7.3.27
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

The erroneous readlink() has apparently been fixed inadvertently
when php_sys_readlink() has been refactored[1].

Anyhow, PHP 7.3 is in security mode[2], so unless this would be
regarded as security issue, the fix will not be backported.

[1] <https://github.com/php/php-src/commit/91c905e83c338ef66da824be4f90c1d78d134507>
[2] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2021-04-27 09:14:18] romanmartinuk at gmail dot com

Description:
------------
see table for all version PHP (8.0.3 - 7.1.3)

https://github.com/symfony/symfony/pull/40866#issuecomment-823991452



Test script:
---------------
<?php

$dir = __DIR__ . DIRECTORY_SEPARATOR . 'dir';
mkdir($dir);

$file = $dir . DIRECTORY_SEPARATOR . 'file';
$link1 = $dir . DIRECTORY_SEPARATOR . 'link1';
$link2 = $dir . DIRECTORY_SEPARATOR . 'link2';

touch($file);

symlink($file, $link1);
symlink($link1, $link2);

echo 'PHP=' . PHP_VERSION . ', realpath=' . basename(realpath($link2)) . ',
readlink=' . basename(readlink($link2)) ;

unlink($file);
unlink($link1);
unlink($link2);
rmdir($dir);


Expected result:
----------------
PHP=7.3.27, realpath=file, readlink=link1

Actual result:
--------------
PHP=7.3.27, realpath=file, readlink=file


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80993&edit=1


Thread (2 messages)

« previous php.bugs (#233588) next »