_____________________________________________________________________________ Notice: This is an unapproved draft interpretation. Use at your own risk. _____________________________________________________________________________ Austin Group Interpretation reference 1003.1-2001 #039 _____________________________________________________________________________ Interpretation Number: 039 Topic: pathchk -p, Filename Portability Relevant Sections: XCU pathchk, XBD Global Concepts Austin Group Interpretation Request: ------------------------------------ Date: Sat, 25 Sep 2004 06:05:26 +0100 (BST) ------------------------------------------------------------------------ 7 Defect Report concerning (number and title of International Standard or DIS final text, if applicable): The Shell and Utilities Volume of IEEE Std 1003.1-2001 ------------------------------------------------------------------------ 8 Qualifier (e.g. error, omission, clarification required): 1. Error ------------------------------------------------------------------------ 9 References in document (e.g. page, clause, figure, and/or table numbers): Page: 696 Line: 26993 Section: pathchk XCUbug2.txt Enhancement Request Number 39 ------------------------------------------------------------------------ 10 Nature of defect (complete, concise explanation of the perceived problem): By intent (as shown in XCU page 698 lines 27053-27054), pathchk -p should succed only on pathnames that can be moved to any conforming system. However, the formal description neglects one case: file name components that begin with "-". Under the current strict reading of the standard, for example, the command "pathchk -p ./-" must succeed even though "./-" is not a portable pathname (see XBD section 4.6 page 98 line 3071). ------------------------------------------------------------------------ 11 Solution proposed by the submitter (optional): Action: After XCU page 696 line 26993, add a new bullet: * Contains any component whose first character is a hyphen. ------------------------------------------------------------------------ Interpretation response ------------------------ The standards states the requirements for portable filenames and the behavior for the pathchk utility, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor. Rationale: ------------ It is believed that the intent of the former POSIX.1-1990 and POSIX.2-1992 standards was that the constraint on use of the hyphen character as the first character of a portable filename is a constraint on application behavior and not on implementations, since applications might not work as expected when such a filename is passed as a command line argument. Notes to the Editor for a future revision(not part of the interpretation) ------------------------------------------------------------------ XBD Chapter 3 Definitions 3.170 Filename Portability is not a definition, it is advice on why filenames should be constructed from the portable filename character set, and should be moved elsewhere (see below) Remove Definition 3.170 Change XBD Chapter 4 Global Concepts 4.6 Filenames From: "4.6 Filenames For a filename to be portable across implementations conforming to IEEE Std 1003.1-2001, it shall consist only of the portable filename character set as defined in Portable Filename Character Set. The hyphen character shall not be used as the first character of a portable filename. Uppercase and lowercase letters shall retain their unique identities between conforming implementations. In the case of a portable pathname, the slash character may also be used." To: "4.6 Filenames Uppercase and lowercase letters shall retain their unique identities between conforming implementations. " Insert new General Concept into XBD after 4.6 Filenames and before 4.7 File Times Update" "4.X Filename Portability For a filename to be portable across implementations conforming to IEEE Std 1003.1-2001, it shall consist only of the portable filename character set as defined in Portable Filename Character Set. Portable filenames shall not have the hyphen character as the first character since this may cause problems when filenames are passed as command line arguments." Insert new RATIONALE into XRAT before A.4.7 File Times Update "A.4.X Filenames should be constructed from the portable filename character set because the use of other characters can be confusing or ambiguous in certain contexts. (For example, the use of a colon ( ':' ) in a pathname could cause ambiguity if that pathname were included in a PATH definition.) The constraint on use of the hyphen character as the first character of a portable filename is a constraint on application behavior and not on implementations, since applications might not work as expected when such a filename is passed as a command line argument." For pathchk it was agreed that we need to address the hyphen character issue, and that pathchk must be able to issue a diagnostic when it encounters it. We discussed whether the new behavior should be added to the -p option rather than a new -P option. If the new behavior was added to -p there were concerns raised about how to maintain conformance to the current and previous standards. The approach of adding a new -P option allows backwards compatibility, and yet allows existing implementations to implement the future direction. In XCU pathchk (2004 ed , p696) Insert at the end of the OPTIONS section in the pathck utility "-P Write a diagnostic for each pathname operand that contains a component whose first character is the hyphen character" In the pathchk SYNOPSIS section change From : "pathchk [-p] pathname...." To: "pathchk [-p] [-P] pathname...." In the pathchk DESCRIPTION section Change the last sentence of the first paragraph From: "More extensive portability checks are provided by the -p option." To: "More extensive portability checks are provided by the -p and -P options." Add to the pathchk APPLICATION USAGE "To verify that a pathname meets the requirements of filename portability, applications should use both -p and -P options together." Add to the pathckh RATIONALE "For historical purposes -p does not check for the use of the hyphen character as the first character in a component of the pathname." Forwarded to Interpretations Group: Mon Nov 22 12:07:02 GMT 2004 Proposed resolution: Mon Nov 22 12:07:02 GMT 2004 Approved: 6 January 2005