From 9123c06aec1a6cc69c9525cb502508bc0b11bcb0 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 22 Feb 2021 12:51:17 +0100 Subject: [PATCH] Fixed issue with `/~` folder created doing install --- src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs b/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs index 22dd3d4276..589a70b7b7 100644 --- a/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs +++ b/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs @@ -7,12 +7,12 @@ using System.IO; using System.Linq; using System.Security.AccessControl; using Microsoft.Extensions.Options; +using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Install; using Umbraco.Cms.Core.IO; using Umbraco.Extensions; -using Constants = Umbraco.Cms.Core.Constants; namespace Umbraco.Infrastructure.Install { @@ -27,6 +27,7 @@ namespace Umbraco.Infrastructure.Install private readonly string[] _permissionFiles = Array.Empty(); private readonly GlobalSettings _globalSettings; private readonly IIOHelper _ioHelper; + private readonly IHostingEnvironment _hostingEnvironment; private string _basePath; /// @@ -36,6 +37,7 @@ namespace Umbraco.Infrastructure.Install { _globalSettings = globalSettings.Value; _ioHelper = ioHelper; + _hostingEnvironment = hostingEnvironment; _basePath = hostingEnvironment.MapPathContentRoot("/"); _permissionDirs = new[] { @@ -68,7 +70,7 @@ namespace Umbraco.Infrastructure.Install EnsureFiles(_permissionFiles, out errors); report[FilePermissionTest.FileWriting] = errors.ToList(); - EnsureCanCreateSubDirectory(_globalSettings.UmbracoMediaPath, out errors); + EnsureCanCreateSubDirectory(_hostingEnvironment.MapPathWebRoot(_globalSettings.UmbracoMediaPath), out errors); report[FilePermissionTest.MediaFolderCreation] = errors.ToList(); return report.Sum(x => x.Value.Count()) == 0;