Get actual path for EUID instead of HOME dir#10336
Get actual path for EUID instead of HOME dir#10336snvakula wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
Not sure about this.
|
|
jonasschnelli, when you are root, or run commands by root via sudo, your HOME env is '/root'. So when you try to execute 'sudo bitcoin-cli getinfo' with u+s flag, 'bitcoin-cli' will be ran by user 'bitcoin', but HOME env will be still '/root'. In this case, 'bitcoin-cli' cannot find the bitcoind without current patch. |
|
I'd prefer not to introduce this dependency. Most straightforward way would be to make a script that sets $HOME correctly before calling the tools, or passes OTOH: Please don't set-UID There's also no need to: My suggestion would be to put bitcoin.conf in a place that's accessible to the users that need access. |
|
Closing this for above reasons (and lack of other feedback) |
Let 'bitcoind' run by user 'bitcoin' in Linux.
Chown 'bitcoin-cli' to 'bitcoin:root' and set chmod '4750' (u+s flag).
Then every root-privileged user be able to run 'bitcoin-cli' even if 'bitcoind' runs by user 'bitcoin'.
For example: 'bitcoin-cli getinfo' or 'sudo bitcoin-cli getinfo'
We need to patch 'util.cpp' by this pull request to get actual path for EUID instead of HOME dir, when you use 'u+s' flag.