Filipus Klutiero wrote: > chmod's manual page contains: > > >chmod changes the file mode bits of each given file according to > >mode, which can be either a symbolic representation of changes to > >make, or an octal number representing the bit pattern for the new > >mode bits. > > An octal number does not necessarily represent the bit pattern for > the new mode bits. If a FILE is a directory, the first digit does > not necessarily represent the bit pattern of its special bits. As > explained in the "SETUID AND SETGID BITS" section:
The change to the way octal file modes are handled is a recent one to the upstream coreutils. (One that I argued against making as it happens.) It was implemented to make shared work among several users easier. It intentionally requires clearing the sgid bit with an explicit command so that the sgid bit remains behind in the typical usage. If people are working with an sgid directory then most of the time the commands do the right thing. And if you use the symbolic modes which are preferred now then there isn't an issue. I always use the symbolic modes now. But being a recent feature addition to the upstream coreutils the ramifications haven't filtered through everywhere yet. It will take a while for all of the parts such as documentation to be corrected. > >chmod changes the file mode bits of each given file according to > >mode, which can be either a symbolic representation of changes to > >make, or an octal number representing the bit pattern for the new > >mode bits. > > Therefore, for example, if a directory has mode 2775, running chmod > on it with OCTAL-MODE 0775 does not change its mode [to 0775]. Do you have a suggestion for how this wording may be improved? Bob -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

