[tbb-commits] [tor-browser] 18/69: Bug 11641: change TBB directory structure to be more like Firefox's

gitolite role git at cupani.torproject.org
Wed Apr 27 20:07:14 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to annotated tag FIREFOX_91_9_0esr_BUILD1
in repository tor-browser.

commit 2d84a0b6238238ca5d72327750f49ae489afbb9f
Author: Kathy Brade <brade at pearlcrescent.com>
AuthorDate: Tue Apr 29 13:08:24 2014 -0400

    Bug 11641: change TBB directory structure to be more like Firefox's
    
    Unless the -osint command line flag is used, the browser now defaults
    to the equivalent of -no-remote.  There is a new -allow-remote flag that
    may be used to restore the original (Firefox-like) default behavior.
---
 toolkit/xre/nsAppRunner.cpp | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index 351766bdbdcdf..6d6238feda461 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1837,8 +1837,10 @@ static void DumpHelp() {
       "  --migration        Start with migration wizard.\n"
       "  --ProfileManager   Start with ProfileManager.\n"
 #ifdef MOZ_HAS_REMOTE
-      "  --no-remote        Do not accept or send remote commands; implies\n"
+      "  --no-remote        (default) Do not accept or send remote commands; "
+      "implies\n"
       "                     --new-instance.\n"
+      "  --allow-remote     Accept and send remote commands.\n"
       "  --new-instance     Open new instance, not a new window in running "
       "instance.\n"
 #endif
@@ -4100,16 +4102,25 @@ int XREMain::XRE_mainInit(bool* aExitFlag) {
                                      gSafeMode);
 
 #if defined(MOZ_HAS_REMOTE)
+  // In Tor Browser, remoting is disabled by default unless -osint is used.
+  bool allowRemote = (CheckArg("allow-remote") == ARG_FOUND);
+  bool isOsint = (CheckArg("osint", nullptr, CheckArgFlag::None) == ARG_FOUND);
+  if (!allowRemote && !isOsint) {
+    SaveToEnv("MOZ_NO_REMOTE=1");
+  }
   // Handle --no-remote and --new-instance command line arguments. Setup
   // the environment to better accommodate other components and various
   // restart scenarios.
   ar = CheckArg("no-remote");
-  if (ar == ARG_FOUND || EnvHasValue("MOZ_NO_REMOTE")) {
+  if ((ar == ARG_FOUND) && allowRemote) {
+    PR_fprintf(PR_STDERR,
+               "Error: argument --no-remote is invalid when argument "
+               "--allow-remote is specified\n");
+    return 1;
+  }
+  if (EnvHasValue("MOZ_NO_REMOTE")) {
     mDisableRemoteClient = true;
     mDisableRemoteServer = true;
-    if (!EnvHasValue("MOZ_NO_REMOTE")) {
-      SaveToEnv("MOZ_NO_REMOTE=1");
-    }
   }
 
   ar = CheckArg("new-instance");

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list