Commit Graph
757 Commits
Author SHA1 Message Date
Tomas Weinfurt e7edbfe538 improve Connection_UnderDifferentUsers_BehavesAsExpected test (#2549)
* improve Connection_UnderDifferentUsers_BehavesAsExpected test

* feedback from review
2020-01-30 20:16:58 -08:00
Jan Kotas 099a512445 Merging small assemblies (part 1/N) (#2189)
* Delete unnecessary ClsCompliant

* Merge System.Diagnostics.Tools\src into CoreLib

* Merge System.Security.Pricipal\src into CoreLib

* Delete System.IO.UnmanagedMemoryStream\ref\System.IO.UnmanagedMemoryStream.cs

* Delete System.Reflection\ref\System.Reflection.cs

* Delete  System.Threading.Timer\src\ApiCompatBaseline.uapaot.txt

* Delete System.Buffers\src\Resources\Strings.resx

* Merge System.Buffers\ref into System.Runtime

* Merge System.Diagnostics.Debug\ref into System.Runtime

* Delete *\MatchingRefApiCompatBaseline.txt

* Merge System.Diagnostics.Tools into System.Runtime\ref

* Merge System.Resources.ResourceManager into System.Runtime\ref

* Cleanup System.IO.* project references

* Cleanup System.Reflection project references

* Cleanup System.Runtime.Handles project references

* Merge System.Threading.Thread\src into CoreLib

* Merge System.Threading.Timer\ref into System.Runtime

* Merge System.Threading.Tasks\ref into System.Runtime
2020-01-29 10:02:22 -08:00
Jan Kotas 9c82a36c23 Unify CoreLib interop files (#1914)
- Unify more of CoreLib interop files
- Replace manual interop with regular managed APIs where possible
- Delete unused code

Contributes to #1232
2020-01-21 20:49:54 -08:00
Jan KotasandStephen Toub 0b25063ec0 More renames of full framework to .NET Framework (#1900)
* More renames of full framework to .NET Framework

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <[email protected]>
2020-01-18 11:04:59 -08:00
Stephen Toub 04f22268ef Change all ActiveIssues to use Uris instead of numbers (#1768) 2020-01-15 23:21:36 -05:00
Jan Kotas fb7edc0c3b Delete RHEL6 leftovers (#1648)
Fixes #423
Closes dotnet/corefx#24525
Closes dotnet/corefx#37739
Closes dotnet/corefx#31792
2020-01-12 12:49:27 -08:00
Jan Kotas 25d316cefa Move Corelib shared files under Common (#1307)
Contributes to #1232
2020-01-06 09:07:16 -08:00
Jan Kotas f1c7ed882a Move most of CoreLib interop under Common (#1247)
Contributes to #1232
2020-01-02 20:21:27 -08:00
Anirudh Agnihotry 3b9abae5aa Removing "netcoreapp" and "netfx" TargetGroup (#457)
* netcoreapp -> netcoreapp5.0 in .sln files

* netcoreapp; -> netcoreapp5.0;  , netcoreapp- to netcoreapp5.0-

* netcoreapp- -> netcoreapp5.0 in .csproj

* 'netcoreapp -> 'netcoreapp5.0 in .csproj

* done with libraries sub folder

* missed semicolon

* minor changes

* netcoreapp -> netcoreapp5.0 in some extra files

* vNext target variable in configurations.props

* netcoreapp => netcoreapp5/0 in some other .props file

* netcoreapp -> vnext in .csproj

* making the netcorepap framework switch work

* fixing sendToHelix and linux build

* TargetFrameworkVNext -> netcoreappCurrent

* case correct netcoreappcurrent

* fixing send to helix zip path

* netfx -> net472 in .sln

* netfx; -> net472; in .props

* netfx- -> net472- in .props

* netfx - -> net472- in .csproj

* 'netfx-> 'net472 in .csproj

* netfx -> net472 manual change

* fixing ci build for netfx

* Not trying to change the global property

* Fixing build failure due to master changes in net https tests

* adding documentaiton and fixing filtering

* netcoreapp -> netcore5.0 in py file

* changing the path to use netcoreapp5.0 version

* feedback and override corefx path corrected in installers

* remaing netcoreapp5.0 changes done

* netcoreapp-> netcoreapp5.0 after live builds

* net472 -> netframeworkcurrent
2019-12-14 12:22:29 -08:00
Youssef Victor 8a163271ba Remove duplicates of Interop.Kernel32.GenericOperations.GENERIC_READ and GENERIC_WRITE (#292)
Remove duplicates of Interop.Kernel32.GenericOperations.GENERIC_READ and GENERIC_WRITE
2019-12-06 11:13:31 -08:00
Carlos Sanchez Lopez 034c5a695a Add NamedPipeServerStream method that takes an ACL (#317)
Add NamedPipeServerStream method that takes an ACL

Approved API proposal: dotnet/corefx#41657

We don't currently have a way to create a pipe with a given ACL in .NET Core. We can modify the ACL, but it would be more secure to have the proper ACL on the pipe from the start.

This PR adds a new static class and method that can create an NamedPipeServerStream taking a PipeSecurity object, reusing code that can already perform this task.
2019-12-02 15:54:46 -08:00
carlossanlop 96a2daf24f Add AnonymousPipeServerStream method that takes an ACL 2019-11-18 13:51:48 -08:00
Santiago Fernandez Madero d8adaeeff2 Fix test build of test project that referenced corefx shared corelib directly and cleanup common path usages (#47)
* Fix test build break and update common path usages to use property

* Use normalize directory for CommonPath and CommonTestPath

* Update instances of CommonPath and CommonTestPath to not use trailing \
2019-11-14 21:03:07 +01:00
Viktor Hofer 8e3694fbdd Fix CodeAnalysis.ruleset path (#35) 2019-11-14 15:38:15 +01:00
Viktor Hofer 00d3a3b733 Update CoreLib path for consolidation (dotnet/corefx#42577)
Commit migrated from https://github.com/dotnet/corefx/commit/dc6136f34c7d4ebbc493a7bb6cf1d15bc82250e6
2019-11-13 20:48:15 +01:00
Stephen Toub 9524bb599e Fix StyleCop rule SA1129 ("Do not use default value type constructor") (dotnet/corefx#42531)
Commit migrated from https://github.com/dotnet/corefx/commit/88f40addc220c73794f962f10d288c20c416ede1
2019-11-11 18:49:48 -05:00
Anirudh Agnihotry 3679e373a3 Bumping the assembly version to 5.0.0.0 (dotnet/corefx#41723)
* bumping the assembly Version

* correcting the resx file

* keeping netfx for oleDb

* fiixing the netfx tests as well

* fixing the DataSetExtensionsVersion

* removing netstandard2.0 from ref in datasetextensions


Commit migrated from https://github.com/dotnet/corefx/commit/9a4ed0d00bc642b015974684c32b00650426429f
2019-11-11 10:43:58 -08:00
Roman Marusyk 25a6514dc0 Consolidate .netcoreapp.cs test files in System.IO.* (dotnet/corefx#42329)
* Consolidate .netcoreapp.cs files because System.IO.* projects is no longer cross-compiled



Commit migrated from https://github.com/dotnet/corefx/commit/1499cbb3e319ec733c09202fd2501292c1d3fe3b
2019-11-03 15:31:21 -08:00
Viktor Hofer 9b88ca1d72 Remove UAP target (dotnet/corefx#41759)
* Remove Uap target

* Remove RemoteInvokeForUap wrapper calls entirely

* Harvest S.D.SqlClient on UWP

* Disable UWP PInvoke analyzer

* Enable WindowsRuntime* tests on netcoreapp

Commit migrated from https://github.com/dotnet/corefx/commit/3b6ec2ba944fb72f921f95b99b6ebf2e7bb3dc5a
2019-10-17 15:04:39 +02:00
Stephen Toub 7ff3a1100a Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)
Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process.  Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.

This helps measurably with test performance.  Consider the System.ComponentModel.Annotations test suite.  On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified.  With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds.  This should help measurably with CI time in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
2019-10-15 12:09:06 -04:00
Stephen Toub 95022c31b5 Expose, test, and use ExceptionDispatchInfo.SetCurrentStackTrace
Commit migrated from https://github.com/dotnet/corefx/commit/615990343a9400e46122debf48a5fb08ec452787
2019-10-05 17:07:51 -04:00
Viktor Hofer d5079dda17 Remove ProjectGUIDs from project files and Project and Name attributes from P2Ps (dotnet/corefx#40926)
* Remove ProjectGUIDs from P2Ps

* Remove ProjectGUIDs from project files

Commit migrated from https://github.com/dotnet/corefx/commit/c22714d65151968a17c3b232748880d5e7961dee
2019-09-09 18:21:25 +02:00
Stephen Toub 4fc5d8971d Contribute to IDE0055 (fix formatting)
Commit migrated from https://github.com/dotnet/corefx/commit/b49a8a9be1d53cd9e50cb68fd8540be25c65d433
2019-08-24 07:47:35 -04:00
Stephen Toub cae3309c0a Fix non-ASCII characters across corefx (dotnet/corefx#40318)
* Fix several non-visible characters in test files

* Replace Unicode surrogate pairs with escaped hex values

* Fix non-ASCII characters in most C# files


Commit migrated from https://github.com/dotnet/corefx/commit/027eb8e19c3498cc2c656931c3b879f5ddb63b0d
2019-08-15 08:17:46 -04:00
Stephen Toub 9548bea38a Make many fields readonly or const across corefx (dotnet/corefx#40298)
* Make many fields readonly or const

* Address PR feedback

- Updated asn.xslt
- Regenerated .xml.cs files


Commit migrated from https://github.com/dotnet/corefx/commit/0cc22ccba707d7552159363d586262fa9c4e8a2a
2019-08-14 14:19:30 -04:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
2019-08-07 21:07:58 -04:00
Stephen Toub 13fc8895db Re-enable xunit warning 1010 (dotnet/corefx#39846)
Commit migrated from https://github.com/dotnet/corefx/commit/e36291288fc182e94a919f45e61a8924f953c3cd
2019-07-28 22:34:44 -04:00
Viktor Hofer 4f76a9ffa2 Enable xunit2007 analyzer (dotnet/corefx#39740)
Commit migrated from https://github.com/dotnet/corefx/commit/619f140e2f0e722a17f3797d532b21ace774ec2e
2019-07-24 22:03:09 -04:00
Stephen Toub c58629fe45 Remove unnecessary empty try { } blocks (dotnet/corefx#39664)
Unnecessary in .NET Core code.  I didn't modify additional instances in libraries that target netstandard/netfx.

Commit migrated from https://github.com/dotnet/corefx/commit/ca795a928d210c78c6bbd3fa10eb35f4c093a5a4
2019-07-22 12:30:03 -04:00
Stephen Toub f9b59811ee Avoid "async void" tests (dotnet/corefx#39613)
Most of these are just because "async void" tests are rare and require special handling in xunit we needn't use.  But a few of these are plain wrong and were resulting in our not actually testing what we hoped to test.

Commit migrated from https://github.com/dotnet/corefx/commit/50d8c71bb6139f3c06dd820d6d757a095a9fe994
2019-07-19 10:07:15 -04:00
Tom Deseyn f48f39fa5c Socket: improve cross-platform behavior on Dispose (dotnet/corefx#38804)
* Add tests

* Don't skip SyncSendFileGetsCanceledByDispose on .NET Framework

* Implement using code from previous PR

* Update SocketErrors when CleanedUp for APM APIs

* Cleanup SO_TYPE socket length handling (Fixes https://github.com/dotnet/corefx/issues/38750)

* SyncSendFileGetsCanceledByDispose: remove SkipTargetFramework NetFramework

* PR feedback

* Fix comment typo

* Also wait for async operations, and wait longer on each retry

* clear sockaddr using memset

* Fix build

* Only perform CLOEXEC check for non-abortive close


Commit migrated from https://github.com/dotnet/corefx/commit/9b2f7a834691a3bbad2949181eec707dd4b5a13b
2019-07-17 11:48:33 -04:00
Stephen Toub 6a392dcb82 Disable Connection_UnderDifferentUsers_BehavesAsExpected test on Fedora (dotnet/corefx#39491)
Commit migrated from https://github.com/dotnet/corefx/commit/ace61287bee166a3777f5b3832295902a58ca79a
2019-07-15 15:22:33 -04:00
David Shulman 935edadf9a Revert "Socket: Linux: unblock synchronous socket operations on Dispose (dotnet/corefx#37486)" (dotnet/corefx#38764)
This reverts commit dotnet/corefx@3fac6ad5bc.

Commit migrated from https://github.com/dotnet/corefx/commit/42ecf717478504fd7cc072f3586c6edd1ba57daa
2019-06-21 16:51:34 -07:00
Tom Deseyn 200afe9208 Socket: Linux: unblock synchronous socket operations on Dispose (dotnet/corefx#37486)
* Socket: Linux: unblock synchronous socket operations on Dispose

* Fix windows build

* TryUnblockSocket: always do an abortive close for TCP

* TryUnblockSocket: experiment, always call Shutdown

* SyncTcpReceiveSendGetsCancelledByDisposeOrClose: Don't check for abortive close

* Fix build

* Revert always shutdown to compare CI results

* PR feedback

* TcpReceiveSendGetsCanceledByDisposeOrClose: fix timing race

* TcpReceiveSendGetsCanceledByDisposeOrClose: fix timing race II

* Fix test

* TcpReceiveSendGetsCanceledByDisposeOrClose: fix timing race III

* TcpReceiveSendGetsCanceledByDisposeOrClose: only run on Sync

* Also perform abortive close when canceling async send/receive

* Fix aborted set to true

* Check what fails on OSX with Shutdown

* Revert "Check what fails on OSX with Shutdown"

This reverts commit dotnet/corefx@5ab7fce93c.

* Don't perform abortive close for operations that were already canceled

* interrup  Accept/Listen on OSX

* Find out what Disconnectx does for different tests on CI machines

* Move Linux connect AF_UNSPEC and OSX disconnectx into pal Disconnect function, update tests for OSX

* Trigger CI

* TcpReceiveSendGetsCanceledByDispose: check SocketErrorCode

* TcpReceiveSendGetsCanceledByDispose: OSX is also performing an RST close for disconnectx

* Revert "TcpReceiveSendGetsCanceledByDispose: OSX is also performing an RST close for disconnectx"

This reverts commit dotnet/corefx@a8d5b02724.

* TcpReceiveSendGetsCanceledByDispose: fix test for OSX

* call CancelIoEx to kick out pending operations

* Socket interop: replace IntPtr with SafeHandle

* Windows: RST close when operations were canceled

* Extend tests to check local SocketError

* test: update expected SocketErrors

* update tests: Apm API throws ObjectDisposedException instead of SocketException

* Extend asserts

* Update expected result for ConnectTask

* Update tests based on Windows behavior (https://github.com/dotnet/corefx/pull/37706)

* Map SocketErrors in Socket.cs

* Rewrite nullable asserts

* Fix test for Mac

* Handle SendFile SocketError

* SyncSendFileGetsCanceledByDispose: change how we generate the large file

* SyncSendFileGetsCanceledByDispose: ensure unique filename

* Fix NETFX build

* SyncSendFileGetsCanceledByDispose: skip on NetFramework

* PR feedback

* Fix broken build

* Perform DangerousAddRef for Socket used with UpdateAcceptContext socket option


Commit migrated from https://github.com/dotnet/corefx/commit/3fac6ad5bc4576eb2216ccb24fbed2bf173d41f4
2019-06-20 09:31:18 -07:00
Viktor Hofer 5f98ba6a2b Enable project restore for test projects (dotnet/corefx#38151)
* Factor out repo restore into seperate props/targets

* Use configuration system msbuild sdk

* Remove XUnit.Runtime.depproj

* Remove TargetGroup usages in test projects

* Fix ILLink configuration

The ILLink package contains netcoreapp2.0 assets which are compatible
with netstandard2.0. Removing the old TargetFramework to restore
successfully.

* Remove usages from TargetGroup in Directory.Build.props

* Remove dead net4* configurations

* Change tests.builds to tests.proj sdk proj

* Make externals dir proj an sdk project

* Consume Microsoft.DotNet.CoreFxTesting as an msbuild sdk

* Use runtimeconfig.template.json

* Remove SupplementalTestData

* Map shared framework version to product version

* Stop binplacing tests

* Move some tool depprojs to targets during restore

* Remove dead code

* Use PackageReference instead of RefFromRuntime in test

* Disable using an apphost

* Copy compression testdata manually cause unicode bug

* Remove target batching in optimizationData

* Reference packaging tools from CoreFx.Private.TestUtilities


Commit migrated from https://github.com/dotnet/corefx/commit/c4c1985531cc1f25c805bbc4801b85c98e0dfee0
2019-06-15 21:27:13 +02:00
Carlos Sanchez Lopez 2ef5c32f8d Fix issue in NamedPipeServerStream.GetImpersonationUserName() (dotnet/corefx#37676)
Fix for issue where NamedPipeServerStream.GetImpersonationUserName() throws unexpected InvalidationOperationException("The operation completed successfully") when impersonation is not allowed, when in fact it should simply return an empty string.

The fix will call GetNamedPipeHandleStateW once. If it fails, it will try to load sspicli.dll if it was not loaded, and will reattempt the call to GetNamedPipeHandleStateW.

This fix is only for Win32: UAP does not allow calling LoadLibraryEx, and Windows Nano says denies access to GetNamedPipeHandleStateW even after attempting to load sspicli.dll.

Commit migrated from https://github.com/dotnet/corefx/commit/30c7f263fc60a558cbabf388555ebea211bce642
2019-06-07 12:35:43 -07:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Stephen Toub 458ce6efd2 Remove socket cancellation workarounds on Unix from System.IO.Pipes (dotnet/corefx#37988)
Commit migrated from https://github.com/dotnet/corefx/commit/ac24849e0404b9a7caba56fd398dbe6c5dbede0a
2019-05-28 17:46:40 -04:00
Stephen Toub 377c37c140 Use CancellationToken.UnsafeRegister in a few more places (dotnet/corefx#37551)
CancellationToken.Register captures the current ExecutionContext and uses it to invoke the callback if/when it's invoked.  That's generally desirable and is the right default, but in cases where we know for certain the callback doesn't care about EC (e.g. we're not invoking any 3rd-party code), we can use UnsafeRegister instead (newly added in 3.0), which skips capturing the ExecutionContext, as if Capture returned null.  This helps few a couple of small costs:
- Avoids thread local lookups to capture the current EC.
- Avoids additional delegate invocations and thread local gets/sets to invoke the callback with the captured EC.
- Avoids holding on to the EC in case it's needed, which can potentially keep alive an unbounded amount of state due to AsyncLocals.

Commit migrated from https://github.com/dotnet/corefx/commit/b1a1bfa0997ce35e8540fbbe74276858e315807e
2019-05-16 11:08:10 -07:00
Tanner Gooding 5a5ed7652a Regenerating reference sources in order to reorder enum fields (dotnet/corefx#37045)
Commit migrated from https://github.com/dotnet/corefx/commit/17382def0f680653870c31af1acf086ac41dcc0b
2019-04-23 13:40:45 -07:00
Viktor 7e4b5f9b01 Update src folder
Commit migrated from https://github.com/dotnet/corefx/commit/817c36a05ef2d92e59ce6f5a37e2be50076361b3
2019-04-02 19:21:57 +02:00
Adam Sitnik 4bf4932b00 Merge remote-tracking branch 'upstream/master' into removePerfTests
Commit migrated from https://github.com/dotnet/corefx/commit/48478bb1ae934e0a4949c71a13ddc7724eef7455
2019-03-19 16:46:37 +01:00
Stephen Toub dce7647bbc Clean up lots of string.Format / SR.Format usage (dotnet/corefx#35777)
* Clean up lots of string.Format usage

This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format.  This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...).  This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.

* Address PR feedback

* Fix breaks due to lower netstandard builds


Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
2019-03-06 12:03:00 -08:00
Adam Sitnik 1d119ecd19 remove System.IO.Pipes.PerformanceTests
Commit migrated from https://github.com/dotnet/corefx/commit/719e3f457b031e9cc743ea2bcb59dcafbfe4e22c
2019-03-05 07:20:05 +01:00
Viktor Hofer f8a8530d0f Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets


Commit migrated from https://github.com/dotnet/corefx/commit/c390ce7df50252e11f5d322276e9d19e046d1332
2019-03-03 18:55:25 +01:00
Ahson Khan 4fed6ab881 Auto-generate the reference assemblies and separate type forwards (dotnet/corefx#35557)
* Auto-generate the reference assemblies

* Add back type forwards.

* Revert "Add back type forwards."

This reverts commit dotnet/corefx@3acf74aabb.

* Add back TypeForwardedTo in .Forward.cs files

* Add new type forward files to the csproj files

* Add back if-defs and move TestUtilities comment from ref to source

* Remove duplicate definitions, delete unnecessary manual files,

* Fix build breaks

* Add back missing AsyncMethodBuilderAttr to S.Runtime ref

* Fix typo between XmlDocument and XPath.XDocument

* Add type forward fild missed from previous commit

* Fix ECDiffieHellmanCngPublicKey internal ctor for netfx 4.6.1

* Remove "this type was moved to comments" from the type forwards.

* Add back the Xml and Debugger* attributes to Xml.ReaderWriter

* Add back struct layout attributes

* Add back attributes missing (highlighted from api compat)

* Add missing toolbox item attribute in s.data.common.

* Add missing struct layout attributes and remove unnecessary additions

* Add back InterfaceTypeAttribute


Commit migrated from https://github.com/dotnet/corefx/commit/16689aa0a933517dc45465fc6edb6223222414a6
2019-02-27 19:39:21 -08:00
Krzysztof Wicher 3ed51b67e9 Fix casing of files to get closer to ./build.sh -allConfiguration working on linux (dotnet/corefx#35085)
* Rename directories to use CamelCasing

* Fix CsProj files to match file names and their casing

* fix couple of Compile items which were not in csproj file


Commit migrated from https://github.com/dotnet/corefx/commit/8c5260061b11323dfd97fbab614d54402405513f
2019-02-07 10:41:44 -08:00
Jan Kotas b04bd23c11 Cleanup security permission and resource consumption attribute references (dotnet/corefx#35042)
Commit migrated from https://github.com/dotnet/corefx/commit/2c2e4a599889652ec579a870054b0f8915ea70fd
2019-02-02 00:09:09 -08:00
Stephen Toub f927467d2f Fix several related inheritability bugs on Unix (dotnet/corefx#34967)
- AnonymousPipeServerStream accepts a HandleInheritability value.  When it's set to None, both ends of the pipe are correctly created as O_CLOEXEC to prevent them from being inherited.  However, when it's set to Inheritable, we're not marking either end of the pipe as O_CLOEXEC, which means both file descriptors are inherited by the child process.  While technically that meets the letter of the law as to what the API requires, in the 99.9% use case the server handle really isn't intended to be inherited, and rather it's only the client handle that is; by allowing the server handle to also be inherited, when the server closes its end of the pipe, the client doesn't get an EOF or broken pipe, because it still has its dup of the file descriptor open, and will for the lifetime of the process.  The fix is to always mark the server file descriptor as O_CLOEXEC even if the inheritability is set to Inheritable.
- NamedPipeServer/ClientStream is built on Socket.  Previously, sockets defaulted to being inheritable, but we changed that for .NET Core 3.0, such that they're now not inherited.  But the pipe code was written expecting the default of Inheritable, and has an if block that says "if inheritability requested was not inheritable, then set O_CLOEXEC"; that now needs to be flipped to say "if inheritability was requested, clear O_CLOEXEC".
- MemoryMappedFile has a similar issue.  It tries to use shm_open to create the backing store, but shm_open defaults to having O_CLOEXEC set, and so if Inheritabile was requested, we're neglecting to clear the O_CLOEXEC flag.

Commit migrated from https://github.com/dotnet/corefx/commit/e5d6c6fc20e72c9d5ba3214f99c25f418bcff0a0
2019-01-31 09:46:39 -05:00
Stephen Toub 13b43c3349 Move Environment to shared CoreLib (dotnet/corefx#34654)
Rather than having Environment partially live in corefx and call into an EnvironmentAugments type in CoreLib that in turn calls into an Environment type in CoreLib, we're just moving Environment to live in CoreLib.

To start that, this PR moves Environment and its dependencies from their current locations into the shared CoreLib.  Those changes will mirror over to coreclr.  After that, I'll fix it up to work in CoreLib. And once those changes are built and available back to corefx, I'll update System.Runtime.Extensions to just use the functionality from CoreLib and delete remaining unnecessary code from corefx.

Commit migrated from https://github.com/dotnet/corefx/commit/b2d890a311ff66857339c7dae493efa43237284c
2019-01-17 20:07:12 -05:00