Bug #60841 [Opn->Ver]: expand_filepath fails to resolve symlinks that point to \xxx\yyy

From: Date: Wed, 18 Nov 2020 15:30:25 +0000
Subject: Bug #60841 [Opn->Ver]: expand_filepath fails to resolve symlinks that point to \xxx\yyy
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230439@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60841&edit=1

 ID:                 60841
 Updated by:         cmb@php.net
 Reported by:        cataphract@php.net
 Summary:            expand_filepath fails to resolve symlinks that point
                     to \xxx\yyy
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows 7
 PHP Version:        5.3.9
 Block user comment: N
 Private report:     N

 New Comment:

Well, in Windows parlance[1], it is

| An absolute path from the root of the current drive.

[1] <https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats>


Previous Comments:
------------------------------------------------------------------------
[2018-06-12 12:04:48] cmb@php.net

Related To: Bug #76460

------------------------------------------------------------------------
[2012-01-22 22:05:32] pajoye@php.net

It is not an absolute path but a relative path to the current drive.

It can have very different meanings withing a request (PWD and co). I remember to 
have made a doc about that back then, let me find it back and try to provide a fix 
or document it better.

------------------------------------------------------------------------
[2012-01-22 21:16:01] cataphract@php.net

Description:
------------
If a path includes a symlink that points to a path like \xxx\yyy, PHP understands 
it as a relative path, while it's actually an absolute path (or quasi-absolute, 
as it doesn't have a drive letter).

Expected result:
----------------
foocontents

Actual result:
--------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd \

C:\>mkdir t

C:\>mkdir t\test

C:\>mklink /D t\testlink \t\test
symbolic link created for t\testlink <<===>> \t\test

C:\>echo foocontents > \t\testlink\foo

C:\>php -r "echo file_get_contents('t\testlink\foo');"

Warning: file_get_contents(t\testlink\foo): failed to open stream: No such file
or directory in Command line code on line 1

C:\>php -r "echo file_get_contents('t\test\foo');"
foocontents

C:\>type t\testlink\foo
foocontents


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



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


Thread (5 messages)

« previous php.bugs (#230439) next »