From 9bc798108ba7e1e411489521a53081b4ff0f930e Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 4 Mar 2019 16:54:36 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=92=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20?= =?UTF-8?q?=D0=BA=D1=83=D1=81=D0=BE=D0=BA=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/gravit/launcher/hasher/DirWatcher.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java b/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java index 70a2a3e9..6969a37f 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java @@ -126,11 +126,11 @@ private void processKey(WatchKey key) throws IOException { if (matcher != null && !matcher.shouldVerify(stringPath)) continue; // Exclusion; should not be verified // Verify is REALLY modified (not just attributes) - //if (kind.equals(StandardWatchEventKinds.ENTRY_MODIFY)) { - // HashedEntry entry = hdir.resolve(stringPath); - // if (entry != null && (entry.getType() != Type.FILE || ((HashedFile) entry).isSame(path, digest))) - // continue; // Modified attributes, not need to worry :D - //} + if (kind.equals(StandardWatchEventKinds.ENTRY_MODIFY)) { + HashedEntry entry = hdir.resolve(stringPath); + if (entry != null && (entry.getType() != Type.FILE || ((HashedFile) entry).isSame(path, digest))) + continue; // Modified attributes, not need to worry :D + } // Forbidden modification! throw new SecurityException(String.format("Forbidden modification (%s, %d times): '%s'", kind, event.count(), path));