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.
This commit is contained in:
Sanjin Sehic 2012-02-07 09:45:45 +01:00 committed by Mark Harrah
parent 5ed012c7d9
commit 837d973fd3
1 changed files with 1 additions and 3 deletions

View File

@ -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
}