[cfe-commits] r49904 - /cfe/trunk/utils/scan-build

Ted Kremenek kremenek at apple.com
Fri Apr 18 08:18:20 PDT 2008


Author: kremenek
Date: Fri Apr 18 10:18:20 2008
New Revision: 49904

URL: http://llvm.org/viewvc/llvm-project?rev=49904&view=rev
Log:
scan-build now fixes permissions of report files and directories, which may
be created as "temporary files" that are not world readable.

Modified:
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=49904&r1=49903&r2=49904&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Fri Apr 18 10:18:20 2008
@@ -156,6 +156,10 @@
   
   $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 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 @@
   close(OUT);
   
   CopyJS($Dir);
+  
+  # Make sure $Dir and $BaseDir is world readable/executable.
+  `chmod 755 $Dir`;
+  `chmod 755 $BaseDir`;
 }
 
 ##----------------------------------------------------------------------------##
@@ -516,6 +526,7 @@
   }
 }
 
+my $BaseDir = $HtmlDir;
 $HtmlDir = GetHTMLRunDir($HtmlDir);
 
 # Set the appropriate environment variables.
@@ -539,7 +550,7 @@
 
 # Postprocess the HTML directory.
 
-Postprocess($HtmlDir);
+Postprocess($HtmlDir, $BaseDir);
 
 if ($ViewResults and -r "$HtmlDir/index.html") {
   # Only works on Mac OS X (for now).





More information about the cfe-commits mailing list