From 94cc36d12eff34a360702d9bb6ed93661c6dff11 Mon Sep 17 00:00:00 2001 From: James Healy Date: Thu, 1 Jul 2010 17:11:20 +1000 Subject: [PATCH] Fix a race condition in ONIX::Normaliser * closes #1 * reported by pixelvixen * to quote the report: "You will want to set the unlink_now option to true when you close the tempfile. The way it is right now, the file can actually be unlinked *after* you copy the old file to that location." --- CHANGELOG | 4 ++++ lib/onix/normaliser.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 20bb125..1b558f7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v0.8.3 (XXX) +- Fix for race condition in ONIX::Normaliser + - thanks to pixelvixen for reporting + v0.8.2 (6th May 2010) - fix APAProduct#series and APAProduct#series= diff --git a/lib/onix/normaliser.rb b/lib/onix/normaliser.rb index 2fdbefb..dc307f3 100644 --- a/lib/onix/normaliser.rb +++ b/lib/onix/normaliser.rb @@ -78,7 +78,7 @@ def app_available?(app) def next_tempfile p = nil Tempfile.open("onix") do |tf| - tf.close + tf.close! p = tf.path end p