From owner-freebsd-fs Sun Nov 2 10:45:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA05908 for fs-outgoing; Sun, 2 Nov 1997 10:45:41 -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 KAA05901 for ; Sun, 2 Nov 1997 10:45:34 -0800 (PST) (envelope-from wosch@cs.tu-berlin.de) Received: from panke.panke.de (anonymous221.ppp.cs.tu-berlin.de [130.149.17.221]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id TAA16313; Sun, 2 Nov 1997 19:41:57 +0100 (MET) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id SAA00541; Sun, 2 Nov 1997 18:39:21 +0100 (MET) To: Terry Lambert Cc: freebsd-fs@FreeBSD.ORG Subject: Re: disabled symlinks References: <199710311838.LAA01803@usr05.primenet.com> From: Wolfram Schneider Date: 02 Nov 1997 18:39:19 +0100 In-Reply-To: Terry Lambert's message of Fri, 31 Oct 1997 18:38:35 +0000 (GMT) Message-ID: Lines: 35 Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert writes: > > > 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. > This whole thing was billed as a security workaround for a race > condition that didn't want to get fixed the right way. 8-(. > > If it's for security, what prevents a putative hacker from calling > legacy code which uses the olstat entry point? Terry?! I thought you are the file system expert ... ;-) lstat(2) print file status. No security. No risks. Symbolic links does not have a mode. lstat can print any value in the mode field to make users happy. [quote from last mail] 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) } -- Wolfram Schneider http://www.apfel.de/~wosch/