diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-23 09:23:52 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-23 09:23:52 -0500 |
| commit | 62cf077ec126089b2a6a1e0c3933167cec4003de (patch) | |
| tree | 211203be241855d3c07cb57480327e5698c6592c /src/slskd/Core/API/Controllers | |
| parent | 4080dcc60fd006b2e5502a4f47f47869692f6b25 (diff) | |
| download | slskd-62cf077ec126089b2a6a1e0c3933167cec4003de.tar.gz | |
delete dump file after transmission
Diffstat (limited to 'src/slskd/Core/API/Controllers')
| -rw-r--r-- | src/slskd/Core/API/Controllers/ApplicationController.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index c9af1296..fc2e31a7 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -36,6 +36,7 @@ namespace slskd.Core.API { using System; using System.Diagnostics; + using System.IO; using System.Threading.Tasks; using Asp.Versioning; using Microsoft.AspNetCore.Authorization; @@ -181,7 +182,9 @@ namespace slskd.Core.API Log.Warning("Dump complete"); - return PhysicalFile(file, "application/octet-stream", "slskd.dmp"); + // the dump contains everything in memory, including secrets. delete it once it has been sent + var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.None, bufferSize: 4096, FileOptions.DeleteOnClose); + return File(stream, "application/octet-stream", "slskd.dmp"); } Log.Warning("Unauthorized attempt to dump application memory; Flags.Dumpable is disabled"); |
