aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/emulate.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-11-30 19:40:53 +0100
committerJakob Unterwurzacher2017-11-30 19:40:53 +0100
commite97c23e08383666117523cf3145f1213b41c2489 (patch)
tree19e93878a9f87e41d4704325d4f01c44c464214b /internal/syscallcompat/emulate.go
parent22282aefe6f4da0257ea8f568aa4369ad15ce5f9 (diff)
syscallcompat: check that we get NOFOLLOW wherever possible
...and fix the instances where the AT_SYMLINK_NOFOLLOW / O_NOFOLLOW / O_EXCL flag was missing.
Diffstat (limited to 'internal/syscallcompat/emulate.go')
-rw-r--r--internal/syscallcompat/emulate.go4
1 files changed, 2 insertions, 2 deletions
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
}
}