aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/dispatcher.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/dispatcher.go')
-rw-r--r--system/dispatcher.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/system/dispatcher.go b/system/dispatcher.go
index c896de57..5d5c82bf 100644
--- a/system/dispatcher.go
+++ b/system/dispatcher.go
@@ -1,6 +1,8 @@
package system
import (
+ "os"
+
"hakurei.app/system/acl"
"hakurei.app/system/dbus"
)
@@ -13,6 +15,11 @@ type syscallDispatcher interface {
// just synchronising access is not enough, as this is for test instrumentation.
new(f func(k syscallDispatcher))
+ // link provides os.Link.
+ link(oldname, newname string) error
+ // remove provides os.Remove.
+ remove(name string) error
+
// aclUpdate provides [acl.Update].
aclUpdate(name string, uid int, perms ...acl.Perm) error
@@ -37,6 +44,9 @@ type direct struct{}
func (k direct) new(f func(k syscallDispatcher)) { go f(k) }
+func (k direct) link(oldname, newname string) error { return os.Link(oldname, newname) }
+func (k direct) remove(name string) error { return os.Remove(name) }
+
func (k direct) aclUpdate(name string, uid int, perms ...acl.Perm) error {
return acl.Update(name, uid, perms...)
}