From 57f76ceb65f06e21ee340724c4be45bdc78897d9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 12 Sep 2014 21:14:32 -0400 Subject: v5 v6: hub, /tmp processing directory checks --- lib/sisu/v5/hub.rb | 2 ++ lib/sisu/v6/hub.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index eda98084..0e90f21a 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -266,6 +266,8 @@ module SiSU rescue ensure if FileTest.directory?(@env.processing_path.processing) \ + and FileTest.directory?(@env.processing_path.processing_base_tmp) \ + and @env.processing_path.processing_base_tmp =~/#{@env.processing_path.processing}/ \ and @env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ FileUtils::cd(@env.processing_path.processing_base_tmp) do FileUtils::rm_rf('.') diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb index 2558a9db..41f8e930 100644 --- a/lib/sisu/v6/hub.rb +++ b/lib/sisu/v6/hub.rb @@ -266,6 +266,8 @@ module SiSU rescue ensure if FileTest.directory?(@env.processing_path.processing) \ + and FileTest.directory?(@env.processing_path.processing_base_tmp) \ + and @env.processing_path.processing_base_tmp =~/#{@env.processing_path.processing}/ \ and @env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ FileUtils::cd(@env.processing_path.processing_base_tmp) do FileUtils::rm_rf('.') -- cgit v1.2.3