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.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
// TODO per-thread secmgr
|
||||||
public class ExecCheckingSecurityManager extends SecurityManager {
|
public class ExecCheckingSecurityManager extends SecurityManager {
|
||||||
public ExecCheckingSecurityManager() {
|
public ExecCheckingSecurityManager() {
|
||||||
this(true);
|
this(true);
|
||||||
@@ -41,7 +42,6 @@ public class ExecCheckingSecurityManager extends SecurityManager {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public static class ExecException extends RuntimeException {
|
public static class ExecException extends RuntimeException {
|
||||||
private final String threadName = Thread.currentThread().getName();
|
private final String threadName = Thread.currentThread().getName();
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ public class CommandExecTest implements CustomTest {
|
|||||||
@Override
|
@Override
|
||||||
public void run(Callable<Object> payload) throws Exception {
|
public void run(Callable<Object> payload) throws Exception {
|
||||||
Assert.assertFalse("test file should not exist", testFile.exists());
|
Assert.assertFalse("test file should not exist", testFile.exists());
|
||||||
Exception err;
|
|
||||||
try {
|
try {
|
||||||
payload.call();
|
payload.call();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ public class PayloadsTest {
|
|||||||
customDeserializer = ((CustomDeserializer)testHarness).getCustomDeserializer();
|
customDeserializer = ((CustomDeserializer)testHarness).getCustomDeserializer();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecCheckingSecurityManager sm = new ExecCheckingSecurityManager();
|
// TODO per-thread secmgr to enforce no detonation during deserialization
|
||||||
final byte[] serialized = sm.callWrapped(makeSerializeCallable(payloadClass, payloadCommand));
|
final byte[] serialized = makeSerializeCallable(payloadClass, payloadCommand).call();
|
||||||
Callable<Object> callable = makeDeserializeCallable(t, addlClassesForClassLoader, deps, serialized, customDeserializer);
|
Callable<Object> callable = makeDeserializeCallable(t, addlClassesForClassLoader, deps, serialized, customDeserializer);
|
||||||
if ( testHarness instanceof WrappedTest ) {
|
if ( testHarness instanceof WrappedTest ) {
|
||||||
callable = ( (WrappedTest) testHarness ).createCallable(callable);
|
callable = ( (WrappedTest) testHarness ).createCallable(callable);
|
||||||
|
|||||||
Reference in New Issue
Block a user