Files
VolcanicAgenticCore/tests/Volcanic.AgenticCore.Extensions.Tests/NoHostHardening.cs
EugeneTes 76e0f8c0e2 feat(processes): make the host process non-dumpable on Linux
HostProcessHardening calls prctl(PR_SET_DUMPABLE, 0) through LibraryImport, once per process, from the ProcessSpawnPolicy constructor, and warns when DOTNET_EnableDiagnostics is not 0. Test projects consume the one-shot call with the flag off in a module initializer. A HardeningProbe helper backs a Linux-only /proc integration test.
2026-09-26 19:09:45 +02:00

14 lines
528 B
C#

using System.Runtime.CompilerServices;
using Microsoft.Extensions.Logging.Abstractions;
using Volcanic.AgenticCore.Features.Processes;
namespace Volcanic.AgenticCore.Extensions.Tests;
/// <summary>Consumes the process-wide hardening call with the flag off, so the test runner stays debuggable.</summary>
internal static class NoHostHardening
{
[ModuleInitializer]
internal static void Disable() =>
HostProcessHardening.Apply(new ProcessEnvironmentOptions { HardenHostProcess = false }, NullLogger.Instance);
}