Skip NTFS ensure and traverse on share roots

This commit is contained in:
Meik
2026-03-18 15:54:42 +01:00
parent eb6f23321d
commit 9d9575c9ef
2 changed files with 33 additions and 0 deletions

View File

@@ -648,6 +648,15 @@ namespace C4IT.LIAM
bool ensureTraverseGroups = false,
bool whatIf = false)
{
if (!IsPermissionManagedFolderPath(folderPath))
{
return Task.FromResult(new ResultToken(System.Reflection.MethodBase.GetCurrentMethod().ToString())
{
resultErrorId = 30008,
resultMessage = $"NTFS permission ensure is only supported for folder paths. Shares, DFS namespaces and server roots are skipped: {folderPath}"
});
}
var parentPath = Directory.GetParent(folderPath)?.FullName;
var engine = CreateFilesystemEngine(
folderPath,
@@ -704,6 +713,7 @@ namespace C4IT.LIAM
groupTraverseTag = GetRequiredCustomTag("Filesystem_GroupTraverseTag"),
groupDLTag = requiresDomainLocalTag ? GetRequiredCustomTag("Filesystem_GroupDomainLocalTag") : string.Empty,
groupGTag = GetRequiredCustomTag("Filesystem_GroupGlobalTag"),
CanManagePermissionsForPath = IsPermissionManagedFolderPath,
forceStrictAdGroupNames = IsAdditionalConfigurationEnabled("ForceStrictAdGroupNames")
};
@@ -726,6 +736,12 @@ namespace C4IT.LIAM
|| rawValue.Equals("yes", StringComparison.OrdinalIgnoreCase);
}
public bool IsPermissionManagedFolderPath(string path)
{
var classification = ClassifyPath(path);
return classification != null && classification.Kind == eNtfsPathKind.Folder;
}
private IEnumerable<IAM_SecurityGroupTemplate> BuildSecurityGroupTemplates()
{
var templates = new List<IAM_SecurityGroupTemplate>();