[Bug 927218] Re: Unable to unset setguid bit
Andrew McCarthy
me at andrewmccarthy.ie
Sat Apr 21 22:16:30 UTC 2012
Thanks for taking the time to report this. The behaviour you describe
may seem surprising (and it was to me, too!), but is actually what the
man page describes:
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.
So, you can clear the setgid bit on the directory in your example with
"chmod g-s Y", but not with "chmod 0775 Y". Since this is the defined
behaviour that others may have come to expect for both interactive use
and in long-established scripts, it's unlikely to be changed now.
** Package changed: bash (Ubuntu) => coreutils (Ubuntu)
** Changed in: coreutils (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/927218
Title:
Unable to unset setguid bit
Status in “coreutils” package in Ubuntu:
Invalid
Bug description:
In Precise, it is possible to set the guid bit for a directory but not
to unset it.
$ chmod g=rwxs Y
foo at precise:/tmp/X$ ls -l
total 4
drwxrwsr-x 2 foo adm 4096 Feb 5 18:48 Y
foo at precise:/tmp/X$ chmod g= Y
foo at precise:/tmp/X$ ls -l
total 4
drwx--Sr-x 2 maintenance adm 4096 Feb 5 18:48 Y
foo at precise:/tmp/X$ chmod g=rwx Y
maintenance at precise:/tmp/X$ ls -l
total 4
drwxrwsr-x 2 foo adm 4096 Feb 5 18:48 Y
foo at precise:/tmp/X$ chmod 0775 Y
foo at precise:/tmp/X$ ls -l
total 4
drwxrwsr-x 2 foo adm 4096 Feb 5 18:48 Y
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bash 4.2-1ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-14.23-generic-pae 3.2.3
Uname: Linux 3.2.0-14-generic-pae i686
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Sun Feb 5 18:52:29 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Alpha i386 (20111129)
ProcEnviron:
LANGUAGE=en_US:en
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/927218/+subscriptions
More information about the foundations-bugs
mailing list