Commit e93fbeb8 authored by anarcat's avatar anarcat Committed by Antoine Beaupre

#693966 - do not opendir() without a closedir() in recursive calls

this fixes a regression introduced in d8554cf433ddb0b665e05b143a28fac429196535
parent a48cda86
......@@ -371,7 +371,7 @@ function _provision_call_recursive($func, $path, $arg) {
$status = 1;
// do not follow symlinks as it could lead to a DOS attack
// consider someone creating a symlink from files/foo to ..: it would create an infinite loop
if ($dh = @opendir($path) && !is_link($path)) {
if (!is_link($path) && ($dh = @opendir($path))) {
while (($file = readdir($dh)) !== false) {
if ($file != '.' && $file != '..') {
$status = _provision_call_recursive($func, $path . "/" . $file, $arg) && $status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment