Skip to content

Commit 763747d

Browse files
committed
don't let pluginmanager install modules
1 parent 208b46d commit 763747d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

core/src/main/java/org/elasticsearch/plugins/PluginManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public enum OutputMode {
6666
"plugin",
6767
"plugin.bat",
6868
"service.bat"));
69+
70+
static final Set<String> MODULES = unmodifiableSet(newHashSet(
71+
"lang-expression",
72+
"lang-groovy"));
6973

7074
static final Set<String> OFFICIAL_PLUGINS = unmodifiableSet(newHashSet(
7175
"analysis-icu",
@@ -78,8 +82,6 @@ public enum OutputMode {
7882
"discovery-ec2",
7983
"discovery-gce",
8084
"discovery-multicast",
81-
"lang-expression",
82-
"lang-groovy",
8385
"lang-javascript",
8486
"lang-python",
8587
"mapper-attachments",
@@ -221,6 +223,12 @@ private void extract(PluginHandle pluginHandle, Terminal terminal, Path pluginFi
221223
PluginInfo info = PluginInfo.readFromProperties(root);
222224
terminal.println(VERBOSE, "%s", info);
223225

226+
// don't let luser install plugin as a module...
227+
// they might be unavoidably in maven central and are packaged up the same way)
228+
if (MODULES.contains(info.getName())) {
229+
throw new IOException("plugin '" + info.getName() + "' cannot be installed like this, it is a system module");
230+
}
231+
224232
// update name in handle based on 'name' property found in descriptor file
225233
pluginHandle = new PluginHandle(info.getName(), pluginHandle.version, pluginHandle.user);
226234
final Path extractLocation = pluginHandle.extractedDir(environment);

0 commit comments

Comments
 (0)