From: Pádraig Brady Date: Sun, 10 Dec 2017 02:26:56 +0000 (-0800) Subject: doc: clarify numeric setuid handling in chmod man page X-Git-Tag: v8.29~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532b4285de02190aa9cf36140d83a8b871080458;p=thirdparty%2Fcoreutils.git doc: clarify numeric setuid handling in chmod man page * man/chmod.x: Update the information to state one can clear the setuid and setgid bits for directories numerically using an additional leading '0' or a leading '='. That has been supported since v8.15-64-g8931cdb. Fixes https://bugs.gnu.org/29390 --- diff --git a/man/chmod.x b/man/chmod.x index ff013a3a18..cf31ea760d 100644 --- a/man/chmod.x +++ b/man/chmod.x @@ -87,14 +87,19 @@ functionality of the underlying system call. When in doubt, check the underlying system behavior. .PP +For directories .B chmod -preserves a directory's set-user-ID and set-group-ID bits unless you +preserves set-user-ID and set-group-ID bits unless you explicitly specify otherwise. You can set or clear the bits with symbolic modes like .B u+s and -.BR g\-s , -and you can set (but not clear) the bits with a numeric mode. +.BR g\-s . +To clear these bits for directories with a numeric mode requires +an additional leading zero, or leading = like +.B 00755 +, or +.B =755 .SH "RESTRICTED DELETION FLAG OR STICKY BIT" The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. For directories, it prevents