From owner-svn-src-projects@FreeBSD.ORG Tue Aug 16 12:57:17 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2192D1065673 for ; Tue, 16 Aug 2011 12:57:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id CAB058FC13 for ; Tue, 16 Aug 2011 12:57:16 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 166144BB; Tue, 16 Aug 2011 14:41:16 +0200 (CEST) Date: Tue, 16 Aug 2011 14:41:02 +0200 From: Pawel Jakub Dawidek To: "Justin T. Gibbs" Message-ID: <20110816124102.GA1674@garage.freebsd.pl> References: <201108160435.p7G4ZgNO041036@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <201108160435.p7G4ZgNO041036@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224901 - projects/zfsd/head/sys/fs/devfs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2011 12:57:17 -0000 --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--