forked from security/hakurei
system/mkdir: use syscall dispatcher
This enables mkdir op methods to be instrumented. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -192,6 +192,20 @@ type kstub struct{ *stub.Stub[syscallDispatcher] }
|
||||
|
||||
func (k *kstub) new(f func(k syscallDispatcher)) { k.Helper(); k.New(f) }
|
||||
|
||||
func (k *kstub) mkdir(name string, perm os.FileMode) error {
|
||||
k.Helper()
|
||||
return k.Expects("mkdir").Error(
|
||||
stub.CheckArg(k.Stub, "name", name, 0),
|
||||
stub.CheckArg(k.Stub, "perm", perm, 1))
|
||||
}
|
||||
|
||||
func (k *kstub) chmod(name string, mode os.FileMode) error {
|
||||
k.Helper()
|
||||
return k.Expects("chmod").Error(
|
||||
stub.CheckArg(k.Stub, "name", name, 0),
|
||||
stub.CheckArg(k.Stub, "mode", mode, 1))
|
||||
}
|
||||
|
||||
func (k *kstub) link(oldname, newname string) error {
|
||||
k.Helper()
|
||||
return k.Expects("link").Error(
|
||||
|
||||
Reference in New Issue
Block a user