Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CommonLib/LdapUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ public IAsyncEnumerable<LdapResult<IDirectoryObject>> PagedQuery(LdapQueryParame

private async Task<(bool Success, string DomainName)> ConvertDomainSidToDomainNameFromLdap(string domainSid) {
if (!GetDomain(out var domain) || domain?.Name == null) {
// fix: BED-6026 adding the domainSid to _unresolvablePrincipals cache to prevent repeated resolving
_unresolvablePrincipals.Add(domainSid);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetDomain returns false if the external call returns an exception. So I figured we can add the SID to _unresolvablePrincipals when it checks the domain and it comes back blank. This can avoid any other attempts to try and resolve that SID and lower the execution time that the user had stated they were experiencing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not been able to test this. Mini GOAD has let me down

return (false, string.Empty);
}

Expand Down
Loading