Fix NTFS ensure group reuse and parent mapping

This commit is contained in:
Meik
2026-03-13 23:37:47 +01:00
parent 865fa577e3
commit 42f57ed7ba
2 changed files with 9 additions and 4 deletions

View File

@@ -267,6 +267,9 @@ namespace C4IT.LIAM
? new DirectoryInfo(classification.NormalizedPath).CreationTimeUtc.ToString("s")
: DateTime.MinValue.ToString("s")
};
folderData.Level = classification.Level;
if (folderData.Parent == null && !string.IsNullOrWhiteSpace(classification.ParentPath))
folderData.Parent = new cNtfsResultFolder() { Path = classification.ParentPath };
var parentPath = !string.IsNullOrWhiteSpace(classification.ParentPath)
? classification.ParentPath
: classification.ParentBoundaryPath;
@@ -1147,7 +1150,11 @@ namespace C4IT.LIAM
this.Level = NtfsFolder.Level;
this.DataType = eLiamDataAreaTypes.NtfsFolder;
this.CreatedDate = NtfsFolder.CreatedDate;
if (ntfsParent != null)
if (!string.IsNullOrWhiteSpace(parentPathOverride))
{
this.ParentUID = GetUniqueDataAreaID(parentPathOverride);
}
else if (ntfsParent != null)
{
this.ParentUID = GetUniqueDataAreaID(ntfsParent.Path);
}
@@ -1155,8 +1162,6 @@ namespace C4IT.LIAM
{
this.ParentUID = GetUniqueDataAreaID(this.Provider.RootPath);
}
if (string.IsNullOrWhiteSpace(this.ParentUID) && !string.IsNullOrWhiteSpace(parentPathOverride))
this.ParentUID = GetUniqueDataAreaID(parentPathOverride);
}
public static string GetUniqueDataAreaID(string fullPath)

View File

@@ -617,7 +617,7 @@ namespace C4IT_IAM_Engine
if (existingGroup == null)
existingGroup = FindGroupEntry(secGroup.Name);
if (existingGroup == null && !ForceStrictAdGroupNames)
if (existingGroup == null && !ForceStrictAdGroupNames && string.IsNullOrWhiteSpace(folderPath))
existingGroup = FindGroupEntryByWildcard(ouPath, secGroup.WildcardPattern);
if (existingGroup == null)