Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/CommonLib/Processors/LdapPropertyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ public async Task<UserProperties> ReadUserProperties(IDirectoryObject entry, str
userProps.UnconstrainedDelegation = uacFlags.HasFlag(UacFlags.TrustedForDelegation);

var comps = new List<TypedPrincipal>();
if (uacFlags.HasFlag(UacFlags.TrustedToAuthForDelegation) &&
entry.TryGetArrayProperty(LDAPProperties.AllowedToDelegateTo, out var delegates)) {
if (entry.TryGetArrayProperty(LDAPProperties.AllowedToDelegateTo, out var delegates)) {
props.Add("allowedtodelegate", delegates);

foreach (var d in delegates) {
Expand Down Expand Up @@ -390,8 +389,7 @@ public async Task<ComputerProperties> ReadComputerProperties(IDirectoryObject en
props.Add("admincount", ac != 0);

var comps = new List<TypedPrincipal>();
if (flags.HasFlag(UacFlags.TrustedToAuthForDelegation) &&
entry.TryGetArrayProperty(LDAPProperties.AllowedToDelegateTo, out var delegates)) {
if (entry.TryGetArrayProperty(LDAPProperties.AllowedToDelegateTo, out var delegates)) {
props.Add("allowedtodelegate", delegates);

foreach (var d in delegates) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/LdapPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}

[Fact]
public async void LDAPPropertyProcessor_ReadDomainProperties_TestGoodData()

Check warning on line 34 in test/unit/LdapPropertyTests.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Support for 'async void' unit tests is being removed from xUnit.net v3. To simplify upgrading, convert the test to 'async Task' instead. (https://xunit.net/xunit.analyzers/rules/xUnit1048)
{
var mock = new MockDirectoryObject("DC\u003dtestlab,DC\u003dlocal", new Dictionary<string, object>
{
Expand All @@ -48,7 +48,7 @@
}

[Fact]
public async void LDAPPropertyProcessor_ReadDomainProperties_TestBadFunctionalLevel()

Check warning on line 51 in test/unit/LdapPropertyTests.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Support for 'async void' unit tests is being removed from xUnit.net v3. To simplify upgrading, convert the test to 'async Task' instead. (https://xunit.net/xunit.analyzers/rules/xUnit1048)
{
var mock = new MockDirectoryObject("DC\u003dtestlab,DC\u003dlocal", new Dictionary<string, object>
{
Expand Down Expand Up @@ -1448,7 +1448,7 @@
new Dictionary<string, object>
{
{"description", "Test"},
{"useraccountcontrol", 0x1000000.ToString()},
{"useraccountcontrol", 0x200.ToString()},
{LDAPProperties.LastLogon, "132673011142753043"},
{LDAPProperties.LastLogonTimestamp, "132670318095676525"},
{"homedirectory", @"\\win10\testdir"},
Expand Down Expand Up @@ -1507,7 +1507,7 @@
new Dictionary<string, object>
{
{"description", "Test"},
{"useraccountcontrol", 0x1001000.ToString()},
{"useraccountcontrol", 0x1000.ToString()},
{"lastlogon", "132673011142753043"},
{"lastlogontimestamp", "132670318095676525"},
{"operatingsystem", "Windows 10 Enterprise"},
Expand Down
Loading