Add missing runtime permission to TikaImpl (#28602)
Tests on jdk10 were failing because of a change in its ZipFile implementation that now needs `accessDeclaredMembers` permissions. This change adds the missing permission to the plugins security policy and TikaImpl. Closes #28568
This commit is contained in:
parent
da1a10fa92
commit
cc9cb5356a
|
@ -52,8 +52,8 @@ import java.security.SecurityPermission;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.PropertyPermission;
|
import java.util.PropertyPermission;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs tika with limited parsers and limited permissions.
|
* Runs tika with limited parsers and limited permissions.
|
||||||
|
@ -161,6 +161,8 @@ final class TikaImpl {
|
||||||
perms.add(new ReflectPermission("suppressAccessChecks"));
|
perms.add(new ReflectPermission("suppressAccessChecks"));
|
||||||
// xmlbeans, use by POI, needs to get the context classloader
|
// xmlbeans, use by POI, needs to get the context classloader
|
||||||
perms.add(new RuntimePermission("getClassLoader"));
|
perms.add(new RuntimePermission("getClassLoader"));
|
||||||
|
// ZipFile needs accessDeclaredMembers on Java 10
|
||||||
|
perms.add(new RuntimePermission("accessDeclaredMembers"));
|
||||||
perms.setReadOnly();
|
perms.setReadOnly();
|
||||||
return perms;
|
return perms;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,6 @@ grant {
|
||||||
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
||||||
// needed by xmlbeans, as part of POI for MS xml docs
|
// needed by xmlbeans, as part of POI for MS xml docs
|
||||||
permission java.lang.RuntimePermission "getClassLoader";
|
permission java.lang.RuntimePermission "getClassLoader";
|
||||||
|
// ZipFile needs accessDeclaredMembers on Java 10
|
||||||
|
permission java.lang.RuntimePermission "accessDeclaredMembers";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue