Closed Bug 149535 Opened 22 years ago Closed 22 years ago

Linux startup script doesn't follow symlinks correctly

Categories

(SeaMonkey :: Build Config, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 57866

People

(Reporter: florian, Assigned: netscape)

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.0.0) Gecko/20020529
BuildID:    2002052918

The symlink-chasing logic in the startup-script called "mozilla" will never test
for run-mozilla.sh in the directory containing the script "mozilla" because it
tests for ! -L "$progname" and then exits before testing for -x $run_moz. (And
shouldn't all these $run_moz-es be double-quoted, too, just in case someone puts
one of the links into a wierd directory with spaces in its name?)

Reproducible: Always
Steps to Reproduce:
1. cd mozilla-installer && ./mozilla-installer
2. ln -s /usr/local/mozilla/mozilla /usr/local/bin
3. start mozilla as any user

Actual Results:  Cannot find mozilla runtime directory. Exiting.

Expected Results:  mozilla should have been started

This seems to work here:

--- mozilla.orig        Thu Jun  6 09:37:00 2002
+++ mozilla     Thu Jun  6 09:58:12 2002
@@ -45,27 +45,26 @@
   progname=$0
   curdir=`dirname $progname`
   run_moz="$curdir/run-mozilla.sh"
-  if test -x $run_moz; then
-    dist_bin=$curdir
+  if test -x "$run_moz"; then
+    dist_bin="$curdir"
     found=1
   else
     here=`/bin/pwd`
     until test $found != 0 -o ! -L "$progname" ; do
+      bn=`basename "$progname"`
+      cd `dirname "$progname"`
+      progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' `
+      if [ ! -x "$progname" ]; then
+        break
+      fi
+      curdir=`dirname $progname`
       run_moz="$curdir/run-mozilla.sh"
-      if [ -x $run_moz ]; then
-        dist_bin=$curdir
+      if [ -x "$run_moz" ]; then
+        dist_bin="$curdir"
         found=1
-      else
-        bn=`basename "$progname"`
-        cd `dirname "$progname"`
-        progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' `
-        if [ ! -x "$progname" ]; then
-          break
-        fi
-        curdir=`dirname $progname`
       fi
     done
-    cd $here
+    cd "$here"
   fi
   if [ $found = 0 ]; then
     # Check default compile-time libdir
@@ -116,4 +115,4 @@
 then
   echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN $@"
 fi
-exec $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
+exec "$dist_bin/run-mozilla.sh" $script_args $dist_bin/$MOZILLA_BIN "$@"
-> Build Config ? ( i really don't know who gets this bugs)
Assignee: Matti → seawood
Status: UNCONFIRMED → NEW
Component: Browser-General → Build Config
Ever confirmed: true
QA Contact: imajes-qa → granrose

*** This bug has been marked as a duplicate of 57866 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
v dup
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.