Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: changing uid/gid in suid cgi script

by ncw (Friar)
on Sep 06, 2001 at 12:11 UTC ( #110520=note: print w/replies, xml ) Need Help??


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

use English;
At the top. See perlvar for more info.

Probably most perl programmers write the above snippet like this (with error checking too):-

$( = $) = $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;
At least that is how I would write it not being a big fan of use English!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://110520]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-01-20 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?