CA-375282: Insert sanitised TARs into Temp folder

Avoids permission related exceptions

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-02-17 11:19:49 +00:00 committed by Danilo Del Busso
parent 653d66cb10
commit 39b84bbcc5

View File

@ -100,7 +100,7 @@ namespace XenAdmin.Actions
outFilename = Path.GetRandomFileName();
string outputDir = Path.Combine(_extractTempDir, Path.GetFileName(outFilename));
string sanitizedTar = Path.GetRandomFileName();
string sanitizedTar = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
TarSanitization.SanitizeTarForWindows(inputFile, sanitizedTar, CheckCancellation);
using (FileStream fs = File.OpenRead(sanitizedTar))