Imported Upstream version 5.10.0.69

Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-29 19:03:06 +00:00
parent d8f8abd549
commit e2950ec768
6283 changed files with 453847 additions and 91879 deletions

View File

@@ -26,14 +26,14 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{6638C675-CD62-408F-AB3B-AAFD8A906A96}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{135980AC-4583-44EC-894E-CB3B1A481920}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{7DEA4539-9A0D-4801-B229-3824710EBCEE}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
{7DEA4539-9A0D-4801-B229-3824710EBCEE}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
{7DEA4539-9A0D-4801-B229-3824710EBCEE}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU

View File

@@ -1,3 +1,6 @@
// 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.
namespace System.DirectoryServices.Protocols {
public partial class AddRequest : System.DirectoryServices.Protocols.DirectoryRequest {
@@ -640,4 +643,4 @@ namespace System.DirectoryServices.Protocols {
public int TargetPosition { get { return default(int); } }
}
}



View File

@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageConfigurations>
netstandard;
netcoreapp2.0-Windows_NT;
</PackageConfigurations>
<BuildConfigurations>
netstandard-Windows_NT;
netstandard;
$(PackageConfigurations);
netcoreapp-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -1 +0,0 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA1821", Justification = "Finalizer has implementation in Windows version.")]

View File

@@ -489,4 +489,7 @@
<data name="InvliadRequestType" xml:space="preserve">
<value>The specified request is not supported.</value>
</data>
<data name="DirectoryServicesProtocols_PlatformNotSupported" xml:space="preserve">
<value>System.DirectoryServices.Protocols is not supported on this platform.</value>
</data>
</root>

View File

@@ -9,16 +9,15 @@
<!-- Although we have a netstandard configuration, we know we are not currently UAP compatible-->
<UWPCompatible>false</UWPCompatible>
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsWindows)' != 'true'">true</GeneratePlatformNotSupportedAssembly>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetGroup)' == 'netstandard'">SR.DirectoryServicesProtocols_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetsWindows)' != 'true'">
<Compile Include="FxCopBaseline.AnyOS.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<Compile Include="System\DirectoryServices\Protocols\common\AuthTypes.cs" />
<Compile Include="System\DirectoryServices\Protocols\common\BerConverter.cs" />
<Compile Include="System\DirectoryServices\Protocols\common\DereferenceAlias.cs" />
@@ -51,5 +50,25 @@
<Reference Include="System.Security.Permissions" />
<Reference Include="System.Security.Principal.Windows" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<Reference Include="System.Collections" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Collections.Specialized" />
<Reference Include="System.ComponentModel.TypeConverter" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Cryptography.X509Certificates" />
<Reference Include="System.Text.Encoding.Extensions" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Xml.ReaderWriter" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Reference Include="System.ComponentModel.Primitives" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -9,11 +9,13 @@ using System.Security.Permissions;
namespace System.DirectoryServices.Protocols
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
public class DirectoryException : Exception
{
protected DirectoryException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
public DirectoryException(string message, Exception inner) : base(message, inner)
@@ -30,6 +32,9 @@ namespace System.DirectoryServices.Protocols
}
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
public class DirectoryOperationException : DirectoryException, ISerializable
{
protected DirectoryOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
@@ -64,6 +69,9 @@ namespace System.DirectoryServices.Protocols
}
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
public class BerConversionException : DirectoryException
{
protected BerConversionException(SerializationInfo info, StreamingContext context) : base(info, context) { }

View File

@@ -1055,8 +1055,6 @@ namespace System.DirectoryServices.Protocols
public void Bind(NetworkCredential newCredential) => BindHelper(newCredential, needSetCredential: true);
[EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)]
[SecurityPermission(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]
private void BindHelper(NetworkCredential newCredential, bool needSetCredential)
{
if (_disposed)

View File

@@ -65,6 +65,9 @@ namespace System.DirectoryServices.Protocols
}
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
public class LdapException : DirectoryException, ISerializable
{
protected LdapException(SerializationInfo info, StreamingContext context) : base(info, context) { }
@@ -104,6 +107,9 @@ namespace System.DirectoryServices.Protocols
}
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
public class TlsOperationException : DirectoryOperationException
{
protected TlsOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }

View File

@@ -1109,7 +1109,6 @@ namespace System.DirectoryServices.Protocols
return value;
}
[PermissionSet(SecurityAction.Assert, Unrestricted = true)]
private static bool AddLdapHandleRef(LdapConnection ldapConnection)
{
bool success = false;
@@ -1126,7 +1125,6 @@ namespace System.DirectoryServices.Protocols
return success;
}
[PermissionSet(SecurityAction.Assert, Unrestricted = true)]
private static void ReleaseLdapHandleRef(LdapConnection ldapConnection)
{
if (ldapConnection != null && ldapConnection._ldapHandle != null && !ldapConnection._ldapHandle.IsInvalid)

View File

@@ -8,7 +8,6 @@ using System.Security;
namespace System.DirectoryServices.Protocols
{
[SuppressUnmanagedCodeSecurity]
internal sealed class BerSafeHandle : SafeHandleZeroOrMinusOneIsInvalid
{
internal BerSafeHandle() : base(true)
@@ -36,7 +35,6 @@ namespace System.DirectoryServices.Protocols
}
}
[SuppressUnmanagedCodeSecurity]
internal sealed class HGlobalMemHandle : SafeHandleZeroOrMinusOneIsInvalid
{
internal HGlobalMemHandle(IntPtr value) : base(true)
@@ -51,7 +49,6 @@ namespace System.DirectoryServices.Protocols
}
}
[SuppressUnmanagedCodeSecurity]
internal sealed class ConnectionHandle : SafeHandleZeroOrMinusOneIsInvalid
{
internal bool _needDispose = false;

View File

@@ -179,7 +179,6 @@ namespace System.DirectoryServices.Protocols
}
}
[SuppressUnmanagedCodeSecurity]
internal class Wldap32
{
private const string Wldap32dll = "wldap32.dll";

View File

@@ -2,7 +2,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netstandard-Windows_NT;
netcoreapp-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
To enable the tests marked with [ConditionalFact(nameof(IsLdapConfigurationExist))], need to setup LDAP server and provide the needed server info here.
The easiest way to get LDAP server is to download and install OpenDJ https://backstage.forgerock.com/downloads/OpenDJ/Directory%20Services/5.0.0#browse.
Download "DS zip" file then extract it. you can set it up by running a command like that following:
/setup directory-server --sampleData 2 --rootUserDN "cn=Directory Manager" --rootUserPassword password --hostname localhost.localdomain --ldapPort 1389 --ldapsPort 1636 --httpPort 8080 --httpsPort 8443 --adminConnectorPort 4444 --baseDN dc=example,dc=com --acceptLicense enableStartTls
After that delete this comment and have the following contents in this Xml file:
<Configuration>
<ServerName>server machine name</ServerName>
<Domain>DC=example,DC=com</Domain>
<Port>1389</Port>
<User>cn=Directory Manager</User>
<Password>password</Password>
<AuthenticationTypes>ServerBind,None</AuthenticationTypes>
</Configuration>
-->

View File

@@ -92,7 +92,7 @@ namespace System.DirectoryServices.Protocols.Tests
}
[Fact]
[ActiveIssue("https://github.com/dotnet/corefx/issues/21217", TargetFrameworkMonikers.UapAot)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "The field _keys in full framework is called keys, so GetField returns null and ends up in a NRE")]
public void SortKeys_GetNull_ReturnsEmptyArray()
{
var control = new SortRequestControl();

View File

@@ -4,9 +4,8 @@
<PropertyGroup>
<ProjectGuid>{6638C675-CD62-408F-AB3B-AAFD8A906A96}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="BerConverterTests.cs" />
<Compile Include="LdapSessionOptionsTests.cs" />
@@ -51,6 +50,16 @@
<Compile Include="BerConversionExceptionTests.cs" />
<Compile Include="AsqRequestControlTests.cs" />
<Compile Include="AddRequestTests.cs" />
<Compile Include="DirectoryServicesProtocolsTests.cs" />
<Compile Include="$(CommonTestPath)\System\DirectoryServices\LdapConfiguration.cs">
<Link>Common\DirectoryServices\LdapConfiguration.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="LDAP.Configuration.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>