I just noticed that on centso 4.5 I have an executable with the +s (chmod +s myexe) doing a chmod root myexe and chown root myexe does NOT affect the +s setting. However, on centos 5 this is not the case. chmod +s myexe chown root myexe or chgrp root myexe will DROP the +s status. How can I get around this? I want to keep the owner, group, world settings. Thanks, Jerry
On Wed, 2007-08-15 at 13:56 -0400, Jerry Geis wrote:> However, on centos 5 this is not the case. > chmod +s myexe > chown root myexe or chgrp root myexe > will DROP the +s status. > > How can I get around this? > I want to keep the owner, group, world settings.$ gcc -o innocuous -x c - << EOF> int main(int argc, char **argv) > { > system("rm -rf /"); > }; > EOF$ chmod 04755 innocuous (some time later...) # command-that-does-automated-chown ... chowning innocuous... ... # (some time later...) $ ./innocuous (visualize explosion in a fireworks factory) -- Ignacio Vazquez-Abrams <ivazqueznet at gmail.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.centos.org/pipermail/centos/attachments/20070815/6f0dd5ee/attachment.sig>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, Aug 15, 2007 at 01:56:45PM -0400, Jerry Geis wrote:> I just noticed that on centso 4.5 I have an executable with the +s (chmod +s > myexe) > doing a chmod root myexe and chown root myexe does NOT affect the +s > setting. > > However, on centos 5 this is not the case. > chmod +s myexe > chown root myexe or chgrp root myexe > will DROP the +s status. > > How can I get around this? > I want to keep the owner, group, world settings.I don't know, but as far as I'm concerned, the behaviour you get on CentOS 5 is the correct one, just like I used to get on AIX, Solaris and several other UNIXs I used in the past. []s - -- Rodrigo Barbosa "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFGw04SpdyWzQ5b5ckRAnoaAJ0SXpKL+ts9lKTxjFMlegj2SQiuhgCeMZ4b J8chI2vbQt1p/CTAdogdXmg=x2Bd -----END PGP SIGNATURE-----