Skip site navigation (1)Skip section navigation (2)
Date:      02 Nov 1997 18:39:19 +0100
From:      Wolfram Schneider <wosch@cs.tu-berlin.de>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-fs@FreeBSD.ORG
Subject:   Re: disabled symlinks
Message-ID:  <p1ig1pf19h4.fsf@panke.panke.de>
In-Reply-To: Terry Lambert's message of Fri, 31 Oct 1997 18:38:35 %2B0000 (GMT)
References:  <199710311838.LAA01803@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert <tlambert@primenet.com> 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   <wosch@apfel.de>   http://www.apfel.de/~wosch/



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