From a26311be882771541c88ddf0da6510488755fa75 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 27 Apr 2019 19:20:26 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=9E=D1=82=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D1=8B=D0=B9=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=20verifyHDir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/gravit/launcher/client/ClientLauncher.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index eff70e03..76009d70 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -19,6 +19,7 @@ import ru.gravit.utils.helper.JVMHelper.OS; import javax.swing.*; +import java.io.File; import java.io.IOException; import java.lang.ProcessBuilder.Redirect; import java.lang.invoke.MethodHandle; @@ -537,8 +538,17 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher, // Hash directory and compare (ignore update-only matcher entries, it will break offline-mode) HashedDir currentHDir = new HashedDir(dir, matcher, true, digest); - if (!hdir.diff(currentHDir, matcher).isSame()) + HashedDir.Diff diff = hdir.diff(currentHDir, matcher); + if (!diff.isSame()) + { + diff.extra.walk(File.separator, (e,k,v) -> { + LogHelper.error("Extra %s", e); + }); + diff.mismatch.walk(File.separator, (e,k,v) -> { + LogHelper.error("Mismatch %s", e); + }); throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir))); + } } private ClientLauncher() {