View Issue Details

IDProjectCategoryView StatusLast Update
00001721003.1(2008)/Issue 7System Interfacespublic2013-04-16 13:06
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectiongetlogin
Page Number1029
Line Number34464
Interp StatusApproved
Final Accepted Text0000172:0000285
Summary0000172: getlogin() and fds 0, 1 and 2
DescriptionMost (possibly all) implementations of getlogin() rely internally on
file descriptor 0, 1 or 2 being open to the terminal in order to find
it. If all three fds are redirected, for example to plain files or
/dev/null, getlogin() fails (with ENOTTY). The standard does not
mention this.

This also affects the logname utility (via the reference to getlogin()
in its description).
Desired Action
At the end of the DESCRIPTION section add a new paragraph:

    The getlogin() and getlogin_r() functions may make use of file
    descriptors 0, 1 and 2 to find the controlling terminal of the
    current process, examining each in turn until the terminal is
    found.  If none of the three file descriptors is open to the
    controlling terminal, the functions may fail.  The method
    used to find the terminal associated with a file descriptor may
    depend on the file descriptor being open to the actual terminal
    device, not /dev/tty.

After line 34476 (ENFILE) add:

    [ENOTTY]    None of the file descriptors 0, 1 or 2 is open to the
                controlling terminal of the current process.

Tagstc1-2008

Activities

msbrown

2009-11-05 17:27

manager   bugnote:0000285

Last edited: 2009-11-06 07:02

Interpretation response
------------------------

The standard is unclear on this issue, and no conformance
distinction can be made between alternative implementations based
on this. This is being referred to the sponsor.


Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

The Committee recommends the following changes:

At the end of the DESCRIPTION section add a new paragraph:

    The getlogin() and getlogin_r() functions may make use of file
    descriptors 0, 1 and 2 to find the controlling terminal of the
    current process, examining each in turn until the terminal is
    found.  If in this case none of these three file descriptors is open to the
    controlling terminal, these functions may fail.  The method
    used to find the terminal associated with a file descriptor may
    depend on the file descriptor being open to the actual terminal
    device, not /dev/tty.

After line 34476 (ENFILE) add:

    [ENOTTY]    None of the file descriptors 0, 1 or 2 is open to the
                controlling terminal of the current process.


Issue History

Date Modified Username Field Change
2009-10-23 09:35 geoffclare New Issue
2009-10-23 09:35 geoffclare Status New => Under Review
2009-10-23 09:35 geoffclare Assigned To => ajosey
2009-10-23 09:35 geoffclare Name => Geoff Clare
2009-10-23 09:35 geoffclare Organization => The Open Group
2009-10-23 09:35 geoffclare Section => getlogin
2009-10-23 09:35 geoffclare Page Number => 1029
2009-10-23 09:35 geoffclare Line Number => 34464
2009-10-23 09:35 geoffclare Interp Status => ---
2009-11-05 17:27 msbrown Interp Status --- => Pending
2009-11-05 17:27 msbrown Note Added: 0000285
2009-11-05 17:27 msbrown Status Under Review => Interpretation Required
2009-11-05 17:27 msbrown Resolution Open => Accepted As Marked
2009-11-05 17:27 msbrown Final Accepted Text => 0000172:0000285
2009-11-06 07:02 ajosey Note Edited: 0000285
2009-11-06 07:02 ajosey Interp Status Pending => Proposed
2009-12-07 16:54 ajosey Interp Status Proposed => Approved
2010-09-24 14:10 Don Cragun Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed