Ticket #20497: tbb-605-homedir.diff

File tbb-605-homedir.diff, 1.9 KB (added by attila, 2 years ago)

Diff/patch to add --enable-tor-browser-data-in-home-dir

  • configure.in

    diff --git a/configure.in b/configure.in
    index 2b1a58c..37d72bc 100644
    a b if test -n "$TOR_BROWSER_UPDATE"; then 
    65396539    AC_DEFINE(TOR_BROWSER_UPDATE)
    65406540fi
    65416541
     6542MOZ_ARG_ENABLE_BOOL(tor-browser-data-in-home-dir,
     6543[  --enable-tor-browser-data-in-home-dir
     6544                          Enable Tor Browser data in home dir],
     6545    TOR_BROWSER_DATA_IN_HOME_DIR=1,
     6546    TOR_BROWSER_DATA_IN_HOME_DIR= )
     6547
    65426548MOZ_ARG_ENABLE_BOOL(tor-browser-data-outside-app-dir,
    65436549[  --enable-tor-browser-data-outside-app-dir
    65446550                          Enable Tor Browser data outside of app directory],
    65456551    TOR_BROWSER_DATA_OUTSIDE_APP_DIR=1,
    65466552    TOR_BROWSER_DATA_OUTSIDE_APP_DIR= )
    65476553
     6554if test -n "$TOR_BROWSER_DATA_IN_HOME_DIR"; then
     6555    TOR_BROWSER_DATA_OUTSIDE_APP_DIR=1
     6556    AC_DEFINE(TOR_BROWSER_DATA_IN_HOME_DIR)
     6557fi
     6558
    65486559if test -n "$TOR_BROWSER_DATA_OUTSIDE_APP_DIR"; then
    65496560    AC_DEFINE(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
    65506561fi
  • xpcom/io/TorFileUtils.cpp

    diff --git a/xpcom/io/TorFileUtils.cpp b/xpcom/io/TorFileUtils.cpp
    index c45961a..14278ec 100644
    a b TorBrowser_GetUserDataDir(nsIFile *aExeFile, nsIFile** aFile) 
    1515  NS_ENSURE_ARG_POINTER(aFile);
    1616  nsCOMPtr<nsIFile> tbDataDir;
    1717
    18 #ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
     18#if defined(TOR_BROWSER_DATA_IN_HOME_DIR)
     19  const char *homeDir = getenv("HOME");
     20  if (!homeDir || !*homeDir)
     21    return NS_ERROR_FAILURE;
     22  nsresult rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
     23                                      getter_AddRefs(tbDataDir));
     24  NS_ENSURE_SUCCESS(rv, rv);
     25  nsAutoCString leafSubdir(NS_LITERAL_CSTRING("TorBrowser-Data"));
     26  rv = tbDataDir->AppendNative(leafSubdir);
     27  NS_ENSURE_SUCCESS(rv, rv);
     28#elif defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
    1929  nsAutoCString tbDataLeafName(NS_LITERAL_CSTRING("TorBrowser-Data"));
    2030  nsCOMPtr<nsIFile> appRootDir;
    2131  nsresult rv = GetAppRootDir(aExeFile, getter_AddRefs(appRootDir));