[tbb-commits] [tor-browser/tor-browser-45.5.0esr-6.5-1] Bug 16622: Pref to spoof time zone as UTC

gk at torproject.org gk at torproject.org
Thu Nov 24 14:20:15 UTC 2016


commit d973b7ebaa5e93ee8e4b6b9f07ec51333687087b
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Mon Nov 14 10:22:09 2016 -0800

    Bug 16622: Pref to spoof time zone as UTC
---
 toolkit/xre/nsAppRunner.cpp | 9 +++++++++
 toolkit/xre/nsAppRunner.h   | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index f0cdd41..81f949a 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4680,6 +4680,8 @@ XREMain::XRE_mainRun()
 
   OverrideDefaultLocaleIfNeeded();
 
+  UseUTCTimeZoneIfNeeded();
+
 #ifdef MOZ_CRASHREPORTER
   nsCString userAgentLocale;
   // Try a localized string first. This pref is always a localized string in
@@ -5385,3 +5387,10 @@ OverrideDefaultLocaleIfNeeded() {
     setlocale(LC_ALL, "C.UTF-8") || setlocale(LC_ALL, "C");
   }
 }
+
+void
+UseUTCTimeZoneIfNeeded() {
+  if (mozilla::Preferences::GetBool("privacy.use_utc_timezone", false)) {
+    SaveToEnv("TZ=UTC");
+  }
+}
diff --git a/toolkit/xre/nsAppRunner.h b/toolkit/xre/nsAppRunner.h
index c7048e0..cab42a4 100644
--- a/toolkit/xre/nsAppRunner.h
+++ b/toolkit/xre/nsAppRunner.h
@@ -96,6 +96,9 @@ WriteConsoleLog();
 void
 OverrideDefaultLocaleIfNeeded();
 
+void
+UseUTCTimeZoneIfNeeded();
+
 #ifdef XP_WIN
 void
 UseParentConsole();





More information about the tbb-commits mailing list