in reply to Re: Re: GnuPG tie to gpg binary gives broken pipe error in CGI output
in thread GnuPG tie to gpg binary gives broken pipe error in CGI output

Update: While I can open and write to a file in the current (cgi) directory from within the program when running as a CGI, gpg as called from the CGI doesn't seem to write anything. I tried:
`gpg --export -a --batch -o /home/...../cgi-bin/NEW`;
but it only works on command line fwiw. I think I got it to do something a little while ago but it would only create a zero byte file.

I wonder how I'd go about trying to do this without using GnuPG or any other module, just the cgi talking to the binary..

Ah yes, I tried $gpg->export_keys( armor => 1, output => "keyring.pub" );
which creates a file in the appropriate place but one of zero bytes only. Permissions were cool.

Update: By cool I mean that it could write something. I could write successfully to files from the CGI. But it is not cool that only a zero byte file came out.. I tried it in different directories, and made a file chmod 777 in a 777 directory and gpg still wouldn't write to it from CGI. I have a whole application working on this system already so I don't think it is permissions.. I'm wondering if Io::Pipe will work.

  • Comment on Re: Re: Re: GnuPG tie to gpg binary gives broken pipe error in CGI output
  • Download Code

Replies are listed 'Best First'.
Re^4:GnuPG tie to gpg binary gives broken pipe error in CGI output
by robartes (Priest) on Mar 07, 2003 at 12:09 UTC
    Hmm, if this wasn't a file that the script exported itself, I would say that you do have write permission on the directory (hence the file creation succeeds) but not on the file itself (hence the 0 byte length). Perhaps your umask is too restrictive?

    CU
    Robartes-

Re: Re: Re: Re: GnuPG tie to gpg binary gives broken pipe error in CGI output
by bart (Canon) on Mar 09, 2003 at 14:03 UTC
    Update: While I can open and write to a file in the current (cgi) directory from within the program when running as a CGI, gpg as called from the CGI doesn't seem to write anything.
    Aha. The directory containing the CGI scripts isn't even supposed to be world writable, or Apache will even refuse to run them. Create a separate directory (it looks like you already did), make it writable for everybody (chmod 777), and chdir to it in your CGI script before calling the external program.