=X actually works quite fine despite the mentioned condition:

        $ touch f; mkdir d
        $ chmod =X f d
        $ ls -ld f d
        d--x--x--x  2 kle  wheel  512 Jun  3 15:11 d/
        ----------  1 kle  wheel    0 Jun  3 15:11 f

One of the given examples has been updated to reflect this.

Whether to implement/fix the desired(?) limitation is another question.

Index: chmod.1
===================================================================
RCS file: /cvs/src/bin/chmod/chmod.1,v
retrieving revision 1.41
diff -u -p -r1.41 chmod.1
--- chmod.1     31 Dec 2015 23:38:16 -0000      1.41
+++ chmod.1     3 Jun 2017 13:10:02 -0000
@@ -287,15 +287,6 @@ Execute/search bits.
.It X
The execute/search bits if the file is a directory or any of the
execute/search bits are set in the original (unmodified) mode.
-Operations with the
-.Ar perm
-symbol
-.Sq X
-are only meaningful in conjunction with the
-.Ar op
-symbol
-.Sq + ,
-and are ignored in all other cases.
.It u
User permission bits in the mode of the original file.
.It g
@@ -333,7 +324,7 @@ Deny write permission to group and other
Set the read and write permissions to the usual defaults, but
retain any execute permissions that are currently set:
.Pp
-.Dl $ chmod =rw,+X file
+.Dl $ chmod =rwX file
.Pp
Make a directory or file searchable/executable by everyone if it is
already searchable/executable by anyone:

Reply via email to