Given the already existing path D:/git/projects/repo_name/source/project_name/uploads/ with the following permissions:
D: ~> Full control to windows_user & administrator_group
git ~> Full control to windows_user & administrator_group
projects ~> Full control to windows_user & administrator_group
repo_name ~> Full control to windows_user & administrator_group
source ~> Full control to windows_user & administrator_group
project_name ~> Full control to IIS_POOL_USER, windows_user & administrator_group
uploads ~> Full control to IIS_POOL_USER, windows_user & administrator_group
and executing the Pri.LongPath.Directory.CreateDirectory("D:\git\projects\repo_name\Source\project_name\Uploads\folder_to_create\"); in an app hosted in IIS, running as the IIS_POOL_USER the pathComponents list contains folders that do exist but the IIS_POOL_USER has no permissions.
I propose that lines 847 & 848 should be altered like this:
if (Exists(subPath))
{
break; // If a subfolder exists then there's no need to check for parent folders
}
else
{
pathComponents.Add(Path.NormalizeLongPath(subPath));
}
Given the already existing path
D:/git/projects/repo_name/source/project_name/uploads/
with the following permissions:windows_user
&administrator_group
windows_user
&administrator_group
windows_user
&administrator_group
windows_user
&administrator_group
windows_user
&administrator_group
IIS_POOL_USER
,windows_user
&administrator_group
IIS_POOL_USER
,windows_user
&administrator_group
and executing the
Pri.LongPath.Directory.CreateDirectory("D:\git\projects\repo_name\Source\project_name\Uploads\folder_to_create\");
in an app hosted in IIS, running as theIIS_POOL_USER
thepathComponents
list contains folders that do exist but theIIS_POOL_USER
has no permissions.In the following code: https://github.com/peteraritchie/LongPath/blob/6133dc9ca935127e1663fef27a52717e4174db3d/Pri.LongPath/Directory.cs#L840-L867
I propose that lines 847 & 848 should be altered like this: