Discussion:
Nashorn script security permissions not working for .js
(too old to reply)
Krueger, Simon
2018-07-10 23:55:40 UTC
Permalink
I cannot get the example at https://wiki.openjdk.java.net/display/Nashorn/Nashorn+script+security+permissions to work. Specifically, I cannot seem to get the permissions for the test.js to apply. The permissions of the .jar that loads the test.js will work. This seems to be a bug. Can anyone else verify if it is working for them or not?
Sundararajan Athijegannathan
2018-07-23 05:24:55 UTC
Permalink
Make sure that test.js is loaded via URLReader or load primitive. i.e.,
nashorn engine should load the script pointed via URL - if you pass
FileReader or loaded content to engine.eval, Nashorn will treat it as
sandboxed - i.e., script loaded from untrusted source. If it still does
not work for you, please post a test case here and/or file a bug with a
test.

-Sundar
Post by Krueger, Simon
I cannot get the example at https://wiki.openjdk.java.net/display/Nashorn/Nashorn+script+security+permissions to work. Specifically, I cannot seem to get the permissions for the test.js to apply. The permissions of the .jar that loads the test.js will work. This seems to be a bug. Can anyone else verify if it is working for them or not?
Simon
Loading...