mirror of
https://github.com/frohoff/ysoserial.git
synced 2026-09-21 22:50:46 +08:00
remove serialization-stage secmgr to avoid spurious errors due to extra surefire thread
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
// TODO per-thread secmgr
|
||||
public class ExecCheckingSecurityManager extends SecurityManager {
|
||||
public ExecCheckingSecurityManager() {
|
||||
this(true);
|
||||
@@ -41,7 +42,6 @@ public class ExecCheckingSecurityManager extends SecurityManager {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static class ExecException extends RuntimeException {
|
||||
private final String threadName = Thread.currentThread().getName();
|
||||
|
||||
@@ -16,7 +16,6 @@ public class CommandExecTest implements CustomTest {
|
||||
@Override
|
||||
public void run(Callable<Object> payload) throws Exception {
|
||||
Assert.assertFalse("test file should not exist", testFile.exists());
|
||||
Exception err;
|
||||
try {
|
||||
payload.call();
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -107,8 +107,8 @@ public class PayloadsTest {
|
||||
customDeserializer = ((CustomDeserializer)testHarness).getCustomDeserializer();
|
||||
}
|
||||
|
||||
ExecCheckingSecurityManager sm = new ExecCheckingSecurityManager();
|
||||
final byte[] serialized = sm.callWrapped(makeSerializeCallable(payloadClass, payloadCommand));
|
||||
// TODO per-thread secmgr to enforce no detonation during deserialization
|
||||
final byte[] serialized = makeSerializeCallable(payloadClass, payloadCommand).call();
|
||||
Callable<Object> callable = makeDeserializeCallable(t, addlClassesForClassLoader, deps, serialized, customDeserializer);
|
||||
if ( testHarness instanceof WrappedTest ) {
|
||||
callable = ( (WrappedTest) testHarness ).createCallable(callable);
|
||||
|
||||
Reference in New Issue
Block a user