From 39bc191fa2a259522aac16bd3fb50b43cc848259 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 10 Oct 2024 08:42:25 -0700 Subject: [PATCH 1/4] use matchAny (#10544) --- .github/policies/disallow-edits.yml | 200 +++++++--------------------- 1 file changed, 46 insertions(+), 154 deletions(-) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 6ae458fe3ce..01607848c0a 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -10,158 +10,50 @@ configuration: - payloadType: Pull_Request - isAction: action: Opened + - or: + - filesMatchPattern: + pattern: xml/Microsoft.Extensions*/* + matchAny: true + excludedFiles: + - xml/Microsoft.Extensions.FileSystemGlobbing/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Composition/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Formats.Cbor/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Formats.Nrbf/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Net.ServerSentEvents/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Numerics.Tensors/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Speech/* + - filesMatchPattern: + matchAny: true + pattern: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml + - filesMatchPattern: + matchAny: true + pattern: xml/System.Runtime.Serialization/ImportOptions.xml + - filesMatchPattern: + matchAny: true + pattern: xml/System.Runtime.Serialization/XsdDataContractExporter.xml then: - - if: - - includesModifiedFile: - file: xml/Microsoft.Extensions*/* - # TODO - These files do use this repo as source-of-truth - how to exclude them? - # - xml/Microsoft.Extensions.FileSystemGlobbing/* - # - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* - # - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'Microsoft.Extensions' in the /// comments in the dotnet/runtime or dotnet/extensions repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Composition/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Composition' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Formats.Cbor/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Formats.Cbor' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Formats.Nrbf/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Formats.Nrbf' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Net.ServerSentEvents/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Net.ServerSentEvents' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Numerics.Tensors/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Numerics.Tensors' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Speech/* - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'System.Speech' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'ISerializationCodeDomSurrogateProvider' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ImportOptions.xml - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'ImportOptions' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest - - if: - - includesModifiedFile: - file: xml/System.Runtime.Serialization/XsdDataContractExporter.xml - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates for 'XsdDataContractExporter' in the /// comments in the dotnet/runtime repo instead. - - if: - - or: - - activitySenderHasPermission: - permission: None - - activitySenderHasPermission: - permission: Read - then: - - closePullRequest + - addReply: + reply: >- + @${issueAuthor} - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates in the /// comments in the dotnet/runtime repo (or dotnet/extensions repo) instead. + - if: + - or: + - activitySenderHasPermission: + permission: None + - activitySenderHasPermission: + permission: Read + then: + - closePullRequest From ef19a53e79734a77ffb9c8034c0272b8c8495295 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Thu, 10 Oct 2024 09:30:45 -0700 Subject: [PATCH 2/4] Add missing return values for VectorX.Create(ROS values) (#10511) --- xml/System.Numerics/Vector2.xml | 2 +- xml/System.Numerics/Vector3.xml | 2 +- xml/System.Numerics/Vector4.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/System.Numerics/Vector2.xml b/xml/System.Numerics/Vector2.xml index abd8ecc3f25..c96fcc89494 100644 --- a/xml/System.Numerics/Vector2.xml +++ b/xml/System.Numerics/Vector2.xml @@ -663,7 +663,7 @@ The span of elements to assign to the vector. Constructs a vector from the given . The span must contain at least 2 elements. - To be added. + A new whose elements have the specified values. To be added. diff --git a/xml/System.Numerics/Vector3.xml b/xml/System.Numerics/Vector3.xml index 771619c4b77..3bd12032637 100644 --- a/xml/System.Numerics/Vector3.xml +++ b/xml/System.Numerics/Vector3.xml @@ -709,7 +709,7 @@ The span of elements to assign to the vector. Constructs a vector from the given . The span must contain at least 3 elements. - To be added. + A new whose elements have the specified values. To be added. diff --git a/xml/System.Numerics/Vector4.xml b/xml/System.Numerics/Vector4.xml index 612188b7d88..1a25bfd7ad1 100644 --- a/xml/System.Numerics/Vector4.xml +++ b/xml/System.Numerics/Vector4.xml @@ -757,7 +757,7 @@ The span of elements to assign to the vector. Constructs a vector from the given . The span must contain at least 4 elements. - To be added. + A new whose elements have the specified values. To be added. From e202b0087b927fa926b5dfe5c5c04473621c4588 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Thu, 10 Oct 2024 11:39:59 -0700 Subject: [PATCH 3/4] Doc: AssemblyBuilder require fully trusted environment with trusted input (#10541) --- xml/System.Reflection.Emit/AssemblyBuilder.xml | 13 ++++++++++++- xml/System.Reflection.Emit/ILGenerator.xml | 9 +++++++++ .../PersistedAssemblyBuilder.xml | 12 +++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/xml/System.Reflection.Emit/AssemblyBuilder.xml b/xml/System.Reflection.Emit/AssemblyBuilder.xml index c2c048fcb2c..ee6e05f93d9 100644 --- a/xml/System.Reflection.Emit/AssemblyBuilder.xml +++ b/xml/System.Reflection.Emit/AssemblyBuilder.xml @@ -76,7 +76,18 @@ Defines and represents a dynamic assembly. - For more information about this API, see Supplemental API remarks for AssemblyBuilder. + + [!WARNING] +> `AssemblyBuilder` APIs require a fully trusted environment with trusted input, similar to other technologies such as compilers. There are no restrictions other than basic validation for generated IL that the `AssemblyBuilder` can contain. That includes validation for member name, count, and associated metadata, such as custom attributes. +]]> + + [!WARNING] +> There are no restrictions, other than basic validation, for ILGenerator APIs that produce method IL. If untrusted input is used for producing IL: +> +> - IL and metadata can contain secrets provided by the consumer. +> - IL can be invalid, such as not having balanced push versus pop opcodes, or invalid operands for a given opcode. +> - IL can contain any code that might, for example, deadlock, have infinite stack recursion, or have an infinite loop. +> - IL can load and execute code on any other reachable assembly. +> +> Such code can do whatever it wishes when the method is loaded and executed. To protect against such vulnerabilities, `ILGenerator` requires a fully trusted environment with trusted input. ]]> diff --git a/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml b/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml index ba086322909..bb83aba6475 100644 --- a/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml +++ b/xml/System.Reflection.Emit/PersistedAssemblyBuilder.xml @@ -25,7 +25,17 @@ Provides an AssemblyBuilder implementation that can persist assembly to a disk or stream. - To be added. + + [!WARNING] +> `PersistedAssemblyBuilder` APIs require a fully trusted environment with trusted input, similar to other technologies such as compilers. There are no restrictions other than basic validation for generated IL that the `AssemblyBuilder` can contain. That includes validation for member name, count, and associated metadata, such as custom attributes. +]]> + From 6fc2cdac747df5fe927ec708e41d21866d73cb80 Mon Sep 17 00:00:00 2001 From: "MSDN.WhiteKnight" <35516665+MSDN-WhiteKnight@users.noreply.github.com> Date: Fri, 11 Oct 2024 04:06:23 +0500 Subject: [PATCH 4/4] Modernize GetLogicalDrives docs (#10376) --- xml/System.IO/Directory.xml | 6 +++--- xml/System/Environment.xml | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/xml/System.IO/Directory.xml b/xml/System.IO/Directory.xml index 4744c0c63e3..e248502f187 100644 --- a/xml/System.IO/Directory.xml +++ b/xml/System.IO/Directory.xml @@ -4055,13 +4055,13 @@ The returned collection is not cached. Each call to the - Retrieves the names of the logical drives on this computer in the form "<drive letter>:\\". - The logical drives on this computer. + Retrieves the names of the logical drives on this computer. + An array of strings representing the logical drive names. :\\" (for example, "C:\\"). On Unix, it returns the paths of all filesystem mount points mounted on a particular machine (for example, "/home/user", "/media/usb"). For a list of common I/O tasks, see [Common I/O Tasks](/dotnet/standard/io/common-i-o-tasks). diff --git a/xml/System/Environment.xml b/xml/System/Environment.xml index 98ce8bf1ca9..18bd3bda93f 100644 --- a/xml/System/Environment.xml +++ b/xml/System/Environment.xml @@ -1421,11 +1421,14 @@ The following example creates environment variables for the - Returns an array of string containing the names of the logical drives on the current computer. - An array of strings where each element contains the name of a logical drive. For example, if the computer's hard drive is the first logical drive, the first element returned is "C:\\". + Retrieves the names of the logical drives on this computer. + An array of strings representing the logical drive names. :\\" (for example, "C:\\"). On Unix, it returns the paths of all filesystem mount points mounted on a particular machine (for example, "/home/user", "/media/usb"). + ## Examples The following example shows how to display the logical drives of the current computer using the method.