From 0f21222a0c873b9e3e258ec6c3ed32278b41614f Mon Sep 17 00:00:00 2001 From: crobibero Date: Mon, 27 Oct 2025 15:43:25 -0400 Subject: [PATCH] Backport pull request #15196 from jellyfin/release-10.11.z Skip directory entry when restoring from backup Original-merge: 0e4031ae52b2ca3a19e22bfc6ab9c9af88944bd8 Merged-by: crobibero Backported-by: Bond_009 --- .../FullSystemBackup/BackupService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs b/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs index e39a2b42f6..70483c36cc 100644 --- a/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs +++ b/Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs @@ -128,7 +128,8 @@ public class BackupService : IBackupService var targetPath = Path.GetFullPath(Path.Combine(target, Path.GetRelativePath(source, item.FullName))); if (!sourcePath.StartsWith(fullSourcePath, StringComparison.Ordinal) - || !targetPath.StartsWith(fullTargetRoot, StringComparison.Ordinal)) + || !targetPath.StartsWith(fullTargetRoot, StringComparison.Ordinal) + || Path.EndsInDirectorySeparator(item.FullName)) { continue; }