diff --git a/README.md b/README.md index e25b18a8244c..6fc1033c0c54 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Orbit is the recommended agent for Fleet. But Orbit can be used with or without ## Try Orbit -#### With [`fleetctl preview` already running](https://github.com/fleetdm/fleet#try-fleet) and [Go](https://golang.org/doc/install) installed: +#### With [`fleetctl preview` already running](https://github.com/fleetdm/fleet#try-fleet) and [Go](https://golang.org/doc/install) 1.16 installed: ```bash # From within the top-level directory of this repo… diff --git a/changes/.keep b/changes/.keep new file mode 100644 index 000000000000..cbf488f2137d --- /dev/null +++ b/changes/.keep @@ -0,0 +1 @@ +IGNORE BUT DO NOT REMOVE. THIS IS HERE SO THAT THE DIRECTORY REMAINS diff --git a/changes/build-msi-root b/changes/build-msi-root new file mode 100644 index 000000000000..acbd23d4ff2b --- /dev/null +++ b/changes/build-msi-root @@ -0,0 +1 @@ +* Fix permissions for building MSI when packaging as root user. Fixes fleetdm/fleet#1424 diff --git a/cmd/package/package.go b/cmd/package/package.go index f226d0767e35..3d69626a2572 100644 --- a/cmd/package/package.go +++ b/cmd/package/package.go @@ -52,7 +52,7 @@ func main() { &cli.StringFlag{ Name: "version", Usage: "Version for package product", - Value: "0.0.2", + Value: "0.0.3", Destination: &opt.Version, }, &cli.BoolFlag{ diff --git a/pkg/packaging/packaging.go b/pkg/packaging/packaging.go index 9f6887d3c41a..93dbdb7797d6 100644 --- a/pkg/packaging/packaging.go +++ b/pkg/packaging/packaging.go @@ -3,6 +3,7 @@ package packaging import ( "io" + "io/fs" "io/ioutil" "os" "path/filepath" @@ -114,3 +115,17 @@ func writeSecret(opt Options, orbitRoot string) error { return nil } + +func chmodRecursive(path string, perm os.FileMode) error { + return filepath.Walk(path, func(path string, info fs.FileInfo, err error) error { + if err != nil { + return errors.Wrap(err, "walk error") + } + + if err := os.Chmod(path, perm); err != nil { + return errors.Wrap(err, "chmod") + } + + return nil + }) +} \ No newline at end of file diff --git a/pkg/packaging/windows.go b/pkg/packaging/windows.go index cad1f53ee8fc..f32ac7ab592b 100644 --- a/pkg/packaging/windows.go +++ b/pkg/packaging/windows.go @@ -59,6 +59,11 @@ func BuildMSI(opt Options) error { return errors.Wrap(err, "write wix file") } + // Make sure permissions are permissive so that the `wine` user in the Wix Docker container can access files. + if err := chmodRecursive(tmpDir, os.ModePerm); err != nil { + return err + } + if err := wix.Heat(tmpDir); err != nil { return errors.Wrap(err, "package root files") }