Email List: Xaustin-review-lX
[All Lists]

Defect in XCU find

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU find
From: Geoff Clare <yyy@xxxxxxxxxxxxx>
Date: Thu, 28 Apr 2005 18:03:07 +0100
@ page 452 line 17515-17523 section find objection [gwc find symlink options]

Problem:

Defect code :  1. Error

The description of the -H and -L options on the find page is:

   -H  Cause the file information and file type evaluated for each
       symbolic link encountered on the command line to be those of the
       file referenced by the link, and not the link itself. If the
       referenced file does not exist, the file information and type
       shall be for the link itself. File information for all symbolic
       links not on the command line shall be that of the link itself.

   -L  Cause the file information and file type evaluated for each
       symbolic link to be those of the file referenced by the link,
       and not the link itself. 

   Specifying more than one of the mutually-exclusive options -H and -L
   shall not be considered an error. The last option specified shall
   determine the behavior of the utility.


There are a few problems with this description.

1. It does not say what happens when neither -H nor -L is specified.
The intended behaviour is not the default for pathname resolution, so
it needs to be stated explicitly.

2. It does not distinguish between different parts of the command line.
For example, in "find . -exec somecommand pathname {} \;" the treatment
of "pathname" is under the control of "somecommand", not find, and
therefore although "pathname" appears on the find command line it
should not be included in the description of how find handles symlinks
on its command line.

3. The statement "File information for all symbolic links not on the
command line shall be that of the link itself" needs some qualification
given that most types of file information are not required to be
meaningful for symlinks.  (According to the lstat() page in XSH the
only meaningful information required to be returned for symlinks is
their file type and size.)

4. The phrase "file information and [file] type" is used several
times, but the last sentence of the description of -H just says "file
information", implying that it does not apply to the file type.


Action:

Replace the description of the -H and -L options with the following:

   -H  Cause the file information and file type evaluated for each
       symbolic link encountered as a path operand on the command line
       to be those of the file referenced by the link, and not the link
       itself.  If the referenced file does not exist, the file
       information and type shall be for the link itself.  File
       information and type for symbolic links encountered during the
       traversal of a file hierarchy shall be that of the link itself.

   -L  Cause the file information and file type evaluated for each
       symbolic link encountered as a path operand on the command line
       or encountered during the traversal of a file hierarchy to be
       those of the file referenced by the link, and not the link
       itself.  If the referenced file does not exist, the file
       information and type shall be for the link itself.

   Specifying more than one of the mutually-exclusive options -H and -L
   shall not be considered an error.  The last option specified shall
   determine the behavior of the utility.  If neither the -H nor the -L
   option is specified, then the file information and type for symbolic
   links encountered as a path operand on the command line or
   encountered during the traversal of a file hierarchy shall be that
   of the link itself.

(Note that this new text also incorporates the change from XCU ERN 48.)

Add a new paragraph to the end of the OPERANDS section (after line
17659):

   When the file type evaluated for the current file is symbolic link
   the results of evaluating the -nouser, -nogroup, -perm, -links,
   -user, -group, -atime, -ctime, -mtime, and -newer primaries are
   implementation defined.

<Prev in Thread] Current Thread [Next in Thread>