-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
FIX | Adds support for Shim gss api on Linux to delay loading libgssapi_krb… #65469
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -16,6 +16,9 @@ internal static partial void ReleaseGssBuffer( | |||||||||
IntPtr bufferPtr, | ||||||||||
ulong length); | ||||||||||
|
||||||||||
[DllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")] | ||||||||||
private static extern int EnsureGssInitialized(); | ||||||||||
|
||||||||||
[GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")] | ||||||||||
internal static partial Status DisplayMinorStatus( | ||||||||||
out Status minorStatus, | ||||||||||
|
@@ -169,5 +172,17 @@ internal static Status UnwrapBuffer( | |||||||||
|
||||||||||
return Unwrap(out minorStatus, contextHandle, inputBytes, offset, count, ref outBuffer); | ||||||||||
} | ||||||||||
|
||||||||||
// This constructor is added to address the issue with net6 regarding | ||||||||||
// Shim gss api on Linux to delay loading libgssapi_krb5.so | ||||||||||
// issue https://github.com/dotnet/SqlClient/issues/1390 | ||||||||||
// dotnet runtime issue https://github.com/dotnet/runtime/pull/55037 | ||||||||||
static NetSecurityNative() | ||||||||||
{ | ||||||||||
if (Environment.Version.Major >= 6) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is only included in .NET 7+ binaries in this repo, so this check is unnecessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the EnsureGssInitialized calls are already being done in the main branch: Lines 17 to 20 in 3806e15
Perhaps you meant to create a PR against one of the servicing branches? |
||||||||||
{ | ||||||||||
EnsureGssInitialized(); | ||||||||||
} | ||||||||||
} | ||||||||||
} | ||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to use 'GeneratedDllImport' like the others in the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JRahnama for context, this is new in 7.0. So you will need to use the new form in this change, and the back port will use the form you have here.