Skip to content

Commit 82c9bc0

Browse files
committed
Add new permission for JDK11 to load JAAS libraries (#32132)
Hadoop's security model uses the OS level authentication modules to collect information about the current user. In JDK 11, the UnixLoginModule makes use of a new permission to determine if the executing code is allowed to load the libraries required to pull the user information from the OS. This PR adds that permission and re-enables the tests that were previously failing when testing against JDK 11.
1 parent ad4bbb1 commit 82c9bc0

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

plugins/repository-hdfs/build.gradle

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1/*
1+
/*
22
* Licensed to Elasticsearch under one or more contributor
33
* license agreements. See the NOTICE file distributed with
44
* this work for additional information regarding copyright
@@ -215,25 +215,6 @@ RestIntegTestTask integTestSecureHa = project.tasks.create('integTestSecureHa',
215215
description = "Runs rest tests against an elasticsearch cluster with HDFS configured with HA Namenode and secured by MIT Kerberos."
216216
}
217217

218-
if (rootProject.ext.compilerJavaVersion.isJava11()) {
219-
// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498
220-
integTestRunner {
221-
systemProperty 'tests.rest.blacklist', [
222-
'hdfs_repository/30_snapshot/take snapshot',
223-
'hdfs_repository/40_restore/Create a snapshot and then restore it',
224-
'hdfs_repository/20_repository_verify/HDFS Repository Verify',
225-
'hdfs_repository/30_snapshot_get/Get a snapshot',
226-
'hdfs_repository/20_repository_create/HDFS Repository Creation',
227-
'hdfs_repository/20_repository_delete/HDFS Delete Repository',
228-
'hdfs_repository/30_snapshot_readonly/Get a snapshot - readonly',
229-
].join(',')
230-
}
231-
}
232-
if (rootProject.ext.runtimeJavaVersion.isJava11()) {
233-
// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498
234-
integTestHa.enabled = false
235-
}
236-
237218
// Determine HDFS Fixture compatibility for the current build environment.
238219
boolean fixtureSupported = false
239220
if (Os.isFamily(Os.FAMILY_WINDOWS)) {

plugins/repository-hdfs/src/main/plugin-metadata/plugin-security.policy

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ grant {
6161

6262
// Hadoop depends on OS level user information for simple authentication
6363
// Unix: UnixLoginModule: com.sun.security.auth.module.UnixSystem.UnixSystem init
64+
permission java.lang.RuntimePermission "loadLibrary.jaas";
6465
permission java.lang.RuntimePermission "loadLibrary.jaas_unix";
6566
// Windows: NTLoginModule: com.sun.security.auth.module.NTSystem.loadNative
6667
permission java.lang.RuntimePermission "loadLibrary.jaas_nt";

0 commit comments

Comments
 (0)