llvm/0005-scan-build-dir.patch
2014-11-20 20:54:51 -07:00

15 lines
394 B
Diff

--- a/tools/clang/tools/scan-build/scan-build
+++ b/tools/clang/tools/scan-build/scan-build
@@ -204,6 +204,12 @@
else {
$NewDir = "$Dir/$DateString-$RunNumber";
}
+
+ # Make sure that the directory does not exist in order to avoid hijack.
+ if (-d $NewDir) {
+ DieDiag("The directory '$NewDir' already exists.\n");
+ }
+
system 'mkdir','-p',$NewDir;
return $NewDir;
}