[PATCH] linux ttyname and ttyname_r: return link if appropriate

Serge E. Hallyn serge@hallyn.com
Wed Aug 10 23:26:00 GMT 2016


Quoting Dmitry V. Levin (ldv@altlinux.org):
> On Wed, Aug 10, 2016 at 06:03:51PM -0500, Serge E. Hallyn wrote:
> [...]
> > But, even if we decide that part is dangerous, the part where we do not
> > return /dev/pts/N when /proc/self/fd/M is from a different devpts mount
> > than the /dev/pts/N in caller's namespace is I think very important, and
> > should at least be separately applied.
> 
> I agree.
> In that case, what should ttyname/ttyname_r set errno to? ENOTTY?

Ideally something like EXDEV, which updated userspace could recognize
as "shucks i'll just use /proc/self/fd/N", but that probably isn't
realistically do-able?



More information about the Libc-alpha mailing list