From 658cc4aebba2f1e328911cf6e2f9f6c9d1084a6c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 26 Aug 2018 13:00:00 +0200 Subject: [PATCH] syscallcompat: drop Fchmodat flags These were silently ignored until now (!) but are rejected by Go 1.11 stdlib. Drop the flags so the tests work again, until we figure out a better solution. https://github.com/golang/go/issues/20130 --- internal/syscallcompat/sys_linux.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go index b6f18d2f..ed5c2a3f 100644 --- a/internal/syscallcompat/sys_linux.go +++ b/internal/syscallcompat/sys_linux.go @@ -84,12 +84,12 @@ func Dup3(oldfd int, newfd int, flags int) (err error) { // Fchmodat syscall. func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - // Why would we ever want to call this without AT_SYMLINK_NOFOLLOW? - if flags&unix.AT_SYMLINK_NOFOLLOW == 0 { - tlog.Warn.Printf("Fchmodat: adding missing AT_SYMLINK_NOFOLLOW flag") - flags |= unix.AT_SYMLINK_NOFOLLOW - } - return syscall.Fchmodat(dirfd, path, mode, flags) + // Linux does not support passing flags to fchmodat! From the man page: + // AT_SYMLINK_NOFOLLOW ... This flag is not currently implemented. + // Linux ignores any flags, but Go stdlib rejects them with EOPNOTSUPP starting + // with Go 1.11. See https://github.com/golang/go/issues/20130 for more info. + // TODO: Use fchmodat2 once available on Linux. + return syscall.Fchmodat(dirfd, path, mode, 0) } // Fchownat syscall.