Merge pull request #15311 from rmuir/symlinks_are_bad
punch thru symlinks when loading plugins/modules
This commit is contained in:
commit
0bf9e36eaa
|
@ -316,7 +316,8 @@ public class PluginsService extends AbstractComponent {
|
|||
// gather urls for jar files
|
||||
try (DirectoryStream<Path> jarStream = Files.newDirectoryStream(module, "*.jar")) {
|
||||
for (Path jar : jarStream) {
|
||||
bundle.urls.add(jar.toUri().toURL());
|
||||
// normalize with toRealPath to get symlinks out of our hair
|
||||
bundle.urls.add(jar.toRealPath().toUri().toURL());
|
||||
}
|
||||
}
|
||||
bundles.add(bundle);
|
||||
|
@ -357,7 +358,8 @@ public class PluginsService extends AbstractComponent {
|
|||
// a jvm plugin: gather urls for jar files
|
||||
try (DirectoryStream<Path> jarStream = Files.newDirectoryStream(plugin, "*.jar")) {
|
||||
for (Path jar : jarStream) {
|
||||
urls.add(jar.toUri().toURL());
|
||||
// normalize with toRealPath to get symlinks out of our hair
|
||||
urls.add(jar.toRealPath().toUri().toURL());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue