[or-cvs] r15392: Seperate out blocking file url network activity into Tor vs (in torbutton/trunk/src: chrome/content chrome/locale/en-US components defaults/preferences)

mikeperry at seul.org mikeperry at seul.org
Sat Jun 21 23:12:10 UTC 2008


Author: mikeperry
Date: 2008-06-21 19:12:10 -0400 (Sat, 21 Jun 2008)
New Revision: 15392

Modified:
   torbutton/trunk/src/chrome/content/preferences.js
   torbutton/trunk/src/chrome/content/preferences.xul
   torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
   torbutton/trunk/src/components/cssblocker.js
   torbutton/trunk/src/defaults/preferences/preferences.js
Log:

Seperate out blocking file url network activity into Tor vs
Non-Tor prefs. It shouldn't be our job protect the user
during Non-Tor anyways.



Modified: torbutton/trunk/src/chrome/content/preferences.js
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.js	2008-06-21 16:02:44 UTC (rev 15391)
+++ torbutton/trunk/src/chrome/content/preferences.js	2008-06-21 23:12:10 UTC (rev 15392)
@@ -231,7 +231,8 @@
     doc.getElementById('torbutton_spoofEnglish').checked = o_torprefs.getBoolPref('spoof_english');
     doc.getElementById('torbutton_clearHttpAuth').checked = o_torprefs.getBoolPref('clear_http_auth');
     doc.getElementById('torbutton_blockJSHistory').checked = o_torprefs.getBoolPref('block_js_history');
-    doc.getElementById('torbutton_blockFileNet').checked = o_torprefs.getBoolPref('block_file_net');
+    doc.getElementById('torbutton_blockTorFileNet').checked = o_torprefs.getBoolPref('block_tor_file_net');
+    doc.getElementById('torbutton_blockNonTorFileNet').checked = o_torprefs.getBoolPref('block_nontor_file_net');
 
     doc.getElementById('torbutton_lockedMode').checked = o_torprefs.getBoolPref('locked_mode');
     /*
@@ -290,7 +291,8 @@
     o_torprefs.setBoolPref('disable_domstorage', doc.getElementById('torbutton_noDomStorage').checked);
     o_torprefs.setBoolPref('clear_http_auth', doc.getElementById('torbutton_clearHttpAuth').checked);
     o_torprefs.setBoolPref('block_js_history', doc.getElementById('torbutton_blockJSHistory').checked);
-    o_torprefs.setBoolPref('block_file_net', doc.getElementById('torbutton_blockFileNet').checked);
+    o_torprefs.setBoolPref('block_tor_file_net', doc.getElementById('torbutton_blockTorFileNet').checked);
+    o_torprefs.setBoolPref('block_nontor_file_net', doc.getElementById('torbutton_blockNonTorFileNet').checked);
 
     if(doc.getElementById('torbutton_shutdownGroup').selectedItem ==
             doc.getElementById('torbutton_noShutdown')) {

Modified: torbutton/trunk/src/chrome/content/preferences.xul
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.xul	2008-06-21 16:02:44 UTC (rev 15391)
+++ torbutton/trunk/src/chrome/content/preferences.xul	2008-06-21 23:12:10 UTC (rev 15392)
@@ -141,8 +141,10 @@
                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
         <checkbox id="torbutton_noSearch" label="&torbutton.prefs.no_search;" 
                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
-        <checkbox id="torbutton_blockFileNet" label="&torbutton.prefs.block_file_net;" 
+        <checkbox id="torbutton_blockTorFileNet" label="&torbutton.prefs.block_tor_file_net;" 
                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+        <checkbox id="torbutton_blockNonTorFileNet" label="&torbutton.prefs.block_nontor_file_net;" 
+                  oncommand="torbutton_prefs_set_field_attributes(document)"/>
         <checkbox id="torbutton_closeTor" label="&torbutton.prefs.close_tor;" 
                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
         <checkbox id="torbutton_closeNonTor" label="&torbutton.prefs.close_nontor;" 

Modified: torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2008-06-21 16:02:44 UTC (rev 15391)
+++ torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2008-06-21 23:12:10 UTC (rev 15392)
@@ -71,7 +71,6 @@
 <!ENTITY torbutton.prefs.resize_on_toggle       "Resize windows to multiples of 50px during Tor usage (recommended)">
 <!ENTITY torbutton.prefs.close_tor    "Close all Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
-<!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
 <!ENTITY torbutton.prefs.jar_certs        "Store SSL certs in seperate jars for Tor/Non-Tor (recommended)">
 <!ENTITY torbutton.prefs.jar_ca_certs        "Store CA certs in seperate jars for Tor/Non-Tor (recommended)">
@@ -80,3 +79,6 @@
 <!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">
 <!ENTITY torbutton.prefs.startup             "Startup">
 <!ENTITY torbutton.prefs.nonontor_sessionstore    "Prevent session store from saving Non-Tor loaded tabs">
+<!ENTITY torbutton.prefs.block_tor_file_net     "Block Tor access to network from file:// urls (recommended)">
+<!ENTITY torbutton.prefs.block_nontor_file_net     "Block Non-Tor access to network from file:// urls">
+

Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js	2008-06-21 16:02:44 UTC (rev 15391)
+++ torbutton/trunk/src/components/cssblocker.js	2008-06-21 23:12:10 UTC (rev 15392)
@@ -119,7 +119,8 @@
 
     this.isolate_content = this._prefs.getBoolPref("extensions.torbutton.isolate_content");
     this.tor_enabled = this._prefs.getBoolPref("extensions.torbutton.tor_enabled");
-    this.block_file_net = this._prefs.getBoolPref("extensions.torbutton.block_file_net");
+    this.block_tor_file_net = this._prefs.getBoolPref("extensions.torbutton.block_tor_file_net");
+    this.block_nontor_file_net = this._prefs.getBoolPref("extensions.torbutton.block_nontor_file_net");
     this.no_tor_plugins = this._prefs.getBoolPref("extensions.torbutton.no_tor_plugins");
 
     return;
@@ -212,8 +213,9 @@
                                       contentLocation.spec);
                     return ok;
                 } else {
-                    if (this.block_file_net) {
-                        this.logger.eclog(3, "Blocking remote request from: " +
+                    if (this.block_tor_file_net && this.tor_enabled ||
+                            this.block_nontor_file_net && !this.tor_enabled) {
+                        this.logger.eclog(4, "Blocking remote request from: " +
                                           requestOrigin.spec + " for: " +
                                           contentLocation.spec);
                         return block;
@@ -363,7 +365,7 @@
         if(browser.__tb_tor_fetched == tor_state) {
             return ok;
         } else {
-            this.logger.log(4, "Blocking: "+contentLocation.spec);
+            this.logger.log(4, "Blocking cross state load of: "+contentLocation.spec);
             return block;
         }
 	},
@@ -394,9 +396,12 @@
             case "extensions.torbutton.tor_enabled":
                 this.tor_enabled = this._prefs.getBoolPref("extensions.torbutton.tor_enabled");
                 break;
-            case "extensions.torbutton.block_file_net":
-                this.block_file_net = this._prefs.getBoolPref("extensions.torbutton.block_file_net");
+            case "extensions.torbutton.block_tor_file_net":
+                this.block_tor_file_net = this._prefs.getBoolPref("extensions.torbutton.block_tor_file_net");
                 break;
+            case "extensions.torbutton.block_nontor_file_net":
+                this.block_nontor_file_net = this._prefs.getBoolPref("extensions.torbutton.block_nontor_file_net");
+                break;
             case "extensions.torbutton.no_tor_plugins":
                 this.no_tor_plugins = this._prefs.getBoolPref("extensions.torbutton.no_tor_plugins");
                 break;

Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-21 16:02:44 UTC (rev 15391)
+++ torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-21 23:12:10 UTC (rev 15392)
@@ -97,7 +97,8 @@
 pref("extensions.torbutton.block_js_history",true);
 pref("extensions.torbutton.resize_on_toggle",true);
 pref("extensions.torbutton.banned_ports","8118,8123,9050,9051");
-pref("extensions.torbutton.block_file_net",true);
+pref("extensions.torbutton.block_tor_file_net",true);
+pref("extensions.torbutton.block_nontor_file_net",false);
 pref("extensions.torbutton.jar_certs",false);
 pref("extensions.torbutton.jar_ca_certs",false);
 pref("extensions.torbutton.startup_state", 2); // 0=non-tor, 1=tor, 2=last



More information about the tor-commits mailing list