File tree Expand file tree Collapse file tree
src/main/java/the/bytecode/club/bytecodeviewer/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import java .io .IOException ;
66import java .net .InetAddress ;
77import java .security .Permission ;
8+ import java .util .concurrent .atomic .AtomicInteger ;
89import the .bytecode .club .bytecodeviewer .BytecodeViewer ;
910import the .bytecode .club .bytecodeviewer .Configuration ;
1011import the .bytecode .club .bytecodeviewer .Constants ;
4445
4546public class SecurityMan extends SecurityManager
4647{
47- private volatile boolean silentExec = true ;
48+ private final AtomicInteger silentExec = new AtomicInteger ( 1 ) ;
4849 private boolean printing = false ;
4950 private boolean printingPackage = false ;
5051
5152 public void silenceExec (boolean b ) {
52- silentExec = b ;
53+ silentExec . addAndGet ( b ? 1 : - 1 ) ;
5354 }
5455
5556 public void setPrinting (boolean printing )
@@ -160,7 +161,7 @@ else if(canClassExecute(Thread.currentThread().getStackTrace()[7].getClassName()
160161 //log exec if allowed
161162 if (allow && validClassCall && !blocked )
162163 {
163- if (silentExec )
164+ if (silentExec . get () >= 1 )
164165 System .err .println ("Allowing exec: " + cmd );
165166 } //throw exception stopping execution
166167 else throw new SecurityException ("BCV is awesome! Blocking exec: " + cmd );
You can’t perform that action at this time.
0 commit comments