From 430b7f7a4befd300e85a6b8d5d5e13880f352fcd Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 8 Jul 2012 12:30:37 +0200 Subject: [PATCH] fetcher git: show error messages when host key has changed --- SparkleLib/Git/SparkleFetcherGit.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 3c22acd9..7a747b26 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -137,10 +137,18 @@ namespace SparkleLib.Git { } else { SparkleHelpers.DebugInfo ("Fetcher", line); - if (line.StartsWith ("fatal:", true, null) || - line.StartsWith ("error:", true, null)) { + line = line.Trim (new char [] {' ', '@'}); + + if (line.StartsWith ("fatal:", StringComparison.InvariantCultureIgnoreCase) || + line.StartsWith ("error:", StringComparison.InvariantCultureIgnoreCase)) { base.errors.Add (line); + + } else if (line.StartsWith ("WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!")) { + base.errors.Add ("warning: Remote host identification has changed!"); + + } else if (line.StartsWith ("WARNING: POSSIBLE DNS SPOOFING DETECTED!")) { + base.errors.Add ("warning: Possible DNS spoofing detected!"); } }