Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000398 [1003.1(2008)/Issue 7] System Interfaces Objection Error 2011-03-17 21:58 2024-06-11 08:53
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Closed  
Name Eric Blake
Organization Red Hat
User Reference ebb.ERANGE
Section getgrgid_r
Page Number 1014
Line Number 34031
Interp Status Approved
Final Accepted Text See Note: 0000796
Summary 0000398: mandatory ERANGE failures on insufficient buffer size
Description Several interfaces in the standard take a pointer and length of a buffer, to
fill in the result in a re-entrant manner. While some of these interfaces
document a mandatory ERANGE failure if the length is too small to hold the
resulting string (such as getpwd), others designate the failure as optional.
Considering that the standard even has several examples (such as getgidgr_r
and getgrnam_r) that assume mandatory ERANGE, it is better to require this
failure reliably; so that there is a consistent idiom of trying successively
larger buffers until the function succeeds or there is an error other than
ERANGE.
Desired Action At line 34031 [getgrgid ERRORS], change "getgrgid_r() function may fail" to
"getgrgid_r() function shall fail".

At line 34160 [getgrnam ERRORS], change "getgrnam_r() function may fail" to
"getgrnam_r() function shall fail".

At line 34478 [getlogin ERRORS], change "getlogin_r() function may fail" to
"getlogin_r() function shall fail".

At line 35330 [getpwnam ERRORS], change "getpwnam_r() function may fail" to
"getpwnam_r() function shall fail".

At line 35462 [getpwuid ERRORS], change "getpwuid_r() function may fail" to
"getpwuid_r() function shall fail".

At line 63270 [strerror ERRORS], change "strerror_r() function may fail" to
"strerror_r() function shall fail".

At line 63303 [strerror RATIONALE], add a sentence:
"Additionally, implementations are encouraged to NUL-terminate strerrbuf
when failing with ERANGE for any size other than buflen of zero."

At line 67667 [ttyname ERRORS], change "The ttyname() function may fail"
to "these functions may fail". At line 67670, change "ttyname_r()
function may fail" to "ttyname_r() function shall fail". Then delete
lines 67671-67672, resulting in EBADF and ENOTTY as common may fail
errors, and ERANGE as a shall fail error.
Tags issue8
Attached Files

- Relationships
related to 0000382Closedajosey may strerror(0) fail with EINVAL? 
parent of 0000618Under Reviewajosey require isatty and friends to set errno on failure 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0000796)
Don Cragun (manager)
2011-05-26 16:05

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:
-------------
Without requiring these conditions to fail, it is extremely difficult for applications to determine what to do.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes suggested in the Desired Action.
(0000843)
ajosey (manager)
2011-06-16 10:15

Interpretation proposed 16 June 2011 for final 30 day review
(0000909)
ajosey (manager)
2011-07-29 06:15

The interpretation is now approved.

- Issue History
Date Modified Username Field Change
2011-03-17 21:58 eblake New Issue
2011-03-17 21:58 eblake Status New => Under Review
2011-03-17 21:58 eblake Assigned To => ajosey
2011-03-17 21:58 eblake Name => Eric Blake
2011-03-17 21:58 eblake Organization => Red Hat
2011-03-17 21:58 eblake User Reference => ebb.ERANGE
2011-03-17 21:58 eblake Section => getgrgid_r
2011-03-17 21:58 eblake Page Number => 1014
2011-03-17 21:58 eblake Line Number => 34031
2011-03-17 21:58 eblake Interp Status => ---
2011-03-17 21:59 eblake Relationship added related to 0000382
2011-03-17 22:02 eblake Desired Action Updated
2011-05-26 16:05 Don Cragun Interp Status --- => Pending
2011-05-26 16:05 Don Cragun Note Added: 0000796
2011-05-26 16:05 Don Cragun Status Under Review => Interpretation Required
2011-05-26 16:05 Don Cragun Resolution Open => Accepted
2011-05-26 16:05 Don Cragun Desired Action Updated
2011-05-26 16:06 Don Cragun Tag Attached: issue8
2011-05-26 16:10 Don Cragun Final Accepted Text => See Note: 0000796
2011-06-16 10:15 ajosey Interp Status Pending => Proposed
2011-06-16 10:15 ajosey Note Added: 0000843
2011-07-29 06:15 ajosey Interp Status Proposed => Approved
2011-07-29 06:15 ajosey Note Added: 0000909
2012-10-03 03:30 eblake Relationship added parent of 0000618
2020-02-21 16:35 geoffclare Status Interpretation Required => Applied
2024-06-11 08:53 agadmin Status Applied => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker