Skip to content

Commit 69bac0b

Browse files
[main] Source code updates from dotnet/dotnet (#17028)
[main] Source code updates from dotnet/dotnet
1 parent f9ac0f4 commit 69bac0b

5 files changed

Lines changed: 37 additions & 7 deletions

File tree

eng/Version.Details.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="arcade" Sha="a065c06c0c5f5647d8e312fc70dec3f5ca77b830" BarId="319156" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="arcade" Sha="ae899ea0758628a22feb37a1401ae397cc5fc8d1" BarId="319323" />
44
<ProductDependencies>
55
</ProductDependencies>
66
<ToolsetDependencies>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
<PropertyGroup>
3+
4+
<!-- Reject unsupported OS via RID prefix match -->
5+
<_NativeAotSupportedOS Condition="
6+
'$(TargetOS)' != 'browser' and
7+
'$(TargetOS)' != 'haiku' and
8+
'$(TargetOS)' != 'illumos' and
9+
'$(TargetOS)' != 'netbsd' and
10+
'$(TargetOS)' != 'solaris'
11+
">true</_NativeAotSupportedOS>
12+
13+
<!-- Reject unsupported architectures via RID suffix match -->
14+
<_NativeAotSupportedArch Condition="
15+
'$(TargetArchitecture)' != 'wasm' and
16+
('$(TargetArchitecture)' != 'x86' or '$(TargetOS)' == 'windows')
17+
">true</_NativeAotSupportedArch>
18+
19+
<NativeAotSupported Condition="
20+
'$(NativeAotSupported)' == '' and
21+
'$(_NativeAotSupportedOS)' == 'true' and
22+
'$(_NativeAotSupportedArch)' == 'true'
23+
">true</NativeAotSupported>
24+
25+
</PropertyGroup>
26+
</Project>

src/Microsoft.DotNet.Build.Tasks.Installers/build/installer.build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@
249249
<Exec Command="chmod ugo+x '$(_LayoutControlRoot)postrm'"
250250
Condition="'@(LinuxPostRemoveScript)' != ''" />
251251

252-
<Exec Command="tar -C '$(_LayoutControlRoot)' -czf '$(_LayoutDirectory)/control.tar.gz' ."
252+
<Exec Command="tar --owner=root --group=root -C '$(_LayoutControlRoot)' -czf '$(_LayoutDirectory)/control.tar.gz' ."
253253
IgnoreExitCode="true"
254254
IgnoreStandardErrorWarningFormat="true" />
255255

256-
<Exec Command="tar -C '$(_LayoutDataRoot)' -czf '$(_LayoutDirectory)/data.tar.gz' ."
256+
<Exec Command="tar --owner=root --group=root -C '$(_LayoutDataRoot)' -czf '$(_LayoutDirectory)/data.tar.gz' ."
257257
IgnoreExitCode="true"
258258
IgnoreStandardErrorWarningFormat="true" />
259259

src/Microsoft.DotNet.SignTool/src/ContentUtil.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static bool IsManaged(string filePath)
6565
{
6666
try
6767
{
68-
using (var stream = new FileStream(filePath, FileMode.Open))
68+
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
6969
using (var peReader = new PEReader(stream))
7070
{
7171
return peReader.PEHeaders.CorHeader != null;
@@ -81,7 +81,7 @@ public static bool IsCrossgened(string filePath)
8181
{
8282
const int CROSSGEN_FLAG = 4;
8383

84-
using (var stream = new FileStream(filePath, FileMode.Open))
84+
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
8585
using (var peReader = new PEReader(stream))
8686
{
8787
return ((int)peReader.PEHeaders.CorHeader.Flags & CROSSGEN_FLAG) == CROSSGEN_FLAG;
@@ -115,7 +115,7 @@ public static ExecutableType GetExecutableType(string filePath)
115115
{
116116
try
117117
{
118-
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
118+
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
119119
{
120120
if (stream.Length < 4)
121121
return ExecutableType.None;

src/Microsoft.DotNet.SignTool/src/VerifySignatures.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ internal static SigningStatus IsSignedPkgOrAppBundle(TaskLoggingHelper log, stri
147147

148148
public static SigningStatus IsSignedPE(string filePath)
149149
{
150-
using (var stream = new FileStream(filePath, FileMode.Open))
150+
// Open read-only with a shared lock. Verification only reads PE headers, so
151+
// requesting write access (the FileStream(path, FileMode) default) is unnecessary
152+
// and causes a sharing violation when another process (e.g. an antimalware scanner)
153+
// momentarily holds the freshly-built file open.
154+
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
151155
{
152156
return IsSignedPE(stream);
153157
}

0 commit comments

Comments
 (0)