Sanitize AD unsafe NTFS group name characters
This commit is contained in:
@@ -15,6 +15,7 @@ namespace C4IT_IAM_Engine
|
||||
public const int MaxAdGroupDescriptionLength = 1024;
|
||||
public const int MaxAdGroupLoopDigits = 3;
|
||||
public const string DefaultGroupNameSanitizeReplacement = "_";
|
||||
private const string AdUnsafeGroupNameCharactersPattern = @"[\x00-\x1F\s\-\/\\\[\]:;\|=,\+\*\?<>\@()'""]";
|
||||
private const int MinLeadingRelativePathSegmentLength = 3;
|
||||
private const int MinSingleLeadingRelativePathSegmentLength = 2;
|
||||
private const int MinLastRelativePathSegmentLength = 12;
|
||||
@@ -211,7 +212,7 @@ namespace C4IT_IAM_Engine
|
||||
return string.Empty;
|
||||
|
||||
var replacement = NormalizeGroupNameSanitizeReplacement(groupNameSanitizeReplacement);
|
||||
return Regex.Replace(segment, @"[\s\-]", match => replacement);
|
||||
return Regex.Replace(segment, AdUnsafeGroupNameCharactersPattern, match => replacement);
|
||||
}
|
||||
|
||||
public static string NormalizeGroupNameSanitizeReplacement(string replacement)
|
||||
|
||||
Reference in New Issue
Block a user