summaryrefslogtreecommitdiffstats
path: root/Source/cmConfigureFileCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r--Source/cmConfigureFileCommand.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index a3cf1dd..b382f86 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -28,6 +28,13 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args)
}
this->InputFile = args[0];
this->OuputFile = args[1];
+ if ( !this->Makefile->CanIWriteThisFile(this->OuputFile.c_str()) )
+ {
+ std::string e = "attempted to configure a file: " + this->OuputFile + " into a source directory.";
+ this->SetError(e.c_str());
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
this->CopyOnly = false;
this->EscapeQuotes = false;