Silly Little Question about SETUID

From: Ben Green (awk@carolina.rr.com)
Date: Wed Jul 16 2003 - 17:07:09 EDT


Fellow managers,

I have been living the superuser lifestyle too long. On one of my servers,
I recently helped a non-privileged user set the setuid bit on a shell
script. I used vi on it as root to make a small fix to it and it continued
to work. However, when the owner of the shell script edits the file with
vi, writing the changes to disk causes the setuid bit to go away. The user
then has to chmod u+s on the file to get it back.

Maybe I missed this during some discussion years ago, or maybe I have been
doing things as root so much that I have forgotten how the common user's
shell life goes.

Why is this happening?

Ben Green
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:46 EDT