#32969: Chutney 'bootstrap-network.sh' shouldn't overwrite 'CHUTNEY_DATA_DIR'
--------------------+----------------------------------
 Reporter:  opara   |          Owner:  (none)
     Type:  defect  |         Status:  new
 Priority:  Medium  |      Component:  Core Tor/Chutney
  Version:          |       Severity:  Normal
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
 Reviewer:          |        Sponsor:
--------------------+----------------------------------
 When you set up a tor network with something like:

 {{{
 tools/test-network.sh --flavor basic --net-dir /tmp/chutney-net
 }}}

 the {{{tools/test-network.sh}}} script will set {{{$CHUTNEY_DATA_DIR}}}
 based on the value of {{{--net-dir}}} and then call {{{tools/bootstrap-
 network.sh}}}. This bootstrapping script will then overwrite the variable
 {{{$CHUTNEY_DATA_DIR}}} if that directory doesn't exist or if the path is
 relative. This causes unexpected behavior when the user explicitly sets
 the {{{--net-dir}}} option. For example, Chutney works fine if you provide
 it with a directory that doesn't exist (it will create that directory
 automatically), so there is no need for the {{{tools/bootstrap-
 network.sh}}} script to unexpectedly change it to {{{$CHUTNEY_PATH/net}}}.
 The {{{tools/bootstrap-network.sh}}} also does not need to change it to an
 absolute path since Chutney
 [https://github.com/torproject/chutney/blob/master/lib/chutney/TorNet.py#L144
 does this automatically].

 My suggestion is to remove the following lines from {{{tools/bootstrap-
 network.sh}}}:

 {{{
 # Get a working net path
 if [ ! -d "$CHUTNEY_DATA_DIR" ]; then
     # looks like a broken path: use the chutney path as a base
     export CHUTNEY_DATA_DIR="$CHUTNEY_PATH/net"
 fi
 if [ -d "$PWD/$CHUTNEY_DATA_DIR" ]; then
     # looks like a relative path: make chutney path absolute
     export CHUTNEY_DATA_DIR="$PWD/$CHUTNEY_DATA_DIR"
 fi
 }}}

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

Reply via email to