Opened 9 years ago

Closed 8 years ago

#2525 closed defect (fixed)

start-tor-browser script doesn't work when symlinked

Reported by: StFS Owned by: rransom
Priority: Medium Milestone:
Component: Applications/Tor bundles/installation Version: Tor: unspecified
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The start-tor-browser script that comes with the Linux Tor Browser Bundle package fails if a symlink is created that points to it and the symlink then executed instead of the actual script.

For example, I installed the bundle in ~/apps/ but I have ~/bin/ in my $PATH so I symlinked the startup script in ~/bin/:
tor-browser -> ../apps/tor-browser_en-US/start-tor-browser

However, this messes up the startup since the script assumes now that it's located in ~/bin instead of ~/apps/tor-browser_en-US/

Below is a patch for the start-tor-browser script that fixes this issue:

19c19,25
< mydir="$(dirname $0)"
---
> if [ -L $0 ]; then
> appname=$(readlink -f $0)
> else
> appname=$0
> fi
> 
> mydir="$(dirname $appname)"

Child Tickets

Change History (6)

comment:1 Changed 9 years ago by arma

Looks plausible to me.

I wonder if there's any other part of it that this patch would break?

One way to learn is to try it and find out. :)

comment:2 Changed 8 years ago by StFS

Hi.

Any chance this will find its way into the distribution. I'm getting a little tired of having to do this every time I update ;-)

comment:3 Changed 8 years ago by rransom

Status: newneeds_review

See fixes-2011-08-23-01-master (in particular, commit 7bf12712a8aa2556fdb023c69bbf51d727a17b90) (on #2824) for a fix for this issue.

comment:4 in reply to:  3 Changed 8 years ago by rransom

Owner: changed from erinn to rransom
Status: needs_reviewassigned

Replying to rransom:

See fixes-2011-08-23-01-master (in particular, commit 7bf12712a8aa2556fdb023c69bbf51d727a17b90) (on #2824) for a fix for this issue.

That doesn't fix it. I only tested the fix with an absolute symlink; it won't handle relative symlinks properly. On the other hand, it's not (much) worse than the current situation.

comment:5 Changed 8 years ago by rransom

Status: assignedneeds_review

See bug2525 ( https://git.torproject.org/user/rransom/torbrowser.git bug2525 ) for the fix.

comment:6 Changed 8 years ago by rransom

Resolution: fixed
Status: needs_reviewclosed

Fixed in TBB for Linux 2.2.32-3.

Note: See TracTickets for help on using tickets.