From 6a9d4cba3395a2d2f0f41b82cc92aa89072c09c2 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 18 Aug 2018 05:20:12 -0400 Subject: [PATCH] Fix unprivileged symlinks --- src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs index 824b5375f5..0fbacb6341 100644 --- a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs +++ b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs @@ -16,7 +16,9 @@ namespace Tgstation.Server.Host.IO { //check if its not a file var flags = File.Exists(targetPath) ? 0 : 1; //SYMBOLIC_LINK_FLAG_DIRECTORY - flags |= 2; //SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE on win10 1607+ +#if DEBUG + flags |= 2; //SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE on win10 1607+ developer mode +#endif cancellationToken.ThrowIfCancellationRequested(); if (!NativeMethods.CreateSymbolicLink(linkPath, targetPath, flags))