Skip to content

Commit

Permalink
fix: check correct var
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed May 23, 2024
1 parent 6f83663 commit 058f537
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CommonLib/LDAPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public IEnumerable<string> DoRangedRetrieval(string distinguishedName, string at
yield break;
}

if (connWrapper == null)
if (connWrapper.Connection == null)
yield break;

var conn = connWrapper.Connection;
Expand Down Expand Up @@ -1703,11 +1703,14 @@ private LdapConnectionWrapper CreateLDAPConnection(string target, AuthType authT
if (!string.IsNullOrEmpty(baseDomainInfo.DomainSID))
{
Cache.AddDomainSidMapping(baseDomainInfo.DomainFQDN, baseDomainInfo.DomainSID);
if (!string.IsNullOrEmpty(baseDomainInfo.DomainNetbiosName))
{
Cache.AddDomainSidMapping(baseDomainInfo.DomainNetbiosName, baseDomainInfo.DomainSID);
}
}

if (!string.IsNullOrEmpty(baseDomainInfo.DomainNetbiosName))
{
Cache.AddDomainSidMapping(baseDomainInfo.DomainNetbiosName, baseDomainInfo.DomainSID);
_netbiosCache.TryAdd(baseDomainInfo.DomainFQDN, baseDomainInfo.DomainNetbiosName);
}

Expand Down

0 comments on commit 058f537

Please sign in to comment.