Bug 246588 - php-pear 1.6.x update
php-pear 1.6.x update
Product: Fedora
Classification: Fedora
Component: php-pear (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Joe Orton
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-07-03 04:59 EDT by Joe Orton
Modified: 2007-11-30 17:12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-26 07:55:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joe Orton 2007-07-03 04:59:02 EDT
Description of problem:
Update to 1.6.1 -- currently waiting on upstream providing a new .phar.
Comment 1 Remi Collet 2007-07-03 06:27:50 EDT
Some comments (i use latest pear for a while).

1/ install-pear-nozlib.phar only available for 1.5.4 (i'm used to create my own
for my need)

2/ It seems there is a problem when packaging extensions using PEAR 1.6.1 :

rpmbuild fails with an error :
download directory "/var/cache/php-pear" is not writeable.  Change download_dir
config variable to a writeable dir

So we need to investigate this before requiring devel update. For my latest
spec (php-pear-SOAP), i used :
%{__pear} -d download_dir=/tmp install --nodeps --packagingroot ...

This is a problem with new "pear" command which cause error when building RPM of
PEAR extension.

This problem is probably a pear regression (already encountered in an older
release, don't remenber witch one, i must search in my old specs).

We could investigate various solutions
- change all pear extensions spec file :(
- change permission on download_dir : world writable :(
- remove download_dir from pear.conf (it will then use /tmp, to be verified)
- file an upstream bug, as it seems to be a regression, and the download_dir not
used during "rpmbuild" (offline install)

Comment 2 Joe Orton 2007-07-03 06:38:21 EDT
IIRC the way PEAR uses temp files in the download_dir is not safe against
symlink attacks, so it can't be world-writable nor be /tmp by default (not that
those would those be otherwise desirable).  Is pear actually trying to *use* the
download_dir is during the rpmbuild, or is it just checking whether it's
writable then failing?
Comment 3 Remi Collet 2007-07-03 12:31:45 EDT
Pear don't use the download_dir during "rpmbuild" but only check for it (even
with --offline option).

This error is not present in 1.6.0
So i think it's a regression bug in 1.6.1

Full message is :
+ /usr/bin/pear install --offline --nodeps --packagingroot
/var/tmp/php-pear-Log-1.9.11-1.fc8-root-extras Log.xml
download directory "/var/cache/php-pear" is not writeable.  Change download_dir
config variable to a writeable dir
Cannot download non-local package "Log.xml"
Package "Log.xml" is not valid
install failed
Error occur in function getDownloadDir (/usr/share/pear/PEAR/Downloader.php)

--- PEAR-1.6.0/Downloader.php   2007-07-03 18:00:14.000000000 +0200
+++ PEAR-1.6.1/Downloader.php   2007-07-03 18:00:51.000000000 +0200
@@ -689,7 +689,8 @@
             $this->log(3, '+ tmp dir created at ' . $downloaddir);
         if (!is_writable($downloaddir)) {
-            if (PEAR::isError(System::mkdir(array('-p', $downloaddir)))) {
+            if (PEAR::isError(System::mkdir(array('-p', $downloaddir))) ||
+                  !is_writable($downloaddir)) {
                 return PEAR::raiseError('download directory "' . $downloaddir .
                     '" is not writeable.  Change download_dir config variable
to ' .
                     'a writeable dir');
Comment 4 Joe Orton 2007-07-03 16:12:07 EDT
OK, I guess we can just patch that out then.  Can you chase this upstream, Remi?
Comment 5 Remi Collet 2007-07-04 00:17:16 EDT
Bug reported upstream :
Comment 6 Remi Collet 2007-07-04 00:26:09 EDT
Another Bug of interest for this release :

It seems we could register PECL extensions (as PEAR extensions).
This will requires a "PHP Guidelines" update.
I've post on fedora-php-devel ML about this and i'm waiting for feedback.

Comment 7 Joe Orton 2007-07-26 07:55:49 EDT
Fixed in devel branch by Remi.

Note You need to log in before you can comment on or make changes to this bug.