aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-18 15:18:20 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-18 15:18:20 +0000
commit684bb097fbb51fe4e8852925d93d6fd2adec31c7 (patch)
tree5d3cd87aa476b7d3b583364d17d21370c5f01ac8
parent57cf446d344bb2649e8742cedf1cf4342ed78aa9 (diff)
scan-build now fixes permissions of report files and directories, which may
be created as "temporary files" that are not world readable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49904 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/scan-build13
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/scan-build b/utils/scan-build
index 441f63f1c1..ff44fee001 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -156,6 +156,10 @@ sub ScanFile {
$AlreadyScanned{$digest} = 1;
+ # At this point the report file is not word readable. Make it happen.
+ `chmod 644 $Dir/$FName`;
+
+ # Scan the report file for tags.
open(IN, "$Dir/$FName") or die "$Prog: Cannot open '$Dir/$FName'\n";
my $BugDesc = "";
@@ -208,8 +212,10 @@ sub CopyJS {
sub Postprocess {
my $Dir = shift;
+ my $BaseDir = shift;
die "No directory specified." if (!defined($Dir));
+ die "No base directory specified." if (!defined($BaseDir));
if (! -d $Dir) {
return;
@@ -363,6 +369,10 @@ ENDTEXT
close(OUT);
CopyJS($Dir);
+
+ # Make sure $Dir and $BaseDir is world readable/executable.
+ `chmod 755 $Dir`;
+ `chmod 755 $BaseDir`;
}
##----------------------------------------------------------------------------##
@@ -516,6 +526,7 @@ if (!defined($HtmlDir)) {
}
}
+my $BaseDir = $HtmlDir;
$HtmlDir = GetHTMLRunDir($HtmlDir);
# Set the appropriate environment variables.
@@ -539,7 +550,7 @@ RunBuildCommand(\@ARGV, $IgnoreErrors);
# Postprocess the HTML directory.
-Postprocess($HtmlDir);
+Postprocess($HtmlDir, $BaseDir);
if ($ViewResults and -r "$HtmlDir/index.html") {
# Only works on Mac OS X (for now).