[comp.lang.perl] setuid perl scripts...

clewis@eci386.uucp (Chris Lewis) (05/29/90)

I note that on System V, the following:

	$< = $>;	# set real id to effective id

Dies with the message:

	setruid() not implemented at t.p line 1.

Yes, I know all about set?uid not being available on System V.
But, Larry, could you detect situations such as this and issue
"setuid()"'s instead?

The rules would be something like:

    if (no set?uid) {
	1) if you're trying to set effective to be the same as
	   real, do it with setuid.
	2) if you're trying to set real to be the same as effective
	   and your effective is root, do it with setuid.
    } else {
	as it is now
    }

T'would be nice to allow setting both effective and real to be some other
uid when you're effective root, but I imagine that it might be kind of
difficult to detect that both of them are going to be set.  Alternately, 
always do it with setuid and rely on the user's program to check to make
sure that the correct results were obtained by reading $< and/or $> - this
would warrant a note in the perl manual.

T'would be nice if this worked with groups too....

Thanks,
-- 
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list