Uh oh!
There was an error while loading. Please reload this page.
Register a callback that tries to load other versions Open LDAP library if the default is failed - #88851
Conversation
…Dll event that tries to load other libraries
ghost
commented
Jul 13, 2023
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 Issue DetailsRegister a callback that tries to load other versions of Open LDAP library if the default is failedOpen LDAP library version is hardcoded in runtime and used for native calls From Ubuntu 22.04 only the new version of the library (libldap-2.5.so.0) is included in OS, so System.DirectoryServices.Protocols.LdapConnection fails to find the new version of the LDAP library as mentioned in the issue. @AaronRobinsonMSFT pointed out that we can register a callback to AssemblyLoadContext.Default.ResolvingUnmanagedll event. This event is raised if the native library could not be resolved via the default resolution logic. The PR doesn't include a specific test, I don't think I can test the logic added here specifically, let me know if you have a testing idea. Though all existing tests that connects to LDAP server would test this run the tests locally, all passes. (No CI test runs LDAP server so they are skipped in CI) Fixes #69456
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
joperezr
left a comment
There was a problem hiding this comment.
Thanks for doing this @buyaa-n. Changes LGTM but I'll defer to @AaronRobinsonMSFT and @elinor-fung for what the best approach to hook to that event is.
Uh oh!
There was an error while loading. Please reload this page.
39fa579 to
298469cCompareUh oh!
There was an error while loading. Please reload this page.
steveharter
left a comment
There was a problem hiding this comment.
LGTM pending question on patch versions
Uh oh!
There was an error while loading. Please reload this page.
8b65ba2 to
4d776fdCompareUh oh!
There was an error while loading. Please reload this page.
buyaa-n
commented
Jul 17, 2023
Failures unrelated and known |
Register a callback that tries to load other versions of Open LDAP library if the default is failed
Open LDAP library version is hardcoded in runtime and used for native calls
runtime/src/libraries/Common/src/Interop/Linux/Interop.Libraries.cs
Line 9 in b12e288
From Ubuntu 22.04 only the new version of the library (libldap-2.5.so.0) is included in OS, so System.DirectoryServices.Protocols.LdapConnection fails to find the new version of the LDAP library as mentioned in the issue.
@AaronRobinsonMSFT pointed out that we can register a callback to AssemblyLoadContext.Default.ResolvingUnmanagedll event. This event is raised if the native library could not be resolved via the default resolution logic.
The PR doesn't include a specific test, I don't think I can test the logic added here specifically, let me know if you have a testing idea. Though all existing tests that connects to LDAP server would test this, run the tests locally on Ubuntu 22.04, after the fix all tests that require LDAP server passed. (No CI test runs LDAP server so they are skipped in CI)
Fixes#69456