aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/outcome/sppulse_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-13 22:58:19 +0900
committerOphestra <cat@gensokyo.uk>2026-10-13 22:58:19 +0900
commitfadb42ec8daeeb8a576582d274cd4aeb64e535c0 (patch)
tree20db92adde637b3d1bc7a931d0551590e80456cf /internal/outcome/sppulse_test.go
parent40e4c9031652731622315e778a9bcace6cea6cb3 (diff)
internal/system: skip superfluous chmod
A successful chmod clobbers acl mask, breaking the fast path. This change also fixes the ACL race. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/sppulse_test.go')
-rw-r--r--internal/outcome/sppulse_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/internal/outcome/sppulse_test.go b/internal/outcome/sppulse_test.go
index a1ff0d03..a9995562 100644
--- a/internal/outcome/sppulse_test.go
+++ b/internal/outcome/sppulse_test.go
@@ -143,12 +143,12 @@ func TestSpPulseOp(t *testing.T) {
call("open", stub.ExpectArgs{"/proc/nonexistent/cookie"}, &stubOsFile{Reader: bytes.NewReader(sampleCookie)}, nil),
}, newI().
// state.ensureRuntimeDir
- Ensure(m(wantRuntimePath), 0700).
+ Ensure(m(wantRuntimePath), 0700, true).
UpdatePermType(system.User, m(wantRuntimePath), acl.Execute).
- Ensure(m(wantRunDirPath), 0700).
+ Ensure(m(wantRunDirPath), 0700, true).
UpdatePermType(system.User, m(wantRunDirPath), acl.Execute).
// state.runtime
- Ephemeral(system.Process, m(wantRuntimeSharePath), 0700).
+ Ephemeral(system.Process, m(wantRuntimeSharePath), 0700, true).
UpdatePerm(m(wantRuntimeSharePath), acl.Execute).
// toSystem
Link(m(wantRuntimePath+"/pulse/native"), m(wantRuntimeSharePath+"/pulse")), sysUsesRuntime(nil), nil, insertsOps(afterSpRuntimeOp(nil)), []stub.Call{
@@ -175,12 +175,12 @@ func TestSpPulseOp(t *testing.T) {
call("open", stub.ExpectArgs{"/proc/nonexistent/cookie"}, &stubOsFile{Reader: bytes.NewReader(sampleCookie[:len(sampleCookie)-0xe])}, nil),
}, newI().
// state.ensureRuntimeDir
- Ensure(m(wantRuntimePath), 0700).
+ Ensure(m(wantRuntimePath), 0700, true).
UpdatePermType(system.User, m(wantRuntimePath), acl.Execute).
- Ensure(m(wantRunDirPath), 0700).
+ Ensure(m(wantRunDirPath), 0700, true).
UpdatePermType(system.User, m(wantRunDirPath), acl.Execute).
// state.runtime
- Ephemeral(system.Process, m(wantRuntimeSharePath), 0700).
+ Ephemeral(system.Process, m(wantRuntimeSharePath), 0700, true).
UpdatePerm(m(wantRuntimeSharePath), acl.Execute).
// toSystem
Link(m(wantRuntimePath+"/pulse/native"), m(wantRuntimeSharePath+"/pulse")), sysUsesRuntime(nil), nil, insertsOps(afterSpRuntimeOp(nil)), []stub.Call{
@@ -208,12 +208,12 @@ func TestSpPulseOp(t *testing.T) {
call("open", stub.ExpectArgs{"/proc/nonexistent/cookie"}, &stubOsFile{Reader: bytes.NewReader(sampleCookie)}, nil),
}, newI().
// state.ensureRuntimeDir
- Ensure(m(wantRuntimePath), 0700).
+ Ensure(m(wantRuntimePath), 0700, true).
UpdatePermType(system.User, m(wantRuntimePath), acl.Execute).
- Ensure(m(wantRunDirPath), 0700).
+ Ensure(m(wantRunDirPath), 0700, true).
UpdatePermType(system.User, m(wantRunDirPath), acl.Execute).
// state.runtime
- Ephemeral(system.Process, m(wantRuntimeSharePath), 0700).
+ Ephemeral(system.Process, m(wantRuntimeSharePath), 0700, true).
UpdatePerm(m(wantRuntimeSharePath), acl.Execute).
// toSystem
Link(m(wantRuntimePath+"/pulse/native"), m(wantRuntimeSharePath+"/pulse")), sysUsesRuntime(nil), nil, insertsOps(afterSpRuntimeOp(nil)), []stub.Call{
@@ -238,12 +238,12 @@ func TestSpPulseOp(t *testing.T) {
call("verbose", stub.ExpectArgs{[]any{"cannot locate PulseAudio cookie (tried $PULSE_COOKIE, $XDG_CONFIG_HOME/pulse/cookie, $HOME/.pulse-cookie)"}}, nil, nil),
}, newI().
// state.ensureRuntimeDir
- Ensure(m(wantRuntimePath), 0700).
+ Ensure(m(wantRuntimePath), 0700, true).
UpdatePermType(system.User, m(wantRuntimePath), acl.Execute).
- Ensure(m(wantRunDirPath), 0700).
+ Ensure(m(wantRunDirPath), 0700, true).
UpdatePermType(system.User, m(wantRunDirPath), acl.Execute).
// state.runtime
- Ephemeral(system.Process, m(wantRuntimeSharePath), 0700).
+ Ephemeral(system.Process, m(wantRuntimeSharePath), 0700, true).
UpdatePerm(m(wantRuntimeSharePath), acl.Execute).
// toSystem
Link(m(wantRuntimePath+"/pulse/native"), m(wantRuntimeSharePath+"/pulse")), sysUsesRuntime(nil), nil, insertsOps(afterSpRuntimeOp(nil)), []stub.Call{