Bug #17817 [Opn->Csd]: File permissions error not handled when listing public keys
| From: | mike at silverorange dot com | Date: | Wed, 25 Aug 2010 13:59:41 +0000 |
| Subject: | Bug #17817 [Opn->Csd]: File permissions error not handled when listing public keys | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4674@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=17817&edit=1
ID: 17817
Updated by: mike@silverorange.com
Reported By: alec at alec dot pl
Summary: File permissions error not handled when listing
public keys
-Status: Open
+Status: Closed
Type: Bug
Package: Crypt_GPG
Package Version: SVN
PHP Version: Irrelevant
-Assigned To:
+Assigned To: gauthierm
Roadmap Versions:
New Comment:
-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.
Patch applied in revision 302771.
http://svn.php.net/viewvc?view=revision&revision=302771
Previous Comments:
------------------------------------------------------------------------
[2010-08-25 13:43:32] alec
Description:
------------
It happen to me once that --list-secret-keys was successful but
--list-public-keys encounters file permissions problem. It happens when
you have no access only for pubring file. Simple patch to trigger file
permissions exception also for public keys listing:
--- GPG.old 2010-08-19 22:18:05.000000000 +0200
+++ GPG.php 2010-08-25 15:38:27.020519615 +0200
@@ -728,6 +735,17 @@
case Crypt_GPG::ERROR_KEY_NOT_FOUND:
// ignore not found key errors
break;
+ case Crypt_GPG::ERROR_FILE_PERMISSIONS:
+ $filename = $this->engine->getErrorFilename();
+ if ($filename) {
+ throw new Crypt_GPG_FileException(sprintf(
+ 'Error reading GnuPG data file \'%s\'. Check to
make ' .
+ 'sure it is readable by the current user.',
$filename),
+ $code, $filename);
+ }
+ throw new Crypt_GPG_FileException(
+ 'Error reading GnuPG data file. Check to make GnuPG
data ' .
+ 'files are readable by the current user.', $code);
default:
throw new Crypt_GPG_Exception(
'Unknown error getting keys. Please use the \'debug\'
option ' .
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=17817&edit=1