From 058f537f8c8d93443dacedbaf8da5aca731d5577 Mon Sep 17 00:00:00 2001 From: rvazarkar Date: Thu, 23 May 2024 10:56:01 -0400 Subject: [PATCH] fix: check correct var --- src/CommonLib/LDAPUtils.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CommonLib/LDAPUtils.cs b/src/CommonLib/LDAPUtils.cs index 5711b86a..bba944c9 100644 --- a/src/CommonLib/LDAPUtils.cs +++ b/src/CommonLib/LDAPUtils.cs @@ -520,7 +520,7 @@ public IEnumerable DoRangedRetrieval(string distinguishedName, string at yield break; } - if (connWrapper == null) + if (connWrapper.Connection == null) yield break; var conn = connWrapper.Connection; @@ -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); }