Implement variant symlinks! In order to use variant symlinks you must first
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 9 Nov 2003 20:29:59 +0000 (20:29 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 9 Nov 2003 20:29:59 +0000 (20:29 +0000)
commit063147e559dced5b6fe3f9f51f1769910cf2b8dc
treed84039d0f7506153b93b951ec16645e1ec5f8b25
parent0d939d2c5da08ff61a2a107df6140440d0da4be9
Implement variant symlinks!  In order to use variant symlinks you must first
enable them with the vfs.varsym_enable sysctl.  Variant symlinks are disabled
by default (the default will change in the future).  WORK TODO: system-wide
and per-user variable sets need to be per-jail, and a method of listing
existing variables is needed.

The 'varsym' utility may be used to set and retrieve system-wide or per-user
variables regardless of whether variant symlinks are enabled or not.  Note
that per-process variables may also be set by a program (e.g. like a csh
builtin or explicitly by a program).

When enabled, variable replacement will occur on softlinks which are
resolved as part of path lookup.  ${VARNAME} patterns within the softlink
will be replaced by the contents of the variable.  If a variable does not
exist, no replacement occurs.  ENAMETOOLONG will occur if a post-replacement
softlink pattern exceeds MAXPATHLEN (1024 bytes).

Note that variable names are case sensitive.  The per-process varsym list
is checked first, then the per-user list, then the system-wide list.
sys/kern/kern_varsym.c
sys/kern/vfs_lookup.c
sys/sys/varsym.h