Re: Conditional SymLinks

Martin von Loewis (martin@mira.isdn.cs.tu-berlin.de)
Fri, 12 Dec 1997 11:36:54 +0100


> 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 think there should be a per-process kernel environment. You would
set this as

char buf[]="BAR",
prctl(PR_SETENV,"FOO",buf,sizeof(buf),O_RDWR|PR_ENV_INHERIT);

and the file system would be free to interpret this in whatever
way is appropriate. For example, some file system would have
special files, others would search for dollar signs in names.

BTW, the PR_SETENV process control has a couple of other uses.
File systems with other autorization schemes, like smbfs, could
use it to retrieve credentials. For security reasons, having
write-only kernel environment variables is then desirable.

Regards,
Martin