syscallcompat: also refactor MkdiratUser on GOOS=darwin

Breakage was:

+GOOS=darwin
+GOARCH=amd64
+go build -tags without_openssl
internal/fusefrontend/node_dir_ops.go:45:34: cannot use context (type *fuse.Context) as type *fuse.Caller in argument to syscallcompat.MkdiratUser
internal/fusefrontend/node_dir_ops.go:83:35: cannot use context (type *fuse.Context) as type *fuse.Caller in argument to syscallcompat.MkdiratUser
This commit is contained in:
Jakob Unterwurzacher 2021-05-22 22:01:46 +02:00
parent e1853e1011
commit 09870bfac5

View File

@ -134,12 +134,12 @@ func SymlinkatUser(oldpath string, newdirfd int, newpath string, context *fuse.C
return Symlinkat(oldpath, newdirfd, newpath) return Symlinkat(oldpath, newdirfd, newpath)
} }
func MkdiratUser(dirfd int, path string, mode uint32, caller *fuse.Caller) (err error) { func MkdiratUser(dirfd int, path string, mode uint32, context *fuse.Context) (err error) {
if caller != nil { if context != nil {
runtime.LockOSThread() runtime.LockOSThread()
defer runtime.UnlockOSThread() defer runtime.UnlockOSThread()
err = pthread_setugid_np(caller.Uid, caller.Gid) err = pthread_setugid_np(context.Owner.Uid, context.Owner.Gid)
if err != nil { if err != nil {
return err return err
} }