diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 19:27:57 -0500 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 19:27:57 -0500 |
commit | ea95bdeb62a44d12faee0a6fcabc121d45b9b0b8 (patch) | |
tree | 295936b4e2dc0a953fd4d01dc8f2a1f623f8ea7a /stage1/Stage1Lib.scala | |
parent | d13f028ae0e9e25c36971f8045f1d19cb3e94002 (diff) | |
download | cbt-ea95bdeb62a44d12faee0a6fcabc121d45b9b0b8.tar.gz cbt-ea95bdeb62a44d12faee0a6fcabc121d45b9b0b8.tar.bz2 cbt-ea95bdeb62a44d12faee0a6fcabc121d45b9b0b8.zip |
Always reset security manager to what it was during startup. Should be less fragile with regards to concurrency and user code setting security managers.
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r-- | stage1/Stage1Lib.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 4af486c..9a1adb5 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -217,7 +217,6 @@ class Stage1Lib( val logger: Logger ) extends BaseLib{ } def trapExitCode( code: => Unit ): ExitCode = { - val old: Option[SecurityManager] = Option(System.getSecurityManager()) try{ System.setSecurityManager( trapSecurityManager ) code @@ -226,7 +225,7 @@ class Stage1Lib( val logger: Logger ) extends BaseLib{ case TrappedExitCode(exitCode) => exitCode } finally { - System.setSecurityManager(old.getOrElse(null)) + System.setSecurityManager(NailgunLauncher.defaultSecurityManager) } } } |