From ae0eabec0a2a7b0ad7d05109b7de7c8c4e0853db Mon Sep 17 00:00:00 2001 From: "Tina Schrepfer (LI)" Date: Wed, 19 Dec 2018 09:59:31 -0800 Subject: [PATCH] Fix security issue, update nuget packages. --- .../LanguageServerWithUI/MainWindowViewModel.cs | 4 ++-- .../MockLanguageExtension/FooLanguageClient.cs | 3 ++- .../MockLanguageExtension.csproj | 16 ++++++++++++---- .../MockLanguageExtension/packages.config | 4 +++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/LanguageServerProtocol/LanguageServerWithUI/MainWindowViewModel.cs b/LanguageServerProtocol/LanguageServerWithUI/MainWindowViewModel.cs index 770f8982..e8757a91 100644 --- a/LanguageServerProtocol/LanguageServerWithUI/MainWindowViewModel.cs +++ b/LanguageServerProtocol/LanguageServerWithUI/MainWindowViewModel.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.IO.Pipes; using System.Linq; +using System.Security.Principal; using System.Threading.Tasks; using System.Windows; using System.Windows.Threading; @@ -21,11 +22,10 @@ public class MainWindowViewModel : INotifyPropertyChanged public MainWindowViewModel() { - Debug.Fail("test"); var stdInPipeName = @"input"; var stdOutPipeName = @"output"; - var pipeAccessRule = new PipeAccessRule("Everyone", PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow); + var pipeAccessRule = new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null), PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow); var pipeSecurity = new PipeSecurity(); pipeSecurity.AddAccessRule(pipeAccessRule); diff --git a/LanguageServerProtocol/MockLanguageExtension/FooLanguageClient.cs b/LanguageServerProtocol/MockLanguageExtension/FooLanguageClient.cs index 7b22e3e5..ddb9f3d5 100644 --- a/LanguageServerProtocol/MockLanguageExtension/FooLanguageClient.cs +++ b/LanguageServerProtocol/MockLanguageExtension/FooLanguageClient.cs @@ -12,6 +12,7 @@ using System.IO; using System.IO.Pipes; using System.Reflection; +using System.Security.Principal; using System.Threading; using System.Threading.Tasks; @@ -73,7 +74,7 @@ public async Task ActivateAsync(CancellationToken token) var stdInPipeName = @"output"; var stdOutPipeName = @"input"; - var pipeAccessRule = new PipeAccessRule("Everyone", PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow); + var pipeAccessRule = new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null), PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow); var pipeSecurity = new PipeSecurity(); pipeSecurity.AddAccessRule(pipeAccessRule); diff --git a/LanguageServerProtocol/MockLanguageExtension/MockLanguageExtension.csproj b/LanguageServerProtocol/MockLanguageExtension/MockLanguageExtension.csproj index e64d7350..ead77fa6 100644 --- a/LanguageServerProtocol/MockLanguageExtension/MockLanguageExtension.csproj +++ b/LanguageServerProtocol/MockLanguageExtension/MockLanguageExtension.csproj @@ -1,6 +1,6 @@  - + 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) @@ -210,18 +210,26 @@ Server + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + + + - + + +