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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23853 in the body.
You can then email your comments to 23853 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23853; Package coreutils. (Mon, 27 Jun 2016 02:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to westlake <westlake2012 <at> videotron.ca>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 27 Jun 2016 02:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: westlake <westlake2012 <at> videotron.ca>
To: bug-coreutils <at> gnu.org
Subject: chmod can unset sticky bits using octet format
Date: Sun, 26 Jun 2016 20:56:24 -0400
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)






Information forwarded to bug-coreutils <at> gnu.org:
bug#23853; Package coreutils. (Mon, 27 Jun 2016 14:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 23853 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: westlake <westlake2012 <at> videotron.ca>, 23853 <at> debbugs.gnu.org
Subject: Re: 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)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#23853; Package coreutils. (Sun, 28 Oct 2018 06:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 23853 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 23853 <at> debbugs.gnu.org
Subject: Re: bug#23853: chmod can unset sticky bits using octet format
Date: Sun, 28 Oct 2018 00:14:33 -0600
close 23853
stop

(triaging old bugs)

On 2016-06-27 8:13 a.m., Eric Blake wrote:
> On 06/26/2016 06:56 PM, westlake wrote:
>>
>> contrary to documentation, chmod can otherwise clear sticky bits using
>> the octet notation but by using a 5th octal
[...]
> 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.

With no further comments in 2 years,
I'm closing this bug.
Discussion can continue by replying to this thread.

-assaf







bug closed, send any further explanations to 23853 <at> debbugs.gnu.org and westlake <westlake2012 <at> videotron.ca> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Oct 2018 06:15:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Nov 2018 12:24:09 GMT) Full text and rfc822 format available.

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

Previous Next


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