Re: Perl Help!!!

Raj Mathur <[email protected]> Tue, 31 Aug 2004 20:18:46 +0530
Newsgroups gmane.user-groups.linux.delhi.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Dhruv" == Dhruv Soi <dhruvs-g/icWj5ZvQOxIBOabOT86AC/[email protected]> writes:

    Dhruv> Hi All I have written a script that has cgi interface and
    Dhruv> requires root rights to achieve the task. When i run that
    Dhruv> script from command line it works fine but when i use cgi
    Dhruv> it doesn't work as Apache is not running as root user which
    Dhruv> i even don't want to run using root user.

    Dhruv> I tried chown u+s scriptname.cgi .....but no help Secondly
    Dhruv> i tried sudo and kept apache in sudoers but the script
    Dhruv> stops for password prompt....Then i tried Perl::expect
    Dhruv> module but from cgi even thats not working....Any
    Dhruv> pointers???

    Dhruv> I know there is some way out to run perl scripts as root
    Dhruv> but don't know what exactly that way is.....

Just use suidperl and make the script SUID.  Be very sure you are
religiously cleaning all input parameters you receive before you use
them, and check for security vulnerabilities 382 times before putting
the script into production.

Regards,

- -- Raju
- -- 
Raj Mathur                [email protected]      http://kandalaya.org/
       GPG: 78D4 FC67 367F 40E2 0DD5  0FEF C968 D0EF CC68 D17F
                      It is the mind that moves
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFBNI/EyWjQ78xo0X8RAj6GAJ4h37cOveoDXl2vnpVizwiJr9E9VACcDWHj
XWqplj8n2hRxb6OrlRn8xng=
=1DaF
-----END PGP SIGNATURE-----