From 76661305af09e499e31a16f2aca53346f8dd50ef Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 27 Apr 2019 19:44:48 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9D=D0=B5=20=D1=80=D0=B5=D0=B0=D0=B3?= =?UTF-8?q?=D0=B8=D1=80=D1=83=D0=B5=D0=BC=20=D0=B5=D1=81=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=D0=B8=D1=81=D1=8C=20?= =?UTF-8?q?=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B4=D0=B8=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/gravit/launcher/client/ClientLauncher.java | 5 +++++ 1 file changed, 5 insertions(+) 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 76009d70..604537bd 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -6,6 +6,7 @@ import ru.gravit.launcher.hasher.DirWatcher; import ru.gravit.launcher.hasher.FileNameMatcher; import ru.gravit.launcher.hasher.HashedDir; +import ru.gravit.launcher.hasher.HashedEntry; import ru.gravit.launcher.managers.ClientGsonManager; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.profiles.PlayerProfile; @@ -35,6 +36,7 @@ import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.PosixFilePermission; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; public final class ClientLauncher { @@ -541,10 +543,13 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher, HashedDir.Diff diff = hdir.diff(currentHDir, matcher); if (!diff.isSame()) { + AtomicBoolean isFoundFile = new AtomicBoolean(false); diff.extra.walk(File.separator, (e,k,v) -> { + if(v.getType().equals(HashedEntry.Type.FILE)) isFoundFile.set(true); LogHelper.error("Extra %s", e); }); diff.mismatch.walk(File.separator, (e,k,v) -> { + if(v.getType().equals(HashedEntry.Type.FILE)) isFoundFile.set(true); LogHelper.error("Mismatch %s", e); }); throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir)));