This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
multiple devpts mounts not supported insysdeps/unix/sysv/linux/ptsname.c:_ptsname_internal()
- From: "Serge E. Hallyn" <serge dot hallyn at canonical dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 11 Oct 2011 12:15:37 -0500
- Subject: multiple devpts mounts not supported insysdeps/unix/sysv/linux/ptsname.c:_ptsname_internal()
Hi,
grantpt, ptsname, and ptsname_r make use of _ptsname_internal(). That
function works by appending the TIOCGPTN result to "/dev/pts". The
path /dev/pts is hardcoded. That means that if you call grantpt on an
fd from /chroot/dev/pts, and /dev/pts/0 (for instance) does not exist
on the host, you'll (wrongly) get back an error. This has been seen with
libvirt (and is easly to verify with a simple testcase).
I'm not sure of the best way to fix this in a way palatable to glibc.
Follow the /proc/self/fd/N symlink? Update the manpages to say the
devpts used must be mounted under /dev/pts by the caller? (Caller would
need privilege, but can fork+unshare+bind-mount).
thanks,
-serge