Req #79795 [Opn]: Support SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
| From: | cmb@php.net | Date: | Mon, 20 Jul 2020 13:01:14 +0000 |
| Subject: | Req #79795 [Opn]: Support SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228120@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79795&edit=1
ID: 79795
Updated by: cmb@php.net
Reported by: svnpenn at gmail dot com
Summary: Support SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
Status: Open
Type: Feature/Change Request
Package: Filesystem function related
Operating System: Windows 10
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
Makes sense to me. A pull request would be welcome.
Previous Comments:
------------------------------------------------------------------------
[2020-07-05 02:12:29] svnpenn at gmail dot com
Description:
------------
Windows SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
Using this file:
<?php
symlink('a.php', 'b.php');
I get this result:
PS C:\php> php a.php
Warning: symlink(): Permission denied in C:\php\a.php on line 2
I am not running as admin, but I do have developer mode enabled:
<https://howtogeek.com/292914/what-is-developer-mode-in-windows-10>
Since December 2016, admin rights are not required to create a symlink, as long
as the application uses the flag
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE:
<https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10>
Note that other programming languages are already doing this. For example
Python:
<https://github.com/python/cpython/blob/1f764531/Modules/winreparse.h#L50>
Dart:
<https://github.com/dart-lang/sdk/blob/a677c245/runtime/bin/file_win.cc#L430>
Go:
<https://github.com/golang/go/blob/dd150176/src/internal/syscall/windows/symlink_windows.go#L13>
Nim:
<https://github.com/nim-lang/Nim/blob/af27e6bd/lib/pure/os.nim#L2417-L2419>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79795&edit=1