From 0d4d68d7362d81a8d065045e048346dd1c207c22 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 26 Jul 2025 20:08:31 -0400 Subject: [PATCH] Fix `DefaultIOManager` bugs - Fix `CreateResolverForSubdirectory` not considering if the input path was rooted. - Fix `DeleteDirectory` not resolving the input path. --- src/Tgstation.Server.Host/IO/DefaultIOManager.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Tgstation.Server.Host/IO/DefaultIOManager.cs b/src/Tgstation.Server.Host/IO/DefaultIOManager.cs index 470f437d7f..eaf2b27736 100644 --- a/src/Tgstation.Server.Host/IO/DefaultIOManager.cs +++ b/src/Tgstation.Server.Host/IO/DefaultIOManager.cs @@ -162,7 +162,8 @@ namespace Tgstation.Server.Host.IO => Task.Factory.StartNew( () => { - var di = fileSystem.DirectoryInfo.New(path); + var di = fileSystem.DirectoryInfo.New( + ResolvePath(path)); if (di.Exists) NormalizeAndDelete(di, cancellationToken); }, @@ -416,11 +417,14 @@ namespace Tgstation.Server.Host.IO { ArgumentNullException.ThrowIfNull(subdirectoryPath); + if (!Path.IsPathRooted(subdirectoryPath)) + subdirectoryPath = ConcatPath( + ResolvePath(), + subdirectoryPath); + return new ResolvingIOManager( fileSystem, - ConcatPath( - ResolvePath(), - subdirectoryPath)); + subdirectoryPath); } ///