Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: HTTP/CGI Backup interface w/Perl

by sauoq (Abbot)
on Jun 10, 2003 at 00:03 UTC ( #264495=note: print w/replies, xml ) Need Help??


in reply to HTTP/CGI Backup interface w/Perl

#!/usr/bin/perl $|++; my @files = qw( /home/sauoq ); print "Content-type: application/x-tar\n\n"; system( "tar cvf - @files" );
-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: HTTP/CGI Backup interface w/Perl
by dash2 (Hermit) on Jun 10, 2003 at 00:21 UTC
    Yup. Don't do anything silly like system("tar cvf - $my_user_input_from_a_form");, unless you want to hand out tar files of your server's passwords, though.

    andramoiennepemousapolutropon

      This is very good advice and I was remiss in not noting such myself. That said, you should also know that, if you did so, you might risk a whole lot worse than the loss of your password file. It would permit a user to run any arbitrary command on your system with privileges the same as those that the cgi script runs with.

      Know the risks, understand the issues, and use the -T option to help you catch dangerous code.

      -sauoq
      "My two cents aren't worth a dime.";
      

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-12-03 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?