HADOOP-12888 Shell to disable bash and setsid support when running under JVM security manager (Costin Leau via stevel)
This commit is contained in:
parent
3ef5500783
commit
5a725f0ab8
@ -717,6 +717,10 @@ private static boolean checkIsBashSupported() {
|
|||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
LOG.warn("Bash is not supported by the OS", ioe);
|
LOG.warn("Bash is not supported by the OS", ioe);
|
||||||
supported = false;
|
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;
|
return supported;
|
||||||
@ -744,7 +748,11 @@ private static boolean isSetsidSupported() {
|
|||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
LOG.debug("setsid is not available on this machine. So not using it.");
|
LOG.debug("setsid is not available on this machine. So not using it.");
|
||||||
setsidSupported = false;
|
setsidSupported = false;
|
||||||
} catch (Error err) {
|
} 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
|
if (err.getMessage() != null
|
||||||
&& err.getMessage().contains("posix_spawn is not " +
|
&& err.getMessage().contains("posix_spawn is not " +
|
||||||
"a supported process launch mechanism")
|
"a supported process launch mechanism")
|
||||||
|
Loading…
Reference in New Issue
Block a user