Skip to content

Commit 86852cb

Browse files
committed
Added URL zone check (MOTW).
1 parent dffc9a2 commit 86852cb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Alba.XnaConvert/Program.cs

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Linq;
88
using System.Reflection;
9+
using Alba.Framework.Security;
910
using Alba.Framework.Sys;
1011
using Alba.Framework.Text;
1112
using Alba.XnaConvert.CommandLine;
@@ -50,6 +51,15 @@ private static void Main (string[] args)
5051

5152
private void MainInternal (string[] args)
5253
{
54+
try {
55+
UrlZone zone = UrlZones.GetUrlZone(Assembly.GetExecutingAssembly().Location);
56+
if (zone != UrlZone.LocalMachine)
57+
Console.WriteLine("Warning: running from untrusted location ({0}). Loading plugins may fail.".Fmt(zone));
58+
}
59+
catch {
60+
Console.WriteLine("Warning: zone check failed.");
61+
}
62+
5363
Options options = Options.ParseCommandLine(args);
5464
if (options == null) {
5565
Exit(1);

0 commit comments

Comments
 (0)