From: Florian Weimer <fweimer@redhat.com>
To: Serge Hallyn <serge.hallyn@ubuntu.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 1/1] linux ttyname: return link if appropriate
Date: Fri, 15 Apr 2016 17:06:00 -0000 [thread overview]
Message-ID: <57111F9C.8030902@redhat.com> (raw)
In-Reply-To: <20160415164652.GE8450@ubuntumail>
On 04/15/2016 06:46 PM, Serge Hallyn wrote:
> Quoting Florian Weimer (fweimer@redhat.com):
>> On 04/15/2016 05:29 PM, Serge Hallyn wrote:
>>> The current ttyname does the wrong thing in two cases:
>>>
>>> 1. If the passed-in link (say /proc/self/fd/0) points to a
>>> device, say /dev/pts/2, in a parent mount namespace, 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.
>>
>> Is this the first change?
>
> Right, it ensures that the filesystem of the two files is
> the same.
>
>>> 2. If the passed-in link (say /proc/self/fd/0) points to
>>> a device, say /dev/pts/2, in a parent mount namespace, and
>>> /dev/pts/2 does not exist in the current namespace, it
>>> returns success but an empty name. As far as I can tell,
>>> there is no reason for it to not return /proc/self/fd/0.
>>> http://pubs.opengroup.org/onlinepubs/009695399/functions/ttyname.html
>>> does not say anything about not returning a link.
>>
>> Is it safe to drop the verification that ttyname ordinarily would do?
>
> Which verification do you mean exactly?
That the file descriptor actually belongs to a PTY device listed under
/dev/pts.
>> ttyname_r will need a similar change.
>
> Oh, yeah, it will.
Please also fix the stylistic issues (GNU style requires a space in
function calls, braces on their own lines etc.).
But I don't think we can make the change, considering the security
implications.
Florian
next prev parent reply other threads:[~2016-04-15 17:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 15:29 Serge Hallyn
2016-04-15 16:27 ` Florian Weimer
2016-04-15 16:47 ` Serge Hallyn
2016-04-15 17:06 ` Florian Weimer [this message]
2016-04-15 17:43 ` Serge Hallyn
2016-04-15 18:48 ` Serge Hallyn
2016-04-15 19:59 ` Mike Frysinger
2016-04-18 19:53 ` [PATCH 1/2] " Serge Hallyn
2016-04-18 20:02 ` Mike Frysinger
2016-04-18 20:23 ` Serge Hallyn
2016-04-20 2:10 ` [PATCH] linux ttyname and ttyname_r: " Serge Hallyn
2016-04-20 2:28 ` Mike Frysinger
2016-04-20 18:51 ` Serge Hallyn
2016-07-27 13:43 ` Serge E. Hallyn
2016-07-27 17:28 ` Dmitry V. Levin
2016-08-06 2:09 ` Serge E. Hallyn
2016-08-06 8:46 ` Mike Frysinger
2016-08-06 15:00 ` Serge E. Hallyn
2016-08-09 20:41 ` Serge E. Hallyn
2016-08-09 21:18 ` Dmitry V. Levin
2016-08-09 21:39 ` Serge E. Hallyn
2016-08-09 23:26 ` Dmitry V. Levin
2016-08-10 23:24 ` Serge E. Hallyn
2016-08-10 23:48 ` Dmitry V. Levin
2016-08-10 6:38 ` Florian Weimer
2016-08-10 23:03 ` Serge E. Hallyn
2016-08-10 23:18 ` Dmitry V. Levin
2016-08-10 23:26 ` Serge E. Hallyn
2016-10-03 6:16 ` Serge E. Hallyn
2016-10-03 7:29 ` Andreas Schwab
2016-10-03 14:05 ` [PATCH 1/1] linux ttyname and ttyname_r: do not return wrong results Serge E. Hallyn
2016-10-04 9:53 ` [PATCH] linux ttyname and ttyname_r: return link if appropriate Florian Weimer
2016-10-04 12:47 ` Serge E. Hallyn
2016-04-18 19:53 ` [PATCH 1/1] linux ttyname: " Serge Hallyn
2016-04-18 19:54 ` [PATCH 2/2] linux ttyname_r: " Serge Hallyn
2016-04-18 20:03 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57111F9C.8030902@redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=serge.hallyn@ubuntu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).