Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
[Release 3.1] | Address Shim gss api on Linux to delay loading libgss…
Browse files Browse the repository at this point in the history
…api_krb5.so while using Net6 (#43133)

* Shims for Kerberos Authentication on Unix

* Move SqlClient fix for .NET 6+ compatibility into SqlClient-only file (#1)

* Adding OOB for System.Data.SqlClient

* Addressing review comments

Co-authored-by: David Engel <dengel1012@gmail.com>
  • Loading branch information
JRahnama and David-Engel committed Sep 13, 2022
1 parent 3dc21d2 commit 2269149
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 10 deletions.
13 changes: 8 additions & 5 deletions pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,10 @@
"3.0.0",
"3.1.0",
"3.1.1",
"3.1.2"
"3.1.2",
"3.1.3"
],
"BaselineVersion": "3.1.2",
"BaselineVersion": "3.1.3",
"InboxOn": {}
},
"Microsoft.Windows.Compatibility.Shims": {
Expand Down Expand Up @@ -1551,9 +1552,10 @@
"4.8.0",
"4.8.1",
"4.8.2",
"4.8.3"
"4.8.3",
"4.8.4"
],
"BaselineVersion": "4.8.3",
"BaselineVersion": "4.8.4",
"InboxOn": {
"net461": "4.1.0.0",
"monoandroid10": "Any",
Expand All @@ -1577,7 +1579,8 @@
"4.6.1.0": "4.8.0",
"4.6.1.1": "4.8.1",
"4.6.1.2": "4.8.2",
"4.6.1.3": "4.8.3"
"4.6.1.3": "4.8.3",
"4.6.1.4": "4.8.4"
}
},
"System.Data.SqlXml": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<!-- We use the PackageVersion property defined in Packaging.props for the Prerelease packages which are using it to be built -->
<_PreReleasePackageVersion>$(PackageVersion)</_PreReleasePackageVersion>
<PackageVersion>3.1.2</PackageVersion>
<ServiceModelVersion>4.7.0</ServiceModelVersion>
<PackageVersion>3.1.3</PackageVersion>
<ServiceModelVersion>4.7.1</ServiceModelVersion>
<!-- We don't need to harvest the stable packages to build this -->
<HarvestStablePackage>false</HarvestStablePackage>
</PropertyGroup>
Expand All @@ -30,7 +30,7 @@
<PrereleaseLibraryPackage Include="System.Data.OleDb" />
<PrereleaseLibraryPackage Include="System.Data.SqlClient">
<!-- SQL client defines its own version, higher than rest of master -->
<Version>4.8.3</Version>
<Version>4.8.4</Version>
</PrereleaseLibraryPackage>
<PrereleaseLibraryPackage Include="System.Drawing.Common" />
<PrereleaseLibraryPackage Include="System.Diagnostics.EventLog" />
Expand Down
4 changes: 2 additions & 2 deletions src/System.Data.SqlClient/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<!-- Must be kept in sync with pkg\Microsoft.Windows.Compatibility\Microsoft.Windows.Compatibility.pkgproj -->
<PackageVersion>4.8.3</PackageVersion>
<AssemblyVersion>4.6.1.3</AssemblyVersion>
<PackageVersion>4.8.4</PackageVersion>
<AssemblyVersion>4.6.1.4</AssemblyVersion>
<!-- Downgrade the Assembly Version to match RTM in order to have System.Data shim to still
typeforward to RTM version instead of servicing version -->
<AssemblyVersion Condition="'$(TargetGroup)' == 'netcoreapp'">4.6.1.0</AssemblyVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class NetSecurityNative
{
[DllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
private static extern int EnsureGssInitialized();

// 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)
{
EnsureGssInitialized();
}
}
}
}
1 change: 1 addition & 0 deletions src/System.Data.SqlClient/src/System.Data.SqlClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
<Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\GssSafeHandles.cs">
<Link>Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs</Link>
</Compile>
<Compile Include="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Extended.cs" />
<Compile Include="$(CommonPath)\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs">
<Link>Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs</Link>
</Compile>
Expand Down
6 changes: 6 additions & 0 deletions src/packages.builds
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<Project Include="*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' OR '$(DotNetBuildFromSource)' == 'true'">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)System.Data.SqlClient\pkg\System.Data.SqlClient.pkgproj">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)..\pkg\Microsoft.Windows.Compatibility\Microsoft.Windows.Compatibility.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
</ItemGroup>

<ItemGroup Condition="'$(BuildAllPackages)' == 'false' AND '$(SkipManagedPackageBuild)' != 'true'" >
Expand Down

0 comments on commit 2269149

Please sign in to comment.