GNU bug report logs -
#8391
chmod setuid & setguid bits
Previous Next
Reported by: Christian <chris <at> computersalat.de>
Date: Thu, 31 Mar 2011 16:48:04 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 02/24/2012 11:48 AM, Eric Blake wrote:
> chmod 0000$(printf %o $mode) DIR
If this is the suggested use, shouldn't the leading-zero approach
require at least *4* leading zeros before the actual octal value?
That would remove one of my objections to it, namely, the confusion
between "chmod 00755 DIR" (which would clear the setuid bits, if
the requirement is 5 or more total digits) and "chmod 0000 DIR" (which
would not).
> s/@/0000/, and you have your distro-agnostic prefix.
Sorry, I don't follow. "chmod 0000755 DIR" will not clear the setuid
bits on Solaris, or on some RHEL versions. So no matter what we do,
the behavior will not be distro-agnostic. If we want distro-agnostic
behavior that solves the problem, we need to start by introducing
behavior that will work on our platform but not other platforms,
and then hope to convince other platform developers to become compatible.
I doubt whether "chmod 0000755 DIR"'s behavior would be standardized
by POSIX, because it would invalidate existing implementations.
In contrast, "chmod @755 DIR"'s behavior might become part of the
standard, if we ask, because it doesn't invalidate existing implementations.
So this seems a better way to move forward, if we want the behavior
to become portable eventually.
This bug report was last modified 13 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.