Use Group SID on fleetctl on Windows (#7854)

This is intended to allow packages to be built on localizations other than English.

See #5065.

Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com>
This commit is contained in:
Zach Wasserman 2022-09-21 11:39:26 -07:00 committed by GitHub
parent cde973293b
commit bdad9ac1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1 @@
* Fix an error generating Windows packages with `fleetctl package` on non-English localizations of Windows.

View File

@ -92,9 +92,13 @@ func BuildMSI(opt Options) (string, error) {
}
if runtime.GOOS == "windows" {
// Explicitly grant read access, otherwise within the Docker container there are permissions
// errors.
out, err := exec.Command("icacls", tmpDir, "/grant", "everyone:R", "/t").CombinedOutput()
// Explicitly grant read access, otherwise within the Docker
// container there are permissions errors.
// "S-1-1-0" is the SID for the World/Everyone group
// (a group that includes all users).
out, err := exec.Command(
"icacls", tmpDir, "/grant", "*S-1-1-0:R", "/t",
).CombinedOutput()
if err != nil {
fmt.Println(string(out))
return "", fmt.Errorf("icacls: %w", err)