From owner-freebsd-emulation@FreeBSD.ORG Sat Mar 6 18:15:13 2010 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21416106566B for ; Sat, 6 Mar 2010 18:15:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id B3E328FC15 for ; Sat, 6 Mar 2010 18:15:12 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 1D3581CD18; Sat, 6 Mar 2010 19:15:12 +0100 (CET) Date: Sat, 6 Mar 2010 19:15:12 +0100 From: Ed Schouten To: John Nielsen Message-ID: <20100306181512.GK8200@hoeg.nl> References: <201003021325.27197.lists@jnielsen.net> <20100306073117.GE8200@hoeg.nl> <20100306081238.GF8200@hoeg.nl> <201003061241.59580.lists@jnielsen.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qnRI6fWS/WyDjwPA" Content-Disposition: inline In-Reply-To: <201003061241.59580.lists@jnielsen.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-emulation@freebsd.org Subject: Re: linux-only jail possible? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2010 18:15:13 -0000 --qnRI6fWS/WyDjwPA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John Nielsen wrote: > Pretty or not the hack does the job. Thanks again! >=20 > For the record the sshd that ships with Fedora 12 also had the same issue= ,=20 > and the hack fixes it as well (not surprisingly). (I'll stick with CentOS= =20 > though, since blatantly lying about the kernel version doesn't give me wa= rm=20 > fuzzies.) That's great to hear. I am still in doubt what to do. Maybe we could consider committing a patch like this: %%% Index: sys/compat/linprocfs/linprocfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/compat/linprocfs/linprocfs.c (revision 204763) +++ sys/compat/linprocfs/linprocfs.c (working copy) @@ -1245,6 +1245,20 @@ #endif =20 /* + * Filler function for proc/pid/fd + */ +static int +linprocfs_dofdescfs(PFS_FILL_ARGS) +{ + + if (p =3D=3D curproc) + sbuf_printf(sb, "/dev/fd"); + else + sbuf_printf(sb, "unknown"); + return (0); +} + +/* * Constructor */ static int @@ -1312,6 +1326,8 @@ NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "status", &linprocfs_doprocstatus, NULL, NULL, NULL, PFS_RD); + pfs_create_link(dir, "fd", &linprocfs_dofdescfs, + NULL, NULL, NULL, 0); =20 /* /proc/scsi/... */ dir =3D pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); %%% This is a bit more complete. What it does, is that it creates a symlink =66rom /proc/%d/fd to /dev/fd, only if the calling process matches. Then when you mount fdescfs on /dev/fd, it also does the right thing, because it will always readlink() on a character device, which also returns an error code. Comments, suggestions anyone? --=20 Ed Schouten WWW: http://80386.nl/ --qnRI6fWS/WyDjwPA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkuSm7AACgkQ52SDGA2eCwVhSwCeNyc4kuxjkf2ZCcH7tzN7xrt6 +8oAn3eNR0WDMLxR3eVXfBvjqSPvW9oG =+WV+ -----END PGP SIGNATURE----- --qnRI6fWS/WyDjwPA--