diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-07-12 23:36:41 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-07-12 23:36:41 +0000 |
commit | d1228ad446b4bae6145dd821757282029499bf92 (patch) | |
tree | 9725e17a5a0b474964aec45815dcc7a6a48295c3 /sys/kern | |
parent | 1f84b097aa12461361f646badc8eb194837bda3c (diff) |
Fix typo that caused fchownat(2) and fchmodat(2) to try to dereference
symbolic links even when the AT_SYMLINK_NOFOLLOW flag is passed.
noticed by naddy@ testing gnulib
ok deraadt@ and presumably tedu@ (who wrote a similar diff)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index cac2668f5be..385d3380245 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.174 2011/07/09 05:46:26 matthew Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.175 2011/07/12 23:36:40 matthew Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -1957,7 +1957,7 @@ dofchmodat(struct proc *p, int fd, const char *path, mode_t mode, int flag, return (EINVAL); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINITAT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fd, path, p); + NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -2054,7 +2054,7 @@ dofchownat(struct proc *p, int fd, const char *path, uid_t uid, gid_t gid, return (EINVAL); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINITAT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fd, path, p); + NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; |