Cant create directory error

Peter Jones pete at petesplace.id.au
Sun Apr 24 08:37:14 CEST 2005


On Thu, 21 Apr 2005 03:26 am, Carlos M wrote:
> Hi there im having problems trying to decrypt a message using PHP or
> Perl. When i run the perl script directly from the linux bash it works
> just fine, but when i run the script from the browser it doesnt work.
> Checkin the apache logs it says:
>
> Name "main::passphrase" used only once: possible typo at
> /usr/local/apache/cgi-bin/decrypt.pl line 10.
> gpg: fatal: ~/.gnupg: can't create directory: No such file or directory
>
> I create the keys using root as user. I got the .gnupg directory on
> /root with the correct keys in there. I have the correct keys in my
> local repository. I dont know what im doing wrong.

I cannot see any other responses [possibly because the Reply-to on your 
message doesn't seem to be configured correctly??] to this so I'll give 
it a shot.

It is almost certain that apache is not running as root (and if it *is*, 
it is a very bad security risk!)

Chances are it will be running as either user "apache", or as "nobody"; 
you will need to check your httpd.conf file to be sure.  Apache, 
therefore, calls your cgi script as this user, and your script calls gpg 
as this user.  gpg then tries to create ~/.gnupg -- and either the user 
home directory doesn't exist, or (for various security reasons) apache 
does not have wtrite access to it.

Best bet is to create a .gnupg file somewhere apache can find it, then in 
your script use "gpg --options /path/to/.gnupg" to specify the correct 
options file for it to use...

(Additionally I'd investigate that main::passphrase warning if I were 
you! ;-))

HTH,
Pete.



More information about the Gnupg-users mailing list