Skip to content

Commit

Permalink
chore: rename entry in wrapper for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Jul 22, 2024
1 parent 6d9adb1 commit ec85996
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/CommonLib/LdapConnectionWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -28,7 +28,7 @@ public string GetServer() {
return _server;
}

_server = _searchResultEntry.GetProperty(LDAPProperties.DNSHostName);
_server = _rootDseEntry.GetProperty(LDAPProperties.DNSHostName);
return _server;
}

Expand All @@ -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)
};

Expand Down

0 comments on commit ec85996

Please sign in to comment.