Log LIAM assembly identities and cap traverse depth

This commit is contained in:
Meik
2026-07-09 23:30:07 +02:00
parent e8b138f9c3
commit b9cd74c5a9
3 changed files with 70 additions and 4 deletions

View File

@@ -1521,10 +1521,33 @@ namespace C4IT.LIAM
private cNtfsLevelRange GetTraverseLevelRange()
{
return GetConfiguredLevelRange(
var range = GetConfiguredLevelRange(
AdditionalConfigurationTraverseGroupsMinLevelKey,
AdditionalConfigurationTraverseGroupsMaxLevelKey,
"traverse group level range");
if (range.IsValid
&& !HasAdditionalConfigurationValue(AdditionalConfigurationTraverseGroupsMaxLevelKey)
&& MaxDepth > 0)
{
var maxDepthLevel = MaxDepth - 1;
if (range.IsConfigured)
{
range.MaxLevel = Math.Min(range.MaxLevel, maxDepthLevel);
}
else
{
range.IsConfigured = true;
range.MaxLevel = maxDepthLevel;
}
if (range.MinLevel > range.MaxLevel)
{
range.IsValid = false;
range.ErrorMessage = $"AdditionalConfiguration traverse group level range is invalid because min level {range.MinLevel} is greater than effective max level {range.MaxLevel}.";
}
}
return range;
}
private cNtfsLevelRange GetConfiguredLevelRange(string minKey, string maxKey, string label)
@@ -1572,6 +1595,11 @@ namespace C4IT.LIAM
return range;
}
private bool HasAdditionalConfigurationValue(string key)
{
return !string.IsNullOrWhiteSpace(GetAdditionalConfigurationValue(key));
}
private static bool IsSupportedPermissionManagedPathKind(cNtfsPathClassification classification, params eNtfsPathKind[] supportedKinds)
{
if (classification == null || supportedKinds == null || supportedKinds.Length == 0)