in reply to Module works when run in a shell, but not when run as a CGI

Hi,

Make sure that Apache/httpd has permissions to the directory/files where gpg key is imported (keyrings). When you import keys to keyring, you can specify the directory where the keyring file(s) need to reside.

Cheers!

--VC

There are three sides to any argument.....
your side, my side and the right side.

  • Comment on Re: Module works when run in a shell, but not when run as a CGI

Replies are listed 'Best First'.
Re^2: Module works when run in a shell, but not when run as a CGI
by azureblue (Initiate) on Jul 20, 2007 at 12:20 UTC
    Now we're onto something. The permissions look OK to me, but:
    print `/usr/bin/gpg --home /path/to/keys --list-keys`;
    ...doesn't produce any output. I need to check more carefully. Thanks for the suggestion.

      Hi,

      It looks like you are passing the wrong "path/to/key" or imported keys to wrong path. One important thing is, apache won't access the directories outside the document-root directly by default. In such case, you can try giving symbolic link under document root to the "path/to/key"

      --VC

      There are three sides to any argument.....
      your side, my side and the right side.

        OK, getting very close now. /path/to/keys is accessible and readable, but not writable (for good reason!). However, temporary files are (failing to be) created in that directory, as revealed by:
        print `/usr/bin/gpg --home /path/to/keys --list-keys 2>&1`;
        Which outputs:
        gpg: failed to create temporary file `/path/to/keys/.#lk0x91f5268.host +name.24199': Permission denied gpg: fatal: can't create lock for `/pa +th/to/keys/trustdb.gpg'
        I think I can take it from here. Thanks for the suggestions.