From owner-freebsd-hackers Wed Oct 2 10:37:34 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9076537B401 for ; Wed, 2 Oct 2002 10:37:32 -0700 (PDT) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD1B243E4A for ; Wed, 2 Oct 2002 10:37:30 -0700 (PDT) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 4D00E3ABB65; Wed, 2 Oct 2002 19:38:42 +0200 (CEST) Date: Wed, 2 Oct 2002 19:38:41 +0200 From: Pawel Jakub Dawidek To: Oliver Fromme Cc: freebsd-hackers@freebsd.org Subject: Re: Getfsstat(2), statfs(2) and fstatfs(2) jailed. Message-ID: <20021002173841.GB61479@garage.freebsd.pl> References: <20021001213848.GK19012@garage.freebsd.pl> <200210021045.g92AjaMU066299@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline In-Reply-To: <200210021045.g92AjaMU066299@lurza.secnetix.de> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.6-STABLE i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 02, 2002 at 12:45:36PM +0200, Oliver Fromme wrote: +> Pawel Jakub Dawidek wrote: +> > With this kernel module for FreeBSD 4.x process in jail can see only +> > file systems that are mounted in jail's chroot directory. +> >=20 +> > For example if we have mounted: +> > [...] +>=20 +> Also see PR 26740: +> http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/26740 +>=20 +> BTW, does your patch work if the process that created the jail +> was already chrooted (possibly with a root different from the +> root of the process that mounted the filesystem)? There are +> a lot of non-trivial cases ... +>=20 +> Another issue might be the degraded efficiency if there are a +> lot of mounts (I mean _really_ many). My way is very simple. I get chroot directory from p->p_fd->fd_jdir. We have for example "/ch/root". Now in getfsstat() I'm checking for file systems begins with "/ch/root". If it doesn't begin with this string I don't add it. I add also file system where chroot directory is mounted on with path "/". --=20 Pawel Jakub Dawidek UNIX Systems Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am. --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPZsvIT/PhmMH/Mf1AQHaHQP/YbR/QGAka7vTVoYpqscsURcMUfDDmJWN 99TvF2AKzVGkANX6UgPr9ao33jvb/dq+xdtcb5PA9L08845Qa7mlRWDtUOBUqr/V UBJ4DelBWJBxUjYPg3jwbEoYgMExcIbUQKIYCrA1eIf9gTHA8rskAfBD34bNQ98i lfiLC3ZwKv0= =koAY -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message