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:
parent
e1853e1011
commit
09870bfac5
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user