Date: Sat, 6 Mar 2010 08:31:17 +0100 From: Ed Schouten <ed@80386.nl> To: John Nielsen <lists@jnielsen.net> Cc: Alexander Leidinger <Alexander@leidinger.net>, freebsd-emulation@freebsd.org Subject: Re: linux-only jail possible? Message-ID: <20100306073117.GE8200@hoeg.nl> In-Reply-To: <201003060113.32628.lists@jnielsen.net> References: <201003021325.27197.lists@jnielsen.net> <20100305092611.0000772c@unknown> <20100305091446.GZ8200@hoeg.nl> <201003060113.32628.lists@jnielsen.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
* John Nielsen <lists@jnielsen.net> wrote:
> Truss from the host side seems okay except that -f doesn't work as expected.
> I can attach manually to the child processes just before submitting an SSH
> password though so hopefully that's enough. If you want me to do any of this
> again with different truss flags or other information just let me know.
Unfortunately it doesn't contain any open() calls on /dev/ptmx, but I
found a way to `fix' it:
%%%
--- sys/compat/linux/linux_file.c
+++ sys/compat/linux/linux_file.c
@@ -883,6 +883,8 @@
error = kern_readlink(td, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE,
args->count);
LFREEPATH(name);
+ if (error == ENOENT)
+ error = EINVAL;
return (error);
}
%%%
It seems a readlink() call on /proc/self/fd/%d fails inside glibc's
ttyname() and the only way to fall back to the looping on /dev/ is by
returning a bogus errno.
ssize_t len = __readlink (procname, ttyname_buf, buflen);
if (__builtin_expect (len == -1 && errno == ENOENT, 0))
{
__set_errno (EBADF);
return NULL;
}
I guess we can only fix this bug properly by adding support for
/proc/self/fd/%d to linprocfs.
--
Ed Schouten <ed@80386.nl>
WWW: http://80386.nl/
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)
iEYEARECAAYFAkuSBMUACgkQ52SDGA2eCwXFJACfejsB+BoI55qWuCzjv5l8KlkW
ICUAn1gHZSW2JSv9obvbsd35Ls89J+KG
=B8Dm
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100306073117.GE8200>
