Greetings everyone!
Two months ago I sent an email [1] to the tor-dev mailing list explaining some important issues with torsocks. I proposed myself to do a complete rewrite for the reasons detailed in the email.
I've released today the first release candidate for a 2.0.0 version.
https://github.com/dgoulet/torsocks Package: https://github.com/dgoulet/torsocks/archive/v2.0.0-rc1.tar.gz
I'm asking the community for feedbacks, testing, code review, optimization design and/or anything useful to help improve the project (even correcting the mistakes or improving any comments). The TODO file in the repository contains some needed features but that are not critical to the project for a beta release.
Hopefully, with your help, we will be able to replace the current version with a better one, more tested, more hardened and more portable!... and maybe with a more meaningful name :).
What is really needed right now is OS X and BSD testers. I did my best to only use POSIX standard and making sure that libc calls are the same on all platforms but I was not able to test it on other OS other than Linux so they might some issues. There is *no* Windows support but again that would be amazing if someone could port it.
Again, please contribute and help this very useful tool getting better! I encourage you all to use tor-dev mailing list for any development issues. I'm also on IRC in #tor-dev as "dgoulet". You can also find me on OFTC, freenode and indymedia servers.
Big thanks to everyone! Using it is testing it! :) Cheers! David
[1] https://lists.torproject.org/pipermail/tor-dev/2013-June/004959.html
freebsd8 gcc421/46
utils.c: In function 'utils_is_address_ipv4': utils.c:54: error: 'AF_INET' undeclared (first use in this function) utils.c:54: error: (Each undeclared identifier is reported only once utils.c:54: error: for each function it appears in.) utils.c: In function 'utils_is_address_ipv6': utils.c:63: error: 'AF_INET6' undeclared (first use in this function)
needs sys/socket.h
In file included from socks5.c:24: ../../src/lib/torsocks.h:220: error: expected declaration specifiers or '...' before '*' token ../../src/lib/torsocks.h:220: warning: data definition has no type or storage class ../../src/lib/torsocks.h:220: warning: type defaults to 'int' in declaration of 'LIBC_SYSCALL_RET_TYPE' ../../src/lib/torsocks.h:220: warning: parameter names (without types) in function declaration ../../src/lib/torsocks.h:220: error: 'LIBC_SYSCALL_RET_TYPE' declared as function returning a function
dont know
Hi David,
Thanks for your effort on the new version of Torsocks.
I've had a brief look at getting a working build on OSX (10.8.4), however I've run into a few problems, which I'm attempting to work through, but I'm not entirely sure how to fix all of them, I'll see how far I get.
The syscalls are handled a little differently on Darwin, which I've partially fixed.
For reference I'm getting similar errors reported by grarpamp in socks5.c, torsocks.h.
Also in tsocks_recvmsg a call to getsockopt uses SO_DOMAIN, which as far as I can tell is Linux only. This appeared to be a problem in an earlier version of Torsocks in tsocks_sendto_guts, although I'm not sure if this work around is still usefull in this context:
https://github.com/dgoulet/torsocks/commit/1e4e20b1bbed7d2e3b8b4d60420a746a0...
regards,
Luke
Hi Luke,
Can you retry with the new upstream master? Some patches went in for BSD support fixing the SO_DOMAIN issue.
Thanks! David
Luke Gallagher:
Hi David,
Thanks for your effort on the new version of Torsocks.
I've had a brief look at getting a working build on OSX (10.8.4), however I've run into a few problems, which I'm attempting to work through, but I'm not entirely sure how to fix all of them, I'll see how far I get.
The syscalls are handled a little differently on Darwin, which I've partially fixed.
For reference I'm getting similar errors reported by grarpamp in socks5.c, torsocks.h.
Also in tsocks_recvmsg a call to getsockopt uses SO_DOMAIN, which as far as I can tell is Linux only. This appeared to be a problem in an earlier version of Torsocks in tsocks_sendto_guts, although I'm not sure if this work around is still usefull in this context:
https://github.com/dgoulet/torsocks/commit/1e4e20b1bbed7d2e3b8b4d60420a746a0...
regards,
Luke
tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
Thanks David,
I've got the upstream changes which fixes quite a few things, so thank you.
I've made some minor changes to make gcc happy which I've sent through in a pull request [1] and perhaps you can offer some feedback to ensure best practices are followed if needed.
Apart from that it's building and working on OSX, I've only tested on 10.8.
regards,
Luke
[1]: https://github.com/dgoulet/torsocks/pull/3
On 27/08/13 6:14 AM, David Goulet wrote:
Hi Luke,
Can you retry with the new upstream master? Some patches went in for BSD support fixing the SO_DOMAIN issue.
Thanks! David
On 8/26/13, David Goulet dgoulet@ev0ke.net wrote:
Can you retry with the new upstream master? Some patches went in for BSD support
Tried this earlier and it compiled clean. Haven't tested it.
Hi,
I'm asking the community for feedbacks, testing, code review, optimization design and/or anything useful to help improve the project (even correcting the mistakes or improving any comments).
under Kubuntu 13.04:
$ make Making all in src make[1]: Betrete Verzeichnis '/opt/git/torsocks/src' Making all in common make[2]: Betrete Verzeichnis '/opt/git/torsocks/src/common' CC log.lo log.c: In function 'log_init': log.c:166:9: warning: ignoring return value of 'fileno', declared with attribute warn_unused_result [-Wunused-result] CC config-file.lo CC utils.lo CC compat.lo CC socks5.lo CC connection.lo CC onion.lo CCLD libcommon.la make[2]: Verlasse Verzeichnis '/opt/git/torsocks/src/common' Making all in lib make[2]: Betrete Verzeichnis '/opt/git/torsocks/src/lib' CC torsocks.lo CC connect.lo CC gethostbyname.lo CC getaddrinfo.lo CC close.lo CC getpeername.lo CC socket.lo CC syscall.lo syscall.c: In function 'tsocks_syscall': syscall.c:77:7: error: '__NR_socket' undeclared (first use in this function) syscall.c:77:7: note: each undeclared identifier is reported only once for each function it appears in syscall.c:80:7: error: '__NR_connect' undeclared (first use in this function) make[2]: *** [syscall.lo] Fehler 1 make[2]: Verlasse Verzeichnis '/opt/git/torsocks/src/lib' make[1]: *** [all-recursive] Fehler 1 make[1]: Verlasse Verzeichnis '/opt/git/torsocks/src' make: *** [all-recursive] Fehler 1
Hi,
K. Raven:
Hi,
I'm asking the community for feedbacks, testing, code review, optimization design and/or anything useful to help improve the project (even correcting the mistakes or improving any comments).
under Kubuntu 13.04:
$ make Making all in src make[1]: Betrete Verzeichnis '/opt/git/torsocks/src' Making all in common make[2]: Betrete Verzeichnis '/opt/git/torsocks/src/common' CC log.lo log.c: In function 'log_init': log.c:166:9: warning: ignoring return value of 'fileno', declared with attribute warn_unused_result [-Wunused-result]
Good catch! I'll push a fix for that.
CC config-file.lo CC utils.lo CC compat.lo CC socks5.lo CC connection.lo CC onion.lo CCLD libcommon.la make[2]: Verlasse Verzeichnis '/opt/git/torsocks/src/common' Making all in lib make[2]: Betrete Verzeichnis '/opt/git/torsocks/src/lib' CC torsocks.lo CC connect.lo CC gethostbyname.lo CC getaddrinfo.lo CC close.lo CC getpeername.lo CC socket.lo CC syscall.lo syscall.c: In function 'tsocks_syscall': syscall.c:77:7: error: '__NR_socket' undeclared (first use in this function) syscall.c:77:7: note: each undeclared identifier is reported only once for each function it appears in syscall.c:80:7: error: '__NR_connect' undeclared (first use in this function)
This has been fixed by some patches sent by ln5. I've just pushed them as of now.
Big thanks for that report! David
make[2]: *** [syscall.lo] Fehler 1 make[2]: Verlasse Verzeichnis '/opt/git/torsocks/src/lib' make[1]: *** [all-recursive] Fehler 1 make[1]: Verlasse Verzeichnis '/opt/git/torsocks/src' make: *** [all-recursive] Fehler 1