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

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'm not too familiar with GPG - but assume that it's fairly similar to the command-line PGP, and that --list-keys lists the public keys on *your* keychain.

The web server is not running as you; it typically runs as "nobody". On OS X, it runs as the user "www". In either case, if that user doesn't have a keychain, GPG won't have any keys to list.

The solution to this is to give the web server user a keychain. "Service" users such as "nobody", "www", "mysql" and others often don't have a home directory. You'll either have to create one, or if there's a command-line switch to tell GPG where to find its keychain, use that.

sherm--

If you listen to a UNIX shell, can you hear the C?



Reply via email to