in reply to changing uid/gid in suid cgi script
A note for anyone following along at home.
The poster has left out the fact that the script has
At the top. See perlvar for more info.use English;
Probably most perl programmers write the above snippet like this (with error checking too):-
At least that is how I would write it not being a big fan of use English!$( = $) = $new_gid; die "Failed to changed groupid to $new_gid: $!" if $) != $new_gid || $( != $new_gid; $< = $> = $new_uid; die "Failed to changed userid to $new_uid: $!" if $> != $new_uid || $< != $new_uid;
|
---|
In Section
Seekers of Perl Wisdom