From ec85996dbb72ad04271b721bd18732ab0462d2ae Mon Sep 17 00:00:00 2001 From: rvazarkar Date: Mon, 22 Jul 2024 12:22:37 -0400 Subject: [PATCH] chore: rename entry in wrapper for clarity --- src/CommonLib/LdapConnectionWrapper.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CommonLib/LdapConnectionWrapper.cs b/src/CommonLib/LdapConnectionWrapper.cs index 59a4698c..17314518 100644 --- a/src/CommonLib/LdapConnectionWrapper.cs +++ b/src/CommonLib/LdapConnectionWrapper.cs @@ -5,7 +5,7 @@ namespace SharpHoundCommonLib { public class LdapConnectionWrapper { public LdapConnection Connection { get; private set; } - private readonly IDirectoryObject _searchResultEntry; + private readonly IDirectoryObject _rootDseEntry; private string _domainSearchBase; private string _configurationSearchBase; private string _schemaSearchBase; @@ -14,10 +14,10 @@ public class LdapConnectionWrapper { public readonly bool GlobalCatalog; public readonly string PoolIdentifier; - public LdapConnectionWrapper(LdapConnection connection, IDirectoryObject entry, bool globalCatalog, + public LdapConnectionWrapper(LdapConnection connection, IDirectoryObject rootDseEntry, bool globalCatalog, string poolIdentifier) { Connection = connection; - _searchResultEntry = entry; + _rootDseEntry = rootDseEntry; Guid = new Guid().ToString(); GlobalCatalog = globalCatalog; PoolIdentifier = poolIdentifier; @@ -28,7 +28,7 @@ public string GetServer() { return _server; } - _server = _searchResultEntry.GetProperty(LDAPProperties.DNSHostName); + _server = _rootDseEntry.GetProperty(LDAPProperties.DNSHostName); return _server; } @@ -39,10 +39,10 @@ public bool GetSearchBase(NamingContext context, out string searchBase) { } searchBase = context switch { - NamingContext.Default => _searchResultEntry.GetProperty(LDAPProperties.DefaultNamingContext), + NamingContext.Default => _rootDseEntry.GetProperty(LDAPProperties.DefaultNamingContext), NamingContext.Configuration => - _searchResultEntry.GetProperty(LDAPProperties.ConfigurationNamingContext), - NamingContext.Schema => _searchResultEntry.GetProperty(LDAPProperties.SchemaNamingContext), + _rootDseEntry.GetProperty(LDAPProperties.ConfigurationNamingContext), + NamingContext.Schema => _rootDseEntry.GetProperty(LDAPProperties.SchemaNamingContext), _ => throw new ArgumentOutOfRangeException(nameof(context), context, null) };