Properly erroring on ".." as path to FS methods. Closes #1708.

This commit is contained in:
Florian Nücke 2016-03-26 13:28:25 +01:00
parent 9bb3fae8d3
commit 0c0880d836

View File

@ -320,7 +320,7 @@ class FileSystem(val fileSystem: IFileSystem, var label: Label, val host: Option
private def clean(path: String) = {
val result = com.google.common.io.Files.simplifyPath(path)
if (result.startsWith("../")) throw new FileNotFoundException(path)
if (result.startsWith("../") || result == "..") throw new FileNotFoundException(path)
if (result == "/" || result == ".") ""
else result
}