Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1969 from khellang/netsh

Added quotes to netsh command parameters
commit ab73ab7cd13c8ce15a0ced7bd7665b7b5fc92f95 2 parents 89f50d8 + ebc87aa
@phillip-haydon phillip-haydon authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Nancy.Hosting.Self/NetSh.cs
View
8 src/Nancy.Hosting.Self/NetSh.cs
@@ -7,7 +7,7 @@
/// </summary>
public static class NetSh
{
- private const string NETSH_COMMAND = "netsh";
+ private const string NetshCommand = "netsh";
/// <summary>
/// Add a url reservation
@@ -21,7 +21,7 @@ public static bool AddUrlAcl(string url, string user)
{
var arguments = GetParameters(url, user);
- return UacHelper.RunElevated(NETSH_COMMAND, arguments);
+ return UacHelper.RunElevated(NetshCommand, arguments);
}
catch (Exception)
{
@@ -29,9 +29,9 @@ public static bool AddUrlAcl(string url, string user)
}
}
- public static string GetParameters(string url, string user)
+ internal static string GetParameters(string url, string user)
{
- return string.Format("http add urlacl url={0} user={1}", url, user);
+ return string.Format("http add urlacl url=\"{0}\" user=\"{1}\"", url, user);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.