Fix dynamic GSSAPI lib path detection on macOS for kerberos #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where the GSSAPI library path for kerberos auth was hardcoded to
/usr/lib/libgssapi_krb5.dylib
on macOS inlib_gssapi_loader.rb
.This caused failures when GSSAPI was installed via Homebrew, as the actual path differs or does not come by default.
Issue
When using the GSSAPI library for Kerberos authentication with WinRM, authentication fails due to the hardcoded
libgssapi_krb5.dylib
path.The error occurs because users with Homebrew-installed Kerberos have the library in
/opt/homebrew/Cellar/krb5/...
.Error Screenshot
Fix
lib_gssapi_loader.rb
, this PR dynamically detects the correct GSSAPI library location:brew --prefix
to find the Homebrew installation directory./usr/lib/
if Homebrew is not installed.After fixing code
Why This Fix is Needed
libgssapi_krb5.dylib
by default.krb5
package) havelibgssapi_krb5.dylib
in/opt/homebrew/Cellar/...
.FFI::Library::ffi_lib
to fail, making GSSAPI unusable.Notes for Users
📌 If you are on macOS and do not have
libgssapi_krb5.dylib
, install it using: