Fix: handle conn. type domain name for socks5 connect

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Add SOCKS5 username/password authentication

Using RFC1929, implement username/password authentication for circuit
isolation feature of Tor daemon.

This adds SOCKS5Username and SOCKS5Password option to torsocks.conf and
also environment variable to control them (TORSOCKS_USERNAME/PASSWORD).

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: assert conn->fd typo

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Test: add socks5 tests

Introduce function pointers for send_data and recv_data so they can be
replaced for testing.

Closes #25

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: check SOCKS5 user/pass before setting them in config

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Add -u/-p/-d to torsocks script

The -u, --user and -p, --pass are for the SOCKS5 authentication where
-d, --debug is to set torsocks in DEBUG mode.

Improve the usage output and make sure torsocks on/off is being sourced
else exit with error.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Update torsocks.1 man page with new options and some fixes

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: move functions in file and set hidden attribute

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Extras: add bash and zsh completion file

Those files need to be installed by hand or from your distribution
package.

They've been taken from the old torsocks (1.3) package.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Update version to v2.0.0-rc4

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: handle NULL node in getaddrinfo

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Add option to allow inbound connections

This adds the possibility of telling torsocks to allow inbound
connections meaning allowing listen() and accept()/accept4() for non
localhost address.

Add a AllowInbound 0|1 option to the configuration file along with a
TORSOCKS_ALLOW_INBOUND environment variable to control that behavior.

By default, Unix socket are allowed.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: add torsocks.conf option type

Signed-off-by: David Goulet <dgoulet@ev0ke.net>