Bug #79795 [NEW]: Windows SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE

From: Date: Sun, 05 Jul 2020 02:12:29 +0000
Subject: Bug #79795 [NEW]: Windows SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227822@lists.php.net to get a copy of this message
From:             svnpenn at gmail dot com
Operating system: Windows 10
PHP version:      7.4.7
Package:          Filesystem function related
Bug Type:         Bug
Bug description:Windows SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE

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 bug report at https://bugs.php.net/bug.php?id=79795&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79795&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79795&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79795&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79795&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79795&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79795&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79795&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79795&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79795&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79795&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79795&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79795&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79795&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79795&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79795&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79795&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79795&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#227822) next »