mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 00:22:40 +01:00
Fix unprivileged file symlink creation
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Tgstation.Server.Host.IO
|
||||
throw new ArgumentNullException(nameof(linkPath));
|
||||
|
||||
//check if its not a file
|
||||
var flags = File.Exists(targetPath) ? 0 : 3; //SYMBOLIC_LINK_FLAG_DIRECTORY | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE on win10 1607+ developer mode
|
||||
var flags = File.Exists(targetPath) ? 2 : 3; //SYMBOLIC_LINK_FLAG_DIRECTORY and SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE on win10 1607+ developer mode
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
if (!NativeMethods.CreateSymbolicLink(linkPath, targetPath, flags))
|
||||
|
||||
Reference in New Issue
Block a user