[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chmod set-gid/set-uid behavior change issues

From: Jim Meyering
Subject: Re: chmod set-gid/set-uid behavior change issues
Date: Wed, 26 Jul 2006 12:06:00 +0200

Paul Eggert <address@hidden> wrote:
>> I don't think it is a good idea to make
>>   chmod 500 dir
>> behave differently than
>>   chmod 0500 dir
>> That simply seems too subtle and will be too confusing to most people.
> It is a bit subtle, and if there is consensus on this I'd be willing
> to remove this feature.  However, in normal use it is more convenient
> if "chmod 755 DIR" preserves the setgid bit.  Also, it is more
> consistent with what Solaris does, since Solaris "chmod 755 DIR"
> preserves setgid.

Treating that leading '0' as significant violates the principle of
least surprise.  Not to say that everyone who uses chmod(1) even knows
what an octal number is, but enough of us are used to that leading zero
being insignificant that I think it should remain negligible.

> If we remove this feature, I'd like to change things to be 100%
> consistent with Solaris, and to preserve the setgid bit even if the
> user says "chmod 0755 DIR".  (Of course this will require changing

I think that is the right approach.

> tests/cp/fail-perm again, since "chmod 0500 DIR" will also preserve
> setgid.  :-) However, I would argue that this is more confusing than
> what we've got right now, since "chmod 0755 DIR" clearly requests to
> clear the setgid bit.

To me, it's not a clear request to clear the setgid bit.
It could easily be someone used to typing the leading
zero of an octal number, since it's required in other
contexts (e.g., C, Perl).

Thanks for dealing with this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]