From 2bc0eaee7ba64c3416e3387b6d24fd85301540a7 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 2 Oct 2018 11:37:24 -0400 Subject: [PATCH] Fix unprivileged file symlink creation --- src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs index ded819552f..d6b0da449c 100644 --- a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs +++ b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs @@ -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))