Hello, this is my very first post on this site. I'm having a problem trying to pscp some files to my computer. When I run the command formed with the parameters I got from the web form in the command prompt, it works great. But running the cgi - script gives me the error of "Insecure dependency in system while running with -T switch at...".
This is the code for my cgi - script:
#!/perl/bin/perl -wT
use CGI qwstandard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
$ENV{'PATH'} = 'C:\\Temp\\';
#Declare the variables
my $result;
my $staging_area = param('staging');
my $directory = param('directory');
my $user_id = param('userid');
my $passwd = param('passwd');
my $store = param('store');
#Attach the store directory to the diectory variable
$directory = $directory . "/" . $store;
#Set the directory where pscp.exe resides
my $pscp_dir = 'C:\\Temp\\';
#Construct the pscp command with the right arguments
my $command = $pscp_dir . "pscp.exe -pw " . $passwd . " " . $user_id . "@" . $staging_area . ":" . $directory . "/" . $store . "*.tgz " . $pscp_dir;
#Execute the command
system($command);
if ( $? == -1 )
{
$result = "command failed: $!\n";
}
print header;
print start_html("Thank You");
print h2("Thank You");
print "$result<br>\n";
print end_html;
I'm running the script in a windows server, that is why I'm using pscp. I did some testing "printing" the result command and I tried that in the command prompt and worked with no problem. I think the problem might be the user the cgi-script is running and not having permission to write on my directory. Do you know how can I solve that issue?
Thanks
This is the code for my cgi - script:
#!/perl/bin/perl -wT
use CGI qwstandard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
$ENV{'PATH'} = 'C:\\Temp\\';
#Declare the variables
my $result;
my $staging_area = param('staging');
my $directory = param('directory');
my $user_id = param('userid');
my $passwd = param('passwd');
my $store = param('store');
#Attach the store directory to the diectory variable
$directory = $directory . "/" . $store;
#Set the directory where pscp.exe resides
my $pscp_dir = 'C:\\Temp\\';
#Construct the pscp command with the right arguments
my $command = $pscp_dir . "pscp.exe -pw " . $passwd . " " . $user_id . "@" . $staging_area . ":" . $directory . "/" . $store . "*.tgz " . $pscp_dir;
#Execute the command
system($command);
if ( $? == -1 )
{
$result = "command failed: $!\n";
}
print header;
print start_html("Thank You");
print h2("Thank You");
print "$result<br>\n";
print end_html;
I'm running the script in a windows server, that is why I'm using pscp. I did some testing "printing" the result command and I tried that in the command prompt and worked with no problem. I think the problem might be the user the cgi-script is running and not having permission to write on my directory. Do you know how can I solve that issue?
Thanks