Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Nov 1997 20:44:10 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, wosch@cs.tu-berlin.de
Cc:        Don.Lewis@tsc.tdk.com, freebsd-fs@FreeBSD.ORG, roberto@keltia.freenix.fr
Subject:   Re: disabled symlinks
Message-ID:  <199711080944.UAA21843@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >> } 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711080944.UAA21843>