From cfc08acd15b51cfe1f650c23891ccb387390a95b Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Wed, 9 Nov 2016 16:42:55 +0100 Subject: [PATCH] avoid 'recursive_find' over directory symlink this could cause an endless recursion if a symlink pointed upwards in the file tree --- lib/cmdtest/fssnapshot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmdtest/fssnapshot.rb b/lib/cmdtest/fssnapshot.rb index 3b045a7..3ba19a7 100644 --- a/lib/cmdtest/fssnapshot.rb +++ b/lib/cmdtest/fssnapshot.rb @@ -41,7 +41,7 @@ module Cmdtest next if entry == ".." path = File.join(dir, entry) relpath = prefix + entry - if File.directory?(path) + if ! File.symlink?(path) && File.directory?(path) ignore2 = yield ignore, relpath recursive_find(ignore2, relpath + "/", path, &block) else