This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]