Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Aug 2011 14:41:02 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        "Justin T. Gibbs" <gibbs@FreeBSD.org>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r224901 - projects/zfsd/head/sys/fs/devfs
Message-ID:  <20110816124102.GA1674@garage.freebsd.pl>
In-Reply-To: <201108160435.p7G4ZgNO041036@svn.freebsd.org>
References:  <201108160435.p7G4ZgNO041036@svn.freebsd.org>

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

--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 16, 2011 at 04:35:42AM +0000, Justin T. Gibbs wrote:
> Author: gibbs
> Date: Tue Aug 16 04:35:42 2011
> New Revision: 224901
> URL: http://svn.freebsd.org/changeset/base/224901
>=20
> Log:
>   Correct the rendering of device aliases that reside in subdirectories
>   of a devfs.
>  =20
>   devfs/devfs_vnops.c:
>   	In devfs_readlink(), convert the devfs root relative path
>   	of an alias's parent, that is recorded in the alias, into a
>   	fully qualified path that includes the root of the containing
>   	devfs.  This avoids the ugliness of generating a relative path
>   	by prepending "../"'s.  For a non-jailed process, the "symlink
>   	root" is the devfs's mount point.  For a jailed process, we
>   	must remove any jail prefix in the mount point so that our
>   	response matches the user process's world view.

Note that currently realpath for both mount point and jail root is
resolved by userland tools (mount(8) and jail(8)). It is still possible
that someone will use nmount(2) or jail(2) system calls directly and
will pass not a realpath, but something else (eg. ../../foo/bar).
Because of this simple strncmp() is no reliable. The given paths should
be resolved for those syscalls within the kernel using
vn_fullpath_global(), then it would be more reliable. It still won't
work when file system is mount, then its parent directory is renamed and
jail created on now different path, but might be good enough. The best
solution would be to build paths based on mount point vnode and jail's
root vnode when needed.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--RnlQjJ0d97Da+TV1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk5KZV4ACgkQForvXbEpPzSntACgltTddTTdyXn9fBe8WPpG7O85
iK8AoI9x7m22BdWA9M0fMmTGCMMAHDaz
=S01v
-----END PGP SIGNATURE-----

--RnlQjJ0d97Da+TV1--



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