On Saturday, February 15, 2003, at 08:17  PM, John Lin wrote:

Hi list,

I have written a perl CGI script that basically executes a system command via an open command like so:

open (COMHANDLE, '/usr/local/bin/gpg --no-tty --list-keys |') or die "can not list keys \n";
print <COMHANDLE>;
close (COMHANDLE) or die "can not close COMHANDLE \n";

For some reason, if I run this CGI script in the command line, it executes correctly (I get a list of keys in the shell).
But when i try to run this script in a browser, nothing is printed in the borwser.
i might suppose the user that the browser runs under doesn't have the same privileges as you do when you execute from the command line. Try giving the script world execute privilege.
as in 'chmod 755 <file>' or so.

I have also tried with a simpler script that basically gets the system date and output it like so:

open (COMHANDLE, 'date |') or die "Can not get system date \n";
print <COMHANDLE>;
close (COMHANDLE) or die "Can not close COMHANDLE \n";

But with this script, I can run it both in the shell and in a browser and I get the system date.
I am not really sure what the problem is at this time.... Any help is welcome!
and here i would guess the date command is good for any user.

Thank you all!

John
rda

Reply via email to