[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#19376: Fix a few torsocks bugs caused by unquoted variables
-----------------------------------+---------------------
     Reporter:  cypherpunks        |      Owner:  dgoulet
         Type:  defect             |     Status:  new
     Priority:  Medium             |  Milestone:
    Component:  Core Tor/Torsocks  |    Version:
     Severity:  Normal             |   Keywords:
Actual Points:                     |  Parent ID:
       Points:                     |   Reviewer:
      Sponsor:                     |
-----------------------------------+---------------------
 For such a short script, the torsocks wrapper has a fair few bugs, almost
 entirely caused by unquoted variables. This patch fixes it by quoting them
 where they need to be. A shell session showing just one example of a bug
 caused by failing to quote variables, followed by intended behavior after
 applying a patch:

 {{{
 $ torsocks --version
 Torsocks 2.1.0
 $ mkdir foo\ bar
 $ echo echo hello\ world > foo\ bar/hello.sh
 $ chmod 700 foo\ bar/hello.sh
 $ ./foo\ bar/hello.sh
 hello world
 $ torsocks ./foo\ bar/hello.sh
 /usr/bin/torsocks: 103: [: ./foo: unexpected operator
 ERROR: ./foo bar/hello.sh cannot be found.
 $ (cd / && sudo patch -p0) < quote.patch
 patching file /usr/bin/torsocks
 $ torsocks ./foo\ bar/hello.sh
 hello world
 }}}

 The patch to fix it is attached.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19376>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs