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


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: ovasik <at> redhat.com
Cc: chris <at> computersalat.de, Eric Blake <eblake <at> redhat.com>, 8391 <at> debbugs.gnu.org
Subject: bug#8391: chmod setuid & setguid bits
Date: Fri, 24 Feb 2012 11:47:33 -0800
On 02/24/2012 11:33 AM, Ondrej Vasik wrote:
> 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...

None of these approaches will let you write a script that will work
without modification on any POSIX platform.  If one wants to be portable,
one must use the symbolic notation, not the octal.

None of these approaches will even let you write a script that will work
without modification on any RHEL platform.  This is because some RHEL
platforms use the newer coreutils.

Still, I take your point that the 5-or-more-digit approach will let you write
scripts that will run on all POSIX platforms without a diagnostic
(though perhaps not with the desired effect).  And these scripts will
run and have the desired effect if you know that your scripts will run
only on a particular subset of POSIX platforms, one where the effect is
the one desired.

How about this idea for a compromise?  Implement both notations, but
recommend leading '@' for future scripts.  It's more likely that a notation
like leading-'@' would be adopted by future POSIX versions, since it's a
pure extension, whereas the 5-or-more-digit approach is incompatible with
some POSIX systems now.  And if leading-'@' is adopted by POSIX, there would
eventually be a portable way to do what the requester wants.

Personally I'd be more inclined to go with a pure '@' solution, since
it's simpler and the portability gains of the compromise are not all
that great; but I guess the compromise would be OK too.




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.