View Issue Details

IDProjectCategoryView StatusLast Update
00008301003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:54
Reportergeoffclare Assigned To 
PrioritynormalSeverityObjectionTypeClarification Requested
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectiondirname
Page Number730
Line Number24593
Interp StatusApproved
Final Accepted TextSee 0000830:0002215.
Summary0000830: not clear that dirname() is purely a string operation
DescriptionThe wording of the dirname() function could be interpreted as requiring
that its behaviour is affected by the contents of the file system:

    The dirname() function shall take a pointer to a character string
    that contains a pathname, and return a pointer to a string that is
    a pathname of the parent directory of that file.

In particular if the pathname is a symlink, the default for pathname
resolution is to follow symlinks so if the text is interpreted in this
way it would imply that dirname() returns the parent directory of the
target of the symlink.

The intention, and historical behaviour, is that dirname() performs
purely a string operation and does not examine the file system at all.
Desired ActionAfter:
... return a pointer to a string that is a pathname of the parent directory of that file.

add:
The dirname() function shall not perform pathname resolution; the result shall not be affected by whether or not path exists or by its file type.

At line 24599 change:
The dirname() function shall return a pointer to a string that is the parent directory of path. If path is a null pointer or points to an empty string, a pointer to a string "." is returned.

to:
The dirname() function shall return a pointer to a string as described above.

Tagstc2-2008

Relationships

related to 0000612 Closedajosey 1003.1(2008)/Issue 7 dirname of "usr/" or "/" are not clear 
related to 0001073 Closedajosey 1003.1(2008)/Issue 7 dirname utility: algorithm for computing pathname string is stricter than the corresponding dirname() function 

Activities

Don Cragun

2014-04-03 15:29

manager   bugnote:0002215

Last edited: 2014-04-03 15:33

Interpretation response
------------------------
The standard clearly states that basename() and dirname() can be used together to parse strings that are in the form of a pathname, and conforming implementations must conform to this.

Rationale:
-------------
There is no requirement that the strings processed by basename() and dirname() refer to existing pathnames.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes suggested in the Desired Action.

ajosey

2014-05-02 09:27

manager   bugnote:0002244

Interpretation proposed 2 May 2014

ajosey

2014-06-25 10:14

manager   bugnote:0002279

Interpretation approved 25 June 2014

Issue History

Date Modified Username Field Change
2014-03-28 15:19 geoffclare New Issue
2014-03-28 15:19 geoffclare Name => Geoff Clare
2014-03-28 15:19 geoffclare Organization => The Open Group
2014-03-28 15:19 geoffclare Section => dirname
2014-03-28 15:19 geoffclare Page Number => 730
2014-03-28 15:19 geoffclare Line Number => 24593
2014-03-28 15:19 geoffclare Interp Status => ---
2014-03-28 15:20 geoffclare Relationship added related to 0000612
2014-04-03 15:29 Don Cragun Note Added: 0002215
2014-04-03 15:31 Don Cragun Interp Status --- => Pending
2014-04-03 15:31 Don Cragun Final Accepted Text => See 0000830:0002215.
2014-04-03 15:31 Don Cragun Status New => Interpretation Required
2014-04-03 15:31 Don Cragun Resolution Open => Accepted
2014-04-03 15:31 Don Cragun Desired Action Updated
2014-04-03 15:32 Don Cragun Note Edited: 0002215
2014-04-03 15:33 Don Cragun Note Edited: 0002215
2014-04-03 15:33 Don Cragun Tag Attached: tc2-2008
2014-05-02 09:27 ajosey Interp Status Pending => Proposed
2014-05-02 09:27 ajosey Note Added: 0002244
2014-06-25 10:14 ajosey Interp Status Proposed => Approved
2014-06-25 10:14 ajosey Note Added: 0002279
2016-08-30 13:33 eblake Relationship added related to 0001073
2019-06-10 08:54 agadmin Status Interpretation Required => Closed