svn commit: r224901 - projects/zfsd/head/sys/fs/devfs

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Aug 16 12:57:17 UTC 2011


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
> 
> Log:
>   Correct the rendering of device aliases that reside in subdirectories
>   of a devfs.
>   
>   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.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20110816/0a188f95/attachment.pgp


More information about the svn-src-projects mailing list