From 8e728c349737039f39e1994c74f22e862cd2e340 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 20 Oct 2018 14:49:21 -0400 Subject: [PATCH 1/2] Remove support for SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE --- .../IO/WindowsSymlinkFactory.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs index 13aae902c2..761d37a574 100644 --- a/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs +++ b/src/Tgstation.Server.Host/IO/WindowsSymlinkFactory.cs @@ -22,19 +22,18 @@ namespace Tgstation.Server.Host.IO //check if its not a file var flags = File.Exists(targetPath) ? NativeMethods.CreateSymbolicLinkFlags.None : NativeMethods.CreateSymbolicLinkFlags.Directory; - flags |= NativeMethods.CreateSymbolicLinkFlags.AllowUnprivilegedCreate; + //no don't fucking use this + //sure it works in SOME cases + //i.e. win10 1803+ and IN DEVELOPER MODE + //other times it throws ERROR_INVALID_PARAMETER + //but the fucking worst is there is some configuration of windows that accept the argument and allow the function to succeed + //BUT IT DOESN'T CREATE THE FUCKING LINK + //I AM NOT DEBUGGING THAT SHIT AGAIN AHHH + //flags |= NativeMethods.CreateSymbolicLinkFlags.AllowUnprivilegedCreate; cancellationToken.ThrowIfCancellationRequested(); if (!NativeMethods.CreateSymbolicLink(linkPath, targetPath, flags)) - { - if (Win32Exception.GetLastWin32Error() == Win32Error.ERROR_INVALID_PARAMETER) //SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE isn't supported - { - flags &= ~NativeMethods.CreateSymbolicLinkFlags.AllowUnprivilegedCreate; - if (NativeMethods.CreateSymbolicLink(linkPath, targetPath, flags)) - return; - } throw new Win32Exception(); - } }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current); } } From 34bf14609df72bcba9f7d78a7f93f60cc49c395c Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 20 Oct 2018 14:51:17 -0400 Subject: [PATCH 2/2] Version bump to 4.0.1.2 --- .../Tgstation.Server.Host.Console.csproj | 2 +- src/Tgstation.Server.Host.Service/Properties/AssemblyInfo.cs | 4 ++-- .../Tgstation.Server.Host.Watchdog.csproj | 2 +- src/Tgstation.Server.Host/Tgstation.Server.Host.csproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj index ccfcd6f12c..fb8e8bcfa7 100644 --- a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj +++ b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj @@ -4,7 +4,7 @@ Exe netcoreapp2.1 Full - 4.0.1.1 + 4.0.1.2 diff --git a/src/Tgstation.Server.Host.Service/Properties/AssemblyInfo.cs b/src/Tgstation.Server.Host.Service/Properties/AssemblyInfo.cs index 93caf9e81a..f53415defe 100644 --- a/src/Tgstation.Server.Host.Service/Properties/AssemblyInfo.cs +++ b/src/Tgstation.Server.Host.Service/Properties/AssemblyInfo.cs @@ -7,5 +7,5 @@ using System.Runtime.InteropServices; [assembly: Guid("29927416-3b78-49a7-a560-5ccaa638b6b4")] [assembly: InternalsVisibleTo("Tgstation.Server.Host.Service.Tests")] -[assembly: AssemblyVersion("4.0.1.1")] -[assembly: AssemblyFileVersion("4.0.1.1")] +[assembly: AssemblyVersion("4.0.1.2")] +[assembly: AssemblyFileVersion("4.0.1.2")] diff --git a/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj b/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj index d401944117..c5a1cb5ab7 100644 --- a/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj +++ b/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj @@ -4,7 +4,7 @@ netstandard2.0 Full false - 4.0.1.1 + 4.0.1.2 diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index 96199922ae..6a1c515126 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -3,7 +3,7 @@ netcoreapp2.1 Full - 4.0.1.1 + 4.0.1.2