Skip to content

Commit 9ba7072

Browse files
authored
Do not follow symlinks when performing chmod operations (#185)
1 parent 4ba0274 commit 9ba7072

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/ufs/fs_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (fs *UnixFS) Chmodat(dirfd int, name string, mode FileMode) error {
9090
}
9191

9292
func (fs *UnixFS) fchmodat(op string, dirfd int, name string, mode FileMode) error {
93-
return ensurePathError(unix.Fchmodat(dirfd, name, uint32(mode), 0), op, name)
93+
return ensurePathError(unix.Fchmodat(dirfd, name, uint32(mode), AT_SYMLINK_NOFOLLOW), op, name)
9494
}
9595

9696
// Chown changes the numeric uid and gid of the named file.

0 commit comments

Comments
 (0)