1
0
Fork 0

report error if binary is a directory (#10463)

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.
pull/10477/head
David Buchmann 2022-01-21 14:52:39 +01:00 committed by GitHub
parent af6013093f
commit 6b8f1409e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,10 @@ class BinaryInstaller
$this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>'); $this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>');
continue; 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)) { if (!$this->filesystem->isAbsolutePath($binPath)) {
// in case a custom installer returned a relative path for the // in case a custom installer returned a relative path for the
// $package, we can now safely turn it into a absolute path (as we // $package, we can now safely turn it into a absolute path (as we