>From 532b4285de02190aa9cf36140d83a8b871080458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 9 Dec 2017 18:26:56 -0800 Subject: [PATCH] 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 --- man/chmod.x | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/man/chmod.x b/man/chmod.x index ff013a3..cf31ea7 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 -- 2.9.3