From 837d973fd348e68a21933f4fae8aa726eed5cdc1 Mon Sep 17 00:00:00 2001 From: Sanjin Sehic Date: Tue, 7 Feb 2012 09:45:45 +0100 Subject: [PATCH] Remove potentially unsafe optimization in local resolver Old implementation of the local resolver did not copy directory if it was writable. This optimization can lead to some potential problems if the directory is writable, but its subdirectories aren't. New implementation of the local resolver does not have this optimization and it always copies the directory into staging area. --- main/Resolvers.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main/Resolvers.scala b/main/Resolvers.scala index 394cf5854..c9efb1f48 100644 --- a/main/Resolvers.scala +++ b/main/Resolvers.scala @@ -19,9 +19,7 @@ object Resolvers val from = new File(uri) val to = uniqueSubdirectoryFor(uri, in = info.staging) - if (from.isDirectory) - if (from.canWrite) Some {() => from} - else Some {() => creates(to) {IO.copyDirectory(from, to)}} + if (from.isDirectory) Some {() => creates(to) {IO.copyDirectory(from, to)}} else None }