瀏覽代碼

Merge pull request #3688 from jeremy-derusse/improve-selfupdate-chmod

Reuse current file permissions in selfupdate
Jordi Boggiano 10 年之前
父節點
當前提交
27ce5ec336
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Command/SelfUpdateCommand.php

+ 1 - 1
src/Composer/Command/SelfUpdateCommand.php

@@ -173,7 +173,7 @@ EOT
     protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)
     {
         try {
-            @chmod($newFilename, 0777 & ~umask());
+            @chmod($newFilename, fileperms($localFilename));
             if (!ini_get('phar.readonly')) {
                 // test the phar validity
                 $phar = new \Phar($newFilename);