summaryrefslogtreecommitdiffstats
path: root/node-maintainer/src/main
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2017-03-13 09:29:50 +0100
committerGitHub <noreply@github.com>2017-03-13 09:29:50 +0100
commitdbd533f835515a9277fc94c9d36a0d51b6cff751 (patch)
tree40ed291bc3a61132026ff777934bdedd986373e0 /node-maintainer/src/main
parent8d4c358fbdffe099ca3c164f156286563c2aa59b (diff)
parent92569b7ce5502ea337a9eb029e4510f702816c2c (diff)
Merge pull request #1986 from yahoo/freva/do-not-follow-sym-links-for-last-modified
Do not follow symbolic links when getting last modified time
Diffstat (limited to 'node-maintainer/src/main')
-rw-r--r--node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/FileHelper.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/FileHelper.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/FileHelper.java
index b9255ace848..7ad2d4c4d66 100644
--- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/FileHelper.java
+++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/FileHelper.java
@@ -3,6 +3,7 @@ package com.yahoo.vespa.hosted.node.maintainer;
import java.io.IOException;
import java.nio.file.Files;
+import java.nio.file.LinkOption;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
@@ -164,9 +165,9 @@ public class FileHelper {
}
}
- private static FileTime getLastModifiedTime(Path path) {
+ static FileTime getLastModifiedTime(Path path) {
try {
- return Files.getLastModifiedTime(path);
+ return Files.getLastModifiedTime(path, LinkOption.NOFOLLOW_LINKS);
} catch (IOException e) {
throw new RuntimeException("Failed to get last modified time of " + path.toAbsolutePath(), e);
}