Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SCA with Php Inspections (EA Extended) #24960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Php Inspecions (EA Extended): rpotential race conditions cases fixed
  • Loading branch information
kalessil committed Nov 13, 2017
commit ddbb184d467de550bda935370f48ea6a6523e957
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Cache/Traits/PhpArrayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function warmUp(array $values)

$tmpFile = uniqid($this->file, true);

file_put_contents($tmpFile, $dump);
file_put_contents($tmpFile, $dump, LOCK_EX);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is wrong: the file has a random name exactly to prevent the need for a lock.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, new false-positive. I'll revert this one.

@chmod($tmpFile, 0666 & ~umask());
unset($serialized, $unserialized, $value, $dump);

Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/ClassLoader/ClassMapGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function dump($dirs, $file)
$maps = array_merge($maps, static::createMap($dir));
}

file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true)));
file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true)), LOCK_EX);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ public function setClassCache(array $classes)
@trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED);
}

file_put_contents(($this->warmupDir ?: $this->getCacheDir()).'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
file_put_contents(($this->warmupDir ?: $this->getCacheDir()).'/classes.map', sprintf('<?php return %s;', var_export($classes, true)), LOCK_EX);
}

/**
* @internal
*/
public function setAnnotatedClassCache(array $annotatedClasses)
{
file_put_contents(($this->warmupDir ?: $this->getCacheDir()).'/annotations.map', sprintf('<?php return %s;', var_export($annotatedClasses, true)));
file_put_contents(($this->warmupDir ?: $this->getCacheDir()).'/annotations.map', sprintf('<?php return %s;', var_export($annotatedClasses, true)), LOCK_EX);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ public function write($path, $locale, $data)
$data = preg_replace('/ /', ' ', $data);
$data = sprintf($template, $data);

file_put_contents($path.'/'.$locale.'.php', $data);
file_put_contents($path.'/'.$locale.'.php', $data, LOCK_EX);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.