Commit e0f2297
committed
mingw: try to create symlinks without elevated permissions
With Windows 10 Build 14972 in Developer Mode, a new flag is supported
by CreateSymbolicLink() to create symbolic links even when running
outside of an elevated session (which was previously required).
This new flag is called SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE and
has the numeric value 0x02.
Previous Windows 10 versions will not understand that flag and return an
ERROR_INVALID_PARAMETER, therefore we have to be careful to try passing
that flag only when the build number indicates that it is supported.
For more information about the new flag, see this blog post:
https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/
This patch is loosely based on the patch submitted by Samuel D. Leslie
as #1184.
Signed-off-by: Johannes Schindelin <[email protected]>1 parent 914b5a8 commit e0f2297
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| |||
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
414 | | - | |
| 416 | + | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
| |||
3114 | 3117 | | |
3115 | 3118 | | |
3116 | 3119 | | |
3117 | | - | |
| 3120 | + | |
3118 | 3121 | | |
3119 | 3122 | | |
3120 | 3123 | | |
| |||
4078 | 4081 | | |
4079 | 4082 | | |
4080 | 4083 | | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
4081 | 4102 | | |
4082 | 4103 | | |
4083 | 4104 | | |
| |||
4113 | 4134 | | |
4114 | 4135 | | |
4115 | 4136 | | |
| 4137 | + | |
4116 | 4138 | | |
4117 | 4139 | | |
4118 | 4140 | | |
| |||
0 commit comments