HADOOP-12888 Shell to disable bash and setsid support when running under JVM security manager (Costin Leau via stevel)

This commit is contained in:
Steve Loughran 2016-03-16 14:31:19 +00:00
parent 3ef5500783
commit 5a725f0ab8

View File

@ -717,6 +717,10 @@ private static boolean checkIsBashSupported() {
} catch (IOException ioe) {
LOG.warn("Bash is not supported by the OS", ioe);
supported = false;
} catch (SecurityException se) {
LOG.info("Bash execution is not allowed by the JVM " +
"security manager.Considering it not supported.");
supported = false;
}
return supported;
@ -744,6 +748,10 @@ private static boolean isSetsidSupported() {
} catch (IOException ioe) {
LOG.debug("setsid is not available on this machine. So not using it.");
setsidSupported = false;
} catch (SecurityException se) {
LOG.debug("setsid is not allowed to run by the JVM "+
"security manager. So not using it.");
setsidSupported = false;
} catch (Error err) {
if (err.getMessage() != null
&& err.getMessage().contains("posix_spawn is not " +