summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_common.go
diff options
context:
space:
mode:
authorSebastian Lackner2019-01-14 02:49:11 +0100
committerrfjakob2019-01-14 21:27:28 +0100
commit92110628ee5f48b0106b32090854fcc61d6bca20 (patch)
tree9469e338a693fb56beea79c961d367771f13346c /internal/syscallcompat/sys_common.go
parent0345cc08307c01da635ea5546952a584480c9a93 (diff)
syscallcompat: Drop Fchownat emulation on macOS.
Diffstat (limited to 'internal/syscallcompat/sys_common.go')
-rw-r--r--internal/syscallcompat/sys_common.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_common.go b/internal/syscallcompat/sys_common.go
index 75d2509..9514830 100644
--- a/internal/syscallcompat/sys_common.go
+++ b/internal/syscallcompat/sys_common.go
@@ -72,6 +72,16 @@ func Unlinkat(dirfd int, path string, flags int) (err error) {
return unix.Unlinkat(dirfd, path, flags)
}
+// Fchownat syscall.
+func Fchownat(dirfd int, path string, uid int, gid int, 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("Fchownat: adding missing AT_SYMLINK_NOFOLLOW flag")
+ flags |= unix.AT_SYMLINK_NOFOLLOW
+ }
+ return unix.Fchownat(dirfd, path, uid, gid, flags)
+}
+
// Linkat exists both in Linux and in MacOS 10.10+.
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
return unix.Linkat(olddirfd, oldpath, newdirfd, newpath, flags)