GNU bug report logs - #8391
chmod setuid & setguid bits

Previous Next

Package: coreutils;

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


Message #68 received at 8391 <at> debbugs.gnu.org (full text, mbox):

From: Ondrej Vasik <ovasik <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: chris <at> computersalat.de, Eric Blake <eblake <at> redhat.com>,
	8391 <at> debbugs.gnu.org
Subject: Re: bug#8391: chmod setuid & setguid bits
Date: Fri, 24 Feb 2012 20:33:26 +0100
On Fri, 2012-02-24 at 11:22 -0800, Paul Eggert wrote:
> On 02/24/2012 11:05 AM, Ondrej Vasik wrote:
> > requester was fine with double zero 5+ octal digit
> > approach.
> 
> I expect the requester would also be fine with a leading-'@'
> approach.  All the requester wanted was *some* solution.
> 
> 
> > 00755 is still octal digit (and easy to get with printf %5.5o
> > from shorter octal digit mode, and probably easy to use further in
> > scripts without modifications)
> 
> Sorry, I don't follow.  If I have a decimal mode 'mode' in a script,
> then this:
> 
>   chmod @$(printf %o $mode) DIR
> 
> is easier and simpler than this:
> 
>   chmod $(printf %5.5o $mode) DIR
> 
> The "5.5o" is tricky: Why *two* "5"s?
> and who can remember which "5" is really needed, and why,
> right off the bat? and remember why "5", and not "4" or "6"?
> 
> The "@" is simple.

Yes, but `chmod @755 DIR' approach will not let you to write a script
which will work without modification on RHEL-4,RHEL-5 and RHEL-6
machine... which is not the case with fully octal mode. That's what I'm
trying to say with "you still have octal digit". This %5.5o was more
about "easy" change to their script which will allow them to use one
script on everything again...
This kind of approach (one script for more systems) is very common in
enterprise area - and without possibility of doing that, requester will
not be fine with the solution.

Greetings,
         Ondrej





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.