From e97c23e08383666117523cf3145f1213b41c2489 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 30 Nov 2017 19:40:53 +0100 Subject: syscallcompat: check that we get NOFOLLOW wherever possible ...and fix the instances where the AT_SYMLINK_NOFOLLOW / O_NOFOLLOW / O_EXCL flag was missing. --- internal/syscallcompat/emulate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/syscallcompat/emulate.go') diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go index 59d0ea5..3af45f8 100644 --- a/internal/syscallcompat/emulate.go +++ b/internal/syscallcompat/emulate.go @@ -136,12 +136,12 @@ func emulateFchmodat(dirfd int, path string, mode uint32, flags int) (err error) } defer syscall.Fchdir(cwd) // We also don't have Lchmod, so emulate it (poorly). - if flags&unix.AT_SYMLINK_NOFOLLOW > 0 { + if flags&unix.AT_SYMLINK_NOFOLLOW != 0 { fi, err := os.Lstat(path) if err != nil { return err } - if fi.Mode()&os.ModeSymlink > 0 { + if fi.Mode()&os.ModeSymlink != 0 { return nil } } -- cgit v1.2.3