dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

dash-cli: $HOME/.dashcore directory always created if -datadir= not set on commandline #1345

Closed taw00 closed 7 years ago

taw00 commented 7 years ago

Platform: Linux, 64bit, Fedora 25

If you trigger dash-cli without a -datadir= set on the commandline, it will ALWAYS create $HOME/.dashcore. It doesn't matter what your datadir setting is in dash.conf. That is ignored just long enough to create that directory. THEN it switches its location to whatever you set it to.

Easy to demonstrate. Do this as a normal user...

HOME=/  dash-cli -conf=/path/to/your/dash.conf

I get in response...

EXCEPTION: N5boost10filesystem16filesystem_errorE       
boost::filesystem::create_directory: Permission denied: "/.dashcore"       
dash in AppInitRPC()      

What that is saying is that regardless of your datadir setting in your dash.conf, we are still trying to create a $HOME/.dashcore -- I used / in this example because it will break with a permissions error and demonstrate that the program is attempting to create the directory.

Side note, that permissions error message is ugly.

Where this is a PITA: I don't use ~/.dashcore as my data directory. And my dash.conf states that. But guess what gets created in my home directoyr if I do a dash-cli -conf=/path/to/dashconf ... a .dashcore directory.

I could specify a -datadir=... but I am not trying to override the dash.conf file, so that is... superfluous.

Thanks. -t0dd

codablock commented 7 years ago

@taw00 This issue can be closed as https://github.com/dashpay/dash/issues/1494 fixed this.

taw00 commented 7 years ago

Not tested by me. I will take your word for it. :)