Files
Pulse/scripts/installtests/umask_unix_test.go
rcourtman 96a4dceb9d Pin umask 022 in installtests so trust fixtures are host-independent
install.sh refuses connection state, token, and lifecycle files whose
parent directory is group- or world-writable. The fixtures build those
parents with t.TempDir, which inherits the process umask, so on a worker
with umask 002 the state directory came out 775 and seven TestInstallSH
cases failed on the pulse-dev release preflight while passing on GitHub
runners and macOS. Set umask 022 for the package on unix so the tests
prove the installer contract rather than the host's umask.
2026-09-01 22:20:15 +01:00

17 lines
631 B
Go

//go:build unix
package installtests
import "syscall"
// The installer lifecycle trust checks refuse state files whose parent
// directory is group- or world-writable. Test fixtures build those parents with
// t.TempDir, which inherits the process umask, so a worker with umask 002 (the
// Ubuntu default for a user's private group) produced 775 fixture directories
// and failed every trusted-state test that passes under umask 022 on GitHub
// runners and macOS. Pin the umask the fixtures were written against so the
// package proves the installer contract instead of the host's umask.
func init() {
syscall.Umask(0o022)
}