diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
| commit | d16da6da8c4880d90dc35fa9006806f7c0395d7f (patch) | |
| tree | d4ca8fed4e14bcffe63268daa6d8efd1923ff03b /system/acl_test.go | |
| parent | e58181a930064385c881b7ee1cac4914dd435121 (diff) | |
system: enforce absolute paths
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute.
Closes #11.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/acl_test.go')
| -rw-r--r-- | system/acl_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/system/acl_test.go b/system/acl_test.go index b288bd4a..992271a2 100644 --- a/system/acl_test.go +++ b/system/acl_test.go @@ -60,42 +60,42 @@ func TestACLUpdateOp(t *testing.T) { 0xdeadbeef, func(_ *testing.T, sys *I) { sys. - UpdatePerm("/run/user/1971/hakurei", acl.Execute). - UpdatePerm("/tmp/hakurei.0/tmpdir/150", acl.Read, acl.Write, acl.Execute) + UpdatePerm(m("/run/user/1971/hakurei"), acl.Execute). + UpdatePerm(m("/tmp/hakurei.0/tmpdir/150"), acl.Read, acl.Write, acl.Execute) }, []Op{ &aclUpdateOp{Process, "/run/user/1971/hakurei", []acl.Perm{acl.Execute}}, &aclUpdateOp{Process, "/tmp/hakurei.0/tmpdir/150", []acl.Perm{acl.Read, acl.Write, acl.Execute}}, }, stub.Expect{}}, {"tmpdirp", 0xdeadbeef, func(_ *testing.T, sys *I) { - sys.UpdatePermType(User, "/tmp/hakurei.0/tmpdir", acl.Execute) + sys.UpdatePermType(User, m("/tmp/hakurei.0/tmpdir"), acl.Execute) }, []Op{ &aclUpdateOp{User, "/tmp/hakurei.0/tmpdir", []acl.Perm{acl.Execute}}, }, stub.Expect{}}, {"tmpdir", 0xdeadbeef, func(_ *testing.T, sys *I) { - sys.UpdatePermType(User, "/tmp/hakurei.0/tmpdir/150", acl.Read, acl.Write, acl.Execute) + sys.UpdatePermType(User, m("/tmp/hakurei.0/tmpdir/150"), acl.Read, acl.Write, acl.Execute) }, []Op{ &aclUpdateOp{User, "/tmp/hakurei.0/tmpdir/150", []acl.Perm{acl.Read, acl.Write, acl.Execute}}, }, stub.Expect{}}, {"share", 0xdeadbeef, func(_ *testing.T, sys *I) { - sys.UpdatePermType(Process, "/run/user/1971/hakurei/fcb8a12f7c482d183ade8288c3de78b5", acl.Execute) + sys.UpdatePermType(Process, m("/run/user/1971/hakurei/fcb8a12f7c482d183ade8288c3de78b5"), acl.Execute) }, []Op{ &aclUpdateOp{Process, "/run/user/1971/hakurei/fcb8a12f7c482d183ade8288c3de78b5", []acl.Perm{acl.Execute}}, }, stub.Expect{}}, {"passwd", 0xdeadbeef, func(_ *testing.T, sys *I) { sys. - UpdatePermType(Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/passwd", acl.Read). - UpdatePermType(Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/group", acl.Read) + UpdatePermType(Process, m("/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/passwd"), acl.Read). + UpdatePermType(Process, m("/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/group"), acl.Read) }, []Op{ &aclUpdateOp{Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/passwd", []acl.Perm{acl.Read}}, &aclUpdateOp{Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/group", []acl.Perm{acl.Read}}, }, stub.Expect{}}, {"wayland", 0xdeadbeef, func(_ *testing.T, sys *I) { - sys.UpdatePermType(hst.EWayland, "/run/user/1971/wayland-0", acl.Read, acl.Write, acl.Execute) + sys.UpdatePermType(hst.EWayland, m("/run/user/1971/wayland-0"), acl.Read, acl.Write, acl.Execute) }, []Op{ &aclUpdateOp{hst.EWayland, "/run/user/1971/wayland-0", []acl.Perm{acl.Read, acl.Write, acl.Execute}}, }, stub.Expect{}}, |
