Christian Brauner 15e9a4f378 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>
2017-03-19 17:36:13 +00:00
..
2017-03-15 16:46:26 -07:00
2017-03-14 17:18:52 +01:00
2017-03-14 17:18:52 +01:00
2017-03-14 17:18:52 +01:00
2017-02-01 01:32:31 +01:00
2017-03-13 20:41:12 +01:00
2017-03-14 17:18:52 +01:00
2017-03-14 17:18:52 +01:00
2017-03-12 17:29:32 -03:00