Opened 8 years ago

Closed 7 years ago

#2498 closed defect (invalid)

Vidalia is not honoring the data directory although specified in the command line option

Reported by: toruser1 Owned by: chiiph
Priority: High Milestone:
Component: Archived/Vidalia Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

OS : Windows

Earlier versions of vidalia could be run portably, i.e. a directory containing tor and vidalia could be moved around and everything worked. This was possible using the --datadir
But now regardless of this vidalia is looking at program files and other places. This got broken unfortunately.

Child Tickets

Change History (7)

comment:1 Changed 7 years ago by chiiph

I can't reproduce this.
What exactly is Vidalia looking in other places? All that I can think of is torrc if Tor's already running, in which case it won't be portable.

comment:2 Changed 7 years ago by jrklein

If I run Vidalia (0.2.13-git) on a system with no configuration files, I am prompted for the location of tor (as expected). I specify tor location, save settings, successfully connect to the tor network, then exit Vidalia.

$ ./Vidalia.app/Contents/MacOS/Vidalia

Afterwards, I see that the following files were created in my home directory.

Library/Vidalia/torrc
Library/Vidalia/torrc.orig.1
Library/Vidalia/vidalia.conf

.tor/
.tor/cached-certs
.tor/cached-consensus
.tor/cached-descriptors
.tor/cached-descriptors.new
.tor/lock
.tor/state

I remove the configuration files, and run the command again with the --datadir parameter

$ ./Vidalia.app/Contents/MacOS/Vidalia --datadir ~/.tordata

Afterwards, I see that the following files were created in my home directory.

.tordata/Vidalia/torrc
.tordata/Vidalia/torrc.orig.1
.tordata/Vidalia/vidalia.conf

.tor/
.tor/cached-certs
.tor/cached-consensus
.tor/cached-descriptors
.tor/cached-descriptors.new
.tor/lock
.tor/state

I suspect they are wanting to store the Tor files there too? I confirmed that Tor DOES accept this "--datadir" parameter.

./TorBrowser_en-US.app/Contents/MacOS/tor --datadir ~/.tordata

If I run Tor from the CLI as shown above, the following files are created in my home directory.

.tordata/cached-certs
.tordata/cached-consensus
.tordata/cached-descriptors
.tordata/cached-descriptors.new
.tordata/lock
.tordata/state

However, if I include the parameter "--datadir ~/.tordata" (with or without quotes) when I specified the Tor binary location, Vidalia complains that it cannot find Tor.

It seems logical that the --datadir parameter value should be passed to Tor when present.

comment:3 Changed 7 years ago by chiiph

Resolution: invalid
Status: newclosed

So, the problem isn't actually Vidalia's datadir but Tor's DataDirectory not being configured in vidalia.conf

Thanks Jason for testing :)

comment:4 Changed 7 years ago by jrklein

chiiph pointed out that the Tor datadir can be specified via the Data Directory field in the Advanced settings.

I found that Vidalia does not save the value of that field if it has prompted you for the location of the Tor binary. If you relaunch Vidalia, you can successfully configure a custom data directory and relaunch Vidalia *AGAIN* for the change to take effect. This is a bug.

comment:5 Changed 7 years ago by chiiph

Which part is a bug?

The fact that you have to restart Vidalia isn't a bug, because you are changing something that can't change while Tor's running.

I can't locate the part of the code where it prompts if it doesn't have a TorExecutable set. If you think _that_ is the bug, please fill a different ticket. And may be provide a patch? ;)

comment:6 Changed 7 years ago by jrklein

Resolution: invalid
Status: closedreopened

I've continued to look at this and my current results contradict my earlier testing. Can someone else follow these steps and confirm in case my environment is just hosed?

1) Remove all configuration files from default locations
rm -r -f ~/.tor/ ~/Library/Vidalia/

2) Create custom configuration files in a custom datadir
cat ~/.vidalia/vidalia.conf
[Tor]
ControlPort=9051
TorExecutable=/Applications/TorBrowser_en-US.app/Contents/MacOS/tor
Torrc=/Users/jrklein/.vidalia/torrc

cat ~/.vidalia/torrc
AvoidDiskWrites 1
DataDirectory /Users/jrklein/.vidalia
GeoIPFile /Users/jrklein/.vidalia
Log notice stdout
SocksPort 9050
SocksListenAddress 127.0.0.1

3) Launch Vidalia and specify the custom datadir
./Vidalia.app/Contents/MacOS/Vidalia --datadir=/Users/jrklein/.vidalia

4) Vidalia displays the following dialog:
"Vidalia was unable to star Tor. Check your settings to ensure the correct name and location of your Tor executable is specified." Show Settings | Cancel | Help

5) When I click "Show Setting", I see the following values:
General->Tor: tor
Advanced->TorConfig: /Users/jrklein/Library/Vidalia/torrc
Advanced->DataDirectory: EMPTY

EXPECTED RESULTS
Vidalia should be able to find Tor instead of displaying the error in step #4.
Vidalia should display my settings instead of displaying the defaults in step #5.

If I specify the same/valid Tor path as shown in the vidalia.conf from my custom datadir and restart Vidalia, it works fine but it writes it's settings to the default locations.

comment:7 Changed 7 years ago by jrklein

Resolution: invalid
Status: reopenedclosed

While debugging, I realized that Vidalia only supports "--datadir <dir>" and not "--datadir=<dir>". Be sure to include a space between each parameter and it's value! When I include a space, everything does seem to be working properly.

See #2965 for a Vidalia patch that will provide improved parameter validation and ability to read parameters that are separated by equal sign (ie: "--datadir=<dir>").

If someone can reproduce the original issue, please reopen ticket and provide more info.

Note: See TracTickets for help on using tickets.