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
0000273 [1003.1(2004)/Issue 6] System Interfaces Objection Clarification Requested 2010-06-28 01:13 2013-04-16 13:06
Reporter Don Cragun View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Geoff Clare
Organization The Open Group
User Reference gwc putenv environ
Section putenv
Page Number 1170
Line Number 36661
Interp Status Approved
Final Accepted Text See Note: 0000451
Summary 0000273: putenv() missing requirement
Description  The getenv(), setenv() and unsetenv() pages all have statements
 similar to this one for getenv():

     "If the application modifies environ or the pointers to which it
     points, the behavior of getenv() is undefined."

 However, putenv() does not. I assume this is accidental, and it
 is not safe to call putenv() after manipulating environ directly.

 This defect report should be sent down the interpretations track for
 consideration in TC1.
Desired Action  Add a new paragraph after line 36661:

     "If the application modifies environ or the pointers to which it
     points, the behavior of putenv() is undefined."
Tags tc1-2008
Attached Files

- Relationships
related to 0000167Closedajosey 1003.1(2008)/Issue 7 getenv() and modifying environ directly 
related to 0000438Closedajosey 2008-TC1 XSH/TC1/D1/0235 partially redundant 

-  Notes
(0000450)
Don Cragun (manager)
2010-06-28 01:16

Copied from xshbug2.txt ERN 240.
Originally submitted by Geoff Clare.
Processed too late to be included in IEEE Std 1003.1-2008.
(0000451)
Don Cragun (manager)
2010-06-28 01:36

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

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

Rationale:
-------------
The descripitions of getenv(), putenv(), setenv(), and unsetenv() should have consistent
environment handing requirements.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Remove from DESCRIPTION the last sentence of para 1 36660 page 1170.
In XSH7, this appears on P1717, L54855-54856.

"The space used by string is no longer used once a new string which
defines name is passed to putenv()."

 Add a new paragraph after line 36661:

     "If the application directly modifies environ or the pointers to which it
     points, the behavior of putenv() is undefined."

Add to APPLICATION USAGE after 36685

Although the space used by string is no longer used once a new string
which defines name is passed to putenv(), if any thread in the application
has used getenv() to retrieve a pointer to this variable, it should
not be freed by calling free(). If the changed environment variable
is one known by the system (such as the locale environment variables)
the application should never free the buffer used by earlier calls to
putenv() for the same variable.


Also make similar changes to getenv, setenv, unsetenv as follows:
for setenv/getenv/unsetenv insert the word "directly"
into
"If the application modifies environ or the pointers"

so it becomes
"If the application *directly* modifies environ or the pointers"
 _________________________________________________________________
(0000498)
ajosey (manager)
2010-07-30 08:20

Comments/objections on the proposed interpretation are due by COB Aug 31 2010
(0000741)
ajosey (manager)
2011-04-15 10:14

Note that the change in the interpretation:

Also make similar changes to getenv, setenv, unsetenv as follows:
for setenv/getenv/unsetenv insert the word "directly"
into
"If the application modifies environ or the pointers"

so it becomes
"If the application *directly* modifies environ or the pointers"

is not applicable when bug 167 is applied.

- Issue History
Date Modified Username Field Change
2010-06-28 01:13 Don Cragun New Issue
2010-06-28 01:13 Don Cragun Status New => Under Review
2010-06-28 01:13 Don Cragun Assigned To => ajosey
2010-06-28 01:13 Don Cragun Name => Geoff Clare
2010-06-28 01:13 Don Cragun Organization => The Open Group
2010-06-28 01:13 Don Cragun User Reference => gwc putenv environ
2010-06-28 01:13 Don Cragun Section => putenv
2010-06-28 01:13 Don Cragun Page Number => 1170
2010-06-28 01:13 Don Cragun Line Number => 36661
2010-06-28 01:13 Don Cragun Interp Status => ---
2010-06-28 01:16 Don Cragun Note Added: 0000450
2010-06-28 01:36 Don Cragun Interp Status --- => Pending
2010-06-28 01:36 Don Cragun Final Accepted Text => See Note: 0000451
2010-06-28 01:36 Don Cragun Note Added: 0000451
2010-06-28 01:36 Don Cragun Status Under Review => Interpretation Required
2010-06-28 01:36 Don Cragun Resolution Open => Accepted As Marked
2010-06-29 05:20 Don Cragun Summary missing requirement => putenv() missing requirement
2010-07-30 08:20 ajosey Interp Status Pending => Proposed
2010-07-30 08:20 ajosey Note Added: 0000498
2010-09-03 16:41 ajosey Interp Status Proposed => Approved
2010-09-03 20:59 Don Cragun Tag Attached: tc1-2008
2011-04-15 10:14 ajosey Note Added: 0000741
2011-04-15 10:15 ajosey Relationship added related to 0000167
2011-05-13 15:31 eblake Relationship added related to 0000438
2013-04-16 13:06 ajosey Status Interpretation Required => Closed


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