linux-only jail possible?

John Nielsen lists at jnielsen.net
Sat Mar 6 17:42:04 UTC 2010


On Saturday 06 March 2010 03:12:38 Ed Schouten wrote:
> * Ed Schouten <ed at 80386.nl> wrote:
> > Unfortunately it doesn't contain any open() calls on /dev/ptmx, but I
> > found a way to `fix' it:
> >
> > <snip>
> 
> Behold, another way to fix this. Still not beautiful, but in my opinion
> not too bad.

Pretty or not the hack does the job. Thanks again!

For the record the sshd that ships with Fedora 12 also had the same issue, 
and the hack fixes it as well (not surprisingly). (I'll stick with CentOS 
though, since blatantly lying about the kernel version doesn't give me warm 
fuzzies.)

> Index: sys/compat/linprocfs/linprocfs.c
> 
===================================================================
> --- sys/compat/linprocfs/linprocfs.c	(revision 204763)
> +++ sys/compat/linprocfs/linprocfs.c	(working copy)
> @@ -1312,6 +1312,8 @@
>  	    NULL, NULL, NULL, PFS_RD);
>  	pfs_create_file(dir, "status", &linprocfs_doprocstatus,
>  	    NULL, NULL, NULL, PFS_RD);
> +	/* XXX: Hack to make ttyname() work. */
> +	pfs_create_file(dir, "fd", NULL, NULL, NULL, NULL, PFS_RD);
> 
>  	/* /proc/scsi/... */
>  	dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0);
> 
> This creates a bogus file called /proc/%d/fd. Because of this, the
> readlink() call will return ENOTDIR.
> 


More information about the freebsd-emulation mailing list