Opened 9 months ago

Last modified 3 months ago

#29000 assigned enhancement

Let torsocks run from source directory

Reported by: traumschule Owned by:
Priority: Very Low Milestone:
Component: Core Tor/Torsocks Version:
Severity: Minor Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I don't know how complicated it is to implement, it can be handy to run torsocks from source to test patches.

src/bin/torsocks is not executable and before running 'make install' it returns:

$ sh src/bin/torsocks --version
ERROR: /usr/local/lib/torsocks/libtorsocks.so does not exist! Try re-installing torsocks.

Child Tickets

Change History (6)

comment:1 Changed 8 months ago by onirony

Status: newneeds_information

Running torsocks from src/ works fine for me both on OS X and Ubuntu. How are you compiling torsocks, and on what system? Also can you paste a log of the compilation process? I want to be able to reproduce this. Thanks!

comment:2 in reply to:  1 Changed 8 months ago by traumschule

Replying to onirony:

Running torsocks from src/ works fine for me both on OS X and Ubuntu. How are you compiling torsocks, and on what system? Also can you paste a log of the compilation process? I want to be able to reproduce this. Thanks!

Hi! Did you try above command? Without --version it doesn't fail. sh autogen.sh && ./configure && make on debian.

Without parameters it prints the version and the help but with options it fails.

~/torsocks$ chmod +x ./src/bin/torsocks
~/torsocks$ ./src/bin/torsocks
torsocks 2.3.0

./src/bin/torsocks [OPTIONS] [COMMAND [arg ...]]

usage: ./src/bin/torsocks command args

Options:
  -h, --help         Show this help
      --shell        Spawn a torified shell
      --version      Show version
  -d, --debug        Set debug mode.
  -u, --user NAME    Username for the SOCKS5 authentication
  -p, --pass NAME    Password for the SOCKS5 authentication
  -i, --isolate      Automatic tor isolation. Can't be used with -u/-p
  -a, --address HOST Specify Tor address
  -P, --port PORT    Specify Tor port
  on, off            Set/Unset your shell to use Torsocks by default
                     Make sure to source the call when using this option. (See Examples)
  show, sh           Show the current value of the LD_PRELOAD

Examples:

Simple use of torsocks with SSH
    $ torsocks ssh user@host.com -p 1234

Set your current shell in Tor mode.
    $ . torsocks on

Please see torsocks(1), torsocks.conf(5) and torsocks(8) for more information.
~/torsocks$ ./src/bin/torsocks --help
ERROR: /usr/local/lib/torsocks/libtorsocks.so does not exist! Try re-installing torsocks.
~/torsocks$ ./src/bin/torsocks --version
ERROR: /usr/local/lib/torsocks/libtorsocks.so does not exist! Try re-installing torsocks.
~/torsocks$ ./src/bin/torsocks on
ERROR: /usr/local/lib/torsocks/libtorsocks.so does not exist! Try re-installing torsocks.

comment:3 Changed 8 months ago by onirony

Status: needs_informationneeds_revision

Okay! This is a huge defect in my opinion. So /usr/local/lib/torsocks/libtorsocks.so is installed during make install, which means when we call torsocks from src after make, the library isn't available. Fascinating! This is very fixable. I can make a patch for this as soon as my getdents patch is resolved (since it's my first patch!).

comment:4 Changed 7 months ago by onirony

I am not sure whether this should be solved by:

  1. find the local copy of libtorsocks before make install (faulty, eg if the user moves torsocks somewhere totally different after make)

OR

  1. Statically linking libtorsocks (right now it's a shared library, but I don't know if there's a good reason for that)

edit: dgoulet recommends the first approach, so I'm going with that. Will update once patch works

Last edited 7 months ago by onirony (previous) (diff)

comment:5 Changed 7 months ago by onirony

Status: needs_revisionneeds_review

comment:6 Changed 3 months ago by gaba

Owner: dgoulet deleted
Status: needs_reviewassigned

removing dgoulet from ownership in torsocks component

Note: See TracTickets for help on using tickets.