[tbb-commits] [tor-browser-build/master] Bug 25485: replace firefox by a wrapper script

gk at torproject.org gk at torproject.org
Thu Aug 16 10:28:53 UTC 2018


commit 5933f5916a68fdafd7103a4800e156a0100c3a6c
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Wed Aug 15 10:55:47 2018 +0200

    Bug 25485: replace firefox by a wrapper script
    
    In a previous patch for bug 25485 we changed how we set LD_LIBRARY_PATH
    in start-tor-browser. However this change is not taken into account when
    the browser is restarted by the updater. To avoid this issue we replace
    the firefox binary by a wrapper setting LD_LIBRARY_PATH.
---
 projects/firefox/build                              |  6 +++++-
 projects/firefox/config                             |  2 ++
 projects/firefox/start-firefox                      | 14 ++++++++++++++
 projects/tor-browser/RelativeLink/start-tor-browser |  9 ---------
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/projects/firefox/build b/projects/firefox/build
index 4dd0945..489d087 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -165,6 +165,10 @@ rm -f js/src/configure
   # subsequent builds could test to see if they've been uploaded before...
   # But let's find out if it actually matters first..
   rm -f $distdir/Browser/*.chk
+  # Replace firefox by a wrapper script (#25485)
+  mv $distdir/Browser/firefox $distdir/Browser/firefox.real
+  mv $rootdir/start-firefox $distdir/Browser/firefox
+  chmod 755 $distdir/Browser/firefox
 [% END %]
 
 [% IF c("var/windows-x86_64") -%]
@@ -203,7 +207,7 @@ cd $distdir
 [% IF c("var/linux-x86_64") %]
   # Strip and generate debuginfo for the firefox binary that we keep, all *.so
   # files, the plugin-container, and the updater (see ticket #10126)
-  for LIB in Browser/*.so Browser/firefox Browser/plugin-container Browser/updater
+  for LIB in Browser/*.so Browser/firefox.real Browser/plugin-container Browser/updater
   do
       objcopy --only-keep-debug $LIB Debug/$LIB
       strip $LIB
diff --git a/projects/firefox/config b/projects/firefox/config
index 02a380d..7546d24 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -118,3 +118,5 @@ input_files:
     enable: '[% c("var/windows") %]'
   - filename: abicheck.cc
     enable: '[% c("var/linux") %]'
+  - filename: start-firefox
+    enable: '[% c("var/linux") %]'
diff --git a/projects/firefox/start-firefox b/projects/firefox/start-firefox
new file mode 100644
index 0000000..dc30574
--- /dev/null
+++ b/projects/firefox/start-firefox
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+basedir=$(dirname "$0")
+
+LD_LIBRARY_PATH="$basedir/TorBrowser/Tor/"
+# Check if the system has a more recent version of libstdc++.so.6; if yes, use
+# that instead of the bundled version.
+"$basedir/abicheck" >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+  LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$basedir/TorBrowser/Tor/libstdc++/"
+fi
+export LD_LIBRARY_PATH
+
+exec "$basedir/firefox.real" "$@"
diff --git a/projects/tor-browser/RelativeLink/start-tor-browser b/projects/tor-browser/RelativeLink/start-tor-browser
index 47fbdef..722caa5 100755
--- a/projects/tor-browser/RelativeLink/start-tor-browser
+++ b/projects/tor-browser/RelativeLink/start-tor-browser
@@ -273,15 +273,6 @@ if [ $SYSARCHITECTURE -ne $TORARCHITECTURE ]; then
    exit 1
 fi
 
-LD_LIBRARY_PATH="${HOME}/TorBrowser/Tor/"
-# Check if the system has a more recent version of libstdc++.so.6; if yes, use
-# that instead of the bundled version.
-./abicheck >/dev/null 2>&1
-if [ $? -ne 0 ]; then
-  LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${HOME}/TorBrowser/Tor/libstdc++/"
-fi
-export LD_LIBRARY_PATH
-
 [% IF ! c("var/release") %]
 export SELFRANDO_write_layout_file=
 [% END %]





More information about the tbb-commits mailing list