Skip to content

Commit

Permalink
Fix build constraints export from flare package (#7937)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladlachmi authored Jun 30, 2024
1 parent 7121a94 commit f84f51d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions pkg/flare/flare.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ func (f *Flare) ProcessEnvVars(outPath, fileName string, getWriterFunc GetFileWr
return nil
}

// SetBaselinePermissions sets the Umask for all files created by flare for posix operating systems
// on Windows this is a noop as permissions are set according to the parent directory
func SetBaselinePermissions(mask int) {
setBaselinePermissions(mask)
}

func (f *Flare) processEnvVars(w io.Writer) error {
for _, e := range os.Environ() {
for _, p := range f.envVarPrefixes {
Expand Down
2 changes: 1 addition & 1 deletion pkg/flare/permissions_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package flare

import "syscall"

func SetBaselinePermissions(mask int) {
func setBaselinePermissions(mask int) {
syscall.Umask(mask)
}
2 changes: 1 addition & 1 deletion pkg/flare/permissions_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package flare

import "syscall"

func SetBaselinePermissions(mask int) {
func setBaselinePermissions(mask int) {
syscall.Umask(mask)
}
2 changes: 1 addition & 1 deletion pkg/flare/permissions_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package flare

import "syscall"

func SetBaselinePermissions(mask int) {
func setBaselinePermissions(mask int) {
syscall.Umask(mask)
}
2 changes: 1 addition & 1 deletion pkg/flare/permissions_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package flare

import "syscall"

func SetBaselinePermissions(mask int) {
func setBaselinePermissions(mask int) {
syscall.Umask(mask)
}
2 changes: 1 addition & 1 deletion pkg/flare/permissions_windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package flare

func SetBaselinePermissions(_ int) {
func setBaselinePermissions(_ int) {
return
}

0 comments on commit f84f51d

Please sign in to comment.