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

Bug #17067 PHP's "install-pear-installer" writes stuff all over the place
Submitted: 2010-02-05 06:05 UTC
From: macphp Assigned:
Status: No Feedback Package: PEAR (version 1.9.0)
PHP Version: 5.3.1 OS: Mac OS X 10.6
Roadmaps: (Not assigned)    
Subscription  


 [2010-02-05 06:05 UTC] macphp (Mac Php)
Description: ------------ As part of PHP's "make install", make apparently defines INSTALL_ROOT as part of the environment and eventually invokes "install-pear-installer". This target calls invokes the newly built CLI: $(build_dir)/sapi/cli/php -n -dshort_open_tag=0 -dsafe_mode=0 - dopen_basedir= -derror_reporting=1803 -dmemory_limit=- 1 -ddetect_unicode=0 pear/install-pear-nozlib.phar -d "/usr/lib/php" -b "/usr/bin" -dp a -ds a This generates permissions failures writing to /usr/lib/php instead of $(INSTALL_ROOT)/usr/lib/php. As an experiment, I changed the invocation to "-d $(INSTALL_ROOT)/usr/lib/php" and found a bunch of files written to $(INSTALL_ROOT)/usr/lib/php, some to $(INSTALL_ROOT)$(INSTALL_ROOT)/usr/lib/php, some to $(INSTALL_ROOT) AND to /usr/lib/php (i.e., my root volume). I have tried various tweaks inside the phar, but it only makes things worse. Hopefully the resulting "ls" output will be obvious to someone more familar with the code. $(INSTALL_ROOT)$(INSTALL_ROOT)/usr/lib/php: .channels/ .lock OS/ Structures/ doc/ .depdb .registry/ PEAR/ System.php pearcmd.php .depdblock Archive/ PEAR.php XML/ peclcmd.php .filemap Console/ PEAR5.php data/ test/ $(INSTALL_ROOT)/usr/lib/php: .depdb .depdblock build/ extensions/ $(INSTALL_ROOT): .channels/ .depdblock .lock .depdb .filemap .registry/ /usr/lib/php: .lock extensions/ (maybe) Expected result: ---------------- I expected everything to be properly placed into INSTALL_ROOT (or in the second example, INSTALL_ROOT/INSTALL_ROOT). Actual result: -------------- Files were put all over the file system, resulting in a build failure when the package was built by an unprivileged user or with /usr/lib/php mounted read-only.

Comments

 [2010-12-02 10:57 UTC] macphp (Mac Php)
 [2010-12-02 10:57 UTC] macphp (Mac Php)
I've attached a patch which addresses most but not all of the issues.
 [2011-02-19 16:35 UTC] macphp (Mac Php)
Some additional debugging information... If /usr/lib/php is essentially empty, the INSTALL_ROOT-style build works properly with the attached patch. However, if dot files and directories are present in /usr/lib/php (e.g., a previous PEAR install) but read access to the directory has been denied (using Mac OS X's sandbox-exec), I get the following error: ------ Warning: touch(): Unable to create file /usr/lib/php/.lock because Operation not permitted in phar:///private/tmp/apache_mod_php.roots/apache_mod_php~obj/Build/php/pear/install-pear-nozlib.phar/PEAR/Registry.php on line 835 ------ In such a case, the .lock file does NOT exist in /usr/lib/php.
 [2011-11-10 04:19 UTC] boobaa (Csécsy László)
Thanks, this helped me to compile php-5.2.17 (sic) for Frugalware.
 [2011-12-10 17:00 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
This patch won't cleanly apply - is it still valid against the git version?
 [2014-06-07 03:23 UTC] cweiske (Christian Weiske)
-Status: Feedback +Status: No Feedback