Commit 09c1be8
committed
Merged PR 668400: [vs17.14] Recreate temp on linux using CreateTempSubdirectory on every build
Recreate temp on linux using CreateTempSubdirectory on every build
----
#### AI description (iteration 1)
#### PR Classification
Security bug fix that improves the creation of the temporary folder on Linux to prevent potential malicious folder hijacking.
#### PR Summary
This PR replaces the custom logic for creating and validating the MSBuild temporary folder on Linux with the built-in Directory.CreateTempSubdirectory method, ensuring a fresh and securely generated temp directory on every build.
- `src/Shared/TempFileUtilities.cs`: Updated the Linux branch in the CreateFolderUnderTemp method to use Directory.CreateTempSubdirectory instead of manually handling mkdir/chmod and username concatenation.
- `src/Shared/TempFileUtilities.cs`: Removed the custom permission logic and the unused `userRWX` constant, simplifying the directory creation for non-Linux platforms.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
----
#### AI description (iteration 2)
#### PR Classification
This pull request is a security bug fix addressing a vulnerability in how MSBuild creates its temporary folder on Linux.
#### PR Summary
The PR improves the security of temp folder creation by replacing custom mkdir/chmod logic with the built-in `Directory.CreateTempSubdirectory` on Linux, ensuring a uniquely created directory for each build. Additionally, it removes redundant permission code in `TempFileUtilities.cs` and bumps the version in `eng/Versions.props` from 17.14.27 to 17.14.28.
- `src/Shared/TempFileUtilities.cs`: Replaces manual Linux temp folder creation with `Directory.CreateTempSubdirectory` and eliminates outdated permission checks.
- `eng/Versions.props`: Updates the version prefix to signal the new release.
Related work items: #25411471 parent c9a5370 commit 09c1be8
2 files changed
+10
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 40 | + | |
45 | 41 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 42 | + | |
49 | 43 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
68 | 47 | | |
69 | 48 | | |
70 | 49 | | |
71 | | - | |
| 50 | + | |
| 51 | + | |
72 | 52 | | |
73 | 53 | | |
74 | | - | |
| 54 | + | |
75 | 55 | | |
76 | 56 | | |
77 | 57 | | |
| |||
0 commit comments