XCU D3R Aardvark Reports Austin-395 Page 1 of 1 Submitted by Andrew Josey, The Open Group. Sep 10, 2007 Aardvark Summary Table ______________________ ERN 1 Accept ERN 2 Accept ERN 3 Accept ERN 4 Accept ERN 5 Accept ERN 6 Accept ERN 7 Accept ERN 8 Accept ERN 9 Accept ERN 10 Accept as marked ERN 11 Accept as marked ERN 12 Accept ERN 13 Accept _____________________________________________________________________________ EDITORIAL Enhancement Request Number 1 ebb9:xxxxxxx Bug in XCUd3 continue (rdvk# 11) {ebb.continue} Thu, 26 Jul 2007 17:25:32 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2286 Line: 72498 Section: continue Problem: Typo in draft 3's attempt to convert echo to printf usage. Action: Replace line 72498: printf '"$s" is not a directory.\n' "$i" with: printf '"%s" is not a directory.\n' "$i" _____________________________________________________________________________ OBJECTION Enhancement Request Number 2 gwc:xxxxxxxxxxxxx Bug in XCUd3 c99 (rdvk# 9) [gwc c99 synopsis] Fri, 6 Jul 2007 09:43:59 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2427 Line: 77976 Section: c99 Problem: In the c99 synopsis the "pathname" within the repeated group needs to be optional, otherwise a simple "c99 file.c -l m" doesn't fit the pattern. There are also some editorial problems with the synopsis (-D should be -I, spacing, and a missing right bracket). Action: Change [pathname[-D directory [-L directory] [-l library]]... to [[pathname] [-I directory] [-L directory] [-l library]]... _____________________________________________________________________________ EDITORIAL Enhancement Request Number 3 gwc:xxxxxxxxxxxxx Bug in XCUd3 c99 (rdvk# 5) [gwc c99 -l c] Fri, 6 Jul 2007 09:24:42 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2431 Line: 78152 Section: c99 Problem: There is a minor editorial mistake in the application of XCUd2 ERN 68. There is also a typo on P2434 L78317. Action: Change "as the last" to "after the last". On P2434 L78317 change "operaneds" to "operands". _____________________________________________________________________________ EDITORIAL Enhancement Request Number 4 ebb9:xxxxxxx Bug in XCUd3 cp (rdvk# 13) {ebb.cp} Fri, 17 Aug 2007 15:26:46 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2483 Line: 80185 Section: cp Problem: cp -r was not completely removed. There are now only three synopses instead of four for cp; and step 4 no longer needs an extra sublevel, since it can now only be reached via the use of -R. Action: At line 80185, replace the phrase: The third and fourth synopsis forms are denoted... with: The third synopsis form is denoted... At lines 80270, replace: 4. Otherwise, the following steps shall be taken: a. If the -R option was specified, the following steps shall be taken: with: 4. Otherwise, the -R option was specified, and the following steps shall be taken: At lines 80272-80284, renumber i., ii., and iii. to a., b., and c., and reduce the indentation accordingly. _____________________________________________________________________________ EDITORIAL Enhancement Request Number 5 gwc:xxxxxxxxxxxxx Bug in XCUd3 df (rdvk# 1) [gwc df stdout 1024] Tue, 17 Jul 2007 09:58:01 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2531 Line: 81991 Section: df Problem: The "1024-blocks" columns header specified to be written by df has been changed to "1 024-blocks". Since this text is part of an output format specification, it cannot be subject to the usual editorial convention for other text; it must show precisely the text to be output. Action: Change "1 024" to "1024". _____________________________________________________________________________ EDITORIAL Enhancement Request Number 6 gwc:xxxxxxxxxxxxx Bug in XCUd3 find (rdvk# 8) [gwc find ch] Tue, 17 Jul 2007 09:58:46 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2676 Line: 87767 Section: find Problem: Incomplete change history entry for find. Action: Change "The description of the -name primary is revised and a new example added." to "The description of the -name primary is revised and the -path primary is added (with a new example)." _____________________________________________________________________________ OBJECTION Enhancement Request Number 7 gwc:xxxxxxxxxxxxx Bug in XCUd3 ln (rdvk# 2) [gwc ln cf link] Tue, 10 Jul 2007 12:15:25 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2765 Line: 91114 Section: ln Problem: A change has been made to the link() function to make it implementation-defined whether or not link() follows symlinks. For consistency the equivalent change should be made for the ln utility, which is currently still required to follow symbolic links. In C programs application writers can choose which behaviour they want by using the linkat() function instead of link(). The same choice should be made available in shell scripts by adding -L and -P options to ln. Action: In both lines of the SYNOPSIS change: "ln [-fs]" to "ln [-fs] [-L|-P]" At line 91143 replace item 3 with: "3. If source_file is a symbolic link: a. If the -P option is in effect, actions shall be performed equivalent to the linkat() function with source_file as the path1 argument, the destination path as the path2 argument, AT_FDCWD as the fd1 and fd2 arguments, and zero as the flag argument. b. If the -L option is in effect, actions shall be performed equivalent to the linkat() function with source_file as the path1 argument, the destination path as the path2 argument, AT_FDCWD as the fd1 and fd2 arguments, and AT_SYMLINK_FOLLOW as the flag argument. The ln utility shall do nothing more with source_file and shall go on to any remaining files." On line 91152 change "option" to "options". After line 91153 add: "-L For each source_file operand that names a file of type symbolic link, create a (hard) link to the file referenced by the symbolic link. -P For each source_file operand that names a file of type symbolic link, create a (hard) link to the symbolic link itself." At line 91154 append to the -s description: "If the -s option is specified, the -L and -P options shall be silently ignored." Add two new paragraphs after line 91154: "Specifying more than one of the mutually-exclusive options -L and -P shall not be considered an error. The last option specified shall determine the behavior of the utility (unless the -s option causes it to be ignored). If the -s option is not specified and neither a -L nor a -P option is specified, it is implementation-defined which of the -L and -P options will be used as the default. Add to the end of RATIONALE (line 91229): "The -L and -P options allow for implementing both common behaviors of the ln utility. Earlier versions of this standard did not specify these options and required the behavior now described for the -L option. Many systems by default or as an alternative provided a non-conforming ln utility with the behavior now described for the -P option. Since applications could not rely on ln following links in practice, the -L and -P options were added to specify the desired behavior for the application. The -L and -P options are ignored when -s is specified in order to allow an alias to be created to alter the default behavior when creating hard links (for example: alias ln='ln -L'). They serve no purpose when -s is specified, since source_file is then just a string to be used as the contents of the created symbolic link and need not exist as a file." _____________________________________________________________________________ EDITORIAL Enhancement Request Number 8 gwc:xxxxxxxxxxxxx Bug in XCUd3 ls (rdvk# 6) [gwc ls synopsis] Fri, 6 Jul 2007 09:45:43 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2788 Line: 91977 Section: ls Problem: The ls synopsis is not up to date with respect to some changes made to the ls options. Specifically, -f and -s are no longer XSI, and -k has been added. The -x option is also missing from the synopsis. And there is a typo on P2792 L92186. Action: Move 'f' and 's' from the XSI shaded block of option letters to the initial (unshaded) block of option letters. Add 'k' and 'x' to the latter. This should produce: ls [-ACFRSacdfiklmnpqrstux1] [-H|-L] [-go] [file...] where [-go] is XSI shaded. On P2792 L92186 change "of the -k option" to "if the -k option". _____________________________________________________________________________ OBJECTION Enhancement Request Number 9 ebb9:xxxxxxx Bug in XCUd3 m4 (rdvk# 12) {ebb.m4} Thu, 26 Jul 2007 19:30:04 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 2800 Line: 92498 Section: m4 Problem: Several problems exist in how m4 edits were made for draft 3. The edits of ERN-130 were lost on 'eval' by the edits of ERN-137. The addition of 'mkstemp' by interp 117 also falls under the intent of ERN-130. There is a typo in the Issue 7 History, listing ERN-118 twice. Action: At line 92498, add one more sentence: The behavior is unspecified if eval is not immediately followed by a left parenthesis. At line 92546, add one more sentence: The behavior is unspecified if mkstemp is not immediately followed by a left parenthesis. At line 92708, replace "SD5-XCU-ERN-118" with "SD5-XCU-ERN-119". _____________________________________________________________________________ OBJECTION Enhancement Request Number 10 gwc:xxxxxxxxxxxxx Bug in XCUd3 pwd (rdvk# 10) [gwc pwd cf getcwd] Fri, 27 Jul 2007 16:29:45 +0100 _____________________________________________________________________________ Accept_____ Accept as marked below_X___ Duplicate_____ Reject_____ Rationale for rejected or partial changes: In the description of the -L option (line 99856) insert: Otherwise, if the PWD environment variable contains a pathname of the current directory that is longer than PATH_MAX bytes including the terminating null, and the pathname does not contain any components that are dot or dot-dot, it is unspecified whether pwd writes this pathname to standard output or behaves as if the -P option had been specified. before: Otherwise, the -L option shall behave ... Replace the description of the -P option (line 99858) with: The pathname written to standard output shall not contain any components that refer to files of type symbolic link. If there are multiple pathnames that the pwd utility could write to standard output, one beginning with a single slash and one or more beginning with two slashes, then it shall write the pathname beginning with a single slash. The pathname shall not contain any unnecessary slashes after the leading one or two slashes. Replace the APPLICATION USAGE section (line 99900) with: If the pathname obtained from pwd is longer than {PATH_MAX} bytes, it could produce an error if passed to cd. Therefore in order to return to that directory it may be necessary to break the pathname into sections shorter than PATH_MAX and call cd on each section in turn (the first section being an absolute pathname and subsequent sections being relative pathnames). At page 2443 line 78636 section cd, change: the PWD environment variable shall be set to an absolute pathname for the current working directory and shall not contain filename components that, in the context of pathname resolution, refer to a file of type symbolic link. to: the PWD environment variable shall be set to the string that would be output by pwd -P. Replace the PWD description at page 3077 line 103479 section sh with: This variable shall represent an absolute pathname of the current working directory. Assignments to this variable may be ignored. Replace the PWD description at page 2252 line 71151 section 2.5.3 with: Set by the shell and by the cd utility. In the shell the value shall be initialized from the environment as follows. If a value for PWD is passed to the shell in the environment when it is executed, the value is an absolute pathname of the current working directory that is no longer than PATH_MAX bytes including the terminating null byte, and the value does not contain any components that are dot or dot-dot, then the shell shall set PWD to the value from the environment. Otherwise, if a value for PWD is passed to the shell in the environment when it is executed, the value is an absolute pathname of the current working directory, and the value does not contain any components that are dot or dot-dot, then it is unspecified whether the shell sets PWD to the value from the environment or sets PWD to the pathname that would be output by pwd -P. Otherwise, the sh utility sets PWD to the pathname that would be output by pwd -P. In cases where PWD is set to the value from the environment, the value can contain components that refer to files of type symbolic link. In cases where PWD is set to the pathname that would be output by pwd -P, if there is insufficient permission on the current working directory, or on any parent of that directory, to determine what that pathname would be, the value of PWD is unspecified. Assignments to this variable may be ignored. If an application sets or unsets the value of PWD, the behaviors of the cd and pwd utilities are unspecified. Cross-volume change to XBD page 164 line 5602 section 8.3, change: This variable shall represent an absolute pathname of the current working directory. It shall not contain any filename components of dot or dot-dot. The value is set by the cd utility. to: This variable shall represent an absolute pathname of the current working directory. It shall not contain any components that are dot or dot-dot. The value is set by the cd utility, and by the sh utility during initialization. _____________________________________________________________________________ Page: 2983 Line: 99849 Section: pwd Problem: Some changes are needed to the pwd utility for consistency with the changes being made to getcwd() by XSH ERN 213. A complication for pwd is the PWD variable. The steps performed by cd can produce PWD values longer than PATH_MAX. (This is clear for cd -L, but for cd -P step 10 says that PWD is set to a "pathname" - a fix for this is also included below.) Since PWD can be too long to be a "pathname", the descriptions of PWD on the pwd page and elsewhere should not state that it is a pathname. The description of the pwd -L option contains a condition on whether PWD is "an absolute pathname of the current directory that does not contain the filenames dot or dot-dot". If PWD is longer than PATH_MAX then it is not a "pathname" and the condition is automatically false. If we want the value of PWD to be written when it is longer than PATH_MAX but otherwise satisfies the condition, then we need to change the wording of the condition. However, we need to consider the implications of doing that. Assume for a moment that we make this change. What would the implementation of pwd need to do to test the condition? For the shell built-in version of pwd there is actually no need to test the condition directly, since the value of PWD is under the control of the shell (and the standard says that if an application sets or unsets the value of PWD, the behavior of pwd is unspecified). However, the exec-able version of pwd does need to test the condition (because the condition could be made false through the use of chdir()), and if required to handle PWD values longer than PATH_MAX then it would not be able to do a simple stat() of the PWD value. I doubt if any implementations do more than the simple stat(), so by requiring pwd to handle longer PWD values we would be forcing all implementors to modify pwd. The changes below allow either behaviour. A related issue is the handling of the PWD value from the environment by the shell when it is executed. As with the exec-able version of pwd, it needs to test whether PWD refers to the current directory in order to decide whether to use the inherited value or reinitialise it. The changes proposed below handle this the same way as for pwd -L. Note that these changes are also intended to supersede XCU ERN 88 (whose status is unclear - it is shown as "Accept as marked" but the accompanying comments to not specify any change to the text). Another addition to the affected text is to copy some text from cd step 10 about permission problems when setting PWD. Action: Replace the two-line pwd DESCRIPTION with: The pwd utility shall write to standard output a string that is either an absolute pathname of the current working directory or a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname. The string shall contain no components that are dot or dot-dot. In the description of the -L option (line 99856) insert: Otherwise, if the PWD environment variable contains a string that would be an absolute pathname of the current directory except that it is too long to be a pathname, and the string does not contain any components that are dot or dot-dot, it is unspecified whether pwd writes this string to standard output or behaves as if the -P option had been specified. before: Otherwise, the -L option shall behave ... Replace the description of the -P option (line 99858) with: The string written to standard output shall not contain any components that refer to files of type symbolic link. If there are multiple strings that the pwd utility could write to standard output, one beginning with a single slash and one or more beginning with two slashes, then it shall write the string beginning with a single slash. The string shall not contain any unnecessary slashes after the leading one or two slashes. In the PWD description at line 99879 change: An absolute pathname of the current working directory. to: An absolute pathname of the current working directory, or a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname. Replace the STDOUT section (line 99884) with: The pwd utility output is a string that is either an absolute pathname of the current working directory or a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname: "%s\n", Replace the APPLICATION USAGE section (line 99900) with: If the string obtained from pwd is longer than {PATH_MAX} bytes, it would produce an error if passed to cd. Therefore in order to return to that directory it is necessary to break the string into sections and call cd on each section in turn (the first section being an absolute pathname and subsequent sections being relative pathnames). Add a new paragraph to RATIONALE (line 99911): Since a pathname cannot, by definition, contain more than {PATH_MAX} bytes (including the null terminator), the description is careful to use the word "string" rather than "pathname" to refer to the output of pwd, as it may contain more than {PATH_MAX} bytes. At page 2443 line 78636 section cd, change: the PWD environment variable shall be set to an absolute pathname for the current working directory and shall not contain filename components that, in the context of pathname resolution, refer to a file of type symbolic link. to: the PWD environment variable shall be set to the string that would be output by pwd -P. At page 2444 line 78689 section cd, change: A pathname of the previous working directory, used by cd -. to: An absolute pathname of the previous working directory, or a string that would be an absolute pathname of the previous working directory except that it is too long to be a pathname. Used by cd -. Replace the PWD description at page 3077 line 103479 section sh with: This variable shall represent either an absolute pathname of the current working directory or a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname. Assignments to this variable may be ignored. Replace the PWD description at page 2252 line 71151 section 2.5.3 with: Set by the shell and by the cd utility. In the shell the value shall be initialized from the environment as follows. If a value for PWD is passed to the shell in the environment when it is executed, the value is an absolute pathname of the current working directory, and the value does not contain any components that are dot or dot-dot, then the shell shall set PWD to the value from the environment. Otherwise, if a value for PWD is passed to the shell in the environment when it is executed, the value is a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname, and the value does not contain any components that are dot or dot-dot, then it is unspecified whether the shell sets PWD to the value from the environment or sets PWD to the string that would be output by pwd -P. Otherwise, the sh utility sets PWD to the string that would be output by pwd -P. In cases where PWD is set to the value from the environment, the value can contain components that refer to files of type symbolic link. In cases where PWD is set to the string that would be output by pwd -P, if there is insufficient permission on the current working directory, or on any parent of that directory, to determine what that string would be, the value of PWD is unspecified. Assignments to this variable may be ignored. If an application sets or unsets the value of PWD, the behaviors of the cd and pwd utilities are unspecified. Cross-volume change to XBD page 164 line 5602 section 8.3, change: This variable shall represent an absolute pathname of the current working directory. It shall not contain any filename components of dot or dot-dot. The value is set by the cd utility. to: This variable shall represent either an absolute pathname of the current working directory or a string that would be an absolute pathname of the current working directory except that it is too long to be a pathname. It shall not contain any components that are dot or dot-dot. The value is set by the cd utility, and by the sh utility during initialization. _____________________________________________________________________________ OBJECTION Enhancement Request Number 11 w.mueller:xxxxxxxxxxxxx Bug in XCUd3 read (rdvk# 3) {muewi-read} Wed, 27 Jun 2007 09:19:28 +0100 (BST) _____________________________________________________________________________ Accept_____ Accept as marked below_X___ Duplicate_____ Reject_____ Rationale for rejected or partial changes: Remove line 102064 Change lines 102060 to 102063 to become just one sentence: If standard input is a terminal device and the invoking shell is interactive, read shall prompt for a continuation line when it reads an input line ending with a backslash , unless the -r option is specified. On line 102112, delete from ", or" to the full stop . On page 2261, section 2.7.4 (Here-Document), after line 71499, insert a new paragraph: When a here document is read from a terminal device and the shell is interactive, it shall write the contents of the variable PS2, processed as described in section 2.5.3 (Shell Variables) to standard error before reading each line of input until the delimiter has been recognized. _____________________________________________________________________________ Page: 3040 Line: 102064 Section: read Problem: The description of the read utility describes prompting behaviour for here documents. Since here documents are not more initimately related to read than to any other utility, their prompting behaviour should be described at the place where they are introduced. Action: Remove line 102064 Change lines 102060 to 102063 to become just one sentence: If standard input is a terminal device and the invoking shell is interactive, read shall prompt for a continuation line when it reads an input line ending with a backslash , unless the -r option is specified. On line 102112, replace anything starting with ``, or'' by a full stop (`.') On page 2261, section 2.7.4 (Here-Document), after line 71499, insert a new paragraph: When a here document is read from a terminal device and the shell is interactive, it shall write the contents of the variable PS2, processed as described in section 2.5.3 (Shell Variables) to standard error before reading each line of input until the delimiter has been recognized. _____________________________________________________________________________ EDITORIAL Enhancement Request Number 12 gwc:xxxxxxxxxxxxx Bug in XCUd3 renice (rdvk# 7) [gwc renice ob forms] Tue, 17 Jul 2007 09:59:38 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 3045 Line: 102283 Section: renice Problem: Typo. Action: Change "forma" to "forms". _____________________________________________________________________________ COMMENT Enhancement Request Number 13 gwc:xxxxxxxxxxxxx Bug in XCUd3 tail (rdvk# 4) [gwc tail -c] Tue, 17 Jul 2007 17:36:38 +0100 _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 3120 Line: 105213 Section: tail Problem: Interpretation AI-100 added the following to the description of the tail -c option: "The application shall ensure that if the sign of the number option-argument is '+', the number option-argument is a positive decimal integer." When this text is read as part of AI-100 it is clear from the context that its purpose is to forbid the use of "-c +0". However, when it is read just as part of the -c description in the standard, it is at first confusing; it takes time to realise that the only aspect of "positive" that matters is that positive numbers are not zero. Since this change was made before draft 3, amending it is out of scope according to the narrowing-down rules. Hence this aardvark is a comment, not an objection. I believe the group can, at their discretion, accept such comments and I hope that a minor clarification to this text will be seen as worthwhile and will be made. There is also another change to the -c description that could be made at the same time. It says: "The application shall ensure that the number option-argument is a decimal integer whose sign affects the location in the file, measured in bytes, to begin the copying:" The sentence needs to be rearranged so that it doesn't appear to place a requirement on the application to ensure that the sign affects the location in the file. Action: On lines 105214 and 105332 change "positive" to "non-zero". On line 105207 change "decimal integer whose sign affects" to "decimal integer, optionally including a sign. The sign shall affect"