GNU bug report logs - #23853
chmod can unset sticky bits using octet format

Previous Next

Package: coreutils;

Reported by: westlake <westlake2012 <at> videotron.ca>

Date: Mon, 27 Jun 2016 02:31:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: westlake <westlake2012 <at> videotron.ca>, 23853 <at> debbugs.gnu.org
Subject: bug#23853: chmod can unset sticky bits using octet format
Date: Mon, 27 Jun 2016 08:13:20 -0600
[Message part 1 (text/plain, inline)]
On 06/26/2016 06:56 PM, westlake wrote:
> According to chmod's manpage,
> "chmod preserves a directory's set-user-ID and set-group-ID bits unless
> you explicitly specify otherwise.  You can set or clear the bits with
> symbolic modes like u+s and g-s, and you can set (but not clear) the
> bits with a numeric mode."
> 
> contrary to documentation, chmod can otherwise clear sticky bits using
> the octet notation but by using a 5th octal
> 
> commands used,
> mkdir abc
> chmod u+s,g+s abc
> chmod 0755 abc (no effect on the sticky bits)
> chmod 00755 abc (sticky bits cleared using the 5th octal position)

The behavior of the 5th octal to intentionally specify that the
otherwise leading 0 is intended to clear sticky bits is intentional, so
the only bug here is in the documentation for not making the intended
behavior more obvious.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 205 days ago.

Previous Next


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