]> granicus.if.org Git - clang/commitdiff
Add scan-view '--allow-all-hosts' option, by default access is now
authorDaniel Dunbar <daniel@zuster.org>
Wed, 24 Sep 2008 17:59:41 +0000 (17:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 24 Sep 2008 17:59:41 +0000 (17:59 +0000)
restricted to 127.0.0.1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56563 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-view/ScanView.py
tools/scan-view/scan-view

index 48b8cc80d0e542ad66e830102486269e33912cdf..2e06f2a8fba56b0e482951419c16338fa9698216 100644 (file)
@@ -492,6 +492,10 @@ File Bug</h3>
         return self.send_string(result)
 
     def send_head(self, fields=None):
+        if (self.server.options.onlyServeLocal and
+            self.client_address[0] != '127.0.0.1'):
+            return self.send_error('401', 'Unauthorized host.')
+
         if fields is None:
             fields = {}
         self.fields = fields
index 844a173ba6538fc9cbe7156412c9d7246a84a20f..06197465e6d222c07bb5a9df7e9cebe3c4029c7d 100755 (executable)
@@ -93,6 +93,9 @@ def main():
     parser.add_option("--no-browser", dest="startBrowser", default=True, 
                       action="store_false",
                       help="Don't open a webbrowser on startup.")
+    parser.add_option("--allow-all-hosts", dest="onlyServeLocal", default=True, 
+                      action="store_false",
+                      help='Allow connections from any host (access restricted to "127.0.0.1" by default)')
     (options, args) = parser.parse_args()
 
     if len(args) != 1: