aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-08-26 13:00:00 +0200
committerJakob Unterwurzacher2018-08-26 13:04:01 +0200
commit658cc4aebba2f1e328911cf6e2f9f6c9d1084a6c (patch)
tree3bf30ae1865a2f5b746b6b55f3402ccc4ee4de48
parent91dc44c8b4ed63a65a1c2410197fa5ff79efba3a (diff)
syscallcompat: drop Fchmodat flagsv1.6.1
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
-rw-r--r--internal/syscallcompat/sys_linux.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index b6f18d2..ed5c2a3 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.