Re: Conditional SymLinks

Adam D. Bradley (
Fri, 12 Dec 1997 00:33:42 -0500 (EST)

> > > There is I beleive some unix out there where one could imbed environment
> > > variables in symlinks, like:
> > >
> > > /tmp -> ${HOME}/tmp
> >
> > Yeah, I had this idea maybe ten years ago. A friend told me someone
> > (IRIX ?) has already done it. The idea of active objects in the filesystem
> > is interesting, and could make porting code from other systems easier. Of
> > course it could make debugging nearly impossible.
> I've seen this _many_ years ago in a BSD 4.2 (4.3?) implementation
> from Sony (NewsOS 3.x and 4.x) on their MIPS R3000 workstations.
> it was a nice feature and I really would like to see this in Linux too
> (but don't ask me how this should be done;)

I've pondered ways of going about this. The problem is, the
uid-to-home-directory is purely a userspace construct. Consider this
possibility then:

/tmp (symlink) -> /proc/uidtmp
/proc/uidtmp is an on-the-fly symlink (like /proc/self)
to -> /realtmp/<euid> (or whichever UID field is apropos)
(Where "realtmp" some directory name settable with a proc entry or
sysctl). And the /realtmp/<uid> files can actually be whatever you
like, e.g. individual symlinks to "/home/username/tmp/"

This could be done with minimal code, default to "off", and be a
useful, easy-to-tune mechanism for people who are more A.R. about
their security. It would also keep policy _out_ of the kernel.

Just an idea.


Things look so bad everywhere      Adam D. Bradley
In this whole world what is fair        Boston University Computer Science
We walk blind and we try to see             Ph.D. student and Linux hacker
Falling behind in what could be  ---->  Bring me a Higher Love  ---->  <><