mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-167037 The assertion "File accessed outside allowed root" is triggered by files symlinked from the the JDK installation folder
This commit is contained in:
@@ -73,12 +73,7 @@ public class VfsRootAccess {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<String> allowed = ApplicationManager.getApplication().runReadAction(new Computable<Set<String>>() {
|
||||
@Override
|
||||
public Set<String> compute() {
|
||||
return allowedRoots();
|
||||
}
|
||||
});
|
||||
Set<String> allowed = ApplicationManager.getApplication().runReadAction((Computable<Set<String>>)VfsRootAccess::allowedRoots);
|
||||
boolean isUnder = allowed == null || allowed.isEmpty();
|
||||
|
||||
if (!isUnder) {
|
||||
@@ -141,6 +136,9 @@ public class VfsRootAccess {
|
||||
allowed.add(FileUtil.toSystemIndependentName(System.getProperty("java.io.tmpdir")));
|
||||
allowed.add(FileUtil.toSystemIndependentName(SystemProperties.getUserHome()));
|
||||
|
||||
allowed.add("/etc"); // After recent update of Oracle JDK 1.8 under Ubuntu Certain files in the JDK installation are symlinked to /etc
|
||||
// see IDEA-167037 The assertion "File accessed outside allowed root" is triggered by files symlinked from the the JDK installation folder
|
||||
|
||||
for (final Project project : openProjects) {
|
||||
if (!project.isInitialized()) {
|
||||
return null; // all is allowed
|
||||
@@ -178,12 +176,7 @@ public class VfsRootAccess {
|
||||
public static void allowRootAccess(@NotNull Disposable disposable, @NotNull final String... roots) {
|
||||
if (roots.length == 0) return;
|
||||
allowRootAccess(roots);
|
||||
Disposer.register(disposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
disallowRootAccess(roots);
|
||||
}
|
||||
});
|
||||
Disposer.register(disposable, () -> disallowRootAccess(roots));
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
|
||||
Reference in New Issue
Block a user