This is the mail archive of the
mailing list for the Cygwin project.
Re: Windows 10 Creators Update and Symlinks
- From: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- To: cygwin at cygwin dot com
- Date: Sun, 23 Apr 2017 09:21:06 -0600
- Subject: Re: Windows 10 Creators Update and Symlinks
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org>
- Reply-to: Brian dot Inglis at SystematicSw dot ab dot ca
On 2017-04-23 03:26, Till Riedel wrote:
> Am 13.04.2017 um 0:29 schrieb Jeffrey Altman:
>> When Developer mode is enabled the elevation requirement for
>> symlink creation is disabled:
>> This was necessary for symlink creation within WSL to work.
> I was really excited to hear this!
> I tried to export CYGWIN="winsymlinks:nativestrict" and create
> symlink without elevation and failed on cygwin 2.8.0 (checked that
> "cmd /C mklink" works as expected in Windows 10 Creators Update
> Developer Mode).
> Any ideas if there are any extra checks that lead to "Operation not
> Windows seemingly even allows symlinks to nonexistent files (I
> somehow think there was a problem with that in the past). For me
> personally this would a strong reason to switch to real symlinks.
To enable the new behavior when using the CreateSymbolicLink API,
there is an additional dwFlags option you will need to set:
0x2 Specify this flag to allow creation of symbolic links when the
process is not elevated
So Cygwin patches are required to winsymlinks:native/strict handling
in winsup/w32api/include/winbase.h (which may be owned by mingw):
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
and in winsup/cygwin/path.cc(symlink_native) like:
/* Try to create native symlink. */
if (!CreateSymbolicLinkW (final_newpath->Buffer, final_oldpath->Buffer,
? SYMBOLIC_LINK_FLAG_DIRECTORY : 0)))
but may need W10 build 14972 checks, and any privilege checks disabled.
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple