Skip to content
Snippets Groups Projects
Commit 1481770c authored by Tim Felgentreff's avatar Tim Felgentreff
Browse files

allow all access (and disallow host access based on the JVM argument as previously)

parent b6461458
No related branches found
No related tags found
No related merge requests found
...@@ -165,8 +165,8 @@ public class RCommand { ...@@ -165,8 +165,8 @@ public class RCommand {
RCmdOptions options = RCmdOptions.parseArguments(Client.R, argsList.toArray(new String[argsList.size()]), false); RCmdOptions options = RCmdOptions.parseArguments(Client.R, argsList.toArray(new String[argsList.size()]), false);
assert env == null || env.length == 0 : "re-enable setting environments"; assert env == null || env.length == 0 : "re-enable setting environments";
ConsoleHandler consoleHandler = createConsoleHandler(options, null, inStream, outStream); ConsoleHandler consoleHandler = createConsoleHandler(options, null, inStream, outStream);
try (Context context = Context.newBuilder().allowHostAccess(useJVM).options(polyglotOptions).arguments("R", options.getArguments()).in(consoleHandler.createInputStream()).out(outStream).err( try (Context context = Context.newBuilder().allowAllAccess(true).allowHostAccess(useJVM).options(polyglotOptions).arguments("R", options.getArguments()).in(
errStream).build()) { consoleHandler.createInputStream()).out(outStream).err(errStream).build()) {
consoleHandler.setContext(context); consoleHandler.setContext(context);
StartupTiming.timestamp("VM Created"); StartupTiming.timestamp("VM Created");
StartupTiming.printSummary(); StartupTiming.printSummary();
......
...@@ -138,8 +138,8 @@ public class RscriptCommand { ...@@ -138,8 +138,8 @@ public class RscriptCommand {
String[] arguments = preprocessRScriptOptions(launcher, options); String[] arguments = preprocessRScriptOptions(launcher, options);
ConsoleHandler consoleHandler = RCommand.createConsoleHandler(options, null, inStream, outStream); ConsoleHandler consoleHandler = RCommand.createConsoleHandler(options, null, inStream, outStream);
try (Context context = Context.newBuilder().allowHostAccess(useJVM).options(polyglotOptions).arguments("R", arguments).in(consoleHandler.createInputStream()).out(outStream).err( try (Context context = Context.newBuilder().allowAllAccess(true).allowHostAccess(useJVM).options(polyglotOptions).arguments("R", arguments).in(consoleHandler.createInputStream()).out(
errStream).build()) { outStream).err(errStream).build()) {
consoleHandler.setContext(context); consoleHandler.setContext(context);
String fileOption = options.getString(RCmdOption.FILE); String fileOption = options.getString(RCmdOption.FILE);
return RCommand.readEvalPrint(context, consoleHandler, fileOption != null ? new File(fileOption) : null); return RCommand.readEvalPrint(context, consoleHandler, fileOption != null ? new File(fileOption) : null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment