Opened 6 years ago

Closed 6 years ago

#9563 closed defect (duplicate)

TBB architecture check depends on working directory

Reported by: cypherpunks Owned by: mikeperry
Priority: Medium Milestone:
Component: Applications/Tor bundles/installation Version:
Severity: Keywords: tbb-3.0, MikePerry201311R
Cc: erinn, mikeperry Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Version: tor-browser-linux32-3.0-alpha-3_en-US

When start-tor-browser is run from a location other than within its directory (eg, it is not invoked as ./start-tor-browser), the architecture check introduced for #3841 looks for tor at the wrong path and fails with a message like this:

./Downloads/tor-browser_en-US/start-tor-browser: 123: [: -ne: argument expected

The check fails open, though, so after that error is printed everything still works (assuming the architecture is correct).

Replacing this:

TORARCHITECTURE=$(expr "$(file App/tor)" : '.*ELF \([[:digit:]]*\)')

With this:

TORARCHITECTURE=$(expr "$(file $(dirname $0)/App/tor)" : '.*ELF \([[:digit:]]*\)')

should fix the problem.

Child Tickets

Change History (5)

comment:1 Changed 6 years ago by arma

Keywords: tbb-3.0 added
Owner: changed from erinn to mikeperry
Status: newassigned

comment:2 Changed 6 years ago by arma

Status: assignedneeds_review

comment:3 Changed 6 years ago by dcf

Later on, the script does some work to figure out its directory (starting with myname="$0"). Then it does a chdir and code after that refers to ./App in the current directory. I think it would be more consistent to move the architecture check to be after the chdir.

comment:4 Changed 6 years ago by mikeperry

Keywords: MikePerry201311R added

comment:5 Changed 6 years ago by mikeperry

Resolution: duplicate
Status: needs_reviewclosed

Calling this a dup of #10049 since the patch in #10049 is cleaner.

Note: See TracTickets for help on using tickets.