This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 244422 - regression: chmod setuid/setgid doesn't do what it's told
regression: chmod setuid/setgid doesn't do what it's told
Status: CLOSED DUPLICATE of bug 243517
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
7
All Linux
high Severity high
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-15 11:39 EDT by Zing
Modified: 2008-05-01 11:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-18 02:41:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Zing 2007-06-15 11:39:03 EDT
Description of problem:
chmod is not removing setuid/setgid bit using OCTAL-MODE.

Version-Release number of selected component (if applicable):
coreutils-6.9-2.fc7.x86_64

How reproducible:
always

Steps to Reproduce:

1. I want to make a directory setgid:

# ls -ld .
drwxrwx--- 3 root svn 4096 2007-06-15 10:59 ./
# chmod 4770 .
# ls -ld .
drwsrwx--- 3 root svn 4096 2007-06-15 10:59 ./

2. oops, not setuid... fix that...

# chmod 2770 .
# ls -ld .
drwsrws--- 3 root svn 4096 2007-06-15 10:59 ./

3. WTF!@#$!  I said 2770!!!!! NOT 6770

4. <calm down> try to clear the bits...

# chmod 0770 .
# ls -ld .
drwsrws--- 3 root svn 4096 2007-06-15 10:59 ./

5. kill -9 self

Actual results:
something dumb

Expected results:
i expect 2770 to be 2770.  There doesn't even seem to be a way to clear the
setuid/setgid bits?

Additional Info:
What in the world is the use case for this bizarre semantics???  You've changed
how this utility has worked for a long time... Please revert/fix to get back
normalcy in this world.
Comment 1 Jim Meyering 2007-06-18 02:41:12 EDT
This is a duplicate of http://bugzilla.redhat.com/243517
Now you have to use chmod's symbolic modes (u-s, g-s, o-t) to clear a
directory's special bits.

*** This bug has been marked as a duplicate of 243517 ***
Comment 2 Steve Bryant 2007-06-18 04:14:26 EDT
N.B. both "chmod 777" and "chmod 0777" do turn off the sticky bit, but not the
set-uid and set-gid bits of directories.

Note You need to log in before you can comment on or make changes to this bug.