Feature #8074

Test check-mirrors with torsocks

Added by sajolida 2014-10-12 00:42:48 . Updated 2015-01-21 11:30:31 .

Status:
Resolved
Priority:
Normal
Assignee:
sajolida
Category:
Infrastructure
Target version:
Start date:
2014-10-12
Due date:
% Done:

100%

Feature Branch:
Type of work:
Test
Blueprint:

Starter:
Affected tool:
check-mirrors
Deliverable for:

Description

Most of check-mirror’s features work when run with torsocks. If some features don’t, maybe fixing them to work with torsocks would be cheaper than adding SOCKS proxy support to the script?


Subtasks


Related issues

Related to Tails - Bug #8603: Unexpected redirection while sending Host header with wget Resolved 2015-01-07

History

#1 Updated by sajolida 2014-12-11 21:16:31

When run from Tails torsocks doesn’t allow DNS resolution to a local address:

$ torsocks ruby check-mirrors.rb
21:14:09 libtorsocks(497): connect: Connection is to a local address (127.0.0.2), may be a TCP DNS request to a local DNS server so have to reject to be safe. Please report a bug to http://code.google.com/p/torsocks/issues/entry if this is preventing a program from working properly with torsocks.
/usr/lib/ruby/1.9.1/resolv.rb:766:in `connect': Inappropriate ioctl for device - connect(2) (Errno::ENOTTY)
        from /usr/lib/ruby/1.9.1/resolv.rb:766:in `initialize'
        from /usr/lib/ruby/1.9.1/resolv.rb:537:in `new'
        from /usr/lib/ruby/1.9.1/resolv.rb:537:in `make_udp_requester'
        from /usr/lib/ruby/1.9.1/resolv.rb:495:in `each_resource'
        from /usr/lib/ruby/1.9.1/resolv.rb:391:in `each_address'
        from /usr/lib/ruby/1.9.1/resolv.rb:379:in `getaddresses'
        from check-mirrors.rb:244:in `<main>'

#2 Updated by sajolida 2014-12-12 23:32:43

  • Status changed from Confirmed to Resolved

check-mirrors don’t work with torsocks because it needs support for full DNS queries, and forcing them to a local DNS server triggers an error with torsocks.

#3 Updated by intrigeri 2014-12-13 08:59:15

  • Status changed from Resolved to In Progress
  • Assignee set to sajolida
  • % Done changed from 0 to 50
  • QA Check set to Info Needed

Was that torsocks 1.x or 2.x?

#4 Updated by sajolida 2014-12-14 18:36:02

  • Assignee changed from sajolida to intrigeri

torsocks 1.2-3 from Tails 1.2.1.

#5 Updated by intrigeri 2014-12-19 10:53:10

  • Assignee changed from intrigeri to sajolida

Does it happen with torsocks 2.x too (can be tested in an experimental ISO)?

#6 Updated by BitingBird 2015-01-04 18:52:23

  • Category changed from 214 to Infrastructure
  • Affected tool set to check-mirrors

#7 Updated by sajolida 2015-01-07 20:20:56

I tested again in experimental 1.3 - 20150103 - 4ce7acf7d27cf7f5ffb0cb966e72508c0fff6874.

More of less the same thing happen doing the DNS query (with or without —dns option):

amnesia@amnesia:~$ torsocks ruby check-mirrors.rb --debug --fast
/usr/lib/ruby/1.9.1/resolv.rb:761:in `initialize': Operation not permitted - socket(2) - udp (Errno::EPERM)
    from /usr/lib/ruby/1.9.1/resolv.rb:761:in `new'
    from /usr/lib/ruby/1.9.1/resolv.rb:761:in `initialize'
    from /usr/lib/ruby/1.9.1/resolv.rb:537:in `new'
    from /usr/lib/ruby/1.9.1/resolv.rb:537:in `make_udp_requester'
    from /usr/lib/ruby/1.9.1/resolv.rb:495:in `each_resource'
    from /usr/lib/ruby/1.9.1/resolv.rb:391:in `each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:115:in `block in each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:114:in `each'
    from /usr/lib/ruby/1.9.1/resolv.rb:114:in `each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:101:in `getaddresses'
    from check-mirrors.rb:290:in `<main>'

What could we do? Parse the output of “host dl.amnesia.boum.org 127.0.0.2” instead?

#8 Updated by sajolida 2015-01-07 20:47:43

  • related to Bug #8603: Unexpected redirection while sending Host header with wget added

#9 Updated by intrigeri 2015-01-21 11:30:32

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
  • QA Check deleted (Info Needed)

Thanks. Once a new torsocks release with the patch merged at https://trac.torproject.org/projects/tor/ticket/8137 is out, we’ll be able to use torsocks :)