[TUHS] Set-uid shell scripts

Dave Horsfall dave at horsfall.org
Thu Aug 8 07:33:47 AEST 2019


On Tue, 6 Aug 2019, Lyndon Nerenberg wrote:

>> Just to extend this thread a bit more, when did the set[ug]id bit start 
>> getting turned off if the file was overwritten?
>
> I'm pretty sure that's been the case since the dawn of time.

Hmmm...  I have this vague memory of V5 (which I only used for a couple of 
months before we got V6) not clearing that bit, but after all these years 
my memory is starting to fail me :-(

> It was certainly the case in every System V (release 0 and beyond) I 
> worked with, along with many BSDs derivatives (SunOS 3+, Ultrix, etc). 
> (And Xenix, which had it's own insanity that I now think selinux is 
> trying to inflict on me.)

I've always thought that Xenix was insane to start with...  Then again, my 
first experience with it was on a 286...  Now, when porting Unify, should 
I use large memory model here or small memory model?  Crazy.

> This has been documented in chown(2) for as long as I can remember, so 
> that's a good place to start if you want to dig back through the various 
> source trees.

I don't have access to the sources right now, but I'll take your word for 
it; it was just a passing thought.

-- Dave


More information about the TUHS mailing list