Skip to content

Commit a9cf168

Browse files
committed
Removed unused "else" branch for no entitlements/no SM (elastic#122354)
1 parent 7fcc2ef commit a9cf168

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
243243
nodeEnv.configDir(),
244244
nodeEnv.tmpDir()
245245
);
246-
} else if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
246+
} else {
247+
assert RuntimeVersionFeature.isSecurityManagerAvailable();
247248
// no need to explicitly enable native access for legacy code
248249
pluginsLoader = PluginsLoader.createPluginsLoader(modulesBundles, pluginsBundles, Map.of());
249250
// install SM after natives, shutdown hooks, etc.
@@ -253,10 +254,6 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
253254
SECURITY_FILTER_BAD_DEFAULTS_SETTING.get(args.nodeSettings()),
254255
args.pidFile()
255256
);
256-
} else {
257-
// TODO: should we throw/interrupt startup in this case?
258-
pluginsLoader = PluginsLoader.createPluginsLoader(modulesBundles, pluginsBundles, Map.of());
259-
LogManager.getLogger(Elasticsearch.class).warn("Bootstrapping without any protection");
260257
}
261258

262259
bootstrap.setPluginsLoader(pluginsLoader);

0 commit comments

Comments
 (0)