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
0000185 [1003.1(2008)/Issue 7] System Interfaces Editorial Error 2009-11-16 16:02 2013-04-16 13:06
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Closed  
Name Eric Blake
Organization NA
User Reference ebb.setenv
Section setenv
Page Number 1857
Line Number 59356
Interp Status Approved
Final Accepted Text Note: 0000318
Summary 0000185: setenv failure case
Description There is a typo in the EINVAL error for setenv.

Meanwhile, many existing BSD implementations crash or give EFAULT, rather than failing with EINVAL, when invoking setenv(NULL,"",0). Therefore, use of a null pointer is already non-portable in practice, and removing the requirement for a null pointer check allows for a faster implementation. Omission of a requirement for a check for a null pointer could invalidate existing applications, but the likelihood of a compliant application expecting setenv(NULL,"",0) to fail with EINVAL is minimal (given that such an application could crash when ported to BSD, and that wasting the time on a call known to not update environ seems pointless). On the other hand, omitting the requirement would allow more existing implementations to be compliant, without penalizing any existing implementation that performs the null pointer check, since the standard already has an overriding statement that if not explicitly mentioned otherwise, use of a null pointer gives unspecified behavior. Therefore, this proposal includes a change to relax the requirement regarding a null pointer check.

This is orthogonal to issue 167, although it touches the same interfaces.

Meanwhile, note that neither putenv("=") nor getenv("") are required to fail with EINVAL, although in practice, behavior varies widely on whether environ can successfully be managed if it contains an entry whose first character is '='. The desired action makes no attempt to change this.
Desired Action At line 59356 (setenv), change

[EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an ’=’ character.

to

[EINVAL] The envname argument points to an empty string or points to a string containing an ’=’ character.

At line 68264 (unsetenv), change

[EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an ’=’ character.

to

[EINVAL] The name argument points to an empty string or points to a string containing an ’=’ character.
Tags tc1-2008
Attached Files

- Relationships

-  Notes
(0000318)
msbrown (manager)
2009-12-03 16:44

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

The standard states the requirements for EINVAL in setenv(), and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------

None.

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

Make the change suggested by the submitter.

- Issue History
Date Modified Username Field Change
2009-11-16 16:02 eblake New Issue
2009-11-16 16:02 eblake Status New => Under Review
2009-11-16 16:02 eblake Assigned To => ajosey
2009-11-16 16:02 eblake Name => Eric Blake
2009-11-16 16:02 eblake Organization => NA
2009-11-16 16:02 eblake User Reference => ebb.setenv
2009-11-16 16:02 eblake Section => setenv
2009-11-16 16:02 eblake Page Number => 1857
2009-11-16 16:02 eblake Line Number => 59356
2009-12-03 16:44 msbrown Interp Status => Pending
2009-12-03 16:44 msbrown Note Added: 0000318
2009-12-03 16:44 msbrown Status Under Review => Interpretation Required
2009-12-03 16:44 msbrown Resolution Open => Accepted
2009-12-03 16:46 geoffclare Final Accepted Text => Note: 0000318
2010-02-12 06:38 ajosey Interp Status Pending => Proposed
2010-03-25 15:17 ajosey Interp Status Proposed => Approved
2010-09-24 14:23 Don Cragun Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed


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