From 7b3f178595a63f9d9fb7c790c0bfded111afd08a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 18 May 2011 20:45:03 +1200 Subject: [PATCH] remove --pipe sillyness from Utility; obsoletes fmode's patch --- OpenRA.Utility/Program.cs | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 47cc94be4c..f4ac6141fa 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -11,27 +11,11 @@ using System; using System.Collections.Generic; using System.IO; -using System.IO.Pipes; -using System.Security.AccessControl; -using System.Security.Principal; namespace OpenRA.Utility { class Program { - const int PipeBufferSize = 1024 * 1024; - - static PipeSecurity MakePipeSecurity() - { - var principal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); - if (!principal.IsInRole(WindowsBuiltInRole.Administrator)) - return null; // no special pipe security required - - var ps = new PipeSecurity(); - ps.AddAccessRule(new PipeAccessRule("EVERYONE", (PipeAccessRights)2032031, AccessControlType.Allow)); - return ps; - } - static void Main(string[] args) { var actions = new Dictionary>() @@ -44,18 +28,6 @@ namespace OpenRA.Utility if (args.Length == 0) { PrintUsage(); return; } - var pipename = GetNamedArg(args, "--pipe"); - var piping = pipename != null; - if (pipename != null) - { - var pipe = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, - PipeTransmissionMode.Byte, PipeOptions.None, PipeBufferSize, PipeBufferSize, - MakePipeSecurity()); - - pipe.WaitForConnection(); - Console.SetOut(new StreamWriter(pipe) { AutoFlush = true }); - } - var supportDir = GetNamedArg(args, "--SupportDir"); if (supportDir != null) Log.LogPath = Path.Combine(supportDir.Replace("\"", ""), "Logs"); @@ -75,13 +47,8 @@ namespace OpenRA.Utility Log.Write("utility", "{0}", e.ToString()); Console.WriteLine("Error: Utility application crashed. See utility.log for details"); - if (piping) - Console.Out.Close(); throw; } - - if (piping) - Console.Out.Close(); } static void PrintUsage()