summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/emulate.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/syscallcompat/emulate.go')
-rw-r--r--internal/syscallcompat/emulate.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go
index 6cb0ea0..59d0ea5 100644
--- a/internal/syscallcompat/emulate.go
+++ b/internal/syscallcompat/emulate.go
@@ -135,6 +135,16 @@ func emulateFchmodat(dirfd int, path string, mode uint32, flags int) (err error)
return err
}
defer syscall.Fchdir(cwd)
+ // We also don't have Lchmod, so emulate it (poorly).
+ if flags&unix.AT_SYMLINK_NOFOLLOW > 0 {
+ fi, err := os.Lstat(path)
+ if err != nil {
+ return err
+ }
+ if fi.Mode()&os.ModeSymlink > 0 {
+ return nil
+ }
+ }
return syscall.Chmod(path, mode)
}