[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] running as root
> setuid script works? doesn't here :) Just tried the obvious:
I tried Perl. It seems (unbeknowns to me) that this may be a special
case....
> > > Race type conditions are ripe :)
> > Err, are you sure about that? Off the top of my head, I can't think of
> > one.
> >From what I remember reading last time I checked this up, race conitions
were
> one potential cause - this is why Solaris can do suid shell scripts by
> feeding the contents of the script through a pipe into the shell
interpreter
> - it avoids the races ... as I remember it :)
I'm still not sure that there's anything obvious there, but then that's
probably down to me. I'm afraid I treat shell scripts equivilent to other
executables, and I would imagine anything you can do with a shell script you
can replicate with a binary? Seems that way to me, anyway.
> oh aye, C can suid - its a binary once built - it's only interpreted (ie
> shell scripts) that can't be run suid. Perl scripts can be run suid by
using
> the sperl interpreter - I've never used it though, so I can't say how good
it
> is :)
Seems this is what I have been doing. To be honest, I find this a bit
strange. Unless there's something implicit in interpretation than make it
unsafe (and then, why not ban other interpreters?), I don't see why the
kernel shouldn't honour suid. Other Unixes do, which is probably why I
thought it would work. I'm going to try it on IRIX and Sunos tomorrow....
> > > main()
> >
> > You're worse than me ;)
>
> This is how I write small one line C things. Longer stuff tends to get the
> full treatment, so "gcc -Wall" creates no warnings :)
Yes, that's usually worthwhile. I tried using -ansi and -pedantic once, but
it complained about good code and passed bad. At least, what I consider to
be good and bad. Unfortunately I'm not a K&R devotee, so perhaps I'm at a
disadvantage.... although I agree about tabs and braces ;)
> However, I have read that system() won't work for suid stuff if /bin/sh
> points to bash greater than version 2...from the man page for system(3):
What a load of rubbish..... IMHO ;)) Usually, security stuff doesn't go
into the kernel when it's patently obvious that it's false security (stack
traps/trampolines come to mind...), I think I probably must have missed some
key corner case somewhere...
Cheers,
Alex.
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.