Skip to content

Commit

Permalink
report error if binary is a directory (#10463)
Browse files Browse the repository at this point in the history
file_exists is true also for directory and symlink. but later in generateUnixyProxyCode we call `file_get_contents` on the binary, which fails with `file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory` if the binary is a directory.
  • Loading branch information
dbu committed Jan 21, 2022
1 parent af60130 commit 6b8f140
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Composer/Installer/BinaryInstaller.php
Expand Up @@ -77,6 +77,10 @@ public function installBinaries(PackageInterface $package, $installPath, $warnOn
$this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>');
continue;
}
if (is_dir($binPath)) {
$this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': found a directory at that path</warning>');
continue;
}
if (!$this->filesystem->isAbsolutePath($binPath)) {
// in case a custom installer returned a relative path for the
// $package, we can now safely turn it into a absolute path (as we
Expand Down

0 comments on commit 6b8f140

Please sign in to comment.