Magic symlinks redux

Luigi Rizzo rizzo at iet.unipi.it
Wed Mar 18 16:40:04 PDT 2009


On Wed, Mar 18, 2009 at 11:54:43PM +0100, Ivan Voras wrote:
> Hi,
> 
> I started doing something that would be nicely solved by magic symlinks
> so I remembered this thread. It started some 6+ months ago here:
> 
> http://lists.freebsd.org/pipermail/freebsd-arch/2008-August/008473.html
> 
> Is there any new development?

at the time i did some quick tests on probably the same code
as you reference below, and it is really trivial (attached).
I do remember a discussion of a more complete implementation
but was many times more complex and more intrusive and I
am afraid that such a thing will never happen.

BTW today i hit a problem where some form of magic symlinks
would be useful.
Say you are preparing a disk image in a subtree
of your filesystem, and your image contains symlinks with absolute
paths: to do things right, you should navigate the subtree in
a chroot'ed environment, but chroot() requires root privs.

If we had some form of magic symlinks that support a per-process
remapping, one could e.g. set a variable that is prepended to
the target of absolute symlinks, and achieve the same effect of a
chroot without the need for root privs...

	cheers
	luigi

> Ivan Voras wrote:
> > I was reading about new things in NetBSD, and one thing caught my
> > attention: per-user /tmp. See
> > http://www.feyrer.de/NetBSD/bx/blosxom.cgi/nb_20080714_0251.html for
> > example.
> > 
> > Google says that a discussion about magic symlinks happens every now and
> > then in FreeBSD but nothing really gets done. I found this
> > implementation which looks like it's for 7.0:
> > 
> > http://butcher.heavennet.ru/patches/kernel/magiclinks/
> > 
> > As far as I understand the VFS (which isn't much...) this looks like an
> > trivial patch, and it's compatible with NetBSD. Since I'm interested in
> > this (specifically for the per-user /tmp and maybe similar gadgetry),
> > I'd like to nurse this patch into the tree, if there are no objections
> > (of course, I'll bug anyone I can find who knows VFS to review it :) ).
> > 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20090211-symlinks.diff
Type: text/x-diff
Size: 4279 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20090318/e7c34846/20090211-symlinks.bin


More information about the freebsd-arch mailing list