diff options
author | Christian Brauner <christian.brauner@canonical.com> | 2017-01-27 15:59:59 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2017-03-19 17:36:13 +0000 |
commit | 15e9a4f378c8607c2ae1aa465436af4321db0e23 (patch) | |
tree | 021ac3c62fe588a8745fcdf09d29392a837759e0 /nptl/tst-mutex3.c | |
parent | 345118d7f5bc42c8d4c3a8ef70b9b709fa57e93d (diff) | |
download | glibc-15e9a4f378c8607c2ae1aa465436af4321db0e23.tar.gz glibc-15e9a4f378c8607c2ae1aa465436af4321db0e23.tar.xz glibc-15e9a4f378c8607c2ae1aa465436af4321db0e23.zip |
linux ttyname and ttyname_r: do not return wrong results
If a link (say /proc/self/fd/0) pointing to a device, say /dev/pts/2, in a parent mount namespace is passed to ttyname, and a /dev/pts/2 exists (in a different devpts) in the current namespace, then it returns /dev/pts/2. But /dev/pts/2 is NOT the current tty, it is a different file and device. Detect this case and return ENODEV. Userspace can choose to take this as a hint that the fd points to a tty device but to act on the fd rather than the link. Signed-off-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'nptl/tst-mutex3.c')
0 files changed, 0 insertions, 0 deletions