Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: changing uid/gid in suid cgi script

by ncw (Friar)
on Sep 06, 2001 at 12:11 UTC ( [id://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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-05-21 23:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found