Skip to content

Commit 58a4b91

Browse files
fix: use locale-neutral Windows ACL for build data
On localized Windows installs, resolving the English Everyone principal can fail when build_data_writer.ps1 creates the output file ACL. This breaks build data generation on systems such as German Windows. Use the language-neutral WorldSid identity instead, preserving the existing Everyone read permission without depending on localized account names.
1 parent e433644 commit 58a4b91

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

news/3886.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(windows) Fixed build data generation on localized Windows installations.

python/private/build_data_writer.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ $Utf8NoBom = New-Object System.Text.UTF8Encoding $False
2121
[System.IO.File]::WriteAllLines($OutputPath, $Lines, $Utf8NoBom)
2222

2323
$Acl = Get-Acl $OutputPath
24-
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "Read", "Allow")
24+
$EveryoneSid = New-Object System.Security.Principal.SecurityIdentifier(
25+
[System.Security.Principal.WellKnownSidType]::WorldSid,
26+
$null
27+
)
28+
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
29+
$EveryoneSid,
30+
"Read",
31+
"Allow"
32+
)
2533
$Acl.SetAccessRule($AccessRule)
2634
Set-Acl $OutputPath $Acl
2735

0 commit comments

Comments
 (0)