瀏覽代碼

Fix permissions when using the PearBinaryInstaller

The PearBinaryInstaller is old and not used by many people, so the
world writable permissions weren't caught
Patrick Rose 7 年之前
父節點
當前提交
b90987fdeb
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Installer/PearBinaryInstaller.php

+ 2 - 2
src/Composer/Installer/PearBinaryInstaller.php

@@ -61,9 +61,9 @@ class PearBinaryInstaller extends BinaryInstaller
     {
         parent::initializeBinDir();
         file_put_contents($this->binDir.'/composer-php', $this->generateUnixyPhpProxyCode());
-        @chmod($this->binDir.'/composer-php', 0777);
+        @chmod($this->binDir.'/composer-php', 0777 & ~umask());
         file_put_contents($this->binDir.'/composer-php.bat', $this->generateWindowsPhpProxyCode());
-        @chmod($this->binDir.'/composer-php.bat', 0777);
+        @chmod($this->binDir.'/composer-php.bat', 0777 & ~umask());
     }
 
     protected function generateWindowsProxyCode($bin, $link)