Re: varlinks! (and 2.1.98 works for me)

H. Peter Anvin (hpa@transmeta.com)
26 Apr 1998 15:00:56 GMT


Followup to: <199804261426.QAA01875@cave.BitWizard.nl>
By author: R.E.Wolff@BitWizard.nl (Rogier Wolff)
In newsgroup: linux.dev.kernel
>
> Varlinks.
>
> What are varlinks?
>
> varlinks are symlinks that have a variable part in them. An example
> will make things clear:
>
> id[wolff@cave ~] id
> uid=500(wolff) gid=500(wolff) groups=100(users),500(wolff)
> [wolff@cave ~] ls -lF link
> lrwxrwxrwx 1 wolff wolff 22 Mar 10 14:12 link -> /home/wolff/tmp/${uid}/
> [wolff@cave ~] cd link
> [wolff@cave ~/link] pwd
> /home/wolff/tmp/500
> [wolff@cave ~/link]
>
> As you see, the "${uid}" part of the link isn't taken litterally. It
> puts in my numeric uid.
>
> You can set variables by doing
>
> echo "HOME=/home/wolff" > /proc/$$/varlinks
>
> This sets the "HOME" variable, allowing ${HOME} function in a varlink.
> If the variable isn't found, the string is left untouched. This allows
> you to create a default. Just put it under the litteral name
> '${HOME}'.
>

That, unfortunately, is really unacceptable. You're taking a
well-defined construct in all versions of Unix (symlinks) and altering
the semantics. If you want to do this, create a new filetype for it,
but don't call this a symlink. The symlink you're describing above
should point to a directory named /home/wolff/tmp/${uid} (the last
portion being the byte sequence 24-7B-75-69-64-7D). Anything else
would mean redefining an existing, well-established concept, which
probably would be detrimental to security, as programs would think
they were doing something else than they really were.

N.B.: For /home this is probably done better with autofs anyway.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu