Skip to content

A new fix: added access check during recursive directory traversal an… #40

A new fix: added access check during recursive directory traversal an…

A new fix: added access check during recursive directory traversal an… #40

Triggered via push October 8, 2024 16:06
Status Failure
Total duration 47s
Artifacts 1

tests.yml

on: push
docker-build
34s
docker-build
Matrix: composer-normalize
Matrix: composer-require-checker
Matrix: composer-unused
Matrix: composer-validate
Matrix: linter
Matrix: mutation-tests
Matrix: refactoring
Matrix: static-analysis
Matrix: unit-tests
Fit to window
Zoom out
Zoom in

Annotations

1 error and 10 warnings
unit-tests (8.3)
Process completed with exit code 1.
mutation-tests (8.3): src/Action.php#L28
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ if (!\extension_loaded('zip')) { throw new \Exception('ZIP extension is not loaded'); } - $directory = (string) $this->configuration->get('build.directory'); + $directory = $this->configuration->get('build.directory'); if (is_dir($directory)) { throw new \Exception('Directory "' . $directory . '" is already exists'); }
mutation-tests (8.3): src/Action.php#L36
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ throw new \Exception('Directory "' . $directory . '" is already exists'); } // rights - mkdir($directory, 0755, true); + mkdir($directory, 492, true); $ignore = new IgnoreFile(); $zip = new \ZipArchive(); if ($zip->open((string) $this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) {
mutation-tests (8.3): src/Action.php#L41
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ mkdir($directory, 0755, true); $ignore = new IgnoreFile(); $zip = new \ZipArchive(); - if ($zip->open((string) $this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) { + if ($zip->open($this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) { throw new \Exception('Failed to create zip archive'); } $rootDirectory = $this->configuration->getRootDirectory();
mutation-tests (8.3): src/Action.php#L47
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ throw new \Exception('Failed to create zip archive'); } $rootDirectory = $this->configuration->getRootDirectory(); - if (is_dir($rootDirectory) && is_readable($rootDirectory) && is_writable($rootDirectory)) { + if ((is_dir($rootDirectory) || is_readable($rootDirectory)) && is_writable($rootDirectory)) { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $path) { /**
mutation-tests (8.3): src/Action.php#L47
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ throw new \Exception('Failed to create zip archive'); } $rootDirectory = $this->configuration->getRootDirectory(); - if (is_dir($rootDirectory) && is_readable($rootDirectory) && is_writable($rootDirectory)) { + if (is_dir($rootDirectory) && is_readable($rootDirectory) || is_writable($rootDirectory)) { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $path) { /**
mutation-tests (8.3): src/Action.php#L54
Escaped Mutant for Mutator "Foreach_": --- Original +++ New @@ @@ $rootDirectory = $this->configuration->getRootDirectory(); if (is_dir($rootDirectory) && is_readable($rootDirectory) && is_writable($rootDirectory)) { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST); - foreach ($iterator as $path) { + foreach (array() as $path) { /** * @var \SplFileInfo $path */
mutation-tests (8.3): src/Action.php#L75
Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace(\DIRECTORY_SEPARATOR . $rootDirectory, '', $path->getPathname())); } } }
mutation-tests (8.3): src/Action.php#L75
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace(\DIRECTORY_SEPARATOR, '', $path->getPathname())); } } }
mutation-tests (8.3): src/Action.php#L75
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace($rootDirectory, '', $path->getPathname())); } } }
mutation-tests (8.3): src/Action.php#L75
Escaped Mutant for Mutator "UnwrapStrReplace": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), $path->getPathname()); } } }

Artifacts

Produced during runtime
Name Size
rosven9856~composer-package-action~RVVIHL.dockerbuild Expired
46.9 KB