GNU bug report logs - #26371
[PATCH 0/1] tty: do not provide conflicting information

Previous Next

Package: coreutils;

Reported by: Christian Brauner <christian.brauner <at> ubuntu.com>

Date: Wed, 5 Apr 2017 15:27:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 26371-done <at> debbugs.gnu.org (full text, mbox):

From: Christian Brauner <christian.brauner <at> canonical.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Christian Brauner <christian.brauner <at> ubuntu.com>, serge <at> hallyn.com,
 26371-done <at> debbugs.gnu.org, coreutils <at> gnu.org, stgraber <at> ubuntu.com
Subject: Re: bug#26371: [PATCH 0/1] tty: do not provide conflicting information
Date: Wed, 5 Apr 2017 22:17:18 +0200
Hi Paul,

Thanks for the quick response. :)

On Wed, Apr 05, 2017 at 11:40:15AM -0700, Paul Eggert wrote:
> Thanks for the bug report. The situation you describe seems to be a platform
> that does not conform to POSIX, since POSIX doesn't allow for isatty to
> succeed but ttyname to fail. So I expect you'll run into problems other than

Oh, where can that information be gathered from? I looked up isatty() and
ttyname{_r}() in:

The Open Group Base Specifications Issue 7
IEEE Std 1003.1-2008, 2016 Edition
Copyright © 2001-2016 The IEEE and The Open Group

but couldn't find any such requirement that forces an alignment between isatty()
and ttyname{_r}().

> with the tty program, as other software will make the same assumptions that
> tty is making.
> 
> That being said, tty could do a better job about the situation. I installed
> the attached somewhat-more-ambitious patch, so that tty will do
> more-extensive checking of the results of isatty and/or ttyname (and so that
> it never needs to call both functions and worry about whether their results
> are consistent :-). Please give it a try on your platform.

Form a purely technical perspective it just seems to make a lot more sense to
exit with success if the file descriptor actually refers to a terminal. The name
of the device it refers to just seems syntactical sugar. :)

Thanks again!
Christian




This bug report was last modified 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.