Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149663 - coreutils-6.2 breaks chmod
Summary: coreutils-6.2 breaks chmod
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-30 15:27 UTC by Robin Johnson
Modified: 2006-09-30 16:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-09-30 15:27:32 UTC
chown in coreutils-6.2 isn't dealing with the special sticky bits correctly on directories.

This is breaking src_test and compiles of several of my packages, and leading to things being installed with incorrect permissions in other cases.

coreutils-5.97:
# mkdir /tmp/foo ; chmod 2755 /tmp/foo ; stat /tmp/foo |grep Uid ; chmod 0755 /tmp/foo ; stat /tmp/foo | grep Uid
Access: (2755/drwxr-sr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)

coreutils-6.2:
# mkdir /tmp/foo ; chmod 2755 /tmp/foo ; stat /tmp/foo |grep Uid ; chmod 0755 /tmp/foo ; stat /tmp/foo | grep Uid
Access: (2755/drwxr-sr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: (2755/drwxr-sr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Comment 1 SpanKY gentoo-dev 2006-09-30 16:07:53 UTC
e-mailed upstream as coreutils-6.3 is broken as well
Comment 2 SpanKY gentoo-dev 2006-09-30 16:28:02 UTC
this is by design unfortunately (it's in the NEWS file)

and the spec even allows for it:
http://www.opengroup.org/onlinepubs/009695399/utilities/chmod.html

EXTENDED DESCRIPTION

For an octal integer mode operand, the file mode bits shall be set absolutely.

For each bit set in the octal number, the corresponding file permission bit shown in the following table shall be set; all other file permission bits shall be cleared. For regular files, for each bit set in the octal number corresponding to the set-user-ID-on-execution or the set-group-ID-on-execution, bits shown in the following table shall be set; if these bits are not set in the octal number, they are cleared. For other file types, it is implementation-defined whether or not requests to set or clear the set-user-ID-on-execution or set-group-ID-on-execution bits are honored.