Subject: Re: /etc/security, mtree, and links to files and directories
To: NetBSD Security Technical Discussion List <tech-security@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-security
Date: 05/15/2002 13:39:15
>> can anyone think of any security risks associated with mtree always
>> following all the symlinks?  or...not warning if it finds one where it
>> expected a file or a directory?
>
>Any file that's explicitly supposed to be a regular file should never be
>a symlink.  Conversely any file that's supposed to be a symlink should
>never be any other type of file.

and what of /etc/localtime?  certainly one *must* have such a thing,
but the cases for "link" and for "file" are equally valid, are they
not?

>I think what we need in 'mtree' is the ability to say that some object
>may be either a file (of some specified type) or a symlink, and in the
>latter case the optional ability to say where the symlink must point to.

so things would be either "file" or "dir" or "link to file" or "link
to dir"?  got code?

>In an ideal world the symlink value could be expressed as a form of
>extended glob pattern (one that allows "/foo/*" to be differentiated
>from "/foo/bar/*", though I don't yet have a good idea of what that
>syntax might be), or perhaps as an ERE.

i don't think getting into a discussion of the range of values for a
"required" symlink is germane to this discussion.  what of tweaking
the special file and the call to mtree to follow symlinks?

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."