On Tue, Jul 12, 2011 at 10:45:00PM +0000, Christian Weisgerber wrote:
> The test does
> 
>   ln -s conftest.no-such conftest.dangle
> 
> and then runs this program:
> 
> --------------->
> #include <fcntl.h>
> #include <unistd.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <sys/types.h>
> int
> main ()
> {
>   return (fchownat (AT_FDCWD, "conftest.dangle", -1, getgid (),
>                     AT_SYMLINK_NOFOLLOW) != 0
>           && errno == ENOENT);
> }
> <---------------
> 
> That indeed looks wrong to me.

Ugh, indeed... FOLLOW vs follow typo, see diff below.

ok?

(N.B., this issue didn't affect any existing system calls, only the
newly added *at() functions.)

Index: vfs_syscalls.c
===================================================================
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.174
diff -u -p -r1.174 vfs_syscalls.c
--- vfs_syscalls.c      9 Jul 2011 05:46:26 -0000       1.174
+++ vfs_syscalls.c      12 Jul 2011 23:05:34 -0000
@@ -1957,7 +1957,7 @@ dofchmodat(struct proc *p, int fd, const
                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
                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;

Reply via email to