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

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.

Replies are listed 'Best First'.
Re^3: Module works when run in a shell, but not when run as a CGI
by atemon (Chaplain) on Jul 20, 2007 at 12:50 UTC

    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.

        Hi,

        Then create a "writable" directory in document root. put symbolic link to key ring file(s) in that directory. Give path to new directory as the path to key-ring :)

        Cheers!

        --VC

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