Sandbox-Test: Deskriptoren von aussen zaehlen (#654)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c220d3cdb4
commit
b74177c142
@@ -126,7 +126,9 @@ public sealed class SandboxEscapeTests : IDisposable
|
|||||||
{
|
{
|
||||||
using var held = File.OpenRead(_instanceSecret); // a file the main process has open
|
using var held = File.OpenRead(_instanceSecret); // a file the main process has open
|
||||||
|
|
||||||
var result = await Sh("for f in /proc/$$/fd/*; do echo ${f##*/}; done");
|
// Listed by a child: a shell globbing its own /proc/$$/fd opens that directory and
|
||||||
|
// would count the handle as fd 3.
|
||||||
|
var result = await Sh("ls /proc/$$/fd");
|
||||||
|
|
||||||
result.StandardOutput.Split('\n', StringSplitOptions.RemoveEmptyEntries).ShouldBe(["0", "1", "2"], ignoreOrder: true);
|
result.StandardOutput.Split('\n', StringSplitOptions.RemoveEmptyEntries).ShouldBe(["0", "1", "2"], ignoreOrder: true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user