I am confused as to what the second line does in this snippet of code. $runas should be evaluated to the user's uid i think. What does the $< do? This is contained in a CGI script.
my $runAS = (getpwnam("username"))[2];
$runAS = $< if ($runAS == 0);
$<
is a special variable in perl:
The real uid of this process. You can change both the real uid and the effective uid at the same time by using POSIX::setuid() . Since changes to $< require a system call, check $! after a change attempt to detect any possible errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With