[tor-bugs] #19376 [Core Tor/Torsocks]: Fix a few torsocks bugs caused by unquoted variables

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 16 18:49:53 UTC 2018


#19376: Fix a few torsocks bugs caused by unquoted variables
-------------------------------+--------------------------
 Reporter:  cypherpunks        |          Owner:  dgoulet
     Type:  defect             |         Status:  reopened
 Priority:  Medium             |      Milestone:
Component:  Core Tor/Torsocks  |        Version:
 Severity:  Normal             |     Resolution:
 Keywords:                     |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+--------------------------
Changes (by torsocksbug):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Doesn't work for me, the quotes were not applied correctly. I don't know
 what happened here, the original attachment actually contained the correct
 fix.

 Here's the patch for the latest master (8013dfb):
 {{{
 diff --git a/src/bin/torsocks.in b/src/bin/torsocks.in
 index fe8b67a..bf545a3 100644
 --- a/src/bin/torsocks.in
 +++ b/src/bin/torsocks.in
 @@ -130,7 +130,7 @@ tor_shell ()

  torify_app ()
  {
 -       local app_path="`which $1`"
 +       local app_path="`which "$1"`"
         local getcap="`PATH="$PATH:/usr/sbin:/sbin" which getcap`"
         local caps=

 @@ -144,7 +144,7 @@ torify_app ()
         # This must be before torifying because getcap uses
 cap_get_file(3)
         # via syscall(2) which breaks torsocks.
         if [ -n "$getcap" ]; then
 -               caps="`$getcap $app_path 2>/dev/null`"
 +               caps="`$getcap "$app_path" 2>/dev/null`"
         fi

         # Check if Apple's System Integrity Protection is enabled if the
 user is
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19376#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list