From a7d59032d3790e117a48be6be1fb3a968266093b Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 14 Jan 2019 21:54:16 +0100 Subject: syscallcompat: rework Fchmodat to FchmodatNofollow We never want Fchmodat to follow symlinks, so follow what Qemu does, and call our function FchmodatNofollow. --- internal/fusefrontend/fs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/fusefrontend/fs.go') diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index e8f3033..7492778 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -290,7 +290,7 @@ func (fs *FS) Chmod(path string, mode uint32, context *fuse.Context) (code fuse. defer syscall.Close(dirfd) // os.Chmod goes through the "syscallMode" translation function that messes // up the suid and sgid bits. So use a syscall directly. - err = syscallcompat.Fchmodat(dirfd, cName, mode, unix.AT_SYMLINK_NOFOLLOW) + err = syscallcompat.FchmodatNofollow(dirfd, cName, mode) return fuse.ToStatus(err) } -- cgit v1.2.3