From 04f0ecfc0128f2934c31e77d9355e5b10d6a82d7 Mon Sep 17 00:00:00 2001 From: Beau Simensen Date: Thu, 9 Feb 2012 10:21:16 -0800 Subject: [PATCH 1/2] Change permission of bin links if they exist and are already links --- src/Composer/Installer/LibraryInstaller.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index db2fe535b..fe135159d 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -147,6 +147,12 @@ class LibraryInstaller implements InstallerInterface foreach ($package->getBinaries() as $bin) { $link = $this->binDir.'/'.basename($bin); if (file_exists($link)) { + if (is_link($link)) { + // likely leftover from a previous install, make sure + // that the target is still executable in case this + // is a fresh install of the vendor. + chmod($link, 0777); + } $this->io->write('Skipped installation of '.$bin.' for package '.$package->getName().', name conflicts with an existing file'); continue; } From 3cbbe1fd823d2ab29e64c34a505f85bbfabdb92a Mon Sep 17 00:00:00 2001 From: Beau Simensen Date: Thu, 9 Feb 2012 14:18:25 -0800 Subject: [PATCH 2/2] No need for group or world write permissions. --- src/Composer/Installer/LibraryInstaller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index fe135159d..0873ed63c 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -151,7 +151,7 @@ class LibraryInstaller implements InstallerInterface // likely leftover from a previous install, make sure // that the target is still executable in case this // is a fresh install of the vendor. - chmod($link, 0777); + chmod($link, 0755); } $this->io->write('Skipped installation of '.$bin.' for package '.$package->getName().', name conflicts with an existing file'); continue; @@ -162,14 +162,14 @@ class LibraryInstaller implements InstallerInterface // add unixy support for cygwin and similar environments if ('.bat' !== substr($bin, -4)) { file_put_contents($link, $this->generateUnixyProxyCode($bin, $link)); - chmod($link, 0777); + chmod($link, 0755); $link .= '.bat'; } file_put_contents($link, $this->generateWindowsProxyCode($bin, $link)); } else { symlink($bin, $link); } - chmod($link, 0777); + chmod($link, 0755); } }