Opened 9 months ago

Closed 9 months ago

#32969 closed defect (fixed)

Chutney '' shouldn't overwrite 'CHUTNEY_DATA_DIR'

Reported by: opara Owned by:
Priority: Medium Milestone:
Component: Core Tor/Chutney Version:
Severity: Normal Keywords:
Cc: teor Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When you set up a tor network with something like:

tools/ --flavor basic --net-dir /tmp/chutney-net

the tools/ script will set $CHUTNEY_DATA_DIR based on the value of --net-dir and then call tools/ 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/ script to unexpectedly change it to $CHUTNEY_PATH/net. The tools/ also does not need to change it to an absolute path since Chutney does this automatically.

My suggestion is to remove the following lines from tools/

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

Child Tickets

Change History (5)

comment:1 Changed 9 months ago by teor

We'd need to check this fix a bit more carefully, but it seems like a good idea.

Would you like to submit a pull request to:

comment:3 Changed 9 months ago by teor


I added a commit that improved the documentation and comments for the path functions.

If you put tickets in needs_review when you submit a pull request, we'll be able to find them more easily.

Merged #32972, #33023, #32969, and #33041 together.

comment:4 in reply to:  3 Changed 9 months ago by arma

Replying to teor:

Merged #32972, #33023, #32969, and #33041 together.

Does that mean this ticket is done? Or is there something remaining?

(No worries if not done. I'm just making sure it didn't accidentally remain open when you meant to close it.)

comment:5 Changed 9 months ago by teor

Resolution: fixed
Status: newclosed

Weird, I definitely tried to close all these tickets. Maybe this close didn't get through.

Note: See TracTickets for help on using tickets.