DelphiFAQ Home Search:

Error message "GnuPG has not been setup on your account"

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

I call gpg from a CGI script and it does report:

"GnuPG has not been setup on your account. Use the form below to create a new GnuPG private key, which you will need for encryption and signing."

In fact, I created several keys already from the command line. If I type
gpg --list-keys

it will show me these keys. Issuing the same command from the CGI script returns no output. My web server runs as root, I run webmin's miniserver.

Answer:

Try issuing gpg --help from your CGI code. I did this and it reported ~/.gnupg to be the home directory.
This is valid from the command line where the ~ gets expanded properly but does not work in the CGI environment.
To enumerate keys in your CGI code, add the parameter to explicitely set the home directory, without using the ~ character, as shown below.

The code shown here will force gpg to use one central repository, independent from the current login/ current remote user name.

$cmd = "$gpgpath  --homedir /home/myname/.gnupg/ --list-keys";
$answer = `$cmd`;

Comments:

2012-06-05, 21:31:32
anonymous from China  
<strong> http://www.coachout..strong> <a href=' http://www.coachout..g>Coach Outlet Online</strong></a><br />
<strong> http://www.coachfac..strong> <a href=' http://www.coachfac..g>Coach Factory</strong></a><br />
<strong> http://www.myloveco..strong> <a href=' http://www.myloveco..g>Coach Outlet Online</strong></a><br />
<strong> http://www.buyincoa..strong> <a href=' http://www.buyincoa..g>Coach Outlet</strong></a><br />
<strong> http://www.cheapcoa..strong> <a href=' http://www.cheapcoa..g>Cheap Coach Handbags</strong></a><br />
<strong> http://www.coachfac..strong> <a href=' http://www.coachfac..g>Coach Factory Outlet</strong></a><br />
<strong> http://www.buycoach..strong> <a href=' http://www.buycoach..g>Coach Outlet Online</strong></a><br />
<strong>www.coachoutletonfactory.net</strong> <a href=' http://www.coachout..g>Coach Factory Outlet</strong></a><br />
<strong>www.coachoutletonline4you.us</strong> <a href=' http://www.coachout..g>Coach Outlet Online</strong></a><br />
<strong>coachfactoryoutletq.net</strong> <a href=' http://www.coachfac..g>Coach Factory</strong></a><br />
<strong>gotocoachoutlets.net</strong> <a href=' http://www.gotocoac..g>Coach Outlet Online</strong></a><br />
2012-11-12, 01:57:40
coach001 from United Kingdom  

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: