You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JENKINS-49971] hudson.Util.loadFile() has a race condition #22627
Util.loadFile() first checks if the file exists via File.exists(). It then tries to open the file for reading. However, it is possible for the file to be deleted between the existence check and the file-open operation, in which case the method throws a FileNotFoundException rather than returning an empty string.
Util.loadFile() first checks if the file exists via File.exists(). It then tries to open the file for reading. However, it is possible for the file to be deleted between the existence check and the file-open operation, in which case the method throws a FileNotFoundException rather than returning an empty string.
If the file is deleted in between when its existence is checked and the
file is opened for reading, then the method will fail to return an empty
string.
Switch to using FileUtils.readFileToString()
(cherry picked from commit aaae71af4bd2952efdc3462fde086faa6a604ee2)
If the file is deleted in between when its existence is checked and the
file is opened for reading, then the method will fail to return an empty
string.
Activity
jenkins-infra-bot commentedon Mar 7, 2018
dtrebbien:
Raw content of original comment:
#3225
jenkins-infra-bot commentedon Mar 11, 2018
Raw content of original comment:
The patch has been integrated towards 2.111
jenkins-infra-bot commentedon Mar 25, 2018
Raw content of original comment:
If the file is deleted in between when its existence is checked and the file is opened for reading, then the method will fail to return an empty string.
(cherry picked from commit aaae71af4bd2952efdc3462fde086faa6a604ee2)
Compare: 115612b...aa799e3
Code changed in jenkins
User: Daniel Trebbien
Path:
core/src/main/java/hudson/Util.java
http://jenkins-ci.org/commit/jenkins/aa799e39ad904183d1da3105b8b3267c7348cd71
Log:
JENKINS-49971Fix a race condition in Util.loadFile() (#3225)If the file is deleted in between when its existence is checked and the
file is opened for reading, then the method will fail to return an empty
string.
(cherry picked from commit aaae71a)
Compare: 115612b...aa799e3