luben / zstd-jni

JNI binding for Zstd
Other
854 stars 168 forks source link

Wrap the System.load and System.loadLibrary calls with doPrivileged. #243

Closed mulugetam closed 1 year ago

mulugetam commented 1 year ago

In cases where pluggable modules are in use and Java security permissions are applied, such as in OpenSearch, wrapping the System.load and System.loadLibrary calls with AccessController.doPrivileged resolves access control exceptions thrown by plugins that are granted access to load a native library. This PR does that.

This PR is motivated by an effort to add zstd-jni and lz4-java compressions into OpenSearch compression plugin.

Signed-off-by: Mulugeta Mammo mulugeta.mammo@intel.com

luben commented 1 year ago

LGTM! Thanks for the contribution!