1
0
Fork 0

Fix source binaries not being made executable when symlinks cannot be used, fixes #9961

pull/9975/head
Jordi Boggiano 2021-06-09 16:21:19 +02:00
parent 2d54a27ebc
commit bf3713072c
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 2 deletions

View File

@ -95,7 +95,7 @@ class BinaryInstaller
} elseif ($this->binCompat === "symlink") { } elseif ($this->binCompat === "symlink") {
$this->installSymlinkBinaries($binPath, $link); $this->installSymlinkBinaries($binPath, $link);
} }
Silencer::call('chmod', $link, 0777 & ~umask()); Silencer::call('chmod', $binPath, 0777 & ~umask());
} }
} }
@ -149,7 +149,6 @@ class BinaryInstaller
// add unixy support for cygwin and similar environments // add unixy support for cygwin and similar environments
if ('.bat' !== substr($binPath, -4)) { if ('.bat' !== substr($binPath, -4)) {
$this->installUnixyProxyBinaries($binPath, $link); $this->installUnixyProxyBinaries($binPath, $link);
@chmod($link, 0777 & ~umask());
$link .= '.bat'; $link .= '.bat';
if (file_exists($link)) { if (file_exists($link)) {
$this->io->writeError(' Skipped installation of bin '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed'); $this->io->writeError(' Skipped installation of bin '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed');
@ -157,6 +156,7 @@ class BinaryInstaller
} }
if (!file_exists($link)) { if (!file_exists($link)) {
file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link)); file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link));
Silencer::call('chmod', $link, 0777 & ~umask());
} }
} }
@ -170,6 +170,7 @@ class BinaryInstaller
protected function installUnixyProxyBinaries($binPath, $link) protected function installUnixyProxyBinaries($binPath, $link)
{ {
file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)); file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link));
Silencer::call('chmod', $link, 0777 & ~umask());
} }
protected function initializeBinDir() protected function initializeBinDir()