From owner-freebsd-fs Sat Nov 8 01:46:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA27138 for fs-outgoing; Sat, 8 Nov 1997 01:46:21 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA27132 for ; Sat, 8 Nov 1997 01:46:17 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id UAA21843; Sat, 8 Nov 1997 20:44:10 +1100 Date: Sat, 8 Nov 1997 20:44:10 +1100 From: Bruce Evans Message-Id: <199711080944.UAA21843@godzilla.zeta.org.au> To: bde@zeta.org.au, wosch@cs.tu-berlin.de Subject: Re: disabled symlinks Cc: Don.Lewis@tsc.tdk.com, freebsd-fs@FreeBSD.ORG, roberto@keltia.freenix.fr Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> >> } diff -u -r1.51.2.6 vfs_syscalls.c >> >> } --- vfs_syscalls.c 1997/10/23 18:04:55 1.51.2.6 >> >> } +++ vfs_syscalls.c 1997/10/30 22:24:47 >> >> } @@ -1326,8 +1328,10 @@ >> >> } return (error); >> >> } vp = nd.ni_vp; >> >> } error = vn_stat(vp, &sb, p); >> >> } - if (vp->v_type == VLNK) >> >> } + if (vp->v_type == VLNK && >> >> } + (vp->v_mount->mnt_flag & MNT_NOSYMLINKFOLLOW) != 0) >> > ^^ >> > >> >> This test looks backwards to me (it changes the behavior if the >> >> new nosymlinkfollow option is not set). I'm also not clear as >> >> to why the behaviour even depends on the option. >> >> It's also wrong because it breaks the setting of S_IFLNK. > >S_IFLNK was already set in vn_stat. I see. ORing in S_IFLNK is a vestige of inheriting the symlink's attributes from its parent directory. vn_stat() was called on the parent directory, so it set S_IFDIR, and ORing in S_IFLNK was part of a fixup. Bruce