[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: suid script



On Sun, 6 Dec 1998, Jiri Baum wrote:

> > > 1) kernel opens the file, finds it suid
> > > 2) kernel executes the shell with that uid
> > > 3) shell opens the same filename
> ...
> > I think it's probably the kernel that does the open on step 3,
> 
> No, it's the shell - it gets passed the filename. If it was the kernel opening
> the file, there wouldn't be any problem, just like there's no problem with
> ordinary executables.

That explains the weird behavior I was having when I tried getting a
counter example working.  I've been taking a course in OS and when I
implemented this in my kernel I had to do two opens because of the way I
was setting up my address space.  If I had implemented it right, I could
have seeked back to the original open file.  But considering I never got
to multiuser stuff, this wasn't a problem.  I guess this just adds to the
list of things that would be nice to have changed in the kernel, the unix
way seems better to me.

Thanks for the bonk with the clue stick :-)
Brandon

+---                                                              ---+
| Brandon Mitchell * bhmit1@mail.wm.edu * http://bhmit1.home.ml.org/ |
|  Sometimes you have to release software with bugs. - MS Recruiter  |


Reply to: