GNU bug report logs - #29390
chmod man page - clear setuid/setgid with numerical value

Previous Next

Package: coreutils;

Reported by: Oliver Isaac <oisaac <at> gmail.com>

Date: Wed, 22 Nov 2017 03:01:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Oliver Isaac <oisaac <at> gmail.com>
To: 29390 <at> debbugs.gnu.org
Subject: bug#29390: chmod man page - clear setuid/setgid with numerical value 
Date: Tue, 21 Nov 2017 20:46:33 -0600
Hello,

There is an incorrect assertion made in the chmod man page:

Under the setuid/setgid header it says, "you can set (but not clear) the bits with a numeric mode"

This is not entirely true. If you prefix your numeric mode with a 0 then it will work:

e.g.:

touch myfile
chmod 644 myfile
ls -l myfile
chmod g+s myfile
Is -l myfile
chmod 00644 myfile
is -l myfile


This simple test shows that you can clear the uid/gid bits with numeric mode which is especially useful in scripts.

An update to the man page to clarify this would be helpful. 

Thanks,
Oliver



This bug report was last modified 7 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.