Skip to content

Commit

Permalink
Check blacklist against global catalog connections too
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelynotagoblin committed Jan 8, 2025
1 parent bda2bc4 commit 5d23536
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CommonLib/LdapConnectionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ private bool CallDsGetDcName(string domainName, out NetAPIStructs.DomainControll
}

public async Task<(bool Success, LdapConnectionWrapper ConnectionWrapper, string Message)> GetGlobalCatalogConnectionAsync() {
if (_blacklistedDomains.Contains(_identifier)) {
return (false, null, $"Identifier {_identifier} blacklisted for connection attempt");
}

if (!_globalCatalogConnection.TryTake(out var connectionWrapper)) {
var (success, connection, message) = await CreateNewConnection(true);
if (!success) {
Expand Down

0 comments on commit 5d23536

Please sign in to comment.