Ahh yes. Wise question Anonymous One. Perl is far beyond using function calls for this. Why use function calls when we have variables like $< and $> ?!?!
$< or $UID
"The real user ID of this process."
$>
$EUID
"The effective uid of this process"
Thus speaks the Holy Camel Book of Knowledge Light of the World.
so...
$< = $> #set real to effective uid
($<,$>) = ($>,$<); #swap real and effective uid
Obviously, these require you to be running setuid.Go and rejoice in your new learning.
---
crulx
crulx@iaxs.net | [reply] [d/l] |
my $form_variable = param("form_variable");
`form_variable`;
I also will prevent users from uploading form variables which contain values other than letters and numbers. Just to be safe, I may also ban words like 'eval' and 'system' from form variables along with parentheses and backticks. | [reply] [d/l] |
Yes indeed. Perl does this with special variables instead of with function calls. The real uid is $<, and the effective uid is $>.
Here's the Perl equivalent of your C statement:
$> = $<; # set effective uid to real uid
See the docs for more examples, as well as the variables for gid. | [reply] [d/l] [select] |