*BSD News Article 12691


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!coombs!avalon
From: avalon@coombs.anu.edu.au (Darren Reed)
Newsgroups: comp.os.386bsd.development
Subject: Re: A challenge to all true kernel hackers - conditional symlinks.
Date: 10 Mar 93 13:28:27 GMT
Organization: Australian National University
Lines: 36
Message-ID: <avalon.731770107@coombs>
References: <JKH.93Mar9214944@whisker.lotus.ie> <CGD.93Mar9185827@eden.CS.Berkeley.EDU>
NNTP-Posting-Host: 150.203.76.2

cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou) writes:

>In article <JKH.93Mar9214944@whisker.lotus.ie> jkh@whisker.lotus.ie (Jordan K. Hubbard) writes:
>[ the idea ... ]

>YES, that would be wonderful.  it's the one thing about apollos that
>i *loved*...  thank god you didn't ask for `node_data... 8-)

>>The question is, is anyone out there game to see what it would take to
>>do this in 386bsd?  I think you'll find getting at the current process
>>environment from namei() somewhat tricky..

>possibly impossible, w/o mods to the rest of the kernel, esp.
>if processes decide to mangle their args buf...

>namei takes a struct proc * of the process in question, it's just a matter
>of finding the environment variables, and i can' think of
>a reliable way to do that, w/o hacking exec slightly...

I didn't read the original post, but some background, Pyramind have
conditional symlinks available on OSx.  The use for this was in having
links which were different depending on which universe (att or ucb)
you were working in (back when there was SVR3 and 4.3BSD).  Changing
universe was a system call, however.

If conditional links were to be done properly it would idealy be a new
flag/mode added to S_IFMT.  What then to decide the "condition" on is a
good question :)  I don't like the idea of using just environment vars.
Maybe something like:
$VAR - env var name holding actual value
#!path - execute this to get name
name - ordinary link
as the filename...maybe even something which works on gid/uid (but I think
this is too featuristic).

darren