Defect report from : Paul Eggert , UCLA
(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
@ page 453 line 17570 section find objection {20060815a}
Problem:
Edition of Specification (Year): 2004
Defect code : 1. Error
The POSIX wording for "find" and octal modes is not consistent with
the wording used in "chmod", and as a result POSIX requires that the
command "find FILE -perm 70644 -print" must ignore the "7". I suspect
that this requirement is inadvertent, as it is contrary to common
practice, prevents implementations from generating reasonable
diagnostics, and is not consistent with the specification for
"chmod 70644 FILE".
For example, on my host using findutils version 4.1.20:
$ ls -l foo
-rw-r--r-- 1 eggert eggert 0 Aug 15 10:38 foo
$ find foo -perm 70644
find: invalid mode `70644'
POSIX requires that the output be "foo". However, findutils has
behaved this way for quite some time and nobody has complained, which
leads me to believe that applications do not rely on this POSIX
requirement.
There is also an editorial error in the spec: it refers to "file
permission bits", which do not include the setuid, setgid, or sticky
bits, whereas the intent is to refer to the file mode bits, which do
include these bits.
Action:
Change XCU page 453 lines 17567-17573 from:
-perm [-]onum
If the hyphen is omitted, the primary shall evaluate as true when
the file permission bits exactly match the value of the octal
number onum and only the bits corresponding to the octal mask
07777 shall be compared. (See the description of the octal mode
in chmod.) Otherwise, if onum is prefixed by a hyphen, the
primary shall evaluate as true if at least all of the bits
specified in onum that are also set in the octal mask 07777 are
set.
to:
-perm [-]onum
If the hyphen is omitted, the primary shall evaluate as true when
the file mode bits exactly match the value of the octal
number onum. (See the description of the octal mode
in chmod.) Otherwise, if onum is prefixed by a hyphen, the
primary shall evaluate as true if at least all of the bits
specified in onum are set. The behavior is unspecified when
onum exceeds 07777.
|