From owner-freebsd-fs Fri Oct 31 04:34:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA02058 for fs-outgoing; Fri, 31 Oct 1997 04:34:57 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA02051 for ; Fri, 31 Oct 1997 04:34:47 -0800 (PST) (envelope-from wosch@cs.tu-berlin.de) Received: from panke.panke.de (anonymous214.ppp.cs.tu-berlin.de [130.149.17.214]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id NAA15425; Fri, 31 Oct 1997 13:27:16 +0100 (MET) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id MAA00284; Fri, 31 Oct 1997 12:09:19 +0100 (MET) To: Don Lewis Cc: Wolfram Schneider , Ollivier Robert , freebsd-fs@freebsd.org Subject: Re: disabled symlinks References: <199710310111.RAA02224@salsa.gv.tsc.tdk.com> From: Wolfram Schneider Date: 31 Oct 1997 12:09:17 +0100 In-Reply-To: Don Lewis's message of Thu, 30 Oct 1997 17:11:23 -0800 Message-ID: Lines: 51 Sender: owner-freebsd-fs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Don Lewis writes: > On Oct 31, 12:13am, Wolfram Schneider wrote: > } Subject: Re: disabled symlinks > } Index: sys/kern/vfs_syscalls.c > } =================================================================== > } RCS file: /usr/cvs/src/sys/kern/vfs_syscalls.c,v > } retrieving revision 1.51.2.6 > } 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 is a typo and should be (vp->v_mount->mnt_flag & MNT_NOSYMLINKFOLLOW) == 0) Thanks for the hint! vfs_syscalls.c rev 1.62 Symlinks do not have modes though, they are accessable to everything that can read the directory (as before). They are made to show this fact at lstat time (they appear as mode 0777 always, since that's how the the lookup routines in the kernel treat them). Now it will be (in function lstat and vn_stat) if (symbolic link) { if (does not follow symlinks) change the mode to 0000 (l---------) else change the mode to 0777 (lrwxrwxrwx) } > Also, shouldn't > the same change be made to both lstat() and olstat()? This is a cosmetic change. I don't think we should change old system calls if it is not necessary. I doubt that anybody use an old ls(1) command. -- Wolfram Schneider http://www.apfel.de/~wosch/