Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.9

Request #17005 Add ability to specify keyring files manually
Submitted: 2010-01-18 02:49 UTC
From: gauthierm Assigned: gauthierm
Status: Closed Package: Crypt_GPG (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2010-01-18 02:49 UTC] gauthierm (Michael Gauthier)
Description: ------------ Hi, I am working with your PEAR package Crypt_GPG and find it very helpful. Thank you! I did have a problem with it, for which I prepared a patch that I hope you will include with your next release. The problem was that I am running a web application which includes a GPG public keyring as one of the application files. The application files, though, are in directories that are not writable by the webserver (Apache) and I do not want the webserver to be able to write files where my application lives.. So my problem was that if I specified 'homedir' in the constructor, then when GPG ran, it would try to create temporary files and random seed files, etc inside my application directories, permission to do so would be denied, and GPG would fail to be able to do any action such as addEncryptKey() or encrypt(). My solution was to add another valid constructor option for "keyring" that corresponds to the --keyring option of GPG. This allows you to specify the exact location of the keyring, so GPG does not have to assume it is in the homedir. That means you can specify /tmp as the homedir so that GPG can write all its little temporary files without littering your application directory. I also added --no-random-seed-file, --no-default-keyring and --no-options to the arguments list that are always given in _openSubprocess(). Attached is the patch to Engine.php. I hope you would look it over and let me know if it would be acceptable to merge in to your official release, or if there's anything you would want me to do to fix it to conform to your standards. Thanks, Allen Lee

Comments

 [2010-01-18 02:50 UTC] gauthierm (Michael Gauthier)
 [2010-02-27 07:11 UTC] gauthierm (Michael Gauthier)
-Status: Open +Status: Closed -Assigned To: +Assigned To: gauthierm
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Committed in SVN in http://svn.php.net/viewvc?view=revision&revision=290500
 [2010-02-27 07:12 UTC] gauthierm (Michael Gauthier)