firefox wrapper script breaks sensible-browser, gnome-www-browser, and firefox-3.0

Bug #275410 reported by Laurent Bigonville on 2008-09-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
firefox-3.0 (Ubuntu)

Bug Description

Binary package hint: debianutils

When I try to use sensible-browser, I get:

$ sensible-browser
exec: 118: /usr/lib/firefox-3.0.3/gnome-www-browser: not found

debianutils 2.29ubuntu2

John Vivirito (gnomefreak) wrote :

this is known about and will mark as a dup as soon as i get the master bug for it

Changed in firefox-3.0:
status: New → Incomplete
Steve Langasek (vorlon) wrote :

no, this is not the same bug; unduping.

Steve Langasek (vorlon) wrote :

This is caused by a bug in the /usr/lib/firefox-3.0.3/ wrapper script; it assumes that 'basename $0' is always a valid binary name under /usr/lib/firefox-3.0.3, which is not at all guaranteed to be the case; e.g., firefox-3.0, abrowser-3.0, gnome-www-browser, and x-www-browser all are (or can be) symlinks to this wrapper script, but none of these appear as program names in /usr/lib/firefox-3.0.3.

I think the best solution here is to use readlink on $0 recursively until a matching name is found; this avoids having to hard-code any lists of known alternatives, or lists of known brandings.

Changed in firefox-3.0:
importance: Undecided → High
milestone: none → ubuntu-8.10
status: Incomplete → Triaged

Its a major bug in Xubuntu, and x-www-browser is also affected, this causes our help system which calls x-www-browser to crash and burn miserably. Also breaks links in X-Chat and probably a few other things.

Here are my comments from the xubuntu-meta bug. Steve already came to the same conclusion why the script is broken so here are my remaining notes:

This is a bug in firefox that manifested when we removed midori as the default browser.

mcasadevall@blacksteel:~/src/linux-ports-2.6.25/debian$ update-alternatives --list x-www-browser

mcasadevall@blacksteel:~/src/linux-ports-2.6.25/debian$ firefox-3.0
exec: 118: /usr/lib/firefox-3.0.3/firefox-3.0: not found

From the rules:
    update-alternatives --install /usr/bin/x-www-browser \
        x-www-browser /usr/bin/$APPNAME 40
    touch $LIBDIR/.autoreg

This is what cases the alternative to point to firefox-3.0 instead of firefox, and thus breaks x-www-browser.

I concur with Steve's solution that the best way to fix this bug is have the script check for a matching name, and fall back on $LIBDIR/firefox if no other things are found.

Steve Langasek (vorlon) wrote :

The suggestion to follow links recursively until a valid name is found will fail for 'abrowser-3.0', which points directly to firefox-3.0. So an additional check of NAME=${NAME%%-3.0}} may be warranted.

Steve Langasek (vorlon) wrote :

Attached is a debdiff with a patch that I believe fixes this issue.

I test built the fix, it seems to work fine. x-www-browser and sensible-browser work for me with both abrowser and regular firefox.

Lieven (lieven-debels) wrote :

What command should I execute to apply the patch?

Alexander Sack (asac) wrote :

committed to packaging head (rev 359). Thanks.

Changed in firefox-3.0:
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox-3.0 - 3.0.3+nobinonly-0ubuntu1

firefox-3.0 (3.0.3+nobinonly-0ubuntu1) intrepid; urgency=low

  [ Steve Langasek <email address hidden> ]
  * Fix the wrapper script to handle all possible invocations.
    LP: #275410.

  [ Fabien Tassin <email address hidden> ]
  * Remove some hardcoded 3.0 to make the merge in the 3.1 branch smoother
    - update debian/rules
    - update debian/
  * Fix abrowser symlink in libdir which must be versioned unless control
    ships a meta package. Add versioned symlinks in libdir for firefox and
    abrowser now that the launcher script uses $0
    - update debian/rules
  * Fix the desktop file for abrowser to call it abrowser-3.0 instead
    of firefox-3.0, and move the desktop icons to the branding packages
    - update debian/rules
  * Add a ubuntu-abrowser.js file dedicated to abrowser and set useragent
    to Firefox/version
    - add debian/ubuntu-abrowser.js.tmpl
    - update debian/rules
  * Fix typo in branding patch for unofficial branding
    - update debian/patches/browser_branding.patch

  [ Alexander Sack <email address hidden> ]
  * add ubuntu code to preferences for yahoo searchplugin
    - update debian/firefox.js
  * fix gnome integration systempath patch in such a way that it properly
    refers to "abrowser" and not awesome-browser
    - update debian/patches/lp185622_system_path_default_browser.patch
  * update aboutRights.xhtml to v1
    - update debian/patches/lp269656_know_your_rights.patch
  * resurrecting ubuntu default bookmarks
    - update debian/patches/browser_branding.patch
    - update debian/patches/series
  * add explicit minimum version to firefox-3.0 depend on firefox-3.0-branding
    and abrowser-3.0-branding (>= 3.0.3+nobinonly-0ubuntu1), to reflect
    that the desktop launcher icon has been moved from firefox-3.0 to
    - update debian/control

 -- Fabien Tassin <email address hidden> Mon, 13 Oct 2008 16:05:14 +0200

Changed in firefox-3.0:
status: Fix Committed → Fix Released
Marcel (marcel-launchpad) wrote :

I'm using: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2008111318 Ubuntu/8.10 (intrepid) Firefox/3.0.4
And when I click on a link in Gnome Terminal or aMSN, nothing happens. In Hardy it used to launch Firefox, but since I upgraded to Intrepid, I have to copy/paste the links. Do I suffer from this bug?

petski (petski) wrote :

Marcel, just update using UpdateManager or simular and you shouldn't suffer from bug 275410 anymore. In case the Gnome Terminal and aMSN bug still persist, I'd advise you to create a new bugreport in Launchpad. Before you do so:

In Gnome Terminal: Right click on the link and click "Open link" to see what happens
In aMSN: In the userlist, press Ctrl-P and go to the "Other"-tab to see what "Browser" is set to. In my case it was set to "firefox"

tags: added: iso-testing
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers