Open Bug 373645 Opened 17 years ago Updated 2 years ago

firefox startup-script (run-mozilla.sh) uses basename of progname before following links

Categories

(Firefox :: General, defect)

3.6 Branch
x86
Linux
defect

Tracking

()

People

(Reporter: mkiever, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2

Following are parts of the firefox startup-script:
-----------
...
progname="$0"
curdir=`dirname "$progname"`
progbase=`basename "$progname"`
...
  while [ -h "$progname" ]; do
...
    if [ -x "$run_moz" ]; then
      cd "$curdir"
      dist_bin=`pwd`
      run_moz="$dist_bin/run-mozilla.sh"
      found=1
      break
...
MOZILLA_BIN="${progbase}-bin"
---------------
If you reference 'firefox' with a symbolic link other than
'firefox' (for example 'firefox2') the variable 'progbase'
will use the name of the link for the 'MOZILLA_BIN',
i.e. in my case tries to launch 'firefox2-bin'.
The script should re-calculate 'progbase' when the target is found.


Reproducible: Always

Steps to Reproduce:
as root:
1. extract tar-file in /usr/local/share/firefox
2. cd /usr/local/bin
3. ln -s /usr/local/share/firefox/firefox firefox2
as normal user:
4. rehash
5. Try to start firefox2.


Actual Results:  
error message:

run-mozilla.sh: Cannot execute /usr/local/share/firefox2.0.0.2/firefox2-bin.


Expected Results:  
Running firefox2.


Proposed patch (diff -u):
--- firefox.old 2007-03-12 17:20:34.292308664 +0100
+++ firefox     2007-03-12 17:21:26.903310576 +0100
@@ -119,6 +119,7 @@
     if [ -x "$run_moz" ]; then
       cd "$curdir"
       dist_bin=`pwd`
+      progbase=`basename "$progname"`
       run_moz="$dist_bin/run-mozilla.sh"
       found=1
       break
This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 5-15-2010]
Version: unspecified → 2.0 Branch
I'll try to find the time to take a look
at latest sources.
My last comment seems to indicate though
that it was present in firefox 3 alpha.
Funny it's still unconfirmed after three years...

Regards,
Matthias Kievernagel
Most current thing I found on mozilla.org was this:
  firefox-3.6.3.tar.bz2
The toplevel firefox shell script looks unchanged to me.
So bug description should still apply.
I can no longer verify it though and it no longer applies to me,
because some time ago I switched to Debian.
My current Debian system installs this:
  Iceweasel/3.0.6 (Debian-3.0.6-1)
The debian package apparently does not use
the mozilla startup script but replaces it
with something else (debian specific ?).

One additional comment:
I do not know if the installation method I used
in the original report is still supported
(i.e. unpacking the tar-file into any system
 directory and then sym-linking the startup script).
I think it was when I first reported this.
Not sure though - it's been so long ago.

Regards,
Matthias Kievernagel
Whiteboard: [CLOSEME 5-15-2010]
Version: 2.0 Branch → 3.6 Branch
Sorry, that was an automated comment. And yeah, time goes fast in bugzilla land! :)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: firefox startup-script uses basename of progname before following links → firefox startup-script (run-mozilla.sh) uses basename of progname before following links
Oh, and the latest source is accessible via the web interface: http://mxr.mozilla.org/mozilla-central/source/build/unix/run-mozilla.sh
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.