Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2018 13:17:21 -0400 (EDT)
From:      Fongaboo <freebsd@fongaboo.com>
To:        "James B. Byrne via freebsd-questions" <freebsd-questions@freebsd.org>
Cc:        Erich Dollansky <freebsd.ed.lists@sumeritec.com>, byrnejb@harte-lyne.ca
Subject:   Re: FreeBSD-11.1 - symbolic links in jails
Message-ID:  <alpine.BSF.2.20.1806261307030.14438@h4lix.wtfayla.net>
In-Reply-To: <20180626115421.26159ff8.freebsd.ed.lists@sumeritec.com>
References:  <5c01d3596c548d3bac00e22ff2fcd2a5.squirrel@webmail.harte-lyne.ca> <20180626115421.26159ff8.freebsd.ed.lists@sumeritec.com>

next in thread | previous in thread | raw e-mail | index | archive | help

I find nullfs to be the most rock-solid solution for stuff like this, 
because it transcends the relatively of jails, chroot, etc. It's like a 
wormhole for filesystems. But I believe you can only link two directories, 
not two files.

But what if you did this:

mkdir /usr/jails/mx32/host/etc

mount_nullfs /etc /usr/jails/mx32/host/etc

ln -s /usr/jails/mx32/host/etc/mail/aliases /usr/jails/mx32/etc/aliases


I wonder if that would work?


On Tue, 26 Jun 2018, Erich Dollansky wrote:

> Hi,
>
> On Mon, 25 Jun 2018 12:59:06 -0400
> "James B. Byrne via freebsd-questions" <freebsd-questions@freebsd.org>
> wrote:
>
>> I wish to confirm that this is intended behaviour; that a single
>> symbolic link can have differing target files depending whether one is
>> in a jail or not.
>>
>>
> it is even a bit more confusing. When you access the same link from
> outside the jail, it will target really the one in the root directory.
> Symbolic links are always relative to the environment it is used in.
> But they can cross mount points.
>
> If you want to make a link always pointing to the same thing, you will
> have to use hard links. But you are not able to cross mount points then
> and it opens the doors for software breaking out of the jail.
>
> Erich
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1806261307030.14438>