Use of the information contained in this unapproved document is at your own risk
.Last update: 03 January,1997
1003.2-92 #143 _____________________________________________________________________________ Interpretation Number: xxxx Topic: c89 Relevant Sections: 2.9.1.4 and A.1.2 Interpretation Request: ----------------------- From: Andre Bellotti <aab@unx.dec.com> Date: Sun, 10 Dec 1995 11:30:00 - 0800 Dear Standards Board, I would like to request a formal interpretation concerning the following point in IEEE Std 1003.2-1992 (POSIX.2). Contrary to historical practice, the Standard is ambiguous as to whether or not the execute permissions will be set on the file created by the c89 compiler if a file of the same name already exists without execute permissions. In section A.1.2, page 688, lines 27 through 31 it states: "The executable file shall be created as specified in 2.9.1.4, except that the file permissions shall be set to S_IRWXO|S_IRWXG|S_IRWXU (see 6.6.1.2 in POSIX.1 {8}) and that the bits specified by the umask of the process shall be cleared." This would indicate that in all cases that the file should be created with the permissions as specified. As this is obviously the action desired from an executable file created by a compiler this should be definitive. However an ambiguity arises in the case of an existing file that is being overwritten by the output of the compiler. In section 2.9.1.4, page 93, lines 3390 and 3391 the specification states that: "When a file that does not exist is created, the following POSIX.1 {8} features shall apply unless the utility or function description states otherwise:" Unfortunately in the case of an existing file the modifying language allowing the utility to override the section 2.9.1.4 does not exist; page 93, lines 3404 and 3405 read: "When an attempt is made to create a file that already exists, the action shall depend on the file type:" Without the modifying language the intent of the explicit permissions in the c89 description becomes ambiguous to apply. As it is obvious that the rules that were being referred to by the reference to section 2.9.1.4 were those dealing with files other than regular text files we would recommend that section 2.9.1.4, page 93, line 3409 be changed to read " (2) For regular files, unless the utility or function description states otherwise:" This would eliminate any ambiguity of application of explicit permissions upon existing files that are being overwritten. Thank you for your attention to this matter. Interpretation response ------------------------ The standard clearly states the behavior for setting permissions on a file's creation and conforming implementations must conform to this. The exception stated on Page 688 applies to both cases of a file existing and not existing. It is not limited to either case. Rationale ------------- None. Forwarded to Interpretations group: Dec 28 1995 Commence 30 day review: Mar 8 1996 Finalised: Oct 28 1996