Encrypting from web form to file: permissions error
Parker Morse
morse at sinauer.com
Thu Apr 29 17:38:27 CEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm working on encrypting the output of a form on our website to a
file, with the idea of then downloading the files from the web server
and decrypting locally. I'm using PHP, like so (edited and line-wrapped
for email):
shell_exec("echo $for_encryption | /usr/bin/gpg -e --no-secmem-warning
- -ao \
/path/to/file.asc -r \"Keyname\"");
I have successfully taken form output and encrypted it to an email
message with a different form of this command. However, the line above
now generates this error in the server error log:
gpg: fatal: /root/.gnupg: can't create directory: Permission denied
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/16384
...and the output of the shell_exec() above is nothing.
Now, PHP is running as "nobody", so I'm not surprised that it can't
create a directory in /root/. But why does it feel that it needs to?
Isn't ~/.gnupg enough? How can I fix this?
If this is a PHP problem, not a GPG problem, please let me know.
Thanks in advance,
pjm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQFAkSF4nRVGoRROKxIRAkvrAJ4xt4lyqz+1aLV/NaTLyWSbUifNnQCfVD2Y
Wpm7QaFA8Jv/Ywc3+x6RKQs=
=zOT+
-----END PGP SIGNATURE-----
More information about the Gnupg-users
mailing list