-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Dispose LdapConnections used by PrincipalContext.ValidateCredentials #62036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ internal static class CapabilityMap | |
| public const string LDAP_CAP_ACTIVE_DIRECTORY_V61_OID = "1.2.840.113556.1.4.1935"; | ||
| } | ||
|
|
||
| internal sealed class CredentialValidator | ||
| internal sealed class CredentialValidator : IDisposable | ||
| { | ||
| private enum AuthMethod | ||
| { | ||
|
|
@@ -341,6 +341,14 @@ public bool Validate(string userName, string password, ContextOptions connection | |
| return (BindSam(_serverName, userName, password)); | ||
| } | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| foreach (LdapConnection connection in _connCache.Values) | ||
| { | ||
| connection.Dispose(); | ||
| } | ||
| } | ||
|
||
| } | ||
| // ******************************************** | ||
| public class PrincipalContext : IDisposable | ||
|
|
@@ -1014,6 +1022,8 @@ public void Dispose() | |
| if (_queryCtx != null) | ||
| _queryCtx.Dispose(); | ||
|
|
||
| _credValidate.Dispose(); | ||
|
||
|
|
||
| _disposed = true; | ||
| GC.SuppressFinalize(this); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.