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
0000830 [1003.1(2013)/Issue7+TC1] System Interfaces Objection Clarification Requested 2014-03-28 15:19 2019-06-10 08:54
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Accepted  
Status Closed  
Name Geoff Clare
Organization The Open Group
User Reference
Section dirname
Page Number 730
Line Number 24593
Interp Status Approved
Final Accepted Text See Note: 0002215.
Summary 0000830: not clear that dirname() is purely a string operation
Description The 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 Action After:
... return a pointer to a string that is a pathname of the parent directory of that file.

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.

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

Tags tc2-2008
Attached Files

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

-  Notes
Don Cragun (manager)
2014-04-03 15:29
edited on: 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.

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 (manager)
2014-05-02 09:27

Interpretation proposed 2 May 2014
ajosey (manager)
2014-06-25 10:14

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 Note: 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
2016-08-30 13:47 emaste Issue Monitored: emaste
2019-06-10 08:54 agadmin Status Interpretation Required => Closed

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