Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jruby-1_7'
Browse files Browse the repository at this point in the history
Conflicts:
	core/pom.xml
	core/src/main/java/org/jruby/Ruby.java
  • Loading branch information
headius committed Apr 23, 2015
2 parents c770ac5 + 9588ec1 commit 4b1526d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 15 additions & 0 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -167,6 +167,7 @@
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.net.BindException;
import java.net.MalformedURLException;
import java.net.URL;
Expand Down Expand Up @@ -1287,6 +1288,20 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
loadService.require("jruby");
}

// attempt to enable unlimited-strength crypto on OpenJDK
try {
Class jceSecurity = Class.forName("javax.crypto.JceSecurity");
Field isRestricted = jceSecurity.getField("isRestricted");
isRestricted.setAccessible(true);
isRestricted.set(null, false);
isRestricted.setAccessible(false);
} catch (Exception e) {
if (isDebug()) {
System.err.println("unable to enable unlimited-strength crypto");
e.printStackTrace();
}
}

// out of base boot mode
bootingCore = false;

Expand Down
7 changes: 3 additions & 4 deletions core/src/main/java/org/jruby/util/ShellLauncher.java
Expand Up @@ -757,7 +757,7 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings) throws I
}

private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env) throws IOException {
return popenShared(runtime, strings, env, false);
return popenShared(runtime, strings, env, true);
}

private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env, boolean addShell) throws IOException {
Expand All @@ -783,10 +783,9 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env,

String[] args = parseCommandLine(runtime.getCurrentContext(), runtime, strings);
LaunchConfig lc = new LaunchConfig(runtime, strings, false);
boolean useShell = lc.shouldRunInShell();
boolean useShell = Platform.IS_WINDOWS ? lc.shouldRunInShell() : false;
if (addShell) for (String arg : args) useShell |= shouldUseShell(arg);

// CON: popen is a case where I think we should just always shell out.

if (strings.length == 1) {
if (useShell) {
// single string command, pass to sh to expand wildcards
Expand Down

0 comments on commit 4b1526d

Please sign in to comment.